/* AI 账号管家 · 网页版 */
:root {
  --paper: #F2F3EF;
  --surface: #FFFFFF;
  --surface-2: #F8F9F6;
  --ink: #1D2430;
  --ink-2: #4E5868;
  --ink-3: #7C8594;
  --line: #DCDFD8;
  --line-2: #E9EBE6;
  --accent: #3150D4;
  --accent-ink: #FFFFFF;
  --accent-soft: #E6EAFB;
  --full: #1F8A6A;
  --mid: #B7790F;
  --low: #C8384F;
  --none: #9AA1AC;
  --seg-empty: #E3E6E0;
  --full-soft: #E2F2EC;
  --mid-soft: #FBF0DC;
  --low-soft: #FBE5E9;
  --side: #1D2430;
  --side-ink: #E7E9EC;
  --side-ink-2: #8E97A6;
  --side-hover: #283142;
  --shadow: 0 1px 2px rgba(29, 36, 48, .06), 0 8px 24px rgba(29, 36, 48, .08);
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "DIN Condensed", "Roboto Condensed", "Arial Narrow", var(--font);
  --r: 10px;
  color-scheme: light;
}
[data-theme="dark"] {
  --paper: #13171D;
  --surface: #1B2028;
  --surface-2: #171C23;
  --ink: #E7E9EC;
  --ink-2: #AEB5C0;
  --ink-3: #7F8794;
  --line: #2C333E;
  --line-2: #242A34;
  --accent: #7D93F2;
  --accent-ink: #10162B;
  --accent-soft: #232C4C;
  --full: #43B892;
  --mid: #E0A63A;
  --low: #EE6F82;
  --none: #6B7380;
  --seg-empty: #2A313B;
  --full-soft: #183229;
  --mid-soft: #33290F;
  --low-soft: #3A1E25;
  --side: #0E1116;
  --side-hover: #1A1F28;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font: 14px/1.55 var(--font);
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); }
.num { font-family: var(--num); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.boot { display: grid; place-items: center; height: 100vh; color: var(--ink-3); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
[hidden] { display: none !important; }

/* ---------- 按钮与输入 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px; justify-content: center;
  height: 36px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  cursor: pointer; white-space: nowrap; font-weight: 500; text-decoration: none;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: var(--ink-3); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.danger { color: var(--low); }
.btn.danger.solid { background: var(--low); border-color: var(--low); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--line-2); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; }
.btn.icon { width: 32px; padding: 0; }
.btn svg { width: 16px; height: 16px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-size: 12px; color: var(--ink-2); font-weight: 500; }
.field .hint { font-size: 12px; color: var(--ink-3); }
.input, select.input, textarea.input {
  height: 38px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); width: 100%;
  transition: border-color .12s, box-shadow .12s;
}
textarea.input { height: auto; min-height: 76px; padding: 9px 12px; resize: vertical; line-height: 1.5; }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
select.input { appearance: none; padding-right: 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%237C8594' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; }
.err { color: var(--low); font-size: 13px; min-height: 18px; }

/* ---------- 登录 ---------- */
.login {
  min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 480px);
}
.login-art {
  background: var(--side); color: var(--side-ink); padding: 48px;
  display: flex; flex-direction: column; justify-content: space-between; overflow: hidden;
}
.login-art .brand { font-weight: 700; font-size: 18px; display: flex; gap: 10px; align-items: center; }
.login-art h1 { font-size: 40px; line-height: 1.2; margin: 0 0 18px; font-weight: 700; letter-spacing: .02em; max-width: 12em; }
.login-art p { color: var(--side-ink-2); max-width: 30em; margin: 0; }
.login-gauges { display: grid; gap: 14px; max-width: 420px; margin: 40px 0; }
.login-gauges .lg { display: grid; grid-template-columns: 90px 1fr 70px; gap: 14px; align-items: center; font-size: 13px; color: var(--side-ink-2); }
.login-gauges .lg b { font-family: var(--num); color: var(--side-ink); font-size: 20px; font-weight: 600; text-align: right; }
.login-gauges .meter { --seg-empty: #2E3747; }
.login-form { display: grid; place-items: center; padding: 32px; }
.login-form form { width: 100%; max-width: 340px; display: grid; gap: 16px; }
.login-form h2 { margin: 0 0 4px; font-size: 22px; }

/* ---------- 外框 ---------- */
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.side {
  background: var(--side); color: var(--side-ink); padding: 18px 12px;
  display: flex; flex-direction: column; gap: 4px; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.side .brand { display: flex; gap: 10px; align-items: center; padding: 6px 10px 18px; font-weight: 700; font-size: 16px; }
.side .brand img { width: 28px; height: 28px; }
.side h4 { margin: 18px 10px 6px; font-size: 12px; color: var(--side-ink-2); font-weight: 500; display: flex; justify-content: space-between; align-items: center; }
.side h4 button { background: none; border: 0; color: var(--side-ink-2); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.side h4 button:hover { background: var(--side-hover); color: var(--side-ink); }
.nav {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  padding: 8px 10px; border-radius: 8px; border: 0; background: none; color: var(--side-ink);
  cursor: pointer; font-size: 14px;
}
.nav:hover { background: var(--side-hover); }
.nav.on { background: var(--accent); color: var(--accent-ink); }
.nav svg { width: 17px; height: 17px; opacity: .85; flex: none; }
.nav .cnt { margin-left: auto; font-family: var(--num); font-size: 13px; color: var(--side-ink-2); }
.nav.on .cnt { color: var(--accent-ink); opacity: .75; }
.side .me { margin-top: auto; padding: 12px 10px 4px; border-top: 1px solid #2B3443; display: flex; align-items: center; gap: 10px; }
.side .me .who { flex: 1; min-width: 0; }
.side .me .who b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side .me .who span { font-size: 12px; color: var(--side-ink-2); }
.side .me button { background: none; border: 0; color: var(--side-ink-2); cursor: pointer; width: 30px; height: 30px; border-radius: 6px; display: grid; place-items: center; }
.side .me button:hover { background: var(--side-hover); color: var(--side-ink); }
.side .me svg { width: 17px; height: 17px; }
.topbar { display: none; }

.main { padding: 28px 32px 60px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; gap: 16px; justify-content: space-between; flex-wrap: wrap; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: .01em; }
.page-head p { margin: 4px 0 0; color: var(--ink-3); }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 读数条 ---------- */
.readout {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  margin-bottom: 18px; overflow: hidden;
}
.readout > * {
  padding: 14px 18px; border: 0; border-right: 1px solid var(--line-2); background: none; text-align: left;
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.readout > *:last-child { border-right: 0; }
.readout button { cursor: pointer; }
.readout button:hover { background: var(--surface-2); }
.readout button.on { background: var(--accent-soft); }
.readout .v { font-family: var(--num); font-size: 30px; line-height: 1.1; font-weight: 600; font-variant-numeric: tabular-nums; }
.readout .k { font-size: 13px; color: var(--ink-3); }
.readout .v.low { color: var(--low); }
.readout .v.due { color: var(--mid); }

/* ---------- 工具栏 ---------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .search { position: relative; flex: 1 1 260px; max-width: 380px; }
.toolbar .search svg { position: absolute; left: 11px; top: 11px; width: 16px; height: 16px; color: var(--ink-3); }
.toolbar .search .input { padding-left: 34px; }
.toolbar select.input { width: auto; min-width: 120px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.chip {
  height: 30px; padding: 0 12px; border-radius: 15px; border: 1px solid var(--line); background: var(--surface);
  cursor: pointer; font-size: 13px; display: inline-flex; align-items: center; gap: 6px;
}
.chip:hover { border-color: var(--ink-3); }
.chip.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 2px; }
.chip .n { font-family: var(--num); opacity: .7; }

/* ---------- 积分表（分段式） ---------- */
.meter { display: grid; grid-template-columns: repeat(10, 1fr); gap: 2px; height: 8px; }
.meter i { background: var(--seg-empty); border-radius: 2px; }
.meter.full i.f { background: var(--full); }
.meter.mid i.f { background: var(--mid); }
.meter.low i.f { background: var(--low); }
.meter.none i { background: repeating-linear-gradient(135deg, var(--seg-empty) 0 3px, transparent 3px 6px); }
.meter i.p { background: linear-gradient(90deg, var(--c) var(--p), var(--seg-empty) var(--p)) !important; }
.meter.full { --c: var(--full); } .meter.mid { --c: var(--mid); } .meter.low { --c: var(--low); }
.meter.big { height: 14px; gap: 3px; }
.meter.big i { border-radius: 3px; }

/* ---------- 账号表 ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
table.grid { width: 100%; border-collapse: collapse; }
.grid th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--ink-3); padding: 10px 14px;
  border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; user-select: none;
}
.grid th.sortable { cursor: pointer; }
.grid th.sortable:hover { color: var(--ink); }
.grid th .arr { font-size: 10px; margin-left: 3px; }
.grid td { padding: 14px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr { cursor: pointer; }
.grid tbody tr:hover td { background: var(--surface-2); }
.grid tbody tr.sel td { background: var(--accent-soft); }
.grid .ck { width: 36px; padding-right: 0; }
.grid input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.acc-name { font-weight: 600; overflow-wrap: anywhere; }
.grid td.c-acc { min-width: 200px; }
.m-only { display: none !important; }
.col-seats, .when span, .burn span, .credit .top em { white-space: nowrap; }
.acc-sub { font-size: 12px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pf { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.pf .dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.credit { min-width: 170px; }
.credit .top { display: flex; align-items: baseline; gap: 6px; margin-bottom: 6px; }
.credit .top b { font-family: var(--num); font-size: 22px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.credit .top span { font-family: var(--num); color: var(--ink-3); font-size: 13px; }
.credit .top em { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 600; }
.lv-full { color: var(--full); } .lv-mid { color: var(--mid); } .lv-low { color: var(--low); } .lv-none { color: var(--ink-3); }
.when b { font-family: var(--num); font-size: 16px; font-weight: 600; display: block; line-height: 1.2; }
.when span { font-size: 12px; color: var(--ink-3); }
.when.r1 b { color: var(--low); } .when.r24 b { color: var(--mid); } .when.r72 b { color: var(--accent); }
.burn b { font-family: var(--num); font-size: 15px; font-weight: 600; display: block; }
.burn span { font-size: 12px; color: var(--ink-3); }
.burn .warn { color: var(--low); }
.status {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 12px; font-weight: 500; white-space: nowrap; border: 1px solid transparent;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-可用 { background: var(--full-soft); color: var(--full); }
.st-使用中 { background: var(--accent-soft); color: var(--accent); }
.st-暂停使用 { background: var(--mid-soft); color: var(--mid); }
.st-已停用 { background: var(--line-2); color: var(--ink-3); }
.holder { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.row-actions { display: flex; gap: 4px; justify-content: flex-end; white-space: nowrap; }
.empty { padding: 56px 20px; text-align: center; color: var(--ink-3); }
.empty b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 6px; }
.empty .btn { margin-top: 14px; }
.foot-note { color: var(--ink-3); font-size: 12px; margin-top: 12px; display: flex; gap: 18px; flex-wrap: wrap; }
.foot-note i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }

.bulk {
  position: sticky; bottom: 16px; z-index: 5; margin-top: 14px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: var(--ink); color: var(--paper); border-radius: var(--r); padding: 10px 14px; box-shadow: var(--shadow);
}
.bulk .btn { background: transparent; color: var(--paper); border-color: rgba(255, 255, 255, .25); }
[data-theme="dark"] .bulk .btn { border-color: rgba(0, 0, 0, .25); }
.bulk .btn:hover { background: rgba(127, 127, 127, .2); }
.bulk b { font-family: var(--num); }

/* ---------- 菜单 ---------- */
.menu {
  position: fixed; z-index: 60; min-width: 170px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: var(--shadow); padding: 5px;
}
.menu button {
  display: flex; width: 100%; gap: 10px; align-items: center; padding: 8px 10px; border: 0; background: none;
  border-radius: 6px; cursor: pointer; text-align: left; font-size: 13px;
}
.menu button:hover { background: var(--line-2); }
.menu button.danger { color: var(--low); }
.menu hr { border: 0; border-top: 1px solid var(--line-2); margin: 4px 0; }
.menu svg { width: 15px; height: 15px; color: var(--ink-3); }

/* ---------- 弹窗与抽屉 ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 19, 26, .42); z-index: 50; display: grid; place-items: center;
  padding: 20px; animation: fade .12s ease-out;
}
.modal {
  background: var(--surface); border-radius: 14px; width: 100%; max-width: 560px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; box-shadow: var(--shadow); animation: pop .16s ease-out;
}
.modal > form { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.modal .body { flex: 1 1 auto; min-height: 0; }
.modal.wide { max-width: 720px; }
.modal.narrow { max-width: 420px; }
.modal header { padding: 20px 22px 4px; }
.modal header h3 { margin: 0; font-size: 18px; }
.modal header p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.modal .body { padding: 16px 22px; overflow-y: auto; display: grid; gap: 14px; }
.modal footer { padding: 14px 22px 18px; display: flex; gap: 8px; justify-content: flex-end; align-items: center; border-top: 1px solid var(--line-2); }
.modal footer .err { margin-right: auto; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.row3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.rule-row { display: flex; align-items: center; gap: 8px; }
.rule-row .input { width: 76px; }
.preview-box {
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px;
  display: grid; gap: 8px;
}
.preview-box .line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.preview-box .line b { font-family: var(--num); font-size: 20px; }
.quick { display: flex; gap: 6px; flex-wrap: wrap; }
.big-in { font-family: var(--num); font-size: 26px !important; height: 52px !important; font-weight: 600; }

.drawer-wrap { position: fixed; inset: 0; z-index: 45; background: rgba(15, 19, 26, .32); animation: fade .12s; }
.drawer {
  position: absolute; right: 0; top: 0; bottom: 0; width: min(520px, 100%); background: var(--surface);
  box-shadow: var(--shadow); display: flex; flex-direction: column; animation: slide .18s ease-out;
}
.drawer header { padding: 20px 22px 16px; border-bottom: 1px solid var(--line-2); display: flex; gap: 12px; align-items: flex-start; }
.drawer header h3 { margin: 0; font-size: 18px; word-break: break-all; }
.drawer .content { padding: 20px 22px 30px; overflow-y: auto; display: grid; gap: 22px; align-content: start; }
.gauge-hero { display: grid; gap: 10px; }
.gauge-hero .big { display: flex; align-items: baseline; gap: 8px; }
.gauge-hero .big b { font-family: var(--num); font-size: 48px; line-height: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.gauge-hero .big span { font-family: var(--num); font-size: 18px; color: var(--ink-3); }
.gauge-hero .big em { margin-left: auto; font-style: normal; font-weight: 600; }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 10px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; word-break: break-all; }
.ip-list { display: flex; flex-wrap: wrap; gap: 6px; }
.ip-list button {
  font-family: ui-monospace, Consolas, monospace; font-size: 12px; border: 1px solid var(--line); background: var(--surface-2);
  border-radius: 6px; padding: 3px 8px; cursor: pointer;
}
.ip-list button:hover { border-color: var(--accent); }
.section-title { font-size: 13px; font-weight: 600; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: center; }
.notes { white-space: pre-wrap; font-size: 13px; background: var(--surface-2); border-radius: 8px; padding: 10px 12px; }

/* ---------- 时间线 / 记录 ---------- */
.timeline { display: grid; gap: 0; }
.tl { display: grid; grid-template-columns: 20px 1fr auto; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.tl:last-child { border-bottom: 0; }
.tl .k { width: 8px; height: 8px; border-radius: 50%; margin: 6px auto 0; background: var(--ink-3); }
.tl .k.consume { background: var(--low); } .tl .k.topup, .tl .k.auto { background: var(--full); }
.tl .k.edit, .tl .k.create, .tl .k.import { background: var(--accent); } .tl .k.status, .tl .k.move { background: var(--mid); }
.tl .t { color: var(--ink-3); font-size: 12px; }
.tl .d { font-family: var(--num); font-weight: 600; font-size: 15px; text-align: right; white-space: nowrap; }
.d.neg { color: var(--low); } .d.pos { color: var(--full); }
.kind-tag { display: inline-block; font-size: 12px; padding: 1px 7px; border-radius: 5px; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.kind-tag.consume { background: var(--low-soft); color: var(--low); }
.kind-tag.topup, .kind-tag.auto { background: var(--full-soft); color: var(--full); }
.kind-tag.edit, .kind-tag.create, .kind-tag.import { background: var(--accent-soft); color: var(--accent); }
.kind-tag.status, .kind-tag.move { background: var(--mid-soft); color: var(--mid); }
.pager { display: flex; gap: 8px; justify-content: space-between; align-items: center; padding: 12px 14px; border-top: 1px solid var(--line-2); color: var(--ink-3); font-size: 13px; }

/* ---------- 统计 ---------- */
.stats-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.panel h3 { margin: 0 0 2px; font-size: 15px; }
.panel .sub { color: var(--ink-3); font-size: 12px; margin-bottom: 14px; }
.panel.span2 { grid-column: 1 / -1; }
.hero-num { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.hero-num b { font-family: var(--num); font-size: 40px; font-weight: 600; line-height: 1; }
.chart { position: relative; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gridline { stroke: var(--line-2); stroke-width: 1; }
.chart .axis { fill: var(--ink-3); font-size: 11px; font-family: var(--num); }
.chart .bar { fill: var(--accent); }
.chart .hit:hover + .bar, .chart .bar.hl { fill: var(--ink); }
.tip {
  position: absolute; pointer-events: none; background: var(--ink); color: var(--paper); font-size: 12px; padding: 6px 9px;
  border-radius: 6px; white-space: nowrap; transform: translate(-50%, -100%); margin-top: -8px; z-index: 3;
}
.tip b { font-family: var(--num); font-size: 14px; }
.hbars { display: grid; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(70px, 120px) 1fr 70px; gap: 10px; align-items: center; font-size: 13px; }
.hbar .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .track { height: 10px; background: var(--seg-empty); border-radius: 0 4px 4px 0; }
.hbar .fill { height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; min-width: 2px; }
.hbar .val { font-family: var(--num); text-align: right; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg button { border: 0; background: none; padding: 0 12px; height: 34px; cursor: pointer; font-size: 13px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: 0; }
.seg button.on { background: var(--ink); color: var(--paper); }

/* ---------- 设置 ---------- */
.settings { display: grid; gap: 16px; max-width: 760px; }
.settings .panel { display: grid; gap: 14px; }
.settings .panel .row-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.pw-show {
  font-family: ui-monospace, Consolas, monospace; font-size: 20px; background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: 8px; padding: 12px; text-align: center; letter-spacing: .06em; user-select: all;
}
.role { font-size: 12px; padding: 2px 8px; border-radius: 5px; background: var(--line-2); }
.role.admin { background: var(--accent-soft); color: var(--accent); }
.rules { margin: 0; padding-left: 18px; color: var(--ink-2); font-size: 13px; display: grid; gap: 4px; }

/* ---------- 提示 ---------- */
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 80; display: grid; gap: 8px; justify-items: center; }
.toast {
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 9px; box-shadow: var(--shadow);
  font-size: 13px; animation: pop .16s ease-out; display: flex; gap: 12px; align-items: center; max-width: 90vw;
}
.toast.bad { background: var(--low); color: #fff; }
.toast button { background: none; border: 0; color: inherit; text-decoration: underline; cursor: pointer; padding: 0; font-weight: 600; }

@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ---------- 窄屏 ---------- */
@media (max-width: 1180px) {
  .col-seats, .col-burn { display: none; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; left: 0; top: 0; bottom: 0; width: 260px; z-index: 40; transform: translateX(-100%); transition: transform .2s; }
  .shell.nav-open .side { transform: none; box-shadow: var(--shadow); }
  .shell.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 39; }
  .topbar {
    display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--side); color: var(--side-ink);
    position: sticky; top: 0; z-index: 20;
  }
  .topbar button { background: none; border: 0; color: inherit; width: 36px; height: 36px; display: grid; place-items: center; cursor: pointer; }
  .topbar b { font-size: 16px; }
  .main { padding: 18px 14px 80px; }
  .readout { grid-template-columns: repeat(2, 1fr); }
  .readout > * { border-bottom: 1px solid var(--line-2); }
  .readout > *:first-child { grid-column: 1 / -1; }
  .stats-grid { grid-template-columns: 1fr; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 28px; }
  .login-art h1 { font-size: 28px; }
  .login-gauges { display: none; }
  /* 表格改为卡片 */
  table.grid thead { display: none; }
  table.grid, .grid tbody { display: block; }
  .grid tbody tr {
    display: grid; grid-template-columns: 26px 1fr auto; gap: 8px 10px; padding: 14px; border-bottom: 1px solid var(--line-2);
  }
  .grid tbody tr:last-child { border-bottom: 0; }
  .grid td { padding: 0; border: 0; background: none !important; }
  .grid td.ck { grid-row: 1; padding-top: 2px; }
  .grid td.c-acc { grid-column: 2; }
  .grid td.c-act { grid-column: 3; grid-row: 1; }
  .grid td.c-pf, .grid td.c-credit, .grid td.c-when, .grid td.c-st { grid-column: 2 / 4; }
  .grid td.c-pf { display: none; }
  .m-only { display: inline-flex !important; }
  .grid tbody tr.sel { background: var(--accent-soft); }
  .row2, .row3 { grid-template-columns: 1fr; }
  .toolbar .search { max-width: none; flex-basis: 100%; }
}
