/* access 样式。色值与字阶沿用 ASR-AIBOX frontend/src/theme/tokens.css、typography.css（ui_v7）。
 * 组件只读 token，不写死颜色。CSP 只允许同源样式，所以没有任何内联 style。 */

:root {
  --ink: #F3F4F7; --slate: #FFFFFF; --graphite: #F7F8FA; --line: #E1E4EA; --line2: #CBD2DD;
  --text: #111827; --text-2: #4B5563; --text-3: #747E8C; --text-4: #B6BDC8;
  --signal: #2563EB; --signal-deep: #1D4FBF; --signal-soft: #EEF3FE; --signal-dim: #D7E3FF;
  --ok: #18794E; --ok-soft: #EEF8F2; --ok-soft-line: #BFE3CF;
  --amber: #985D09; --amber-ink: #8A5A00; --amber-soft: #FFF8E6; --amber-soft-line: #EED9A6;
  --live: #C63029; --live-deep: #B4231A; --live-soft: #FDF1F0; --live-soft-line: #F2C9C5;
  --rail: #111827; --rail-2: #1F2937; --rail-text: #D8DEE8; --rail-muted: #8F9AAA; --rail-accent: #60A5FA;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-lg: 0 20px 48px rgba(16, 24, 40, .18), 0 4px 12px rgba(16, 24, 40, .08);
  --radius: 8px;
  --ui: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --fs-title: 22px; --fs-h2: 15px; --fs-body: 13px; --fs-control: 14px; --fs-caption: 12px;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --ink: #0B0E13; --slate: #151A22; --graphite: #1E242E; --line: #262E3A; --line2: #323C4C;
  --text: #E8ECF3; --text-2: #97A1B2; --text-3: #646E80; --text-4: #4A5364;
  --signal: #5B89F5; --signal-deep: #7DA2F7; --signal-soft: #1B2A4A; --signal-dim: #2B4A96;
  --ok: #3DD68C; --ok-soft: #12261D; --ok-soft-line: #1E4A35;
  --amber: #E8A33D; --amber-ink: #E8A33D; --amber-soft: #2A2112; --amber-soft-line: #4D3A17;
  --live: #FF5A52; --live-deep: #FF7A73; --live-soft: #2E1716; --live-soft-line: #5A2622;
  --rail: #0B0E13; --rail-2: #1A202A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #0B0E13; --slate: #151A22; --graphite: #1E242E; --line: #262E3A; --line2: #323C4C;
    --text: #E8ECF3; --text-2: #97A1B2; --text-3: #646E80; --text-4: #4A5364;
    --signal: #5B89F5; --signal-deep: #7DA2F7; --signal-soft: #1B2A4A; --signal-dim: #2B4A96;
    --ok: #3DD68C; --ok-soft: #12261D; --ok-soft-line: #1E4A35;
    --amber: #E8A33D; --amber-ink: #E8A33D; --amber-soft: #2A2112; --amber-soft-line: #4D3A17;
    --live: #FF5A52; --live-deep: #FF7A73; --live-soft: #2E1716; --live-soft-line: #5A2622;
    --rail: #0B0E13; --rail-2: #1A202A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3); --shadow-lg: 0 20px 48px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--ink); color: var(--text); font: var(--fs-body)/1.55 var(--ui); -webkit-font-smoothing: antialiased; }
a { color: var(--signal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; color: var(--text); font-weight: 600; }
h1 { font-size: var(--fs-title); letter-spacing: -.01em; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: 14px; }
p { margin: 0; }
code, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -999px; top: 8px; background: var(--slate); padding: 8px 12px; border-radius: 6px; z-index: 50; }
.skip:focus { left: 8px; }
.muted { color: var(--text-3); }
.nowrap { white-space: nowrap; }
.wrap { overflow-wrap: anywhere; min-width: 160px; }
.right { text-align: right; }
.num { font-variant-numeric: tabular-nums; }
.warn-text { color: var(--amber); font-weight: 600; }
.bad-text { color: var(--live); font-weight: 600; }
.link { font-size: var(--fs-caption); font-weight: 600; }

.icon { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.logo { width: 30px; height: 30px; flex: none; }
.logo-bg { fill: var(--signal); }
.logo-fg { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; }

/* ---- 应用骨架 ---- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.rail { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 18px; padding: 18px 12px 14px; background: var(--rail); color: var(--rail-text); }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 10px; color: #fff; }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text b { font-size: 16px; letter-spacing: .01em; }
.brand-text small { color: var(--rail-muted); font-size: 11.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a { position: relative; display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 7px; color: var(--rail-muted); font-size: var(--fs-control); font-weight: 500; }
.nav a:hover { background: var(--rail-2); color: var(--rail-text); text-decoration: none; }
.nav a.active { background: rgba(96, 165, 250, .14); color: #fff; }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rail-accent); }
.nav a.active .icon { color: var(--rail-accent); }
.nav-label { margin: 14px 12px 4px; color: var(--rail-muted); font-size: 11px; font-weight: 600; letter-spacing: .08em; }
.rail-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(255, 255, 255, .08); }
.me { display: flex; align-items: center; gap: 10px; padding: 4px 6px; min-width: 0; }
.me-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.me-text b { color: #fff; font-size: 13px; }
.me-text small { color: var(--rail-muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 50%; background: linear-gradient(135deg, var(--signal), #6D5BD0); color: #fff; font-weight: 600; font-size: 13px; }
.avatar.sm { width: 24px; height: 24px; font-size: 11px; }
.rail-actions { display: flex; gap: 6px; }
.rail-actions form { flex: 1; display: flex; }
.rail-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 32px; padding: 0 10px; border: 1px solid rgba(255, 255, 255, .1); border-radius: 7px; background: transparent; color: var(--rail-muted); font: inherit; font-size: 12.5px; cursor: pointer; }
.rail-btn:hover { background: var(--rail-2); color: var(--rail-text); }
.rail-actions form .rail-btn { flex: 1; }
.main { padding: 28px 36px 56px; max-width: 1240px; width: 100%; display: flex; flex-direction: column; gap: 18px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 2px; }
.lede { margin-top: 5px; color: var(--text-2); font-size: var(--fs-body); max-width: 72ch; }

/* ---- 卡片与布局 ---- */
.card { background: var(--slate); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.card-title { margin-bottom: 16px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 18px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 18px; }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0 18px; color: var(--text-3); font-size: var(--fs-caption); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---- 表单 ---- */
.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.grow { flex: 1 1 240px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field label, .label { color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line2); border-radius: 7px; background: var(--slate); color: var(--text); font: inherit; font-size: var(--fs-control); transition: border-color .15s, box-shadow .15s; }
.input::placeholder { color: var(--text-4); }
.input:hover { border-color: var(--text-4); }
.input:focus { outline: none; border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.input[aria-invalid="true"] { border-color: var(--live); box-shadow: 0 0 0 3px var(--live-soft); }
select.input { padding-right: 28px; }
.input-sm { height: 30px; font-size: 12.5px; padding: 0 8px; width: auto; }
.input-sn { height: 48px; font-size: 19px; letter-spacing: .06em; text-transform: uppercase; }
.code-input { letter-spacing: .3em; font-size: 17px; }
.hint { color: var(--text-3); font-size: var(--fs-caption); }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--live); }
details.more { border: 1px dashed var(--line2); border-radius: 8px; padding: 10px 12px; }
details.more summary { cursor: pointer; color: var(--text-2); font-size: 12.5px; font-weight: 600; list-style: none; }
details.more summary::before { content: "＋ "; color: var(--signal); }
details.more[open] summary::before { content: "－ "; }
details.more[open] summary { margin-bottom: 12px; }

/* ---- 按钮 ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 7px; font: inherit; font-size: var(--fs-control); font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s, color .15s; text-decoration: none; }
.btn:hover { text-decoration: none; }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--signal); color: #fff; }
.btn-primary:hover { background: var(--signal-deep); }
.btn-secondary { background: var(--slate); border-color: var(--line2); color: var(--text); }
.btn-secondary:hover { background: var(--graphite); border-color: var(--text-4); }
.btn-ghost { background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--graphite); color: var(--text); }
.btn-danger { background: var(--slate); border-color: var(--live-soft-line); color: var(--live); }
.btn-danger:hover { background: var(--live-soft); }
.dialog .btn-danger[data-confirm-ok] { background: var(--live); border-color: var(--live); color: #fff; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }
.btn-lg { height: 44px; font-size: 15px; }
.btn-block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn.is-busy { position: relative; color: transparent !important; pointer-events: none; }
.btn.is-busy::after { content: ""; position: absolute; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-secondary.is-busy::after { border-color: var(--line2); border-top-color: var(--signal); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- 提示条 ---- */
.banner { display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px; border: 1px solid; border-radius: 8px; font-size: 13px; }
.banner .icon { margin-top: 1px; }
.banner.error { background: var(--live-soft); border-color: var(--live-soft-line); color: var(--live-deep); }
.banner.ok { background: var(--ok-soft); border-color: var(--ok-soft-line); color: var(--ok); }
.banner.warn { background: var(--amber-soft); border-color: var(--amber-soft-line); color: var(--amber-ink); }

/* ---- 徽标 ---- */
.badge { display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; border: 1px solid transparent; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.b-ok { background: var(--ok-soft); color: var(--ok); border-color: var(--ok-soft-line); }
.b-warn { background: var(--amber-soft); color: var(--amber-ink); border-color: var(--amber-soft-line); }
.b-bad { background: var(--live-soft); color: var(--live-deep); border-color: var(--live-soft-line); }
.b-info { background: var(--signal-soft); color: var(--signal-deep); border-color: var(--signal-dim); }
.b-muted { background: var(--graphite); color: var(--text-3); border-color: var(--line); }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: left; padding: 10px 14px; background: var(--graphite); color: var(--text-3); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--graphite); }
.table tr.dim td { color: var(--text-3); }
.table .right { text-align: right; }
.person { display: inline-flex; align-items: center; gap: 8px; }
.row-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.inline-form { display: inline-flex; gap: 6px; align-items: center; }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; }
.pager-links { display: inline-flex; gap: 6px; }

/* ---- 筛选 ---- */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; padding: 14px 16px; }
.filters .field { flex: 0 1 170px; }
.filters .field.grow { flex: 1 1 260px; }
.filters-actions { display: flex; gap: 6px; margin-left: auto; }

/* ---- 统计块 ---- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stats-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); margin: 18px 0; }
.stat { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; background: var(--slate); border: 1px solid var(--line); border-radius: 10px; color: var(--text); box-shadow: var(--shadow); }
a.stat:hover { border-color: var(--line2); text-decoration: none; }
.stat.on { border-color: var(--signal); box-shadow: 0 0 0 3px var(--signal-soft); }
.stat-label { color: var(--text-3); font-size: 12px; font-weight: 600; }
.stat-value { font-size: 26px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat.ok .stat-value { color: var(--ok); }
.stat.warn .stat-value { color: var(--amber); }
.stat.bad .stat-value { color: var(--live); }
.stat.muted .stat-value { color: var(--text-3); }
.result .stat { box-shadow: none; background: var(--graphite); }

/* ---- 查码结果 ---- */
.code-result { display: flex; flex-direction: column; gap: 16px; }
.code-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.code-sn { color: var(--text-2); font-size: 14px; letter-spacing: .04em; }
.code-main { display: flex; align-items: center; gap: 26px; padding: 18px 20px; background: var(--graphite); border: 1px solid var(--line); border-radius: 12px; }
.ring-wrap { position: relative; width: 104px; height: 104px; flex: none; }
.ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--line); stroke-width: 8; }
.ring-bar { fill: none; stroke: var(--signal); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 326.73; stroke-dashoffset: 0; transition: stroke-dashoffset .25s linear, stroke .3s; }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.1; }
.ring-label b { font-family: var(--mono); font-size: 26px; font-variant-numeric: tabular-nums; }
.ring-label small { color: var(--text-3); font-size: 11.5px; }
.code-body { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.code-digits { display: flex; gap: 18px; font-family: var(--mono); font-size: 44px; font-weight: 600; letter-spacing: .1em; line-height: 1.1; font-variant-numeric: tabular-nums; user-select: all; }
.code-status { color: var(--text-2); }
.code-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.code-result.is-warning .ring-bar { stroke: var(--amber); }
.code-result.is-expired .ring-bar { stroke: var(--text-4); }
.code-result.is-expired .code-digits { color: var(--text-4); text-decoration: line-through; text-decoration-thickness: 2px; }
.code-result.is-expired [data-refresh] { background: var(--signal); border-color: var(--signal); color: #fff; }
.kv { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px 12px; margin: 0; font-size: 12.5px; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text-2); }

/* ---- 最近与说明 ---- */
.recent { list-style: none; margin: 0; padding: 6px 0; }
.recent li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 18px; }
.recent li + li { border-top: 1px solid var(--line); }
.recent a { display: flex; flex-direction: column; min-width: 0; color: var(--text); }
.recent a:hover { text-decoration: none; }
.recent a:hover .mono { color: var(--signal); }
.recent small { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.recent time { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.help h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.help h2 .icon { color: var(--signal); }
.help ul { margin: 0; padding-left: 18px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 40px 20px; color: var(--text-3); text-align: center; }
.empty .icon { width: 28px; height: 28px; stroke-width: 1.5; }

/* ---- 上传 ---- */
.dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 140px; padding: 22px; border: 1.5px dashed var(--line2); border-radius: 10px; background: var(--graphite); color: var(--text-2); text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone .icon { width: 30px; height: 30px; color: var(--signal); stroke-width: 1.5; }
.dropzone b { color: var(--text); font-size: 14px; overflow-wrap: anywhere; }
.dropzone small { color: var(--text-3); }
.dropzone:hover, .dropzone.is-over { border-color: var(--signal); background: var(--signal-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--signal); }
.dropzone:focus-within { outline: 2px solid var(--signal); outline-offset: 2px; }
.progress { height: 6px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--signal); transition: width .2s; }
.result-head { display: flex; align-items: center; gap: 14px; }
.result-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; }
.result-icon.ok { background: var(--ok-soft); color: var(--ok); }
.result-icon.warn { background: var(--amber-soft); color: var(--amber); }
.section-title { margin: 8px 0 10px; color: var(--text-2); }
.result .table-wrap { border: 1px solid var(--line); border-radius: 8px; }
.result-actions { display: flex; gap: 8px; margin-top: 18px; }

/* ---- 对话框与轻提示 ---- */
.dialog { width: min(500px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 14px; background: var(--slate); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 14, 22, .5); backdrop-filter: blur(2px); }
.dialog[open] { animation: pop .16s ease-out; }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.dialog-body { display: flex; gap: 14px; padding: 22px 22px 6px; }
.dialog-body.col { flex-direction: column; gap: 12px; }
.dialog-body p { color: var(--text-2); margin-top: 6px; }
.dialog-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 16px 22px 20px; }
.dialog-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 50%; }
.dialog-icon.warn { background: var(--live-soft); color: var(--live); }
.dialog-icon.ok { background: var(--ok-soft); color: var(--ok); }
.copy-field { display: flex; gap: 8px; }
.copy-field .input { font-size: 12.5px; }
.toast { position: fixed; right: 24px; bottom: 24px; z-index: 60; display: flex; align-items: center; gap: 8px; max-width: min(420px, calc(100vw - 32px)); padding: 11px 16px; border-radius: 9px; background: #111827; color: #fff; font-size: 13px; box-shadow: var(--shadow-lg); animation: rise .2s ease-out; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } }

/* ---- 登录与激活 ---- */
.bare { min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, var(--signal-soft), transparent 60%), var(--ink); }
.bare-main { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; padding: 40px 16px; }
.bare-foot { color: var(--text-3); font-size: 12px; }
.auth { width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px; }
.auth-wide { width: min(560px, 100%); }
.auth-brand { display: flex; align-items: center; gap: 12px; justify-content: center; }
.auth-brand .logo { width: 38px; height: 38px; }
.auth-brand div { display: flex; flex-direction: column; line-height: 1.25; }
.auth-brand b { font-size: 18px; }
.auth-brand span { color: var(--text-3); font-size: 12px; }
.auth-card { padding: 28px; display: flex; flex-direction: column; gap: 16px; }
.auth-card .lede { margin-top: -8px; }
.auth-note { display: flex; gap: 8px; align-items: flex-start; color: var(--text-3); font-size: 12px; }
.auth-note .icon { width: 16px; height: 16px; margin-top: 1px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 20px; }
.steps > li { display: flex; flex-direction: column; gap: 10px; }
.step-head { display: flex; align-items: center; gap: 10px; }
.step-no { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--signal-soft); color: var(--signal-deep); font-size: 12px; font-weight: 700; }
.qr-row { display: flex; gap: 18px; align-items: center; }
.qr { width: 176px; height: 176px; flex: none; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; image-rendering: pixelated; }
.secret { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.secret-code { font-size: 14px; letter-spacing: .04em; color: var(--text); overflow-wrap: anywhere; padding: 8px 10px; background: var(--graphite); border: 1px solid var(--line); border-radius: 6px; }
.error-wrap { display: grid; place-items: center; padding: 60px 0; }
.error-card { width: min(480px, 100%); padding: 32px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.error-icon { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--amber-soft); color: var(--amber); margin-bottom: 6px; }
.error-icon .icon { width: 24px; height: 24px; }
.error-actions { display: flex; gap: 8px; margin-top: 14px; }

/* ---- 窄屏（售后常在现场用手机） ---- */
@media (max-width: 960px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .stats-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail { position: sticky; top: 0; z-index: 20; height: auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; overflow-x: auto; }
  .brand { padding: 0 6px 0 0; }
  .brand-text small, .nav-label, .me-text, .rail-btn span { display: none; }
  .nav { flex-direction: row; gap: 2px; }
  .nav a { padding: 8px 10px; white-space: nowrap; }
  .nav a.active::before { display: none; }
  .rail-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; border: 0; padding: 0; }
  .me { padding: 0; }
  .main { padding: 18px 16px 40px; }
  .page-head { flex-direction: column; align-items: flex-start; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .code-main { flex-direction: column; align-items: flex-start; gap: 14px; }
  .code-digits { font-size: 38px; }
  .qr-row { flex-direction: column; align-items: flex-start; }
  .field-row { grid-template-columns: minmax(0, 1fr); }
  .filters .field { flex: 1 1 140px; }
  .filters-actions { margin-left: 0; }
  .input-sn, .input, .code-input { font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
