/* TokenDeck —— 深色质感。墨黑底带一点绿，薄荷色只用在「数据在发光」的地方；卡组按稀有度用不同的箔面。 */
@font-face {
  font-family: "Geist";
  src: url("/fonts/Geist.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
:root {
  --bg: #080C0B;
  --panel: #0F1513;
  --panel-hi: #141C19;
  --line: rgba(220, 255, 240, .07);
  --line-2: rgba(220, 255, 240, .13);
  --ink: #ECF3F0;
  --ink-2: #A3B2AC;
  --ink-3: #66756F;
  --glow: #74E8C3;
  --glow-soft: rgba(116, 232, 195, .12);
  --ok: #4FCF9C;
  --warn: #F0B65E;
  --warn-bg: rgba(240, 182, 94, .1);
  --danger: #FF7B6B;
  --danger-bg: rgba(255, 123, 107, .1);
  /* 热力图：单一色相由暗到亮，最高一档带光晕 */
  --h0: rgba(220, 255, 240, .05);
  --h1: #143B33;
  --h2: #1B6553;
  --h3: #2EA382;
  --h4: #74E8C3;
  /* token 构成（已用色盲校验脚本验证）：输入 / 输出 / 缓存读 / 缓存写 */
  --m0: #2FAA84;
  --m1: #6A88EC;
  --m2: #BC8231;
  --m3: #A574D4;
  --sans: "Geist", -apple-system, "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --r: 18px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body {
  margin: 0; min-height: 100vh; color: var(--ink);
  font: 15px/1.55 var(--sans); font-feature-settings: "ss01", "tnum";
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  background:
    radial-gradient(900px 420px at 12% -8%, rgba(116, 232, 195, .085), transparent 70%),
    radial-gradient(700px 380px at 92% -12%, rgba(106, 136, 236, .06), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
/* 极淡的颗粒，让大面积深色不发「塑料感」 */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='140' height='140'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
#app { position: relative; z-index: 1; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--glow); }
:focus-visible { outline: 2px solid var(--glow); outline-offset: 2px; border-radius: 6px; }
.muted { color: var(--ink-3); }
.dim { color: var(--ink-3); }
.small { font-size: 13px; }
.hidden { display: none !important; }

/* ---------- 顶栏 */
.topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%); background: rgba(8, 12, 11, .72); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 1240px; margin: 0 auto; padding: 0 36px; height: 64px; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 16px; letter-spacing: .02em; white-space: nowrap; }
.brand-mark {
  width: 18px; height: 18px; border-radius: 5px; display: inline-block;
  background: conic-gradient(from 210deg, var(--h1), var(--h3), var(--glow), var(--h2), var(--h1));
  box-shadow: 0 0 14px rgba(116, 232, 195, .35), inset 0 0 0 1px rgba(255,255,255,.18);
}
.tabs { display: flex; gap: 2px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.tabs button { border: 0; background: none; color: var(--ink-2); cursor: pointer; font-size: 14px; padding: 6px 16px; border-radius: 9px; transition: color .15s, background .15s; }
.tabs button:hover { color: var(--ink); }
.tabs button[aria-current="page"] { color: var(--ink); background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.06); font-weight: 500; }
.topbar-end { margin-left: auto; display: flex; gap: 8px; }
.ghost { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.03); border: 1px solid var(--line-2); color: var(--ink); border-radius: 10px; padding: 7px 14px; font-size: 14px; cursor: pointer; transition: background .15s, border-color .15s; }
.ghost:hover { background: rgba(255,255,255,.07); border-color: rgba(220,255,240,.22); }
.ghost.icon { padding: 7px 10px; color: var(--ink-2); }

/* ---------- 页面与卡片 */
.page { max-width: 1240px; margin: 0 auto; padding: 32px 36px 72px; }
.section { margin-bottom: 34px; }
.section-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 0 2px 12px; min-height: 30px; }
.section-h h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: .01em; }
.section-h .aside { font-size: 13px; color: var(--ink-3); }
.card {
  position: relative; border-radius: var(--r); padding: 22px 24px;
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008)), var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), 0 1px 0 rgba(0,0,0,.4), 0 20px 40px -24px rgba(0,0,0,.6);
}
.card.flush { padding: 0; overflow: hidden; }
.empty { text-align: center; color: var(--ink-2); padding: 40px 24px; display: grid; gap: 14px; justify-items: center; }
.empty b { color: var(--ink); font-size: 16px; font-weight: 600; }
.linkbtn { border: 0; background: none; color: var(--glow); font-size: 13px; cursor: pointer; padding: 0 0 0 6px; }
.linkbtn:hover { text-decoration: underline; text-underline-offset: 3px; }
.linkbtn.warn { color: var(--warn); padding: 0; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; display: inline-block; }
.dot.ok { background: var(--ok); box-shadow: 0 0 0 3px rgba(79, 207, 156, .12); }
.dot.warn { background: var(--warn); box-shadow: 0 0 0 3px rgba(240, 182, 94, .14); }
.dot.danger { background: var(--danger); box-shadow: 0 0 0 3px rgba(255, 123, 107, .16), 0 0 10px rgba(255, 123, 107, .5); }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 6px; background: rgba(255,255,255,.05); border: 1px solid var(--line); color: var(--ink-2); white-space: nowrap; }
.lv-danger .lv-text, .lv-danger .days { color: var(--danger); }
.lv-warn .lv-text, .lv-warn .days { color: var(--warn); }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.035); border: 1px solid var(--line); }
.seg button { border: 0; background: none; padding: 4px 12px; border-radius: 7px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: rgba(255,255,255,.08); color: var(--ink); }

/* ---------- 今日概况 */
.hero {
  display: grid; grid-template-columns: 1.15fr 1fr 1.1fr; padding: 0; overflow: hidden;
  background:
    radial-gradient(520px 220px at 0% 0%, rgba(116, 232, 195, .10), transparent 70%),
    linear-gradient(180deg, rgba(255,255,255,.03), rgba(255,255,255,.008)), var(--panel);
}
.hero-col { padding: 26px 28px 22px; display: flex; flex-direction: column; min-width: 0; }
.hero-col + .hero-col { border-left: 1px solid var(--line); }
.stat-k { font-size: 14px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.tip-i { color: var(--ink-3); display: inline-flex; cursor: help; }
.hero-num { font-size: 56px; line-height: 1.05; font-weight: 600; letter-spacing: -.035em; margin-top: 12px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hero-num .unit { font-size: 22px; font-weight: 500; letter-spacing: -.01em; margin-left: 4px; }
.hero-num .unit.soft { color: var(--ink-3); font-size: 16px; margin-left: 10px; letter-spacing: 0; }
.hero-num.dim, .model-name.dim { color: var(--ink-3); }
.stat-note { font-size: 13px; color: var(--ink-2); margin-top: 6px; min-height: 20px; }
.stat-foot { margin-top: auto; padding-top: 18px; font-size: 13px; color: var(--ink-3); }
.mix { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; margin-top: 16px; }
.mix i { display: block; min-width: 2px; }
.m0 { background: var(--m0); } .m1 { background: var(--m1); } .m2 { background: var(--m2); } .m3 { background: var(--m3); }
.mix-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.mix-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }
.spark { margin-top: 12px; height: 44px; }
.spark-svg { width: 100%; height: 44px; display: block; overflow: visible; filter: drop-shadow(0 0 6px rgba(116, 232, 195, .35)); }
.model-name { font-size: 30px; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; margin-top: 14px; background: linear-gradient(90deg, var(--ink), var(--glow)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.model-name.dim { background: none; -webkit-text-fill-color: currentColor; }
.model-list { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 8px; }
.model-list li { display: grid; grid-template-columns: minmax(0, 1fr) 90px 38px; gap: 10px; align-items: center; font-size: 13px; }
.model-list .nm { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-list .bar { height: 4px; border-radius: 2px; background: rgba(255,255,255,.06); overflow: hidden; }
.model-list .bar i { display: block; height: 100%; background: var(--h3); border-radius: 0 2px 2px 0; }
.model-list .bar i.lead { background: var(--glow); box-shadow: 0 0 8px rgba(116, 232, 195, .6); }
.model-list .pct { text-align: right; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- 热力图 */
.heat { display: flex; padding: 0; overflow: hidden; }
.heat-main { flex: 1; min-width: 0; padding: 22px 24px 18px; display: flex; flex-direction: column; justify-content: center; }
.heat-scroll { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.heat-scroll svg { display: block; width: 100%; min-width: 660px; height: auto; overflow: visible; }
#heat rect { cursor: pointer; transition: opacity .1s; }
#heat rect:hover { stroke: rgba(255,255,255,.55); stroke-width: 1; }
#heat rect.sel { stroke: var(--ink); stroke-width: 1.5; }
#heat rect.l4 { filter: drop-shadow(0 0 3px rgba(116, 232, 195, .55)); }
.hm-axis { fill: var(--ink-3); font-size: 10.5px; font-family: var(--sans); }
.l0 { fill: var(--h0); background: var(--h0); }
.l1 { fill: var(--h1); background: var(--h1); }
.l2 { fill: var(--h2); background: var(--h2); }
.l3 { fill: var(--h3); background: var(--h3); }
.l4 { fill: var(--h4); background: var(--h4); }
.heat-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; }
.legend { display: inline-flex; align-items: center; gap: 3px; font-size: 12px; color: var(--ink-3); }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; }
.legend i:first-child { margin-left: 5px; }
.legend i:last-child { margin-right: 5px; }
.heat-side { width: 280px; flex: none; border-left: 1px solid var(--line); padding: 22px 24px; display: flex; flex-direction: column; background: rgba(255,255,255,.012); }
.day-date { font-size: 13px; color: var(--ink-3); }
.day-total { font-size: 34px; font-weight: 600; line-height: 1.15; margin-top: 4px; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.day-total small { font-size: 14px; font-weight: 500; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.day-items { list-style: none; margin: 12px 0 0; padding: 0; font-size: 13px; }
.day-items li { display: flex; justify-content: space-between; gap: 10px; padding: 4px 0; }
.day-items li.sum { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.day-items .nm { color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-items .v { font-variant-numeric: tabular-nums; white-space: nowrap; }
.heat-stats { margin: auto 0 0; padding-top: 16px; display: grid; gap: 8px; border-top: 1px solid var(--line); margin-top: 16px; }
.heat-stats div { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.heat-stats dt { color: var(--ink-3); }
.heat-stats dd { margin: 0; font-variant-numeric: tabular-nums; color: var(--ink-2); }

/* ---------- 余额表 */
.bal-table { width: 100%; border-collapse: collapse; }
.bal-table th { text-align: left; font-size: 12.5px; font-weight: 500; color: var(--ink-3); padding: 14px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.bal-table td { padding: 15px 20px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.bal-table tbody tr:last-child td { border-bottom: 0; }
.bal-table tbody tr { cursor: pointer; transition: background .12s; }
.bal-table tbody tr:hover { background: rgba(255,255,255,.025); }
.bal-table .c-name { display: flex; align-items: center; gap: 14px; min-width: 200px; }
.bal-table .nm { font-weight: 500; }
.bal-table .note { font-size: 12.5px; margin-top: 1px; }
.bal-table .c-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 15px; }
.bal-table th.c-num, .bal-table th.c-days { text-align: right; font-size: 12.5px; }
.bal-table .c-days { text-align: right; white-space: nowrap; min-width: 150px; }
.bal-table .days { font-size: 24px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.bal-table .days-u { font-size: 12.5px; color: var(--ink-3); margin-left: 4px; }
.runway { height: 3px; border-radius: 2px; background: rgba(255,255,255,.06); margin: 6px 0 0 auto; width: 110px; overflow: hidden; }
.runway i { display: block; height: 100%; margin-left: auto; background: var(--h3); border-radius: 2px; }
.lv-warn .runway i { background: var(--warn); }
.lv-danger .runway i { background: var(--danger); box-shadow: 0 0 6px rgba(255, 123, 107, .6); }
.bal-table .c-upd { white-space: nowrap; font-size: 13px; }
.bal-table .c-act { text-align: right; width: 1%; white-space: nowrap; }

/* ---------- 账号密码 */
.toolbar { display: flex; gap: 14px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.search { width: 320px; max-width: 100%; border: 1px solid var(--line-2); background: rgba(255,255,255,.03); border-radius: 11px; padding: 9px 13px; outline: none; }
.search:focus { border-color: rgba(116, 232, 195, .5); box-shadow: 0 0 0 3px var(--glow-soft); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1px solid var(--line); background: rgba(255,255,255,.025); border-radius: 999px; padding: 5px 13px; font-size: 13px; cursor: pointer; color: var(--ink-2); }
.chip:hover { color: var(--ink); }
.chip[aria-pressed="true"] { background: rgba(116, 232, 195, .12); border-color: rgba(116, 232, 195, .35); color: var(--glow); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.acc {
  border-radius: 16px; padding: 16px 18px 16px; display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,.028), rgba(255,255,255,.008)), var(--panel);
  border: 1px solid var(--line); box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
  transition: border-color .15s;
}
.acc:hover { border-color: var(--line-2); }
.acc-head { display: flex; align-items: center; gap: 10px; border: 0; background: none; padding: 0; text-align: left; cursor: pointer; width: 100%; }
.acc-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; }
.acc-title .nm { font-weight: 600; font-size: 15.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-head:hover .nm { color: var(--glow); }
.acc-bal { font-size: 17px; font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.acc-bal small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.acc-sub { font-size: 13px; color: var(--ink-3); margin: 3px 0 14px 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.qbtn { border: 1px solid var(--line-2); background: rgba(255,255,255,.025); border-radius: 9px; padding: 5px 11px; font-size: 13px; cursor: pointer; color: var(--ink); text-decoration: none; line-height: 1.4; transition: background .12s, border-color .12s; }
.qbtn:hover { background: rgba(255,255,255,.06); }
.qbtn.primary { background: rgba(116, 232, 195, .12); border-color: rgba(116, 232, 195, .32); color: var(--glow); }
.qbtn.primary:hover { background: rgba(116, 232, 195, .2); }
.archived { opacity: .5; }

/* ---------- 按钮与表单 */
.btn { border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--ink); border-radius: 11px; padding: 9px 16px; font-size: 14px; cursor: pointer; text-decoration: none; transition: background .12s, border-color .12s; }
.btn:hover { background: rgba(255,255,255,.08); }
.btn.primary { background: linear-gradient(180deg, #8AF0CF, #5FD9B2); border-color: transparent; color: #062019; font-weight: 600; box-shadow: 0 0 0 1px rgba(116,232,195,.3), 0 8px 22px -10px rgba(116, 232, 195, .7); }
.btn.primary:hover { background: linear-gradient(180deg, #9BF4D8, #6BE0BB); }
.btn.danger { color: var(--danger); }
.btn:disabled, .mini:disabled { opacity: .45; cursor: default; }
.mini { border: 1px solid var(--line-2); background: rgba(255,255,255,.035); border-radius: 8px; padding: 4px 10px; font-size: 12.5px; cursor: pointer; flex: none; color: var(--ink); text-decoration: none; }
.mini:hover { background: rgba(255,255,255,.08); }
.form { display: grid; gap: 14px; }
.group { border-radius: 16px; padding: 4px 18px; background: var(--panel); border: 1px solid var(--line); }
.group-h { font-size: 12.5px; color: var(--ink-3); margin: 4px 4px -6px; }
.lockbar { font-size: 12.5px; color: var(--ink-3); margin: 4px 4px -6px; }
.field { display: grid; gap: 4px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field > span { font-size: 12.5px; color: var(--ink-2); }
.field input, .field select, .field textarea { width: 100%; border: 0; background: transparent; padding: 3px 0; outline: none; font-size: 15px; min-width: 0; }
.field select option { background: var(--panel); }
.field input[type="checkbox"] { width: auto; accent-color: var(--glow); }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-3); }
.field textarea { min-height: 60px; resize: vertical; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { flex: 1; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 14px 0 4px; }
.settings-wrap { max-width: 860px; }
.inline-code { font-family: var(--mono); font-size: 12.5px; background: rgba(255,255,255,.06); padding: 1px 6px; border-radius: 5px; }

/* 设置：本机采集 */
.steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: grid; gap: 22px; }
.steps > li { counter-increment: s; position: relative; padding-left: 40px; }
.steps > li::before {
  content: counter(s); position: absolute; left: 0; top: -1px; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-size: 13px; font-weight: 600; color: var(--glow);
  background: var(--glow-soft); border: 1px solid rgba(116, 232, 195, .25);
}
.step-t { font-weight: 600; margin-bottom: 3px; }
.step-d { color: var(--ink-2); font-size: 13.5px; margin-bottom: 10px; max-width: 64em; }
.code-tabs { display: flex; gap: 4px; margin-bottom: 8px; }
.code-tabs button { border: 0; background: none; color: var(--ink-3); font-size: 13px; padding: 3px 10px; border-radius: 7px; cursor: pointer; }
.code-tabs button[aria-pressed="true"] { color: var(--ink); background: rgba(255,255,255,.07); }
.code { display: flex; gap: 10px; align-items: flex-start; background: #060908; border: 1px solid var(--line); border-radius: 12px; padding: 12px 12px 12px 14px; }
.code code { flex: 1; font-family: var(--mono); font-size: 12.5px; line-height: 1.6; color: #BFE9DA; word-break: break-all; white-space: pre-wrap; }
.sheet { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.sheet.inset { background: rgba(0,0,0,.2); }
.price-warn { margin: 16px 18px 0; padding: 10px 14px; border-radius: 10px; background: var(--warn-bg); color: var(--warn); font-size: 13px; line-height: 1.8; }
.price-table { width: 100%; border-collapse: collapse; margin-top: 6px; }
.price-table th { text-align: left; font-size: 12px; color: var(--ink-3); font-weight: 500; padding: 12px 10px 8px; }
.price-table th:first-child, .price-table td:first-child { padding-left: 18px; }
.price-table td { padding: 3px 10px; border-top: 1px solid var(--line); }
.price-table input { width: 100%; background: transparent; border: 0; padding: 7px 0; outline: none; font-variant-numeric: tabular-nums; font-size: 14px; }
.price-table input:focus { color: var(--glow); }
.price-table td:first-child input { font-family: var(--mono); font-size: 13px; }
.price-table td:not(:first-child) { width: 92px; }
.price-table td:last-child { width: 40px; text-align: center; }
.price-actions { display: flex; gap: 8px; align-items: center; padding: 14px 18px; }
.del { border: 0; background: none; color: var(--ink-3); cursor: pointer; font-size: 15px; padding: 4px 6px; }
.del:hover { color: var(--danger); }

/* ---------- 抽屉（电脑右侧滑出，手机底部弹出） */
.overlay { position: fixed; inset: 0; background: rgba(2, 5, 4, .6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); z-index: 40; display: flex; justify-content: flex-end; }
.panel { background: linear-gradient(180deg, #121916, #0C1110); border-left: 1px solid var(--line-2); width: 500px; max-width: 100%; height: 100%; overflow-y: auto; padding-bottom: 28px; animation: slide .22s cubic-bezier(.2, .8, .2, 1); box-shadow: -30px 0 60px -20px rgba(0,0,0,.7); }
@keyframes slide { from { transform: translateX(32px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .panel { animation: none; } }
.panel-h { position: sticky; top: 0; z-index: 2; background: rgba(18, 25, 22, .9); backdrop-filter: blur(10px); display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 20px 24px 14px; }
.panel-h h3 { margin: 0; font-size: 18px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.panel-body { padding: 0 24px; }
.panel-body > .group-h { margin: 22px 4px 8px; }
.close { border: 1px solid var(--line-2); background: rgba(255,255,255,.04); color: var(--ink-2); border-radius: 10px; width: 34px; height: 34px; font-size: 18px; cursor: pointer; flex: none; }
.close:hover { color: var(--ink); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stat { background: var(--panel); padding: 14px 16px; }
.stat .k { font-size: 12px; color: var(--ink-3); }
.stat .v { font-size: 22px; font-weight: 600; margin-top: 3px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .v small { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 3px; }
.reasons { margin: 12px 0 0; padding: 10px 14px; border-radius: 10px; font-size: 13.5px; }
.reasons.danger { background: var(--danger-bg); color: var(--danger); }
.reasons.warn { background: var(--warn-bg); color: var(--warn); }
.kv { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; align-items: center; padding: 11px 16px; border-bottom: 1px solid var(--line); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--ink-3); font-size: 12.5px; }
.kv .v { word-break: break-all; }
.kv .v.mono { font-family: var(--mono); font-size: 13.5px; }
.hist { font-size: 14px; }
.hist .item { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border-bottom: 1px solid var(--line); }
.hist .item:last-child { border-bottom: 0; }
.hist .when { color: var(--ink-3); font-size: 12.5px; width: 104px; flex: none; }
.hist .what { flex: 1; font-variant-numeric: tabular-nums; }
.hist .del { font-size: 12.5px; }
.src { font-size: 11px; color: var(--ink-3); margin-left: 6px; }
.errline { font-size: 13px; color: var(--danger); padding: 8px 16px; }

/* ---------- 解锁页 */
.gate { min-height: 100vh; display: flex; }
.gate-inner { margin: auto; width: 100%; max-width: 380px; padding: 32px 24px; }
.gate h1 { font-size: 32px; margin: 0 0 8px; font-weight: 600; letter-spacing: -.01em; display: flex; align-items: center; gap: 12px; }
.gate h1::before { content: ""; width: 26px; height: 26px; border-radius: 8px; background: conic-gradient(from 210deg, var(--h1), var(--h3), var(--glow), var(--h2), var(--h1)); box-shadow: 0 0 22px rgba(116, 232, 195, .4); }
.gate p { color: var(--ink-2); margin: 0 0 24px; font-size: 14px; }
.gate input { width: 100%; border: 1px solid var(--line-2); background: rgba(255,255,255,.035); border-radius: 12px; padding: 13px 16px; font-size: 16px; margin-bottom: 10px; outline: none; }
.gate input:focus { border-color: rgba(116, 232, 195, .5); box-shadow: 0 0 0 3px var(--glow-soft); }
.gate button { width: 100%; border: 0; border-radius: 12px; padding: 13px; font-size: 15px; font-weight: 600; cursor: pointer; margin-top: 6px; background: linear-gradient(180deg, #8AF0CF, #5FD9B2); color: #062019; box-shadow: 0 10px 28px -12px rgba(116, 232, 195, .8); }
.gate button:disabled { opacity: .6; }
.gate .err { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 10px; }
.gate .note { font-size: 13px; color: var(--ink-3); margin-top: 18px; line-height: 1.7; }

#toast { position: fixed; left: 50%; bottom: calc(28px + var(--safe-b)); transform: translateX(-50%) translateY(10px); background: rgba(236, 243, 240, .96); color: #0A100E; padding: 9px 16px; border-radius: 11px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .18s, transform .18s; z-index: 60; max-width: 86vw; }
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 窄屏 */
@media (max-width: 1020px) {
  .hero { grid-template-columns: 1fr 1fr; }
  .hero-col:nth-child(3) { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); }
  .heat { flex-direction: column; }
  .heat-side { width: auto; border-left: 0; border-top: 1px solid var(--line); }
  .bal-table .c-upd { display: none; }
}
@media (max-width: 680px) {
  .topbar-inner { padding: 10px 14px; gap: 10px; height: auto; flex-wrap: wrap; padding-top: calc(env(safe-area-inset-top, 0px) + 10px); }
  .tabs { order: 3; width: 100%; }
  .tabs button { flex: 1; }
  .page { padding: 18px 12px 48px; }
  .hero { grid-template-columns: 1fr; }
  .hero-col + .hero-col { border-left: 0; border-top: 1px solid var(--line); }
  .hero-col { padding: 20px; }
  .hero-num { font-size: 44px; }
  .heat-main { padding: 18px 16px 14px; }
  .heat-side { padding: 18px; }
  .bal-table th { display: none; }
  .bal-table td { padding: 13px 14px; }
  .bal-table td:nth-child(3), .bal-table .c-act { display: none; }
  .bal-table .c-name { min-width: 0; }
  .bal-table .c-days { min-width: 0; }
  .bal-table .days { font-size: 20px; }
  .bal-table .days-u, .runway { display: none; }
  .acc-grid { grid-template-columns: 1fr; }
  .search { width: 100%; }
  .overlay { align-items: flex-end; }
  .panel { height: auto; max-height: 92vh; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; padding-bottom: calc(20px + var(--safe-b)); animation: rise .22s ease-out; }
  @keyframes rise { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
  .panel-body { padding: 0 14px; }
}

/* ---------- 卡组：收藏卡片，按稀有度分箔面 */
@property --ang { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
.section-h h2 .count { font-weight: 400; color: var(--ink-3); font-size: 13px; margin-left: 8px; }
.deck { display: grid; grid-template-columns: repeat(auto-fill, minmax(214px, 1fr)); gap: 22px 18px; perspective: 1200px; }
.tcard {
  --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 30%;
  --edge: linear-gradient(150deg, rgba(220,255,240,.2), rgba(220,255,240,.05));
  --tint: hsl(var(--hue) 45% 50%);
  position: relative; aspect-ratio: 63 / 88; padding: 1.5px; border-radius: 18px; cursor: pointer;
  background: var(--edge); outline: none;
  transform: rotateX(var(--rx)) rotateY(var(--ry)); transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .3s;
  box-shadow: 0 18px 36px -22px rgba(0,0,0,.9);
}
.tcard.live { transition: transform .08s linear, box-shadow .3s; }
.tcard:hover, .tcard:focus-visible { box-shadow: 0 26px 50px -24px rgba(0,0,0,.95), 0 0 0 1px rgba(255,255,255,.06); }
.tcard:focus-visible { outline: 2px solid var(--glow); outline-offset: 4px; }
.tc-inner {
  position: relative; height: 100%; border-radius: 16.5px; overflow: hidden;
  padding: 14px 16px 14px; display: flex; flex-direction: column;
  background:
    radial-gradient(120% 70% at 50% 0%, hsl(var(--hue) 40% 22% / .55), transparent 62%),
    linear-gradient(180deg, #121A17, #0B100E);
}
.tc-foil, .tc-glare { position: absolute; inset: 0; pointer-events: none; border-radius: inherit; }
.tc-glare { background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,.16), transparent 46%); opacity: 0; transition: opacity .25s; mix-blend-mode: overlay; }
.tcard:hover .tc-glare { opacity: 1; }

.tc-top { position: relative; display: flex; align-items: center; gap: 8px; }
.tc-rarity { font-weight: 800; font-size: 15px; letter-spacing: .06em; font-style: italic; color: var(--ink-2); }
.tc-cat { font-size: 11.5px; color: var(--ink-3); padding: 1px 7px; border: 1px solid var(--line); border-radius: 6px; background: rgba(0,0,0,.25); }
.tc-more { margin-left: auto; border: 1px solid transparent; background: rgba(0,0,0,.25); color: var(--ink-2); border-radius: 8px; width: 28px; height: 24px; line-height: 1; cursor: pointer; font-size: 13px; letter-spacing: 1px; }
.tc-more:hover { border-color: var(--line-2); color: var(--ink); }
.tc-emblem {
  position: relative; width: 74px; height: 74px; margin: 20px auto 14px; border-radius: 22px;
  display: grid; place-items: center;
  background:
    radial-gradient(circle at 30% 25%, hsl(var(--hue) 70% 72% / .55), transparent 55%),
    linear-gradient(145deg, hsl(var(--hue) 50% 38%), hsl(calc(var(--hue) + 30) 45% 18%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25), inset 0 -10px 20px rgba(0,0,0,.35), 0 10px 26px -10px hsl(var(--hue) 60% 40% / .7);
}
.tc-emblem::after { content: ""; position: absolute; inset: -7px; border-radius: 27px; border: 1px solid hsl(var(--hue) 60% 70% / .18); }
.tc-emblem span { font-size: 30px; font-weight: 700; color: rgba(255,255,255,.94); letter-spacing: -.02em; text-shadow: 0 2px 10px rgba(0,0,0,.35); }
.tc-name { position: relative; text-align: center; font-weight: 600; font-size: 16.5px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-host { position: relative; text-align: center; font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; justify-content: center; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; }
.tcard:hover .tc-host { color: var(--glow); }
.tc-stats { position: relative; margin-top: auto; display: flex; justify-content: space-between; align-items: flex-end; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.tc-stats .k { display: block; font-size: 11px; color: var(--ink-3); }
.tc-stats b { font-size: 18px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tc-stats b.sm { font-size: 16px; }
.tc-stats b small { font-size: 11px; font-weight: 400; color: var(--ink-3); margin-left: 2px; letter-spacing: 0; }
.tc-stats .r { text-align: right; }
.tc-runway { position: relative; height: 3px; border-radius: 2px; background: rgba(255,255,255,.07); margin-top: 9px; overflow: hidden; }
.tc-runway i { display: block; height: 100%; background: var(--h3); border-radius: 2px; }
.tc-meta, .tc-alert { position: relative; font-size: 11.5px; margin-top: 7px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-alert { color: var(--danger); }
.lv-warn .tc-alert { color: var(--warn); }
.lv-warn .tc-runway i { background: var(--warn); }
.lv-danger .tc-runway i { background: var(--danger); box-shadow: 0 0 8px rgba(255, 123, 107, .7); }
.lv-danger .tc-stats .r b { color: var(--danger); }
.lv-warn .tc-stats .r b { color: var(--warn); }
.lv-danger .tc-inner { box-shadow: inset 0 0 0 1px rgba(255, 123, 107, .35), inset 0 -40px 60px -30px rgba(255, 90, 70, .35); }

/* R：钢蓝描边 */
.r-r { --edge: linear-gradient(150deg, #8FD3F2, #2B5A70 45%, #9ED8EE 75%, #2B5A70); }
.r-r .tc-rarity { color: #9ED8EE; }

/* SR：银紫箔边 + 细斜纹 */
.r-sr { --edge: linear-gradient(150deg, #E3DBFF, #6D63E8 35%, #CFC4FF 60%, #4F45B8 85%, #E3DBFF); box-shadow: 0 18px 36px -22px rgba(0,0,0,.9), 0 0 28px -12px rgba(140, 120, 255, .55); }
.r-sr .tc-rarity { background: linear-gradient(90deg, #F1ECFF, #A99BFF); -webkit-background-clip: text; background-clip: text; color: transparent; }
.r-sr .tc-foil {
  background: repeating-linear-gradient(125deg, rgba(200,190,255,.05) 0 2px, transparent 2px 9px),
              linear-gradient(115deg, transparent 30%, rgba(190,175,255,.22) 45%, rgba(150,220,255,.18) 52%, transparent 66%);
  background-size: 100% 100%, 260% 260%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: screen; opacity: .8;
}

/* SSR：流动彩虹金边 + 全息箔面 + 星点 */
.r-ssr {
  --edge: conic-gradient(from var(--ang), #FFD98A, #FF9ACB, #9BD9FF, #A6FFDA, #FFE9A8, #FFD98A);
  animation: ssr-edge 6s linear infinite;
  box-shadow: 0 18px 36px -22px rgba(0,0,0,.9), 0 0 34px -10px rgba(255, 205, 140, .45);
}
@keyframes ssr-edge { to { --ang: 360deg; } }
.r-ssr .tc-rarity { font-size: 17px; background: linear-gradient(90deg, #FFE7A3, #FF9ACB 45%, #9BD9FF 80%); -webkit-background-clip: text; background-clip: text; color: transparent; filter: drop-shadow(0 0 6px rgba(255, 200, 150, .45)); }
.r-ssr .tc-foil {
  background:
    radial-gradient(circle at 1px 1px, rgba(255,255,255,.55) .6px, transparent 1.2px) 0 0 / 13px 13px,
    linear-gradient(115deg, transparent 18%, rgba(255,120,190,.30) 32%, rgba(255,220,120,.26) 40%, rgba(120,230,255,.30) 48%, rgba(150,255,200,.26) 56%, transparent 72%);
  background-size: 13px 13px, 280% 280%;
  background-position: 0 0, var(--mx) var(--my);
  mix-blend-mode: color-dodge; opacity: .42;
  -webkit-mask-image: radial-gradient(130% 90% at 50% 40%, #000 35%, rgba(0,0,0,.35) 100%);
          mask-image: radial-gradient(130% 90% at 50% 40%, #000 35%, rgba(0,0,0,.35) 100%);
}
.r-ssr .tc-emblem::after { border: 1.5px solid transparent; background: conic-gradient(from var(--ang), #FFD98A, #FF9ACB, #9BD9FF, #A6FFDA, #FFD98A) border-box;
  -webkit-mask: linear-gradient(#000 0 0) padding-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: ssr-edge 6s linear infinite; }
.r-ssr:hover .tc-foil, .r-sr:hover .tc-foil { opacity: .65; }

.tcard-add {
  aspect-ratio: 63 / 88; border-radius: 18px; border: 1.5px dashed var(--line-2); background: rgba(255,255,255,.015);
  color: var(--ink-3); cursor: pointer; display: grid; place-content: center; gap: 8px; font-size: 14px; transition: color .15s, border-color .15s;
}
.tcard-add span { font-size: 28px; font-weight: 300; line-height: 1; }
.tcard-add:hover { color: var(--glow); border-color: rgba(116, 232, 195, .4); }

@media (prefers-reduced-motion: reduce) {
  .r-ssr, .r-ssr .tc-emblem::after { animation: none; }
  .tcard { transition: none; }
}
@media (max-width: 680px) {
  .deck { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; perspective: none; }
  .tc-inner { padding: 11px 12px; }
  .tc-emblem { width: 54px; height: 54px; border-radius: 16px; margin: 12px auto 10px; }
  .tc-emblem::after { inset: -5px; border-radius: 20px; }
  .tc-emblem span { font-size: 22px; }
  .tc-name { font-size: 14.5px; }
  .tc-stats b { font-size: 15px; }
  .tc-cat { display: none; }
}

/* ---------- 官网图标（拿到了就换成浅色底的图标砖，拿不到显示首字母） */
.tc-emblem img, .acc-ico img, .icon-preview img { display: none; }
.tc-emblem.logo, .acc-ico.logo, .icon-preview.logo {
  background: linear-gradient(150deg, #FFFFFF, #E4EBE8);
  box-shadow: inset 0 1px 0 #fff, inset 0 -6px 14px rgba(20, 40, 34, .12), 0 12px 28px -12px hsl(var(--hue, 160) 60% 45% / .55);
}
.tc-emblem.logo img, .acc-ico.logo img, .icon-preview.logo img { display: block; width: 62%; height: 62%; object-fit: contain; border-radius: 6px; }
.tc-emblem.logo span, .acc-ico.logo span, .icon-preview.logo span { display: none; }
.acc-ico, .icon-preview {
  flex: none; display: grid; place-items: center; border-radius: 9px;
  background: linear-gradient(145deg, hsl(var(--hue, 160) 45% 34%), hsl(calc(var(--hue, 160) + 30) 40% 18%));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.18);
}
.acc-ico { width: 30px; height: 30px; }
.acc-ico span { font-size: 13px; font-weight: 700; color: rgba(255,255,255,.92); }
.acc-ico.logo { box-shadow: inset 0 1px 0 #fff; }
.acc-sub { display: flex; align-items: center; gap: 7px; margin: 6px 0 14px 0; }
.icon-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.icon-preview { width: 44px; height: 44px; border-radius: 12px; margin-right: 6px; }
.icon-preview span { font-size: 18px; font-weight: 700; color: rgba(255,255,255,.92); }
.file-btn { cursor: pointer; }
