:root {
  color-scheme: light;
  --bg: #eef1f6;
  --panel: #ffffff;
  --line: #e3e8f0;
  --line-strong: #cfd7e3;
  --text: #131a26;
  --muted: #6b7480;
  --blue: #1f6feb;
  --blue-dark: #1656c0;
  --blue-soft: #e9f1ff;
  --navy: #0d1b36;
  --navy-2: #17345f;
  --navy-text: #9fb3d9;
  --gold: #f5b942;
  --green: #15824f;
  --green-soft: #e6f6ec;
  --red: #d23b34;
  --red-soft: #ffecea;
  --amber: #b7791f;
  --amber-soft: #fff4d9;
  --shadow: 0 6px 18px rgba(17, 24, 39, 0.08);
  --nav-h: 60px;
  --bar-h: 52px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* 按钮 loading：转圈 + 禁止重复点击（高延迟下给即时反馈，防连点） */
.btn-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  margin-right: 7px;
  vertical-align: -2px;
  border: 2px solid currentColor;
  border-top-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
button.is-loading {
  position: relative;
  color: transparent !important;
  pointer-events: none;
}
button.is-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 15px;
  height: 15px;
  margin: -8px 0 0 -8px;
  border: 2px solid var(--blue, #1f6feb);
  border-top-color: transparent;
  border-radius: 50%;
  animation: btnSpin 0.6s linear infinite;
}
/* 实心蓝底按钮（confirm-btn）上用白色转圈，避免蓝底蓝圈看不见 */
.confirm-btn.is-loading::after {
  border-color: #fff;
  border-top-color: transparent;
}
@keyframes btnSpin {
  to { transform: rotate(360deg); }
}

.loading {
  display: grid;
  place-items: center;
  min-height: 100vh;
  color: var(--muted);
}

.tiny {
  font-size: 12px;
  color: var(--muted);
}

.center {
  text-align: center;
}

.empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 26px;
  line-height: 1.9;
}

.empty.sm {
  padding: 22px 0;
  font-size: 13px;
}

/* ---------------- 应用骨架 ---------------- */

.app {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

.appbar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: var(--bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  background: linear-gradient(135deg, var(--navy), var(--navy-2));
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.appbar .ab-title {
  color: #fff;
}

.ab-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.ab-title {
  font-weight: 760;
  font-size: 15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ab-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.conn-dot {
  font-size: 10px;
}

.balance-pill {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(245, 185, 66, 0.16);
  color: #ffd479;
  font-weight: 720;
  white-space: nowrap;
}

.auth-card .balance-pill {
  background: var(--blue-soft);
  color: var(--blue-dark);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--gold), #d99a1f);
  color: #2b1c00;
  font-weight: 800;
}

.brand-mark.sm {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  font-size: 13px;
}

.page {
  padding: 12px 12px calc(var(--nav-h) + 18px);
}

/* ---------------- 底部导航 ---------------- */

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 40;
  width: 100%;
  max-width: 600px;
  height: var(--nav-h);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.nav-btn {
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  gap: 2px;
  color: var(--muted);
}

.nav-btn.active {
  color: var(--blue);
}

.nav-icon {
  font-size: 19px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
}

/* ---------------- 分段控件 ---------------- */

.seg {
  display: flex;
  gap: 6px;
  padding: 4px;
  margin-bottom: 12px;
  background: #e9edf4;
  border-radius: 10px;
}

.seg-btn {
  flex: 1;
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.seg-btn.active {
  background: #fff;
  color: var(--blue);
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.12);
}

.seg-scope {
  position: sticky;
  top: var(--bar-h);
  z-index: 10;
}

/* ---------------- 赛事卡片 ---------------- */

.card-list {
  display: grid;
  gap: 10px;
}

.card-list.tight {
  gap: 6px;
}

.m-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.m-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 12px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
}

.comp {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.m-status {
  font-size: 12px;
  color: var(--muted);
}

.m-status.live {
  color: var(--red);
  font-weight: 700;
}

.m-card-body {
  padding: 10px 12px;
}

.flag {
  font-size: 22px;
  line-height: 1;
  text-align: center;
  flex-shrink: 0;
}

.flag-img {
  width: 38px;
  height: 26px;
  object-fit: cover;
  border-radius: 5px;
  box-shadow: 0 0 0 1px rgba(17, 24, 39, 0.14);
  background: #eef1f6;
}

.sb-flag .flag-img {
  width: 50px;
  height: 34px;
  border-radius: 6px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.3);
}

.sb-flag .flag {
  font-size: 36px;
  width: auto;
}

.sm-team .flag-img {
  width: 24px;
  height: 16px;
}

/* 大厅卡片：左主队 / 中比分（时间） / 右客队 */
.m-face {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: start;
  gap: 8px;
  padding: 13px 12px 6px;
}

.hs {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-width: 0;
}

.hs .flag {
  font-size: 27px;
}

.hs-name {
  max-width: 100%;
  font-weight: 760;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hs-tag {
  display: inline-flex;
  align-items: center;
  height: 17px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 800;
}

.hs-tag.home {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.hs-tag.away {
  color: #5b6472;
  background: #eceff4;
}

.hc-mid {
  text-align: center;
  min-width: 78px;
  padding-top: 4px;
}

.hc-score {
  font-size: 26px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--red);
}

.hc-score i {
  font-style: normal;
  color: var(--muted);
  margin: 0 3px;
  font-size: 20px;
}

.hc-time {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.hc-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}

.hc-sub.live {
  color: var(--red);
}

.m-extra {
  display: flex;
  justify-content: center;
  gap: 14px;
  padding: 2px 12px 0;
  color: var(--muted);
  font-size: 12px;
}

.quick-odds {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px 12px 12px;
}

.q-odd {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-height: 52px;
  padding: 7px 4px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: linear-gradient(180deg, #ffffff, #f7f9fd);
}

.q-odd:active:not(:disabled) {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.q-odd.more {
  grid-column: 1 / -1;
  flex-direction: row;
  justify-content: center;
  color: var(--blue);
  font-weight: 600;
}

.q-label {
  font-size: 12px;
  color: var(--muted);
}

.q-price {
  font-size: 16px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

/* ---------------- 比赛详情 ---------------- */

.detail-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.back-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  border-radius: 8px;
  min-height: 34px;
  padding: 0 12px;
  font-weight: 600;
}

.sb {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 16px;
  background:
    radial-gradient(120% 90% at 50% -20%, rgba(31, 111, 235, 0.35), transparent 60%),
    linear-gradient(155deg, var(--navy), var(--navy-2));
  border: none;
  border-radius: 14px;
  color: #fff;
  box-shadow: 0 10px 24px rgba(13, 27, 54, 0.32);
}

.sb-side {
  display: grid;
  justify-items: center;
  gap: 5px;
  text-align: center;
}

.sb-flag {
  font-size: 30px;
  line-height: 1;
}

.sb-name {
  font-weight: 760;
  font-size: 15px;
  color: #fff;
}

.sb-tag {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}

.sb-tag.home {
  color: #9cc1ff;
  background: rgba(31, 111, 235, 0.28);
}

.sb-tag.away {
  color: #d6deeb;
  background: rgba(255, 255, 255, 0.14);
}

.sb-center {
  text-align: center;
  min-width: 92px;
}

.sb-score {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  font-size: 32px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}

.sb-score i {
  font-style: normal;
  color: var(--navy-text);
}

.sb-vs {
  color: var(--navy-text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 2px;
}

.sb-state {
  margin-top: 4px;
  font-size: 12px;
  color: var(--navy-text);
  font-weight: 600;
}

.sb-state.live {
  color: #ff8d84;
  font-weight: 700;
}

.sb-meta {
  display: flex;
  justify-content: center;
  gap: 18px;
  padding: 8px 0 12px;
  color: var(--muted);
  font-size: 12px;
}

.section-title {
  font-weight: 760;
  margin: 16px 2px 8px;
}

.markets {
  display: grid;
  gap: 10px;
}

.market-block {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
}

.mb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: #fafbfe;
  border-bottom: 1px solid var(--line);
}

.mb-title {
  font-weight: 720;
}

.mb-line {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  margin-left: 4px;
}

.mb-status {
  font-size: 12px;
  padding: 2px 9px;
  border-radius: 999px;
}

.mb-status.open {
  color: var(--green);
  background: var(--green-soft);
}

.mb-status.closed {
  color: var(--red);
  background: var(--red-soft);
}

.mb-odds {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 10px;
}

.odd-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  text-align: left;
}

.odd-btn:active:not(:disabled) {
  background: var(--blue-soft);
  border-color: var(--blue);
}

.ob-name {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.ob-price {
  font-size: 16px;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 玩法分类标签（横向滚动） */
.cat-bar {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin-bottom: 12px;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.cat-bar::-webkit-scrollbar {
  display: none;
}

.cat-btn {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.cat-btn.active {
  background: var(--navy-2);
  border-color: var(--navy-2);
  color: #fff;
}

/* 波胆：左中右三列 = 主胜 / 和局 / 客胜 */
.cs-cols {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: 10px;
  align-items: start;
}

.cs-col {
  display: grid;
  gap: 7px;
  align-content: start;
  min-width: 0;
}

.cs-col-head {
  text-align: center;
  font-weight: 760;
  font-size: 12.5px;
  padding: 8px 4px;
  background: #f1f5fb;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-none {
  text-align: center;
  color: var(--muted);
  padding: 10px 0;
}

.odd-btn.cs-cell {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 7px 4px;
  text-align: center;
}

.cs-cell .ob-name {
  font-size: 14.5px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.cs-cell .ob-price {
  font-size: 13px;
}

.mini-bet {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 9px 12px;
}

.mb-line1 {
  font-weight: 600;
}

.mb-line2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}

.event-list {
  display: grid;
  gap: 6px;
}

.event-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 9px;
}

.event-item b {
  color: var(--blue);
  min-width: 34px;
}

/* ---------------- 投注单底部弹层 ---------------- */

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.42);
  animation: fade 0.18s ease;
}

.sheet-backdrop.stable {
  animation: none;
}

.sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  z-index: 51;
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 18px 18px 0 0;
  padding: 8px 16px calc(18px + env(safe-area-inset-bottom));
  box-shadow: 0 -10px 30px rgba(17, 24, 39, 0.18);
  animation: slideUp 0.22s ease;
}

.sheet.stable {
  animation: none;
}

.sheet-grip {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-strong);
  margin: 4px auto 8px;
}

.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 16px;
}

.sheet-x {
  border: 0;
  background: #f0f2f7;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--muted);
}

.sheet-pick {
  background: #fafbfe;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
}

.sp-match {
  font-weight: 720;
}

.sp-sel {
  margin-top: 3px;
  font-size: 13px;
}

.sp-odds {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.sp-odds b {
  color: var(--blue);
  font-size: 18px;
}

.slip-lock {
  margin-top: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--amber-soft);
  color: var(--amber);
  font-size: 13px;
  text-align: center;
}

.big-input {
  width: 100%;
  height: 50px;
  margin-top: 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

.big-input:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.14);
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
}

.chip-btn {
  min-height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
}

.chip-btn:active:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
}

.sheet-rows {
  margin-top: 12px;
}

.sheet-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 2px;
}

.sheet-row .win {
  color: var(--green);
  font-size: 16px;
}

/* ---------------- 通用按钮 ---------------- */

.confirm-btn {
  width: 100%;
  min-height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 11px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 720;
}

.confirm-btn:active:not(:disabled) {
  background: var(--blue-dark);
}

.confirm-btn.sm {
  min-height: 40px;
  margin-top: 0;
  font-size: 14px;
  border-radius: 9px;
}

.confirm-btn.ghost {
  background: #fff;
  color: var(--red);
  border: 1px solid var(--line-strong);
}

.ghost-btn {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
}

.danger-btn {
  min-height: 32px;
  padding: 0 11px;
  border: 1px solid #ffc8bd;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
}

/* ---------------- 注单 / 流水卡片 ---------------- */

.bet-card,
.tx-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 11px 13px;
}

.bc-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.bc-match {
  font-weight: 720;
}

.bc-mid {
  margin-top: 6px;
  font-size: 13px;
}

.bc-bot {
  display: flex;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

.bc-foot {
  margin-top: 6px;
}

.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  background: #eef1f6;
  color: var(--muted);
}

.badge.result-win {
  background: var(--green-soft);
  color: var(--green);
}

.badge.result-lose {
  background: var(--red-soft);
  color: var(--red);
}

.badge.result-pending {
  background: var(--amber-soft);
  color: var(--amber);
}

.badge.result-void {
  background: #eef1f6;
  color: var(--muted);
}

.tx-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.tx-amt {
  font-size: 17px;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.tx-amt.win {
  color: var(--green);
}

.tx-amt.lose {
  color: var(--red);
}

.tx-bot {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.tag.tx-bet { color: var(--red); background: var(--red-soft); }
.tag.tx-win { color: var(--green); background: var(--green-soft); }
.tag.tx-refund { color: var(--blue); background: var(--blue-soft); }
.tag.tx-admin { color: var(--amber); background: var(--amber-soft); }

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 14px;
}

/* ---------------- 我的 ---------------- */

.profile {
  display: grid;
  gap: 14px;
  padding-top: 8px;
}

.p-card {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 24px 16px;
  border-radius: 14px;
  background: linear-gradient(150deg, var(--blue), var(--blue-dark));
  color: #fff;
}

.p-avatar {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  font-size: 24px;
  font-weight: 700;
}

.p-name {
  font-size: 17px;
  font-weight: 720;
  margin-top: 6px;
}

.p-balance {
  font-size: 30px;
  font-weight: 800;
}

.p-balance-label {
  color: rgba(255, 255, 255, 0.8);
}

.p-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.p-stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
}

.p-stat b {
  display: block;
  margin-top: 4px;
  font-size: 17px;
}

/* ---------------- 登录 ---------------- */

.auth-wrap {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.auth-card {
  width: min(400px, 100%);
  padding: 28px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}

.auth-head {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
  margin-bottom: 18px;
}

.auth-head h1 {
  margin: 8px 0 0;
  font-size: 20px;
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-top: 4px;
}

.auth-hint {
  margin-top: 14px;
  text-align: center;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 12px;
  color: var(--muted);
}

.input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  padding: 0 12px;
  outline: none;
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 111, 235, 0.12);
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7480' stroke-width='1.6' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 30px;
}

/* ---------------- 后台 ---------------- */

.admin-app {
  max-width: none;
  background: #eef2f7;
}

.admin-appbar {
  height: 56px;
  padding: 0 22px;
}

.admin-page {
  width: min(1440px, calc(100% - 28px));
  margin: 0 auto;
  padding: 16px 0 34px;
  display: grid;
  gap: 14px;
}

.admin-overview {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(17, 24, 39, 0.06);
}

.admin-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.admin-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-overview h1 {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: 0;
}

.admin-live,
.admin-mini-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.admin-live.ok {
  color: var(--green);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-soft);
}

.status-dot.ok {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.admin-live.ok .status-dot {
  background: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.overview-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.overview-tile {
  min-width: 0;
  min-height: 92px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
  text-align: left;
}

.overview-tile span,
.overview-tile small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.overview-tile strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.05;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.overview-tile:active {
  border-color: var(--blue);
}

.admin-tabs {
  position: sticky;
  top: 56px;
  z-index: 20;
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
}

.admin-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.admin-tab.active {
  border-color: #b8c7dc;
  background: #e9f1ff;
  color: var(--blue-dark);
}

.admin-workspace {
  display: grid;
  gap: 14px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 5px 16px rgba(17, 24, 39, 0.05);
  overflow: hidden;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fbfcff;
}

.panel-title {
  font-weight: 760;
}

.panel-body {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.panel-body.compact {
  padding-bottom: 8px;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.metric-label {
  font-size: 12px;
  color: var(--muted);
}

.metric-value {
  margin-top: 6px;
  font-size: 22px;
  line-height: 1.1;
  font-weight: 760;
  font-variant-numeric: tabular-nums;
}

.chart-row {
  display: grid;
  gap: 12px;
}

.chart-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f9fbff;
}

.chart-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.chart-svg {
  width: 100%;
  height: auto;
}

.chart-scroll {
  overflow-x: auto;
  padding-bottom: 4px;
}

.chart-scroll .chart-svg {
  display: block;
  width: auto;
  max-width: none;
  height: 130px;
}

.pie-wrap {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.pie-svg {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

.legend {
  display: grid;
  gap: 6px;
  font-size: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: end;
}

.full {
  grid-column: 1 / -1;
}

.table-toolbar {
  display: flex;
  justify-content: flex-end;
}

.filter-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
  color: var(--muted);
  font-size: 13px;
}

.search-input {
  max-width: 340px;
}

.row-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.table-wrap {
  overflow-x: auto;
}

.accounting-flow {
  margin: 12px 0 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
  font-size: 13px;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  background: #f7f9fc;
}

tbody tr:hover td {
  background: #fbfcff;
}

.clickable {
  cursor: pointer;
}

.expand-row td {
  background: #f7f9fc;
  white-space: normal;
}

.inner-table th,
.inner-table td {
  padding: 6px 8px;
  font-size: 12px;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.detail-row:last-child {
  border-bottom: 0;
}

.detail-row strong {
  text-align: right;
  word-break: break-word;
}

.admin-app .toast {
  bottom: 24px;
}

.result-win { color: var(--green); font-weight: 700; }
.result-lose { color: var(--red); font-weight: 700; }
.result-pending { color: var(--amber); font-weight: 700; }
.result-void { color: var(--muted); font-weight: 700; }

/* ---------------- 赔率闪烁 ---------------- */

.flash-up { animation: flashUp 1.5s ease-out; }
.flash-down { animation: flashDown 1.5s ease-out; }

@keyframes flashUp {
  0% { background: var(--green-soft); }
  100% { background: #fff; }
}

@keyframes flashDown {
  0% { background: var(--red-soft); }
  100% { background: #fff; }
}

@keyframes slideUp {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}

@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------------- Toast ---------------- */

.toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 14px);
  z-index: 60;
  max-width: calc(100% - 32px);
  padding: 11px 16px;
  border-radius: 10px;
  background: #1f2937;
  color: #fff;
  font-size: 13px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: var(--red);
}

/* ---------------- 桌面适配 ---------------- */

@media (min-width: 760px) {
  .overview-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .chart-row {
    grid-template-columns: 1fr 1fr;
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid.three {
    grid-template-columns: 1.1fr 0.9fr 1.4fr auto;
  }

  .user-create-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  }

  .user-create-grid .full {
    grid-column: auto;
  }

  .form-grid .confirm-btn.sm {
    min-width: 110px;
  }

  .app:not(.admin-app) {
    box-shadow: 0 0 0 1px var(--line);
  }
}

@media (max-width: 640px) {
  .admin-appbar {
    padding: 0 12px;
  }

  .admin-page {
    width: calc(100% - 20px);
    padding-top: 10px;
  }

  .admin-overview {
    padding: 14px;
  }

  .admin-overview h1 {
    font-size: 20px;
  }

  .admin-overview-head {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .admin-live {
    align-self: flex-start;
  }

  .overview-tile {
    min-height: 84px;
  }

  .panel-header {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    padding: 10px 12px;
  }

  .table-toolbar,
  .search-input {
    max-width: none;
    width: 100%;
  }
}

/* ---------------- 数据源封锁层 ---------------- */

.lock-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  animation: fade 0.2s ease;
}

.lock-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border-radius: 16px;
  padding: 26px 22px;
  text-align: center;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--red);
}

.lock-ico {
  font-size: 38px;
  line-height: 1;
}

.lock-title {
  margin-top: 10px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.lock-reason {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 13px;
  word-break: break-word;
}

.lock-sub {
  margin: 12px 0 16px;
  color: var(--muted);
}

.lock-banner {
  display: block;
  width: 100%;
  border: none;
  text-align: left;
  padding: 9px 16px;
  background: var(--red);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.auth-banner {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green);
  font-size: 13px;
}

.auth-banner.error {
  background: var(--red-soft);
  color: var(--red);
}

/* ---------------- 统计页 ---------------- */

.stats-page {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.stat-hero {
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  color: #fff;
  box-shadow: var(--shadow);
}

.stat-hero.pos {
  background: linear-gradient(135deg, #15824f, #0f6b40);
}

.stat-hero.neg {
  background: linear-gradient(135deg, #d23b34, #b22a24);
}

.stat-hero .tiny {
  color: rgba(255, 255, 255, 0.85);
}

.stat-hero-num {
  font-size: 30px;
  font-weight: 800;
  margin: 4px 0;
  letter-spacing: 0.5px;
}

.mkt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 13px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
}

.mkt-button {
  width: 100%;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.mkt-button.active {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.mkt-label {
  font-weight: 600;
  flex: 1;
}

.market-detail {
  display: grid;
  gap: 8px;
  margin: -4px 0 4px 10px;
  padding-left: 10px;
  border-left: 3px solid var(--line);
}

.bet-detail-card {
  display: grid;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.bd-top,
.bd-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.bd-top b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------------- 投注成功详情（可截图） ---------------- */

.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(2px);
  animation: fade 0.2s ease;
  overflow-y: auto;
}

.success-card {
  width: 100%;
  max-width: 360px;
  background: var(--panel);
  border-radius: 16px;
  padding: 22px 18px 18px;
  box-shadow: var(--shadow);
  border-top: 4px solid var(--green);
}

.success-top {
  display: grid;
  justify-items: center;
  gap: 4px;
  text-align: center;
}

.success-check {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow: 0 0 0 6px var(--green-soft);
}

.success-title {
  margin-top: 8px;
  font-size: 19px;
  font-weight: 800;
  color: var(--green);
}

.success-match {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 16px 0;
  padding: 12px 10px;
  border-radius: 12px;
  background: linear-gradient(160deg, #ffffff, #eef3fc);
  border: 1px solid var(--line);
}

.sm-team {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.sm-team.end {
  justify-content: flex-end;
}

.sm-name {
  font-weight: 720;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sm-tag {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
}

.sm-tag.home { background: var(--blue); }
.sm-tag.away { background: #8a93a3; }

.sm-vs {
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}

.success-rows {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.srow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  background: #fff;
}

.srow span {
  color: var(--muted);
  font-size: 13px;
}

.srow b {
  font-weight: 720;
  text-align: right;
  overflow-wrap: anywhere;
}

.srow b.hl {
  color: var(--blue);
}

.srow b.win {
  color: var(--green);
}

.success-meta {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  background: #f7f9fc;
}

.smeta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  font-size: 12px;
}

.smeta span {
  color: var(--muted);
}

.smeta b {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: right;
}

.success-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.success-actions .confirm-btn {
  margin-top: 0;
}

/* ---------------- 投注篮 / 串关 ---------------- */

.odd-btn.selected {
  background: var(--blue);
  border-color: var(--blue-dark);
}
.odd-btn.selected .ob-name,
.odd-btn.selected .ob-price {
  color: #fff;
}

/* 底部常驻投注篮按钮（在底部导航之上） */
.slip-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--nav-h) + 10px);
  z-index: 45;
  width: calc(100% - 24px);
  max-width: 576px;
  height: 50px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: #fff;
  box-shadow: 0 8px 20px rgba(31, 111, 235, 0.4);
  cursor: pointer;
}
.slip-bar .sb-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--gold);
  color: var(--navy);
  font-weight: 700;
  font-size: 13px;
}
.slip-bar .sb-text {
  flex: 1;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}
.slip-bar .sb-go {
  font-weight: 700;
  font-size: 14px;
}

.sheet-head-r {
  display: flex;
  align-items: center;
  gap: 12px;
}
.sheet-clear {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
}

.slip-legs {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 38vh;
  overflow-y: auto;
  margin: 6px 0 2px;
}
.slip-leg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.slip-leg .leg-x {
  border: none;
  background: none;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 2px;
}
.slip-leg .leg-main {
  flex: 1;
  min-width: 0;
}
.slip-leg .leg-match {
  font-size: 12px;
  color: var(--muted);
}
.slip-leg .leg-sel {
  font-size: 13px;
  margin-top: 2px;
}
.slip-leg .leg-odds {
  font-size: 15px;
  font-weight: 700;
  color: var(--blue);
}
.slip-leg .leg-odds.closed {
  color: var(--red);
}
.slip-combo-odds {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 4px 2px;
  font-size: 13px;
  color: var(--muted);
}
.slip-combo-odds b {
  font-size: 18px;
  color: var(--blue);
}

/* 我的注单：串关卡片 */
.bet-card.combo .combo-legs {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
}
.combo-leg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.combo-leg-row .clr-l {
  min-width: 0;
}
.combo-leg-row .clr-match {
  color: var(--muted);
}
.combo-leg-row .clr-sel {
  font-size: 13px;
  margin-top: 1px;
}
