/* 金冠体育 · 用户端
   设计基调：深底 + 细边框 + 小字号，信息密度优先。
   不堆渐变、不做大圆角、不加浮夸投影——赔率表要像赔率表。

   断点策略
     超宽 ≥1440  内容居中，投注单加宽
     PC   ≥1024  左侧赛事 + 右侧粘性投注单
     Pad  768-1023  投注单收进抽屉，按需弹出
     WAP  <768   单列 + 底部导航 + 全屏抽屉
     SE   <375   进一步压缩间距
   横屏且高度 <500 单独处理（抢手横持） */

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

:root {
  --bg: #14161a;
  --bg2: #1b1e23;
  --bg3: #22262c;
  --line: #2e333a;
  --line2: #3a4049;
  --tx: #c8cdd4;
  --tx2: #8b929c;
  --tx3: #626973;
  --red: #c8443c;
  --red2: #a3372e;
  --green: #3f9c62;
  --gold: #b8974a;
  --gold2: #ddb96f;
  --blue: #3d6ea8;

  --h-top: 46px;      /* 顶栏高 */
  --h-tab: 50px;      /* 移动端底部导航高 */
  --gap: 12px;
  --r: 2px;           /* 全局圆角，保持锐利 */

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--tx);
  font: 13px/1.5 "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: 13px; }
button { touch-action: manipulation; }
[hidden] { display: none !important; }
.muted { color: var(--tx3); }
.mono { font-family: Consolas, "SF Mono", Menlo, monospace; }

/* 数字统一用等宽，赔率列不会跳动 */
.obtn, .score, .bal, .wv, .amt, .no, .pot, .odds {
  font-family: Consolas, "SF Mono", Menlo, monospace;
  font-variant-numeric: tabular-nums;
}

.wrap {
  width: 1180px;
  max-width: calc(100% - 24px);
  margin: 0 auto;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

/* ==================== 顶栏 ==================== */
.topbar {
  background: #101216;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: var(--safe-t);
}
.topbar .wrap {
  display: flex;
  align-items: center;
  height: var(--h-top);
  gap: 20px;
}

.brand { display: flex; align-items: baseline; gap: 4px; font-size: 15px; letter-spacing: .5px; white-space: nowrap; }
.brand b { color: var(--gold); font-weight: 700; }
.brand span { color: var(--tx2); font-size: 12px; }
.brand em { font-style: normal; color: var(--tx3); font-size: 11px; margin-left: 6px; }

.mainnav { display: flex; gap: 2px; }
.mainnav a {
  padding: 5px 13px;
  color: var(--tx2);
  border: 1px solid transparent;
  border-radius: var(--r);
  font-size: 13px;
  transition: color .12s, background .12s;
}
.mainnav a:hover { color: var(--tx); background: var(--bg2); }
.mainnav a.on { color: #e8c877; border-color: #4a4028; background: #1e1c15; }

.acct { margin-left: auto; display: flex; align-items: center; gap: 8px; min-width: 0; }
.bal {
  color: var(--gold);
  font-size: 13px;
  padding: 3px 9px;
  border: 1px solid #3d3524;
  background: #1a1813;
  border-radius: var(--r);
  white-space: nowrap;
}

/* ==================== 按钮 ==================== */
.btn {
  background: var(--bg3);
  color: var(--tx);
  border: 1px solid var(--line2);
  padding: 6px 14px;
  border-radius: var(--r);
  cursor: pointer;
  line-height: 1.4;
  transition: background .12s, border-color .12s;
  white-space: nowrap;
}
.btn:hover { background: #2a2f36; border-color: #4a515b; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-s { padding: 4px 11px; font-size: 12px; }
.btn-primary { background: #8f2f28; border-color: #a93a31; color: #f0dcd8; }
.btn-primary:hover { background: var(--red2); border-color: #c04a3e; }
.btn-block { width: 100%; padding: 9px; }

.ghost { background: transparent; }

.x {
  background: none;
  border: 0;
  color: var(--tx3);
  font-size: 20px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  min-width: 32px;
  min-height: 32px;
}
.x:hover { color: var(--tx); }

/* ==================== 公告 ==================== */
.notice {
  background: #1d1a12;
  border-bottom: 1px solid #3a3220;
  color: #b9a878;
  font-size: 12px;
  padding: 6px 0;
}
.notice .wrap { padding-left: 2px; }

/* ==================== 主体 ==================== */
.main { padding: 14px 0 60px; }

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

.tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  flex-shrink: 0;
}
.tabs button {
  background: var(--bg2);
  color: var(--tx2);
  border: 0;
  border-right: 1px solid var(--line);
  padding: 5px 15px;
  cursor: pointer;
  font-size: 12px;
  transition: color .12s, background .12s;
  white-space: nowrap;
}
.tabs button:last-child { border-right: 0; }
.tabs button:hover { color: var(--tx); }
.tabs button.on { background: #2c2118; color: var(--gold2); }
.tabs.sub { margin: 16px 0 8px; display: inline-flex; }

select, input[type=text], input[type=password], input[type=number], textarea {
  background: #17191d;
  border: 1px solid var(--line2);
  color: var(--tx);
  padding: 6px 9px;
  border-radius: var(--r);
  outline: none;
  width: 100%;
  transition: border-color .12s;
  -webkit-appearance: none;
  appearance: none;
}
select {
  cursor: pointer;
  width: auto;
  min-width: 120px;
  background-image: linear-gradient(45deg, transparent 50%, #7a828c 50%),
                    linear-gradient(135deg, #7a828c 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
input:focus, select:focus, textarea:focus { border-color: #5a6472; }
input::placeholder { color: #4e555e; }

label { display: block; margin-bottom: 9px; font-size: 12px; color: var(--tx2); }
label input, label select { margin-top: 4px; }

/* ==================== 赛事列表 ==================== */
.slip-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: var(--gap);
  align-items: start;
}

.matchlist {
  border: 1px solid var(--line);
  background: var(--bg2);
  border-radius: var(--r);
  overflow: hidden;
  min-width: 0;
}

.mgroup { border-bottom: 1px solid var(--line); }
.mgroup:last-child { border-bottom: 0; }

.mg-hd {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: #191c21;
  font-size: 11px;
  color: var(--tx3);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: calc(var(--h-top) + var(--safe-t));
  z-index: 2;
}
.mg-hd .lg { color: #9aa4b0; font-size: 12px; }
.mg-hd .tm { margin-left: auto; }

/* 一行 = 队名区 + 两组赔率（每组三个纵向排列） */
.mrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 68px 68px;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-bottom: 1px solid #24282e;
  transition: background .1s;
}
.mrow:last-child { border-bottom: 0; }
.mrow:hover { background: #1f2329; }

.mrow .teams { min-width: 0; }
.mrow .t1, .mrow .t2 {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
  font-size: 13px;
  color: #d3d8de;
  line-height: 1.35;
}
.mrow .t1 .tn, .mrow .t2 .tn {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
/* 队徽容器：固定 18px 宽，图片和首字块同尺寸，换行不错位 */
.crest-w { flex: 0 0 18px; width: 18px; height: 18px; display: inline-flex; }
.crest {
  width: 18px; height: 18px;
  object-fit: contain;
  display: block;
}
/* 没有队徽时的首字块，按队名哈希取色，同一队永远同色 */
.crest-t {
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1; color: #cfd4da;
  background: #2b3038;
  border: 1px solid #363c45;
  border-radius: 2px;
  flex: 0 0 18px;
}
.crest-t.t0 { background: #2d3340; border-color: #3a4250; color: #9fb0c6; }
.crest-t.t1 { background: #382f2b; border-color: #4a3e38; color: #c6ab9a; }
.crest-t.t2 { background: #2b3730; border-color: #37473d; color: #9cc3a9; }
.crest-t.t3 { background: #35302b; border-color: #47403a; color: #c9b795; }
.crest-t.t4 { background: #2f2b38; border-color: #3d3749; color: #b0a5c9; }
.crest-t.t5 { background: #2b3538; border-color: #37454a; color: #9bbcc6; }
.mrow .vs { color: var(--tx3); font-size: 11px; margin: 1px 0; display: flex; align-items: center; gap: 6px; }
.mrow .score { color: #e0a04a; font-size: 13px; }
.mrow .hcp { color: var(--tx3); font-size: 11px; }
.mrow .state { font-size: 11px; color: var(--tx3); }
.mrow .state.live { color: var(--red); }
.mrow .state.fin { color: var(--tx3); }

.odds-col { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.obtn {
  background: #23272d;
  border: 1px solid #31363d;
  color: #b9c0c8;
  font-size: 12px;
  padding: 4px 2px;
  border-radius: var(--r);
  cursor: pointer;
  text-align: center;
  line-height: 1.5;
  min-height: 26px;
  transition: background .1s, border-color .1s, color .1s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.obtn:hover { background: #2c3238; border-color: #4a525c; color: #e2e8ef; }
.obtn.on { background: #3a2018; border-color: #8f4a34; color: #f0b490; }
.obtn:disabled { opacity: .35; cursor: not-allowed; }
.obtn:disabled:hover { background: #23272d; border-color: #31363d; color: #b9c0c8; }
/* 赔率变动闪一下，抢盘的人靠这个吃饭 */
.obtn.up { animation: flashUp .9s ease-out; }
.obtn.down { animation: flashDown .9s ease-out; }
@keyframes flashUp   { 0%,40% { background: #1d3326; border-color: #3f7a55; color: #a8e0bc; } }
@keyframes flashDown { 0%,40% { background: #3a1f1c; border-color: #7a3a32; color: #e8b0a8; } }

/* ==================== 投注单 ==================== */
.slip {
  border: 1px solid var(--line);
  background: var(--bg2);
  border-radius: var(--r);
  position: sticky;
  top: calc(var(--h-top) + var(--gap) + var(--safe-t));
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--h-top) - 28px);
}

.slip-hd {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: #b9a878;
  background: #191c21;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.slip-hd span { color: var(--tx3); }
.slip-hd .x { display: none; }

.slip-body { overflow: auto; padding: 6px 0; flex: 1; min-height: 60px; }
.slip-body .empty { padding: 26px 10px; text-align: center; color: var(--tx3); font-size: 12px; }

.sit {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid #24282e;
  font-size: 12px;
  align-items: flex-start;
}
.sit:last-child { border-bottom: 0; }
.sit .sinfo { flex: 1; min-width: 0; }
.sit .sm { color: var(--tx3); font-size: 11px; }
.sit .sp { color: #d9c489; }
.sit .so { color: #9fb4cc; }
.sit .del {
  background: none;
  border: 0;
  color: var(--tx3);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  min-width: 26px;
  min-height: 26px;
}
.sit .del:hover { color: var(--red); }

.slip-ft { padding: 9px 10px; border-top: 1px solid var(--line); background: #191c21; flex-shrink: 0; }
.slip-ft .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--tx2);
  margin-bottom: 7px;
}
.slip-ft .row input { width: 108px; text-align: right; }
.slip-ft .row b { color: var(--gold); font-size: 14px; }

.quick { display: flex; gap: 4px; margin-bottom: 8px; }
.quick button {
  flex: 1;
  background: #23272d;
  border: 1px solid #31363d;
  color: var(--tx2);
  font-size: 11px;
  padding: 4px 0;
  cursor: pointer;
  border-radius: var(--r);
  min-height: 28px;
  transition: background .1s, color .1s;
}
.quick button:hover { background: #2c3238; color: var(--tx); }
.quick button.on { background: #2c2118; border-color: #4a4028; color: var(--gold2); }

.tip { font-size: 12px; margin-top: 6px; min-height: 16px; }
.tip.err { color: #d9695f; }
.tip.ok { color: #62a87b; }

/* 移动端投注单浮标（默认只在窄屏出现） */
.slip-fab {
  display: none;
  position: fixed;
  right: 14px;
  bottom: calc(var(--h-tab) + var(--safe-b) + 14px);
  z-index: 60;
  background: #8f2f28;
  border: 1px solid #a93a31;
  color: #f0dcd8;
  border-radius: var(--r);
  padding: 9px 14px;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,.5);
  align-items: center;
  gap: 7px;
}
.slip-fab.on { display: inline-flex; }
.slip-fab .cnt {
  background: #f0dcd8;
  color: #8f2f28;
  font-size: 11px;
  padding: 0 5px;
  border-radius: var(--r);
  font-weight: 700;
}

.slip-mask {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 90;
}
.slip-mask.on { display: block; }

/* ==================== 注单 ==================== */
.betcard {
  border: 1px solid var(--line);
  background: var(--bg2);
  margin-bottom: 8px;
  border-radius: var(--r);
}
.bc-hd {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--line);
  background: #191c21;
  font-size: 12px;
  flex-wrap: wrap;
}
.bc-hd .no { color: var(--tx2); }
.bc-hd .amt { color: #d9c489; }

.badge {
  font-size: 11px;
  padding: 1px 7px;
  border-radius: var(--r);
  border: 1px solid;
  white-space: nowrap;
}
.badge.pending    { color: #b9a878; border-color: #4a4028; background: #1e1c15; }
.badge.won,
.badge.half_won   { color: #6fb98a; border-color: #2f5c43; background: #16211b; }
.badge.lost       { color: #a77;    border-color: #4a2f2f; background: #1e1616; }
.badge.half_lost  { color: #b08a6a; border-color: #4a3a2a; background: #1e1a15; }
.badge.canceled   { color: var(--tx3); border-color: var(--line2); background: var(--bg3); }

.bc-bd { padding: 4px 10px 8px; }
.bitem {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px 92px;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px dashed #24282e;
  font-size: 12px;
  align-items: center;
}
.bitem:last-child { border-bottom: 0; }
.bitem .bm { color: var(--tx2); font-size: 11px; }
.bitem .bo { color: #9fb4cc; }
.bitem .br { text-align: right; font-size: 11px; }

.r-win, .r-half_win { color: #6fb98a; }
.r-lose { color: #c0695f; }
.r-half_lost, .r-half_lose { color: #b08a6a; }
.r-push, .r-void { color: var(--tx3); }

/* ==================== 资金 ==================== */
.wallet-top {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.wcard {
  border: 1px solid var(--line);
  background: var(--bg2);
  padding: 10px 12px;
  border-radius: var(--r);
  min-width: 0;
}
.wcard .wk { font-size: 11px; color: var(--tx3); margin-bottom: 3px; }
.wcard .wv { font-size: 19px; color: var(--gold); overflow: hidden; text-overflow: ellipsis; }

.cols2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gap); }
.panel { border: 1px solid var(--line); background: var(--bg2); border-radius: var(--r); }
.panel-hd {
  padding: 7px 12px;
  border-bottom: 1px solid var(--line);
  background: #191c21;
  font-size: 12px;
  color: #b9a878;
}
.panel-bd { padding: 12px; }

/* ---------- 收款账户 ---------- */
.hd-note { float: right; color: var(--tx3); font-size: 11px; font-weight: 400; }

.paygrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.paycard {
  border: 1px solid var(--line);
  background: #191c21;
  border-radius: var(--r);
  padding: 9px 10px;
  cursor: pointer;
  transition: border-color .12s, background .12s;
  min-width: 0;
}
.paycard:hover { border-color: var(--line2); background: #1d2026; }
.paycard.bound { border-color: #3a4a3d; }
.paycard-hd { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.paycard-i {
  width: 16px; height: 16px; line-height: 16px; text-align: center;
  background: #242830; color: var(--tx2); font-size: 10px; border-radius: var(--r);
  flex: 0 0 auto;
}
.paycard-n { color: var(--tx); }
.paycard-ok { margin-left: auto; color: var(--green); font-size: 10px; }
.paycard-no { margin-left: auto; color: var(--tx3); font-size: 10px; }
.paycard-v {
  margin-top: 6px; font-size: 12px; color: var(--tx);
  font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.paycard-o {
  margin-top: 2px; font-size: 11px; color: var(--tx3);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.payform { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.payform-hd { font-size: 12px; color: #b9a878; margin-bottom: 8px; }
.btnrow { display: flex; gap: 8px; margin-top: 10px; }
.btnrow .btn { flex: 1; }

/* 提现页：未绑齐时的提示条 */
.bindbar {
  border: 1px solid #4a3f2a;
  background: #201c14;
  border-radius: var(--r);
  padding: 10px 12px;
  margin-bottom: 10px;
}
.bindbar-t { font-size: 12px; color: #c0a86a; }
.bindbar-l { margin: 7px 0 9px; display: flex; flex-wrap: wrap; gap: 5px; }
.chip {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--line2);
  border-radius: var(--r);
  font-size: 11px;
  color: var(--tx2);
  background: #24272d;
}
.bindbar .btn { width: 100%; }

/* 提现表单：只读的到账卡信息 */
.fld-ro {
  display: flex; align-items: baseline; gap: 8px;
  font-size: 12px; padding: 7px 9px; margin: 8px 0;
  background: #191c21; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden;
}
.fld-ro:empty { display: none; }
.fld-ro .k { color: var(--tx3); flex: 0 0 auto; }
.fld-ro .v { color: var(--tx); font-variant-numeric: tabular-nums;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fld-ro .o { color: var(--tx3); margin-left: auto; flex: 0 0 auto; }

/* ---------- 邀请 ---------- */
.invcode {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  background: #191c21; border: 1px solid var(--line2); border-radius: var(--r);
}
.invcode-v {
  font-size: 20px; letter-spacing: 2px; color: var(--gold);
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}
.invcode .btn { margin-left: auto; }

.invlink { display: flex; gap: 6px; margin-top: 8px; }
.invlink input {
  flex: 1; min-width: 0;
  background: #14161a; border: 1px solid var(--line);
  color: var(--tx3); font-size: 11px; padding: 6px 8px; border-radius: var(--r);
}
.invlink .btn { flex: 0 0 auto; }

.invstat { display: flex; gap: 10px; margin-top: 12px; }
.invstat > div {
  flex: 1; text-align: center; padding: 9px 6px;
  background: #191c21; border: 1px solid var(--line); border-radius: var(--r);
}
.invstat b { display: block; font-size: 18px; color: var(--gold); font-variant-numeric: tabular-nums; }
.invstat span { font-size: 11px; color: var(--tx3); }

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

/* 表格：移动端横向滚动，不挤压内容 */
.tbl-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 460px; }
table.tbl th {
  text-align: left;
  padding: 6px 8px;
  background: #191c21;
  color: var(--tx3);
  font-weight: normal;
  border-bottom: 1px solid var(--line);
  font-size: 11px;
  white-space: nowrap;
}
table.tbl td { padding: 6px 8px; border-bottom: 1px solid #24282e; color: var(--tx2); }
table.tbl tr:hover td { background: #1f2329; }

.pos { color: #6fb98a; }
.neg { color: #c0695f; }
.dim { color: var(--tx3); }

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + var(--safe-b));
}
.modal-box {
  background: var(--bg2);
  border: 1px solid var(--line2);
  border-radius: var(--r);
  width: 420px;
  max-width: 100%;
  max-height: 88vh;
  overflow: auto;
}
.modal-box.sm { width: 320px; }
.modal-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: #191c21;
  font-size: 13px;
  color: #c8b98c;
  position: sticky;
  top: 0;
}
.modal-bd { padding: 14px 12px; }
.modal-bd input { font-size: 14px; padding: 9px 10px; }  /* 防止 iOS 聚焦放大 */
.swap { text-align: center; margin-top: 10px; font-size: 12px; color: var(--tx3); }
.swap span { cursor: pointer; }
.swap span:hover { color: var(--tx); }

/* ==================== 提示 ==================== */
.toast {
  position: fixed;
  left: 50%;
  top: calc(64px + var(--safe-t));
  transform: translateX(-50%);
  background: #2a2f36;
  border: 1px solid #4a515b;
  color: var(--tx);
  padding: 8px 18px;
  border-radius: var(--r);
  font-size: 13px;
  z-index: 200;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.err { background: #3a1f1c; border-color: #7a3a32; color: #e8b0a8; }
.toast.ok  { background: #1b2a20; border-color: #386248; color: #a8d4b8; }

.loading { padding: 30px; text-align: center; color: var(--tx3); font-size: 12px; }

/* 移动端底部导航，桌面隐藏 */
.tabbar { display: none; }

/* ============================================================
   Pad 768 ~ 1023：投注单改为右侧抽屉
   ============================================================ */
@media (max-width: 1023px) {
  .slip-layout { grid-template-columns: minmax(0, 1fr); }

  .slip {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 340px;
    max-width: 92vw;
    max-height: none;
    z-index: 95;
    border-radius: 0;
    border-left: 1px solid var(--line2);
    transform: translateX(100%);
    transition: transform .22s ease;
    padding-top: var(--safe-t);
    padding-bottom: var(--safe-b);
  }
  .slip.open { transform: translateX(0); }
  .slip-hd .x { display: block; }

  .slip-fab.on { display: inline-flex; }

  .cols2 { grid-template-columns: 1fr; }

  .wallet-top { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================================
   WAP < 768：单列 + 底部导航
   ============================================================ */
@media (max-width: 767px) {
  :root {
    --h-top: 44px;
    --gap: 8px;
  }

  /* 收款卡片：手机放不下三列，改成单列整齐排 */
  .paygrid { grid-template-columns: 1fr; gap: 6px; }
  .paycard { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 9px 10px; }
  .paycard-hd { flex: 1 1 100%; }
  .paycard-v { margin-top: 0; flex: 1 1 auto; }
  .paycard-o { margin-top: 0; flex: 1 1 100%; }

  .invcode { padding: 9px 10px; }
  .invcode-v { font-size: 18px; letter-spacing: 1px; }
  .invlink { flex-direction: column; }
  .invlink .btn { width: 100%; }
  .invstat b { font-size: 16px; }

  .cols2 { grid-template-columns: 1fr; }

  /* 移动端触控目标：所有按钮至少 32px 高，避免误触 */
  .btn { min-height: 32px; }
  .btn-s { min-height: 30px; }

  body { font-size: 14px; }   /* 手机上 13px 偏小，抬到 14 */

  .wrap { max-width: calc(100% - 20px); }

  /* 顶栏：品牌 + 余额 + 登录，导航交给底部 */
  .topbar .wrap { gap: 10px; height: var(--h-top); }
  .mainnav { display: none; }
  .brand { font-size: 14px; }
  .brand em { display: none; }
  .brand span { font-size: 11px; }

  .acct { gap: 6px; }
  .bal { font-size: 12px; padding: 3px 7px; }
  .acct .btn { padding: 5px 10px; font-size: 12px; min-height: 32px; }

  .main { padding: 10px 0 calc(var(--h-tab) + var(--safe-b) + 16px); }

  /* 工具栏允许横向滚动，不换行堆高 */
  .toolbar {
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar #matchCount { margin-left: auto; flex-shrink: 0; font-size: 11px; }

  .tabs { flex-shrink: 0; }
  .tabs button {
    padding: 7px 13px;
    font-size: 13px;
    min-height: 34px;
  }

  select { min-width: 96px; font-size: 13px; padding: 6px 24px 6px 8px; min-height: 34px; }

  /* 赛事行：队名一列，赔率 2 列，加大触摸区 */
  .mrow {
    grid-template-columns: minmax(0, 1fr) 62px 62px;
    gap: 5px;
    padding: 8px 9px;
  }
  .mrow .t1, .mrow .t2 { font-size: 14px; }
  .mrow .vs { font-size: 11px; gap: 5px; }
  .mrow .score { font-size: 14px; }

  .obtn {
    min-height: 34px;      /* ≥34px 触摸目标 */
    font-size: 13px;
    padding: 6px 2px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mg-hd {
    padding: 6px 9px;
    font-size: 12px;
  }
  .mg-hd .lg { font-size: 12px; }

  /* 投注单：全屏抽屉，从底部滑出 */
  .slip {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 82vh;
    border-left: 0;
    border-top: 1px solid var(--line2);
    transform: translateY(100%);
    border-radius: 0;
  }
  .slip.open { transform: translateY(0); }
  .slip-body { max-height: 42vh; }
  .slip-hd { padding: 10px 12px; font-size: 14px; }
  .slip-ft { padding: 10px 12px calc(10px + var(--safe-b)); }
  .slip-ft .row { font-size: 13px; }
  .slip-ft .row input { width: 120px; font-size: 16px; }  /* 16px 防 iOS 缩放 */
  .quick button { min-height: 34px; font-size: 13px; }
  .slip-ft .btn-block { padding: 12px; font-size: 15px; }

  /* 注单项：三列压成两行 */
  .bitem {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 2px 8px;
  }
  .bitem .bo { grid-column: 2; }
  .bitem .br { grid-column: 1 / -1; text-align: left; padding-top: 2px; }

  /* 资金卡：余额占满，其余两列 */
  .wallet-top {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .wallet-top .wcard:first-child {
    grid-column: 1 / -1;
  }
  .wcard .wv { font-size: 18px; }
  .wcard:first-child .wv { font-size: 24px; }

  .panel-bd { padding: 10px; }
  .panel-bd input { font-size: 16px; padding: 9px 10px; }  /* 防 iOS 聚焦缩放 */

  .tabs.sub { display: flex; width: 100%; margin: 12px 0 8px; }
  .tabs.sub button { flex: 1; text-align: center; }

  /* 底部导航 */
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 80;
    background: #101216;
    border-top: 1px solid var(--line);
    padding-bottom: var(--safe-b);
    padding-left: var(--safe-l);
    padding-right: var(--safe-r);
  }
  .tabbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    height: var(--h-tab);
    color: var(--tx3);
    font-size: 11px;
    position: relative;
    transition: color .12s;
  }
  .tabbar a .ic { font-size: 17px; line-height: 1; }
  .tabbar a.on { color: var(--gold2); }
  .tabbar a.on::before {
    content: '';
    position: absolute;
    top: 0;
    left: 22%;
    right: 22%;
    height: 2px;
    background: var(--gold);
  }

  /* 移动端弹窗贴底，像原生 sheet */
  .modal { align-items: flex-end; padding: 0; padding-bottom: var(--safe-b); }
  .modal-box, .modal-box.sm {
    width: 100%;
    max-width: 100%;
    max-height: 86vh;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .modal-bd { padding: 14px 14px 18px; }
  .modal-bd input { font-size: 16px; padding: 10px; }
  .modal-bd .btn-block { padding: 12px; font-size: 15px; }

  .toast { top: calc(56px + var(--safe-t)); font-size: 13px; }

  .slip-fab { bottom: calc(var(--h-tab) + var(--safe-b) + 12px); right: 10px; }
}

/* ============================================================
   SE < 375：再压一档
   ============================================================ */
@media (max-width: 374px) {
  .invcode-v { font-size: 16px; letter-spacing: 1px; }
  .invcode .btn { padding: 4px 8px; font-size: 11px; }
  .paycard-i { display: none; }
  .invstat span { font-size: 10px; }
  .mrow { grid-template-columns: minmax(0, 1fr) 54px 54px; gap: 4px; padding: 7px 7px; }
  .mrow .t1, .mrow .t2 { font-size: 13px; }
  .obtn { font-size: 12px; min-height: 32px; }
  .tabs button { padding: 7px 10px; font-size: 12px; }
  .brand em { display: none; }
  .tabbar a { font-size: 10px; }
  .wcard .wv { font-size: 16px; }
}

/* ============================================================
   横屏手机（高度很矮）：顶栏和间距都收紧
   ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  :root { --h-top: 38px; }
  .main { padding-top: 6px; }
  .mg-hd { position: static; }
  .slip { max-height: 94vh; }
  .slip-body { max-height: 30vh; }
  .modal-box { max-height: 94vh; }
}

/* ============================================================
   超宽屏：内容不无限拉伸
   ============================================================ */
@media (min-width: 1440px) {
  .wrap { width: 1320px; }
  .slip-layout { grid-template-columns: minmax(0, 1fr) 300px; }
}

/* ============================================================
   无障碍 / 系统偏好
   ============================================================ */

/* 触屏设备不要粘滞 hover 高亮 */
@media (hover: none) {
  .mrow:hover { background: transparent; }
  .obtn:hover { background: #23272d; border-color: #31363d; color: #b9c0c8; }
  .obtn.on:hover { background: #3a2018; border-color: #8f4a34; color: #f0b490; }
  .btn:hover { background: var(--bg3); border-color: var(--line2); }
  .btn-primary:hover { background: #8f2f28; border-color: #a93a31; }
  .mainnav a:hover { background: transparent; }
  .quick button:hover { background: #23272d; color: var(--tx2); }
}

/* 尊重减少动效 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* 高对比度模式 */
@media (forced-colors: active) {
  .obtn, .btn, .tabs { border: 1px solid ButtonBorder; }
  .obtn.on { border: 2px solid Highlight; }
}

/* 键盘可达 */
:focus-visible {
  outline: 2px solid #6a8fc4;
  outline-offset: 1px;
}
button:focus:not(:focus-visible) { outline: none; }
