/* 懂球帝离线版 移动端 H5 —— 深空夜蓝/草场绿茵 双主题（与鸿蒙版配色一致） */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
  font-family: -apple-system, 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg); color: var(--text);
  height: 100vh; height: 100dvh; display: flex; flex-direction: column;
  overflow: hidden;
}
button { font-family: inherit; border: none; cursor: pointer; background: none; color: inherit; }
input { font-family: inherit; }

:root, body[data-theme="night"] {
  --bg:#0a0e1a; --card:#141826; --bar:#2a3045; --barBg:#1e2535;
  --primary:#4fc3f7; --accent:#1976d2; --gold:#ffca28; --green:#66bb6a; --red:#e53935;
  --text:#e0e6ed; --sub:#90a4ae; --dim:#546e7a; --border:#3a4763;
  --pitchA:#123c1f; --pitchB:#15482a; --pitchLine:rgba(255,255,255,.22);
  --tintGold:rgba(255,202,40,.12); --tintGoldB:rgba(255,202,40,.45);
  --scrim:rgba(4,6,12,.72);
}
body[data-theme="pitchday"] {
  --bg:#0d2318; --card:#14301f; --bar:#28543a; --barBg:#1a3d28;
  --primary:#6fe08a; --accent:#2e9e57; --gold:#ffd54f; --green:#9ccc65; --red:#ef5350;
  --text:#eaf5ec; --sub:#93b9a0; --dim:#5e7f6a; --border:#33543f;
  --pitchA:#0d3a1e; --pitchB:#114824; --pitchLine:rgba(255,255,255,.25);
  --tintGold:rgba(255,213,79,.12); --tintGoldB:rgba(255,213,79,.45);
  --scrim:rgba(3,14,8,.72);
}

/* ===== 启动屏 ===== */
#boot { position: fixed; inset: 0; z-index: 99; background: var(--bg); display: flex; align-items: center; justify-content: center; transition: opacity .3s; }
#boot.hide { opacity: 0; pointer-events: none; }
.boot-in { text-align: center; }
.boot-logo { font-size: 52px; }
.boot-t1 { font-size: 17px; font-weight: 700; margin: 10px 0 22px; color: var(--text); }
#bootMsg { font-size: 12px; color: var(--sub); margin-bottom: 10px; }
.boot-bar { width: 200px; height: 4px; background: var(--barBg); border-radius: 2px; margin: 0 auto; overflow: hidden; }
#bootBar { display: block; height: 100%; width: 0%; background: var(--primary); border-radius: 2px; transition: width .2s; }

/* ===== 顶栏 ===== */
#topbar { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: var(--bg); flex-shrink: 0; }
.brand { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.brand .logo { font-size: 20px; }
.brand .ver { font-size: 11px; color: var(--primary); background: var(--barBg); padding: 2px 8px; border-radius: 8px; }
.icon-btn { font-size: 18px; padding: 6px 10px; border-radius: 10px; background: var(--barBg); }

/* ===== 主体 ===== */
#page { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 0 12px 16px; }
.tab { display: none; }
.tab.active { display: block; }
.sect { font-size: 14px; font-weight: 700; color: var(--primary); margin: 14px 0 8px; }
.sect span { color: var(--sub); font-weight: 400; font-size: 12px; }
.sq-b { margin-top: 16px; }

/* ===== 搜索 ===== */
.searchbar { position: sticky; top: 0; z-index: 5; background: var(--bg); padding: 10px 0; }
#q { width: 100%; padding: 11px 14px; font-size: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--card); color: var(--text); outline: none; }
#q:focus { border-color: var(--primary); }
.suggest { background: var(--card); border-radius: 12px; margin-top: 6px; overflow: hidden; border: 1px solid var(--border); display: none; max-height: 340px; overflow-y: auto; }
.suggest .sg { display: flex; gap: 8px; align-items: center; padding: 10px 12px; font-size: 13px; border-bottom: 1px solid var(--barBg); }
.suggest .sg:last-child { border-bottom: none; }
.sg .nm { font-weight: 600; color: var(--text); flex: 1; }
.sg .nt { color: var(--sub); font-size: 12px; }
.sg .g { color: var(--gold); font-size: 12px; white-space: nowrap; }

/* ===== 榜单 ===== */
.board-tabs { display: flex; gap: 8px; margin: 4px 0 10px; overflow-x: auto; scrollbar-width: none; }
.board-tabs::-webkit-scrollbar { display: none; }
.board-tabs button { flex-shrink: 0; padding: 7px 14px; font-size: 13px; border-radius: 14px; background: var(--barBg); color: var(--sub); }
.board-tabs button.on { background: var(--primary); color: var(--bg); font-weight: 700; }
.brow { display: flex; align-items: center; gap: 10px; padding: 10px 10px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; }
.brow .rk { width: 30px; text-align: center; font-weight: 800; color: var(--dim); font-size: 14px; flex-shrink: 0; }
.brow .rk.t { color: var(--gold); }
.brow .bi { flex: 1; min-width: 0; }
.brow .bn { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bm { font-size: 11px; color: var(--sub); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brow .bv { text-align: right; flex-shrink: 0; }
.brow .bv b { font-size: 16px; color: var(--gold); }
.brow .bv i { display: block; font-style: normal; font-size: 10px; color: var(--dim); }
.known-dot { color: var(--primary); font-size: 11px; margin-left: 4px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 12px; }
.pager button { padding: 9px 16px; border-radius: 10px; background: var(--barBg); color: var(--sub); font-size: 13px; }
.pager button:disabled { opacity: .35; }
.pager span { font-size: 12px; color: var(--sub); }

/* ===== 模式切换/横条 ===== */
.mode-tabs { display: flex; justify-content: center; gap: 8px; padding: 10px 0 6px; }
.mode-tabs button { padding: 7px 20px; font-size: 14px; border-radius: 16px; background: var(--barBg); color: var(--sub); }
.mode-tabs button.on { background: var(--primary); color: var(--bg); font-weight: 700; }
.chipbar { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0; scrollbar-width: none; }
.chipbar::-webkit-scrollbar { display: none; }
.chipbar span { flex-shrink: 0; padding: 6px 14px; font-size: 13px; border-radius: 14px; background: var(--barBg); color: var(--sub); }
.chipbar span.on { background: var(--primary); color: var(--bg); font-weight: 700; }

/* ===== 信息卡 ===== */
.meta .mrow1 { display: flex; gap: 8px; margin-top: 8px; }
.meta .mrow1 .mc { flex: 1.4; } .meta .mrow1 .mc + .mc { flex: 1; }
.mc { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 6px; text-align: center; }
.mc .k { font-size: 11px; color: var(--dim); margin-bottom: 3px; }
.mc .v { font-size: 13px; font-weight: 700; }
.mc .v.gold { color: var(--gold); } .mc .v.green { color: var(--green); } .mc .v.primary { color: var(--primary); }
.mstars { display: flex; gap: 6px; margin-top: 8px; }
.mstars .mc { flex: 1; padding: 8px 4px; }
.mstars .v { font-size: 12.5px; white-space: nowrap; }
.msoul { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; margin-top: 8px; text-align: left; }
.msoul .k { font-size: 11px; color: var(--dim); margin-bottom: 2px; }
.msoul .v { font-size: 12.5px; font-weight: 700; line-height: 17px; }
.mtactic { background: var(--barBg); border-radius: 10px; padding: 10px; margin-top: 8px; }
.mtactic .t1 { font-size: 13px; font-weight: 700; color: var(--primary); }
.mtactic .t2 { font-size: 12px; color: var(--sub); line-height: 19px; margin-top: 3px; }

/* ===== 球场 ===== */
.pitchbox { margin-top: 4px; }
.pitch { position: relative; width: 100%; aspect-ratio: 0.74; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); background: var(--pitchA); }
.pitch .stripe { position: absolute; left: 0; width: 100%; height: 12.5%; background: var(--pitchA); }
.pitch .stripe.b { background: var(--pitchB); }
.pitch .ln { position: absolute; background: var(--pitchLine); }
.pitch .ln.mid { left: 0; width: 100%; height: 1.5px; top: 50%; }
.pitch .circle { position: absolute; left: 50%; top: 50%; width: 24%; aspect-ratio: 1; transform: translate(-50%,-50%); border: 1.5px solid var(--pitchLine); border-radius: 50%; }
.pitch .box-t, .pitch .box-b { position: absolute; left: 22%; width: 56%; height: 13%; border: 1.5px solid var(--pitchLine); }
.pitch .box-t { top: 0; border-top: none; } .pitch .box-b { bottom: 0; border-bottom: none; }
.pitch .formlabel { position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%) translateY(14px); font-size: 12px; color: var(--pitchLine); }
.pnode { position: absolute; transform: translate(-50%,-50%); display: flex; flex-direction: column; align-items: center; gap: 1px; }
.pnode .chip { font-weight: 700; color: #fff; background: rgba(8,12,20,.94); padding: 2px 5px; border-radius: 6px; text-align: center; line-height: 1.25; }
.pnode .plabel { font-size: 9px; color: rgba(255,255,255,.95); background: rgba(8,12,20,.78); padding: 1px 4px; border-radius: 4px; white-space: nowrap; max-width: 42vw; overflow: hidden; text-overflow: clip; }

/* ===== 替补/遗珠 ===== */
.bgrid { display: flex; flex-wrap: wrap; justify-content: space-between; }
.pcard { width: 48.5%; padding: 10px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); margin-bottom: 10px; }
.pcard.cb { border-color: var(--tintGoldB); }
.pcard .pr1 { display: flex; gap: 5px; align-items: center; }
.pcard .tag { font-size: 9px; color: var(--gold); background: var(--tintGold); padding: 1px 5px; border-radius: 4px; flex-shrink: 0; }
.pcard .ppos { font-size: 10px; color: var(--primary); flex-shrink: 0; }
.pcard .pnm { font-size: 12px; font-weight: 600; flex: 1; min-width: 0; line-height: 16px; }
.pcard .pnat { font-size: 10px; color: var(--dim); margin: 4px 0; }
.pcard .pst { display: flex; gap: 8px; font-size: 11px; }
.pcard .pst .g { color: var(--gold); } .pcard .pst .a { color: var(--primary); }
.pcard .pst .s { color: var(--sub); }
.yzgrid .yrow { display: flex; gap: 8px; align-items: center; padding: 11px; background: var(--card); border-radius: 10px; border: 1px solid var(--border); margin-bottom: 8px; }
.yzgrid .yt { font-size: 10px; color: var(--dim); flex-shrink: 0; }
.yzgrid .ynm { font-size: 13px; flex: 1; min-width: 0; line-height: 17px; }
.yzgrid .ynat { font-size: 11px; color: var(--sub); flex-shrink: 0; }
.yzgrid .ygo { font-size: 11px; color: var(--primary); flex-shrink: 0; }

/* ===== 说明折叠 ===== */
.notes { margin-top: 14px; }
.notes details { background: var(--card); border-radius: 10px; border: 1px solid var(--border); padding: 10px 12px; margin-bottom: 8px; }
.notes summary { font-size: 13px; font-weight: 700; color: var(--primary); list-style: none; }
.notes details .body { font-size: 12px; color: var(--sub); line-height: 20px; margin-top: 8px; }

/* ===== 猜人 ===== */
.qcard { background: var(--card); border-radius: 12px; border: 1px solid var(--border); padding: 12px; margin-top: 10px; }
.qcard .qhead { font-size: 14px; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.qcard .qhead small { color: var(--sub); font-weight: 400; font-size: 11px; margin-left: 6px; }
.clue { padding: 9px 10px; background: var(--barBg); border-radius: 8px; font-size: 12.5px; color: var(--text); line-height: 19px; margin-bottom: 7px; }
.clue.locked { color: var(--dim); }
.qinput { display: flex; gap: 8px; margin-top: 10px; position: relative; }
.qinput input { flex: 1; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--bg); color: var(--text); font-size: 14px; outline: none; }
.qinput input:focus { border-color: var(--primary); }
.qinput button { padding: 0 18px; border-radius: 10px; background: var(--primary); color: var(--bg); font-weight: 700; font-size: 14px; }
.qcand { position: absolute; left: 0; right: 74px; top: 46px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; z-index: 6; max-height: 240px; overflow-y: auto; display: none; }
.qcand .sg { display: flex; gap: 8px; padding: 9px 12px; font-size: 13px; border-bottom: 1px solid var(--barBg); }
.qresult { margin-top: 10px; padding: 10px; border-radius: 10px; font-size: 13px; display: none; }
.qresult.ok { display: block; background: rgba(102,187,106,.12); color: var(--green); }
.qresult.no { display: block; background: rgba(229,57,53,.12); color: var(--red); }
.qmiss { margin-top: 8px; font-size: 11px; color: var(--dim); }

/* ===== 九宫格 ===== */
.gwrap { margin-top: 10px; overflow-x: auto; }
.gtable { border-collapse: collapse; margin: 0 auto; }
.gtable th, .gtable td { border: 1px solid var(--border); text-align: center; }
.gtable th { background: var(--barBg); color: var(--sub); font-size: 11px; padding: 8px 6px; font-weight: 600; max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gtable td.gcell { min-width: 96px; height: 52px; background: var(--card); }
.gcell input { width: 100%; height: 100%; border: none; background: transparent; color: var(--text); font-size: 12px; text-align: center; outline: none; }
.gcell.ok { background: rgba(102,187,106,.14); }
.gcell.no { background: rgba(229,57,53,.14); }
.gstat { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); margin: 10px 2px; }
.gstat b { color: var(--gold); }

/* ===== 弹窗 ===== */
.ovl { position: fixed; inset: 0; background: var(--scrim); z-index: 20; display: none; align-items: flex-end; justify-content: center; }
.ovl.show { display: flex; }
.modal { width: 100%; max-height: 82vh; overflow-y: auto; background: var(--card); border-radius: 16px 16px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); animation: up .22s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } to { transform: none; opacity: 1; } }
.modal .mclose { float: right; font-size: 20px; color: var(--sub); padding: 2px 8px; }
.modal h2 { font-size: 18px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.modal h2 .pos { font-size: 12px; color: var(--primary); background: var(--barBg); padding: 2px 8px; border-radius: 6px; }
.modal h2 .nat { font-size: 12px; color: var(--sub); font-weight: 400; }
.modal .subt { font-size: 12px; color: var(--sub); margin: 3px 0 10px; }
.dgrid { display: flex; gap: 8px; margin: 10px 0; }
.dgrid .d { flex: 1; background: var(--barBg); border-radius: 10px; padding: 8px 4px; text-align: center; }
.dgrid .d .k { font-size: 10px; color: var(--dim); }
.dgrid .d .v { font-size: 15px; font-weight: 700; color: var(--gold); margin-top: 2px; }
.msec { margin-top: 12px; }
.msec h4 { font-size: 13px; color: var(--primary); margin-bottom: 6px; }
.msec .honors { display: flex; flex-wrap: wrap; gap: 6px; }
.msec .honors .h { font-size: 11px; color: var(--text); background: var(--barBg); padding: 3px 8px; border-radius: 6px; }
.msec .reason, .msec .plain { font-size: 12.5px; color: var(--sub); line-height: 20px; }
.career-tb { width: 100%; border-collapse: collapse; margin-top: 4px; }
.career-tb th { font-size: 10px; color: var(--dim); text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); }
.career-tb td { font-size: 11.5px; color: var(--text); padding: 5px 6px; border-bottom: 1px solid var(--barBg); }
.career-tb td.num, .career-tb th.num { text-align: right; }

/* ===== 底部导航 ===== */
#tabbar { display: flex; flex-shrink: 0; background: var(--bg); border-top: 1px solid var(--barBg); padding-bottom: env(safe-area-inset-bottom); }
#tabbar button { flex: 1; padding: 12px 0 10px; font-size: 13px; color: var(--dim); }
#tabbar button.on { color: var(--primary); font-weight: 700; }
