:root {
  --ink: #1f1f1f; --ink2: #5f5e5a; --ink3: #6b6a65; --line: #efeee9; --bg: #f4f3f1; --card: #fff;
  --brand: #1d3a5f; --brand-soft: #e8eef6; --red: #b3261e; --green: #0f6b3a; --pay: #067a3d;
  --warm: #7a4a2a; --warm2: #8a6a52; --profit: #c8352a;
  color-scheme: light;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Noto Sans SC", "Noto Sans CJK SC", "Hiragino Sans GB", sans-serif; font-size: 14px; -webkit-font-smoothing: antialiased; }
main { max-width: 480px; margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
a { color: var(--brand); }
button { font-family: inherit; }
.num { font-variant-numeric: tabular-nums; }

/* 通用 */
.bar { background: #fff; padding: 10px 12px; display: flex; align-items: center; position: sticky; top: 0; z-index: 5; }
.bar .back { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; color: var(--ink); background: none; border: 0; }
.bar h1 { flex: 1; text-align: center; font-size: 17px; margin: 0 36px 0 0; font-weight: 600; }
.card { background: var(--card); border-radius: 14px; margin: 12px 16px 0; }
.pad { padding: 14px 16px; }
.btn { display: flex; height: 50px; border-radius: 25px; background: var(--brand); color: #fff; font-size: 16px; font-weight: 600; align-items: center; justify-content: center; text-decoration: none; border: 0; width: 100%; }
.btn[disabled] { opacity: .5; }
.btn.pay { background: var(--pay); }
.muted { color: var(--ink3); font-size: 12px; }
.err { color: var(--red); font-size: 13px; }
.spacer { flex: 1; }

/* 入口 */
.entry { background: #fff; flex: 1; display: flex; flex-direction: column; padding: 96px 24px calc(32px + env(safe-area-inset-bottom)); }
.entry .brand { font-size: 13px; color: var(--brand); font-weight: 600; letter-spacing: 1px; }
.entry h2 { margin: 12px 0 0; font-size: 26px; line-height: 1.4; }
.entry .lead { margin-top: 14px; color: var(--ink2); line-height: 1.7; }
.entry .for { margin-top: 20px; font-size: 13px; color: #3d3c39; }
.entry label { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--ink2); line-height: 1.6; margin: 10px 0 14px; }
.entry input[type=checkbox] { margin-top: 2px; width: 16px; height: 16px; accent-color: var(--brand); }

/* 登录推流 */
.live { background: #fff; flex: 1; display: flex; flex-direction: column; height: 100vh; height: 100dvh; }
.live .tip { background: var(--brand); color: #fff; padding: 9px 16px; font-size: 13px; line-height: 1.5; text-align: center; }
.live .tip small { display: block; font-size: 12px; opacity: .8; }
.live .screen { flex: 1; min-height: 0; display: flex; align-items: flex-start; justify-content: center; background: #fff; overflow: hidden; }
.live img { display: block; touch-action: none; user-select: none; -webkit-user-drag: none; max-width: 100%; max-height: 100%; }
.live .keys { padding: 10px 12px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid #e3e1db; display: flex; gap: 8px; background: #f5f4f1; }
.live .keys input { flex: 1; height: 44px; border-radius: 8px; border: 1px solid #c9c7c0; padding: 0 12px; font-size: 16px; }
.live .keys button { width: 52px; height: 44px; border-radius: 8px; border: 1px solid #c9c7c0; background: #fff; }
.live .wait { padding: 40px; text-align: center; color: var(--ink2); }

/* 读取中 */
.loading { background: #fff; flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 32px; gap: 14px; }
.loading h2 { font-size: 18px; margin: 0; }
.progress { height: 8px; border-radius: 4px; background: #e8e6e1; overflow: hidden; }
.progress div { height: 8px; background: var(--brand); border-radius: 4px; transition: width .3s; }

/* 我的订单（原样） */
.assets { margin: 12px 16px 0; border-radius: 14px; background: linear-gradient(180deg, #fbe9d6, #fdf6ee); padding: 0 16px 16px; display: flex; flex-direction: column; align-items: center; }
.assets .lbl { font-size: 13px; color: var(--warm); background: #f6d9b8; padding: 3px 14px; border-radius: 0 0 10px 10px; }
.assets .total { font-size: 30px; font-weight: 600; color: var(--warm); margin-top: 12px; }
.assets .two { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 10px; background: rgba(255,255,255,.6); border-radius: 10px; padding: 10px 0; text-align: center; }
.assets .two b { display: block; font-size: 17px; color: var(--warm); font-weight: 400; }
.assets .two span { font-size: 11px; color: var(--warm2); }
.tabs { display: flex; gap: 28px; padding: 18px 24px 8px; }
.tabs button { background: none; border: 0; padding: 0 0 6px; font-size: 15px; color: var(--ink3); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--warm); font-weight: 600; border-color: #a8744a; }
.orders { padding: 4px 16px 110px; display: flex; flex-direction: column; gap: 12px; }
.order { background: #fff; border-radius: 14px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; text-decoration: none; color: var(--ink); }
.order .h { display: flex; gap: 8px; align-items: center; }
.order .badge { width: 20px; height: 20px; border-radius: 4px; color: #fff; font-size: 12px; display: flex; align-items: center; justify-content: center; }
.order .name { font-size: 16px; font-weight: 600; flex: 1; }
.order .g3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.order .g3 b { display: block; font-size: 18px; font-weight: 600; }
.order .g3 span { font-size: 11px; color: var(--ink3); }
.order .g3 .p { color: var(--profit); }
.dock { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom)); width: min(456px, calc(100% - 24px)); background: var(--brand); border-radius: 16px; padding: 10px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; box-shadow: 0 8px 24px rgba(17,30,50,.25); }
.dock a { height: 46px; border-radius: 12px; background: rgba(255,255,255,.12); color: #fff; font-size: 15px; display: flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.dock a.main { background: #fff; color: var(--brand); font-weight: 600; }
.empty { text-align: center; color: var(--ink3); padding: 40px 0; }

/* 详情（原样） */
.dhead { margin: 12px 16px 0; border-radius: 14px; background: linear-gradient(180deg, #fde3cc, #fff6ee); padding: 20px 16px 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dhead .t { font-size: 18px; font-weight: 700; text-align: center; }
.dhead .tags { display: flex; gap: 8px; }
.dhead .tags span { font-size: 11px; color: #8a5a32; background: #f8dcc2; padding: 2px 8px; border-radius: 4px; }
.dhead .big { font-size: 34px; font-weight: 700; color: var(--profit); }
.dhead .two { display: grid; grid-template-columns: 1fr 1fr; width: 100%; margin-top: 6px; text-align: center; }
.dhead .two div + div { border-left: 1px solid #f0d9c4; }
.dhead .two b { display: block; font-size: 17px; font-weight: 400; color: var(--profit); }
.dhead .two .r b { color: #8a5a32; }
.dhead .two span, .dhead .sub { font-size: 11px; color: #6b5a4a; }
.ptable { padding: 6px 16px; }
.ptable .row { display: grid; grid-template-columns: 1fr 1.4fr 1.2fr; padding: 10px 0; font-size: 14px; }
.ptable .row.h { font-size: 12px; color: var(--ink3); border-bottom: 1px solid var(--line); }
.ptable .row span:nth-child(2) { text-align: center; } .ptable .row span:nth-child(3) { text-align: right; }
.ptable .more { width: 100%; background: none; border: 0; color: var(--ink3); padding: 8px; font-size: 12px; }
.kv { padding: 4px 16px; }
.kv h3, .docs h3 { font-size: 15px; margin: 0; padding: 12px 0; }
.kv .row { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; padding: 8px 0; }
.kv .row span:first-child { color: var(--ink3); flex-shrink: 0; }
.kv .row span:last-child { text-align: right; word-break: break-all; }
.docs { padding: 4px 16px 8px; margin-bottom: 24px; }
.docs a { display: flex; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); text-decoration: none; color: var(--ink); font-size: 13px; }
.docs a span { flex: 1; }

/* 分析 */
.hero { background: var(--brand); color: #fff; border-radius: 14px; margin: 12px 16px 0; padding: 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.hero .l { font-size: 12px; opacity: .85; } .hero .v { font-size: 32px; font-weight: 700; } .hero .s { font-size: 12px; opacity: .9; }
.hero .s b { font-size: 15px; }
.hero .meter { height: 10px; border-radius: 5px; background: rgba(255,255,255,.18); overflow: hidden; }
.hero .meter div { height: 10px; background: #8fb6e8; }
.hero .ends { display: flex; justify-content: space-between; font-size: 11px; opacity: .9; }
.ledger { padding: 6px 16px; }
.ledger .row { display: flex; justify-content: space-between; align-items: baseline; padding: 11px 0; border-top: 1px solid var(--line); font-size: 13px; }
.ledger .row:first-child { border-top: 0; }
.ledger .row span:first-child { color: #3d3c39; }
.ledger .row.b { font-weight: 600; }
.ledger .row.gap { border-top: 2px solid var(--ink); font-size: 15px; font-weight: 700; }
.ledger .row.gap span { color: var(--ink); } .ledger .row.gap span:last-child { color: var(--red); }
.ledger .row.gap.pos span:last-child { color: var(--green); }
.calc { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.calc h3 { margin: 0; font-size: 15px; }
.calc label { display: flex; flex-direction: column; gap: 6px; }
.calc label .t { display: flex; justify-content: space-between; font-size: 13px; color: #3d3c39; }
.calc label b { font-size: 18px; color: var(--brand); }
.calc input[type=range] { width: 100%; accent-color: var(--brand); height: 28px; }
.calc .two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.calc .two div { background: #f5f4f1; border-radius: 10px; padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.calc .two span { font-size: 12px; color: var(--ink2); } .calc .two b { font-size: 20px; }
.calc table { width: 100%; border-collapse: collapse; font-size: 13px; }
.calc th { font-size: 11px; color: var(--ink3); font-weight: 400; text-align: left; padding: 6px 0; border-bottom: 1px solid var(--line); }
.calc td { padding: 8px 0; border-bottom: 1px solid #f3f2ee; }
.calc th + th, .calc td + td { text-align: right; }
.calc tr.be td { font-weight: 600; }
.neg { color: var(--red); } .pos { color: var(--green); }
.list { padding: 6px 16px; }
.list h3 { font-size: 15px; margin: 0; padding: 10px 0 4px; }
.list .row { display: flex; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.list .row.b span:last-child { font-weight: 700; }
.list .o { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.list .o div { display: flex; flex-direction: column; gap: 2px; } .list .o div + div { align-items: flex-end; }
.list .o small { font-size: 11px; color: var(--ink3); }
.foot { font-size: 11px; color: var(--ink3); line-height: 1.6; padding: 12px 20px 0; }
.bottom { padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }

/* 导出 */
.xhead { padding: 32px 16px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.xhead .ic { width: 64px; height: 64px; border-radius: 16px; background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; }
.xhead b { font-size: 18px; }
.xinc .row { display: flex; justify-content: space-between; padding: 12px 16px; border-top: 1px solid var(--line); }
.xinc .row:first-child { border-top: 0; }
.xinc .row span:last-child { color: var(--ink2); }

/* 首页（2026-11-13 重设计） */
.home { flex: 1; display: flex; flex-direction: column; background: #f6f5f2; color: #16181d; min-height: 100vh; min-height: 100dvh; }
.home-brand { padding: 20px 24px 0; display: flex; align-items: center; gap: 10px; font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.home-brand .logo { width: 30px; height: 30px; border-radius: 8px; background: var(--brand); color: #fff; display: flex; align-items: center; justify-content: center; }
.home-title { margin: 44px 24px 0; font-size: 32px; line-height: 1.3; font-weight: 700; letter-spacing: .5px; }
.home-lead { margin: 14px 24px 0; font-size: 15px; line-height: 1.7; color: #5a5d66; }
.home-card { margin: 32px 16px 0; background: #fff; border-radius: 16px; padding: 4px 18px; }
.home-row { display: flex; gap: 14px; align-items: center; padding: 16px 0; }
.home-row + .home-row { border-top: 1px solid #f0efeb; }
.home-row .ic { width: 40px; height: 40px; border-radius: 12px; background: #eef2f8; color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.home-row b { display: block; font-size: 15px; font-weight: 600; }
.home-row small { display: block; margin-top: 3px; font-size: 13px; color: #6b6e76; }
.home-steps { margin: 20px 24px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: #5a5d66; }
.home-steps b { color: #16181d; } .home-steps i { font-style: normal; color: #b8bac0; }
.home-foot { padding: 24px 20px calc(28px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.home-foot label { display: flex; gap: 8px; align-items: center; font-size: 12px; color: #5a5d66; }
.home-foot input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.home-foot .btn { height: 52px; border-radius: 26px; font-size: 17px; letter-spacing: 1px; }
.home-last { font-size: 13px; text-align: center; }
.home-note { font-size: 11px; color: #85878e; text-align: center; line-height: 1.6; }

/* 分析页表格 */
.list h3 small, .fold summary small { font-size: 11px; color: var(--ink3); font-weight: 400; margin-left: 6px; }
.tbl { overflow-x: auto; margin: 4px -4px 8px; }
.tbl table { width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.tbl th { font-weight: 400; color: var(--ink3); font-size: 11px; text-align: right; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.tbl td { text-align: right; padding: 7px 4px; border-bottom: 1px solid #f3f2ee; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.fold summary { font-size: 15px; font-weight: 600; padding: 12px 0; cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "展开"; float: right; font-size: 12px; font-weight: 400; color: var(--brand); }
.fold[open] summary::after { content: "收起"; }

/* 登录方式弹窗：点确认才消失 */
.modal { position: fixed; inset: 0; z-index: 50; background: rgba(15, 20, 30, .55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal-box { background: #fff; border-radius: 16px; padding: 22px 20px 18px; width: 100%; max-width: 340px; display: flex; flex-direction: column; gap: 10px; }
.modal-box h3 { margin: 0; font-size: 18px; }
.modal-box p { margin: 0; font-size: 14px; line-height: 1.7; color: #2b2d33; }
.modal-box p.muted { font-size: 12px; color: var(--ink3); }
.modal-box .btn { margin-top: 8px; height: 46px; border-radius: 23px; font-size: 16px; }

.redeem { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.redeem label { font-size: 14px; font-weight: 600; }
.redeem input { height: 48px; border-radius: 10px; border: 1px solid #c9c7c0; padding: 0 14px; font-size: 18px; letter-spacing: 2px; font-family: ui-monospace, Menlo, monospace; text-transform: uppercase; box-sizing: border-box; width: 100%; }
.redeem input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
