:root {
  --red: #d5382c;
  --red-dark: #b02a20;
  --red-grad: linear-gradient(135deg, #e04a35 0%, #c02a24 60%, #a81f1c 100%);
  --gold: #f5b63f;
  --gold-dark: #d99a1b;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #23262b;
  --text2: #7a808a;
  --line: #ececf0;
  --green: #1fa15d;
  --blue: #2f6fed;
  --radius: 14px;
  --shadow: 0 2px 12px rgba(30, 34, 40, .07);
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; overflow-x: hidden; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  touch-action: manipulation;         /* 禁双击放大 */
  -webkit-text-size-adjust: 100%;     /* 禁横屏自动放大文字 */
  text-size-adjust: 100%;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; touch-action: manipulation; }
/* 输入框固定16px，避免 iOS 聚焦时自动放大页面 */
input, select { font-family: inherit; font-size: 16px; outline: none; }
[hidden] { display: none !important; }

/* ---------- 登录 ---------- */
.auth-wrap {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 24px;
  background: var(--red-grad);
}
.auth-logo { text-align: center; margin-bottom: 26px; color: #fff; }
.auth-logo .big { font-size: 2rem; font-weight: 800; letter-spacing: 2px; }
.auth-logo .sub { margin-top: 8px; font-size: .85rem; opacity: .85; }
.auth-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: 18px; padding: 26px 22px; box-shadow: 0 10px 40px rgba(0,0,0,.18);
}
.auth-card h2 { font-size: 1.15rem; margin-bottom: 18px; text-align: center; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .8rem; color: var(--text2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fafafa; transition: border-color .2s;
}
.field input:focus { border-color: var(--red); background: #fff; }
.btn-primary {
  width: 100%; padding: 13px; border-radius: 12px; color: #fff;
  background: var(--red-grad); font-size: 1rem; font-weight: 600;
  transition: transform .12s, opacity .2s;
}
.btn-primary:active { transform: scale(.97); }
.btn-primary:disabled { opacity: .55; }
.auth-switch { text-align: center; margin-top: 14px; font-size: .85rem; color: var(--text2); }
.auth-switch b { color: var(--red); cursor: pointer; }
.auth-cs {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 14px; padding: 9px 12px; border-radius: 10px;
  font-size: .85rem; font-weight: 600; color: #1c93e3;
  background: #eef7fd; border: 1px solid #bfe0f5; text-decoration: none;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
}
@media (hover: hover) {
  .auth-cs:hover {
    background: #dceffb; border-color: #8ecdf0;
    transform: translateY(-1px); box-shadow: 0 4px 12px rgba(28, 147, 227, .22);
  }
}
.auth-cs:active { opacity: .75; transform: none; }
.cs-ico { width: 18px; height: 18px; flex: none; }
.auth-note { margin-top: 18px; font-size: .72rem; color: rgba(255,255,255,.8); text-align: center; line-height: 1.6; max-width: 340px; }
.pending-box { text-align: center; padding: 8px 0 4px; }
.pending-box .pb-icon { font-size: 2.6rem; line-height: 1; margin-bottom: 12px; }
.pending-box .pb-title { font-size: 1.35rem; font-weight: 800; line-height: 1.5; color: var(--red); margin-bottom: 12px; }
.pending-box .pb-sub {
  font-size: .88rem; font-weight: 600; color: #8a6100;
  background: #fdf3d7; border: 1px solid var(--gold);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 18px;
}

/* ---------- 主框架 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--red-grad); color: #fff;
  padding: 14px 16px calc(14px + 0px);
  box-shadow: 0 2px 10px rgba(160, 30, 25, .25);
}
.topbar-main {
  position: relative; min-height: 33px;
  display: flex; align-items: center; justify-content: center;
}
.topbar-main .balance-chip { position: absolute; right: 0; top: 50%; transform: translateY(-50%); }
.topbar-cs {
  width: fit-content; margin: 10px auto 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 7px 12px; border-radius: 999px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  color: #fff; font-size: .82rem; font-weight: 600; text-decoration: none;
  transition: background .18s, border-color .18s, transform .18s, box-shadow .18s;
}
@media (hover: hover) {
  .topbar-cs:hover {
    background: rgba(255,255,255,.28); border-color: rgba(255,255,255,.5);
    transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .25);
  }
}
.topbar-cs:active { opacity: .75; transform: none; }
.topbar .brand {
  font-weight: 800; font-size: 1.35rem; letter-spacing: 2px; line-height: 1;
  color: #fff;
  text-shadow:
    0 1px 0 #e6e6e6,
    0 2px 0 #cccccc,
    0 3px 0 #a6a6a6,
    0 5px 8px rgba(0, 0, 0, .45);
}
.topbar .brand small { font-weight: 400; font-size: .68rem; opacity: .85; margin-left: 6px; }
.balance-chip {
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28);
  border-radius: 999px; padding: 6px 14px; font-size: .85rem; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.balance-chip .coin { color: var(--gold); }

/* 底部留白 = dock 实际高度（含浮条/安全区）+ 20px，JS 用 ResizeObserver 维护 --dock-h */
main { max-width: 560px; margin: 0 auto; padding: 14px 14px calc(var(--dock-h, 70px) + 20px); }
.view { animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin-bottom: 14px;
}
.card-title { font-size: .95rem; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; }
.card-title .hint { font-size: .72rem; font-weight: 400; color: var(--text2); }

/* 分段选择 */
.seg {
  display: flex; background: #ebecef; border-radius: 12px; padding: 4px; gap: 4px;
}
.seg button {
  flex: 1; padding: 9px 0; border-radius: 9px; font-size: .92rem; font-weight: 600;
  color: var(--text2); transition: all .2s;
}
.seg button.on { background: #fff; color: var(--red); box-shadow: 0 1px 6px rgba(0,0,0,.1); }

/* 期次卡 */
.draw-card { position: relative; overflow: hidden; }
.draw-card .issue-line { display: flex; align-items: baseline; gap: 8px; }
.draw-card .issue-line .no { font-size: 1.15rem; font-weight: 800; }
.draw-card .issue-line .date { font-size: .78rem; color: var(--text2); }
.countdown { margin-top: 10px; display: flex; align-items: center; gap: 8px; font-size: .8rem; color: var(--text2); }
.countdown .t {
  background: #2b2e33; color: #fff; border-radius: 7px; padding: 4px 7px;
  font-variant-numeric: tabular-nums; font-weight: 700; font-size: .9rem; min-width: 34px; text-align: center;
}
.closed-tip { margin-top: 10px; color: var(--red); font-size: .85rem; font-weight: 600; }
.draw-select { border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: #fafafa; font-size: .85rem; max-width: 165px; }

/* 玩法选号 */
.bt-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; }
.bt-tabs button {
  padding: 8px 16px; border-radius: 999px; background: #fff; white-space: nowrap;
  border: 1px solid var(--line); font-size: .88rem; font-weight: 600; color: var(--text2);
  transition: all .2s; box-shadow: var(--shadow);
}
.bt-tabs button.on { background: var(--red); border-color: var(--red); color: #fff; }
.odds-tip { font-size: .78rem; color: var(--gold-dark); font-weight: 600; }

.pos-row { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.pos-row:last-child { border-bottom: none; }
.pos-name {
  flex: 0 0 44px; text-align: center; font-size: .8rem; font-weight: 700; color: var(--text2);
  line-height: 1.2;
}
.pos-name i { display: block; font-style: normal; font-size: .62rem; color: var(--red); font-weight: 600; margin-top: 2px; }
.pos-row.picked .pos-name { color: var(--red); }
.digits { display: flex; gap: 4px; flex: 1; min-width: 0; flex-wrap: nowrap; justify-content: space-between; }
/* 号码球宽度 = (屏宽 - 页边距28 - 卡片内边距32 - 位置名44 - 行间距8 - 球间隙36) / 10，绝不溢出 */
.digit {
  width: 24px; height: 24px; /* 老浏览器兜底 */
  flex: 0 0 auto; border-radius: 50%;
  border: 1px solid var(--line); background: #fff; font-size: .92rem; font-weight: 700;
  color: var(--text); display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
@supports (width: min(1px, 1vw)) {
  .digit {
    width: min(calc((100vw - 150px) / 10), 34px);
    height: min(calc((100vw - 150px) / 10), 34px);
    font-size: min(calc((100vw - 150px) / 24), .92rem);
  }
}
.digit.on {
  background: var(--red-grad); border-color: var(--red-dark); color: #fff;
  transform: scale(1.08); box-shadow: 0 2px 8px rgba(200, 50, 40, .4);
}
.combo-info { margin-top: 12px; font-size: .85rem; color: var(--text2); text-align: center; min-height: 1.2em; }
.combo-info b { color: var(--text); }
.combo-info .hl { color: var(--red); font-size: 1.05rem; }

/* 金额 */
.amount-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.amt-chip {
  padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-weight: 700; font-size: .88rem; transition: all .15s;
  white-space: nowrap;   /* 「自定义 xx.x」不许折行撑高 chip */
}
.amt-chip.on { background: var(--gold); border-color: var(--gold-dark); color: #5c3d00; }
.amt-input { width: 90px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 999px; text-align: center; }
.btn-add {
  width: 100%; margin-top: 14px; padding: 13px; border-radius: 12px;
  background: var(--gold); color: #4a3000; font-weight: 800; font-size: 1rem;
  transition: transform .12s; box-shadow: 0 3px 10px rgba(217, 154, 27, .35);
}
.btn-add:active { transform: scale(.97); }

/* 分页条 */
.pager {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.pg-btn {
  padding: 8px 16px; border-radius: 10px; font-weight: 700; font-size: .9rem;
  background: var(--card); color: var(--text); border: 1px solid var(--line);
}
.pg-btn:active { transform: scale(.96); }
.pg-btn:disabled { opacity: .4; }
.pg-info { color: var(--text2); font-size: .88rem; font-variant-numeric: tabular-nums; }

/* 注单栏：dock 内自然堆叠，收起时高度归零（不再固定定位，永不与导航重叠） */
.slip-bar {
  width: 100%; max-width: 560px; margin: 0 auto; padding: 0 14px;
  overflow: hidden; max-height: 0; transition: max-height .25s ease;
}
.slip-bar.show { max-height: 110px; }
.slip-bar .inner {
  background: #2b2e33; color: #fff; border-radius: 14px; padding: 12px 14px;
  margin-bottom: 10px;
  display: flex; align-items: center; gap: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.slip-bar .info { flex: 1; font-size: .85rem; }
.slip-bar .info b { color: var(--gold); }
.slip-bar button { padding: 9px 16px; border-radius: 9px; font-weight: 700; font-size: .85rem; }
.slip-bar .view-btn { background: rgba(255,255,255,.14); color: #fff; }
.slip-bar .submit-btn { background: var(--red-grad); color: #fff; }

/* 弹层 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
  max-width: 560px; margin: 0 auto; background: #fff;
  border-radius: 18px 18px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  max-height: 78vh; overflow-y: auto;
  transform: translateY(105%); transition: transform .28s cubic-bezier(.2,.8,.25,1);
}
.sheet.show { transform: none; }
.sheet h3 { font-size: 1rem; margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
.sheet h3 .close { color: var(--text2); font-size: .85rem; font-weight: 400; }
.slip-item {
  display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line);
}
.slip-item .desc { flex: 1; }
.slip-item .desc .t1 { font-size: .9rem; font-weight: 700; }
.slip-item .desc .t2 { font-size: .74rem; color: var(--text2); margin-top: 3px; }
.slip-item .amt { font-weight: 700; color: var(--red); }
.slip-item .del { color: var(--text2); font-size: 1.1rem; padding: 4px 8px; }
.sheet .total-line { display: flex; justify-content: space-between; padding: 14px 0; font-weight: 700; }

/* 开奖列表：期号/日期一行，开奖号独占一行，七星彩7个球也放得下 */
.result-card { display: flex; flex-direction: column; gap: 10px; }
.result-card .meta { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.result-card .meta .g { font-weight: 700; font-size: .92rem; }
.result-card .meta .i { font-size: .74rem; color: var(--text2); }
.balls { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.ball {
  width: 34px; height: 34px; border-radius: 50%; color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: var(--red-grad); box-shadow: 0 2px 6px rgba(190, 45, 38, .4);
}
.ball.dim { background: #c8cbd1; box-shadow: none; width: 26px; height: 26px; font-size: .8rem; }
/* 七星彩特别号(第7位0-14)：整体一颗，两位数也不拆；蓝色区别于前区 */
.ball.sp { background: #2f6fb0; box-shadow: none; height: 26px; min-width: 26px;
  width: auto; padding: 0 7px; border-radius: 13px; font-size: .8rem; letter-spacing: 0; }
.sum-tag { font-size: .7rem; color: var(--text2); margin-top: 4px; }

/* 排行 */
.rank-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rank-item:last-child { border-bottom: none; }
.rank-no { flex: 0 0 30px; text-align: center; font-weight: 800; color: var(--text2); font-size: .95rem; }
.rank-no.m1 { color: #e7a400; font-size: 1.25rem; }
.rank-no.m2 { color: #9aa4b2; font-size: 1.15rem; }
.rank-no.m3 { color: #c0793a; font-size: 1.1rem; }
.rank-item .who { flex: 1; }
.rank-item .who .n { font-weight: 700; font-size: .92rem; }
.rank-item .who .s { font-size: .72rem; color: var(--text2); margin-top: 2px; }
.rank-net { font-weight: 800; font-variant-numeric: tabular-nums; }
.rank-net.pos { color: var(--red); }
.rank-net.neg { color: var(--green); }

/* 我的 */
.profile-head {
  background: var(--red-grad); border-radius: var(--radius); color: #fff;
  padding: 20px 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.profile-head .n { font-size: 1.15rem; font-weight: 800; }
.profile-head .b { margin-top: 10px; font-size: .85rem; opacity: .9; }
.profile-head .b b { font-size: 1.5rem; color: var(--gold); margin-right: 4px; }
.bet-item { padding: 12px 0; border-bottom: 1px solid var(--line); }
.bet-item:last-child { border-bottom: none; }
.bet-item .l1 { display: flex; justify-content: space-between; align-items: center; }
.bet-item .l1 .t { font-weight: 700; font-size: .9rem; }
.bet-item .l2 { display: flex; justify-content: space-between; margin-top: 5px; font-size: .76rem; color: var(--text2); }

/* 注单明细弹窗：合并同号后按两列网格排布，每格「号码 = 金额分」，
   长列表用 content-visibility 跳过视口外布局 */
.bd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.bd-row { display: flex; justify-content: space-between; align-items: center; gap: 6px;
  content-visibility: auto; contain-intrinsic-size: auto 30px;
  padding: 5px 2px; border-bottom: 1px solid var(--line); font-size: .86rem; }
.bd-row .combo { font-weight: 700; letter-spacing: .5px; }
.bd-row.lost { color: var(--text2); }
.bd-row.refunded { color: var(--text2); }
.bd-row .win { color: var(--red); font-weight: 700; flex: none; }
.bd-row .muted { color: var(--text2); font-size: .78rem; flex: none; }
.bd-more { grid-column: 1 / -1; }
@media (max-width: 360px) { .bd-grid { grid-template-columns: 1fr; } }

/* 全站下注记录·玩家明细：同样合并同号，「号码 = 金额分」 */
.ap-bet.lost .bd, .ap-bet.refunded .bd { color: var(--text2); font-weight: 400; }
.ap-bet .win { color: var(--red); font-weight: 700; }
.ap-bet .muted { color: var(--text2); font-size: .78rem; }

.tag { font-size: .72rem; padding: 3px 9px; border-radius: 999px; font-weight: 700; }
.tag.pending { background: #fff4e0; color: #b47b00; }
.tag.won { background: #ffecea; color: var(--red); }
.tag.lost { background: #eef0f3; color: var(--text2); }
.tag.push, .tag.refunded { background: #e8f3ff; color: var(--blue); }
/* 管理 tab 小按钮 */
.mini-yes, .mini-no, .mini-edit { font-size: .8rem; font-weight: 700; padding: 6px 14px; border-radius: 8px; }
.mini-yes { background: var(--red-grad); color: #fff; }
.mini-no { background: #eef0f3; color: var(--text2); }
.mini-edit { background: #e8f3ff; color: var(--blue); }
.mini-yes:disabled { cursor: not-allowed; }
/* 管理：整行等宽操作按钮条（窄屏不溢出） */
.adm-act-bar { display: flex; gap: 8px; margin-top: 10px; }
.adm-act-bar button { flex: 1; padding: 8px 0; text-align: center; white-space: nowrap; }
/* 管理：用户管理单行 + 操作菜单 */
.ua-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ua-row:last-child { border-bottom: none; }
.ua-row .ph { flex: 1; font-weight: 700; font-size: .9rem; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.ua-row .ph-l1 { display: flex; align-items: center; gap: 6px; }
.ua-row .ll { font-weight: 400; font-size: .74rem; opacity: .55; }
.ua-row .bal { min-width: 64px; text-align: right; font-weight: 700; font-size: .88rem; }
.ua-btn {
  display: block; width: 100%; padding: 12px; margin-bottom: 8px;
  border-radius: 10px; font-size: .92rem; font-weight: 700; text-align: center;
  background: #eef0f3; color: var(--text);
}
.ua-btn.up { background: var(--red-grad); color: #fff; }
.ua-btn.danger { background: #ffecea; color: var(--red); }
.ua-btn:active { transform: scale(.97); }
/* 管理：期次明细玩家行 */
.ap-row { border-bottom: 1px solid var(--line); padding: 10px 0; }
.ap-row:last-child { border-bottom: none; }
.ap-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; }
.ap-head .ph { font-weight: 700; }
.ap-head .st { font-size: .76rem; color: var(--text2); flex: none; }
.ap-bet { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding: 5px 0; font-size: .82rem; content-visibility: auto; contain-intrinsic-size: auto 30px; }
.ap-bet .bd { font-weight: 700; letter-spacing: .5px; }
.ap-bet .bd i { opacity: .55; font-style: normal; font-weight: 400; }
.ap-bet .br { display: flex; gap: 6px; align-items: center; flex: none; margin-left: auto; }
.menu-btn {
  width: 100%; text-align: left; padding: 14px 2px; font-size: .92rem;
  border-bottom: 1px solid var(--line); display: flex; justify-content: space-between;
}
.menu-btn:last-child { border-bottom: none; }
.menu-btn span.arrow { color: var(--text2); }
.menu-btn .menu-r { display: flex; align-items: center; gap: 8px; }
.sheet.center {
  left: 16px; right: 16px; top: 50%; bottom: auto;
  max-width: 480px; border-radius: 18px; max-height: 80vh;
  padding-bottom: 18px;
  opacity: 0; pointer-events: none;
  transform: translateY(-50%) scale(.92);
  transition: transform .24s cubic-bezier(.2,.8,.25,1), opacity .2s;
}
.sheet.center.show { transform: translateY(-50%) scale(1); opacity: 1; pointer-events: auto; }
.menu-badge {
  background: var(--red); color: #fff; font-size: .7rem; font-weight: 700;
  border-radius: 10px; padding: 2px 8px; line-height: 1.4;
}
.menu-badge:empty { display: none; }
.sheet-hint { font-size: .76rem; color: var(--text2); margin: -8px 0 10px; }

/* 底部 dock：注单条/导航同一固定容器纵向堆叠，高度由内容+安全区自然决定；
   空白区 pointer-events 穿透，main 底部留白用 --dock-h（JS ResizeObserver 维护）跟随 */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex; flex-direction: column; pointer-events: none;
}
.dock > * { pointer-events: auto; }

/* 底部导航（dock 内最底层） */
.bottomnav {
  width: 100%;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav button {
  flex: 1; padding: 8px 0 7px; display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: .68rem; color: var(--text2); transition: color .15s;
}
.bottomnav button svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bottomnav button.on { color: var(--red); font-weight: 700; }

/* toast */
#toast {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%) translateY(-16px);
  background: rgba(35, 38, 43, .92); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: .85rem; z-index: 99; opacity: 0; pointer-events: none;
  transition: all .25s; max-width: 86vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
#toast.good { background: rgba(23, 130, 76, .95); }
#toast.bad { background: rgba(190, 45, 38, .95); }

.empty { text-align: center; color: var(--text2); font-size: .85rem; padding: 34px 0; }
.footer-note { text-align: center; font-size: .68rem; color: #b6bac2; padding: 10px 20px 0; line-height: 1.7; }

/* ---------- 管理后台 ---------- */
.admin-body { background: var(--bg); }
.admin-top {
  background: #2b2e33; color: #fff; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
}
.admin-top .t { font-weight: 800; }
.admin-top a { color: var(--gold); text-decoration: none; font-size: .85rem; }
.admin-main { max-width: 900px; margin: 0 auto; padding: 16px 14px 60px; }
.admin-tabs { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; }
.admin-tabs button {
  padding: 9px 18px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-weight: 600; font-size: .88rem; color: var(--text2); white-space: nowrap; box-shadow: var(--shadow);
}
.admin-tabs button.on { background: #2b2e33; color: #fff; border-color: #2b2e33; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .82rem; }
.tbl th { text-align: left; color: var(--text2); font-weight: 600; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 9px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl-wrap { overflow-x: auto; }
.mini-btn {
  padding: 5px 11px; border-radius: 7px; font-size: .76rem; font-weight: 600; margin: 2px;
  background: #eef0f3; color: var(--text);
}
.mini-btn.red { background: #ffecea; color: var(--red); }
.mini-btn.blue { background: #e8f1ff; color: var(--blue); }
.mini-btn.dark { background: #2b2e33; color: #fff; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.form-grid .field input, .form-grid .field select { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; }
.inline-note { font-size: .74rem; color: var(--text2); margin-top: 8px; line-height: 1.6; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-tile { background: #fff; border-radius: 12px; padding: 14px; box-shadow: var(--shadow); }
.stat-tile .k { font-size: .72rem; color: var(--text2); }
.stat-tile .v { font-size: 1.3rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }

/* ---------- 全机型自适应 ---------- */
/* 窄屏（iPhone SE / 小屏安卓 320~374px）：压缩边距给号码球留空间 */
@media (max-width: 374px) {
  html { font-size: 14.5px; }
  main { padding-left: 10px; padding-right: 10px; }
  .card { padding: 13px 11px; }
  .pos-name { flex-basis: 34px; font-size: .74rem; }
  .pos-row { gap: 6px; }
  .digits { gap: 3px; }
  /* 非号码球空间 = 20+22+34+6+27 = 109px */
  .digit { width: calc((100vw - 112px) / 10); height: calc((100vw - 112px) / 10); font-size: .8rem; }
  .amt-chip { padding: 7px 12px; font-size: .82rem; }
  .balance-chip { padding: 5px 10px; font-size: .78rem; }
  .topbar .brand { font-size: 1rem; }
  .ball { width: 30px; height: 30px; font-size: .95rem; }
}
/* 平板 / 桌面：main 限宽 560px，号码球取上限 */
@media (min-width: 600px) {
  main { padding-top: 20px; }
  .digit { width: 34px; height: 34px; font-size: .92rem; }
}

/* ---------- 自定义弹窗 ---------- */
.dlg-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 22px;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.dlg-mask.show { opacity: 1; pointer-events: auto; }
.dlg {
  background: #fff; border-radius: 16px; padding: 20px 18px; width: 100%; max-width: 340px;
  transform: scale(.92) translateY(8px); transition: transform .22s cubic-bezier(.2,.8,.25,1);
  box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}
.dlg-mask.show .dlg { transform: none; }
.dlg-title { font-weight: 700; font-size: 1rem; margin-bottom: 10px; }
.dlg-msg { font-size: .85rem; color: var(--text2); line-height: 1.6; margin-bottom: 12px; white-space: pre-line; }
.dlg input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #fafafa; margin-bottom: 14px; }
.dlg input:focus { border-color: var(--red); background: #fff; }
/* 手动录号按位输入格：flex 均分，窄屏自动收缩不溢出；特别号格(可两位)稍宽 */
#dlgBoxes { display: flex; gap: 5px; margin-bottom: 14px; }
#dlgBoxes input {
  flex: 1 1 0; min-width: 0; width: auto; height: 44px; padding: 0; margin: 0;
  text-align: center; font-size: 1.15rem; font-weight: 700;
  border: 1px solid var(--line); border-radius: 9px; background: #fafafa;
}
#dlgBoxes input.wide { flex: 1.5 1 0; }
#dlgBoxes input:focus { border-color: var(--red); background: #fff; }
.dlg-btns { display: flex; gap: 10px; }
.dlg-btns button { flex: 1; padding: 11px; border-radius: 10px; font-weight: 700; font-size: .92rem; }
.dlg-btns .cancel { background: #eef0f3; color: var(--text2); }
.dlg-btns .ok { background: var(--red-grad); color: #fff; }
/* 横屏手机：压缩上下留白 */
@media (max-height: 450px) and (orientation: landscape) {
  .topbar { padding-top: 8px; padding-bottom: 8px; }
  .pos-row { padding: 6px 0; }
}

/* 玩法tab下方的赔率行 */
.odds-line { margin: 9px 6px 0; font-size: .84rem; color: var(--gold-dark); font-weight: 700; }
