/* 晨曦弹幕 · 玻璃拟态管理控制台。静态渐变与本地字体，无外部资源。 */
:root {
  color-scheme: light;
  --bg: #edf3fa; --surface: rgba(255,255,255,.68); --surface-2: rgba(247,250,255,.7);
  --surface-3: rgba(224,233,247,.58); --surface-solid: #f7faff; --input-bg: rgba(255,255,255,.56);
  --ink: #1c2b46; --ink-2: #4a5c77; --ink-3: #657996; --ink-4: #72829b;
  --line: rgba(113,142,184,.15); --line-strong: rgba(113,142,184,.29); --glass-edge: rgba(255,255,255,.9);
  --accent: #3468ee; --accent-hover: #2455d8; --accent-soft: rgba(68,111,239,.09); --accent-line: rgba(68,111,239,.22);
  --cyan: #128699; --cyan-soft: rgba(34,157,176,.1); --violet: #7b59cc; --violet-soft: rgba(133,100,207,.1);
  --ok: #13856c; --ok-soft: rgba(21,155,119,.1); --warn: #9d690b; --warn-soft: rgba(209,150,38,.1);
  --danger: #c34660; --danger-soft: rgba(213,75,102,.1);
  --sidebar: rgba(248,251,255,.66); --sidebar-ink: #253b5a; --sidebar-muted: #637592;
  --sidebar-line: rgba(115,144,184,.14); --sidebar-hover: rgba(255,255,255,.76);
  --selection: rgba(68,111,239,.2); --chart-track: rgba(135,162,211,.1);
  --chart-1: #5480ef; --chart-2: #78a6ec; --chart-3: #84c2ce; --chart-4: #b5a4d8;
  --shadow-1: 0 4px 22px rgba(40,67,115,.035),inset 0 1px 0 var(--glass-edge);
  --shadow-2: 0 16px 50px rgba(40,67,115,.075),inset 0 1px 0 var(--glass-edge);
  --glow-blue: rgba(136,177,255,.29); --glow-mint: rgba(143,219,206,.23); --glow-lilac: rgba(200,181,239,.23);
  --sidebar-w: 234px; --topbar-h: 68px; --content-max: 1560px;
  --radius-sm: 11px; --radius-md: 20px; --radius-lg: 26px;
  --font-sans: -apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans SC",sans-serif;
  --font-mono: ui-monospace,"SFMono-Regular","Cascadia Code",Consolas,Menlo,monospace;
  --ease: cubic-bezier(.2,.7,.2,1); --duration: 160ms;
  --space-1: 4px; --space-2: 8px; --space-3: 12px; --space-4: 16px; --space-5: 24px; --space-6: 32px;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101827; --surface: rgba(29,42,63,.76); --surface-2: rgba(26,39,59,.64);
  --surface-3: rgba(61,81,111,.4); --surface-solid: #1d2b42; --input-bg: rgba(16,28,46,.45);
  --ink: #ecf2fd; --ink-2: #becce2; --ink-3: #a0b0c9; --ink-4: #90a2bf;
  --line: rgba(166,189,226,.12); --line-strong: rgba(166,189,226,.24); --glass-edge: rgba(182,206,244,.12);
  --accent: #8bacff; --accent-hover: #acc3ff; --accent-soft: rgba(139,172,255,.12); --accent-line: rgba(139,172,255,.28);
  --cyan: #7ad0dd; --cyan-soft: rgba(122,208,221,.1); --violet: #c2a9f5; --violet-soft: rgba(194,169,245,.1);
  --ok: #73d6b6; --ok-soft: rgba(115,214,182,.1); --warn: #eac57f; --warn-soft: rgba(234,197,127,.1);
  --danger: #f39bad; --danger-soft: rgba(243,155,173,.1);
  --sidebar: rgba(24,36,56,.76); --sidebar-ink: #e1eafa; --sidebar-muted: #a0b1cc;
  --sidebar-line: rgba(166,189,226,.12); --sidebar-hover: rgba(118,149,196,.1);
  --selection: rgba(139,172,255,.25); --chart-track: rgba(152,176,223,.09);
  --chart-1: #83a6ff; --chart-2: #74b8e7; --chart-3: #7abdbf; --chart-4: #a391cf;
  --shadow-1: 0 4px 22px rgba(0,8,21,.1),inset 0 1px 0 var(--glass-edge);
  --shadow-2: 0 18px 48px rgba(0,8,21,.2),inset 0 1px 0 var(--glass-edge);
  --glow-blue: rgba(48,83,149,.24); --glow-mint: rgba(29,104,106,.13); --glow-lilac: rgba(98,66,133,.18);
}
*, *::before, *::after { box-sizing: border-box; }
html { min-height: 100%; -webkit-text-size-adjust: 100%; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: var(--bg); font: 14px/1.65 var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body::before { position: fixed; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 8% 8%,var(--glow-blue),transparent 48%),radial-gradient(ellipse at 92% 32%,var(--glow-mint),transparent 48%),radial-gradient(ellipse at 45% 94%,var(--glow-lilac),transparent 53%); content: ""; }
h1, h2, h3, p, dl, dd { margin: 0; }
a { color: var(--accent); text-decoration: none; }
svg { display: block; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
code, .mono, .code, .code-block { font-family: var(--font-mono); }
code { padding: 2px 6px; color: var(--ink-2); background: var(--surface-3); border-radius: 5px; font-size: .9em; overflow-wrap: anywhere; }
.mono { font-size: 12px; }
.muted { color: var(--ink-3); }
::selection { color: var(--ink); background: var(--selection); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
* { scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border: 3px solid transparent; border-radius: 99px; background-clip: content-box; }
.skip-link { position: fixed; top: 12px; left: 50%; z-index: 100; padding: 10px 18px; color: var(--ink); background: var(--surface-solid); border-radius: var(--radius-sm); transform: translate(-50%,-160%); }
.skip-link:focus { transform: translate(-50%,0); }
.sidebar, .topbar, .card, .stat, .auth-aside, .auth-card { -webkit-backdrop-filter: blur(20px) saturate(135%); backdrop-filter: blur(20px) saturate(135%); }

/* 浮动导航与工作区 */
.shell { display: flex; gap: 26px; min-height: 100vh; padding: 18px 26px 18px 18px; align-items: flex-start; }
.sidebar { position: sticky; top: 18px; z-index: 40; display: flex; flex: 0 0 var(--sidebar-w); flex-direction: column; width: var(--sidebar-w); height: calc(100vh - 36px); height: calc(100dvh - 36px); padding: 23px 14px 17px; color: var(--sidebar-ink); background: var(--sidebar); border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 7px 23px; border-bottom: 1px solid var(--sidebar-line); }
.brand-mark { display: grid; flex: 0 0 40px; place-items: center; width: 40px; height: 40px; color: #fff; background: linear-gradient(145deg,#6b94fc,#3864e9); border: 1px solid rgba(255,255,255,.45); border-radius: 13px; box-shadow: 0 5px 14px rgba(57,103,226,.18),inset 0 1px 0 rgba(255,255,255,.25); }
.brand-mark svg { width: 24px; height: 24px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; }
.brand-name { display: block; font-size: 17px; font-weight: 700; letter-spacing: .05em; line-height: 1.4; }
.brand-sub { display: block; margin-top: 4px; color: var(--sidebar-muted); font-size: 10px; letter-spacing: .03em; line-height: 1.4; }
.nav { flex: 1 1 auto; min-height: 0; margin: 0 -5px; padding: 8px 5px 12px; overflow-y: auto; }
.nav-group { margin: 19px 13px 8px; color: var(--sidebar-muted); font-size: 10px; letter-spacing: .08em; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; min-height: 42px; margin: 3px 0; padding: 8px 13px; color: var(--sidebar-ink); border: 1px solid transparent; border-radius: 12px; font-size: 13px; transition: color var(--duration) var(--ease),background-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease); }
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--sidebar-muted); stroke-width: 1.7; }
.nav-item:hover { background: var(--sidebar-hover); }
.nav-item.is-active { color: #fff; background: linear-gradient(105deg,#4e7af2,#3968e5); border-color: rgba(255,255,255,.22); box-shadow: 0 5px 12px rgba(58,102,217,.2),inset 0 1px 0 rgba(255,255,255,.15); font-weight: 600; }
.nav-item.is-active::after { width: 5px; height: 5px; margin-left: auto; background: rgba(255,255,255,.75); border-radius: 50%; content: ""; }
.nav-item.is-active svg { color: #fff; }
.sidebar-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 16px 9px 0; color: var(--sidebar-muted); border-top: 1px solid var(--sidebar-line); font-size: 11px; }
.version-pill { padding: 2px 7px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; font-family: var(--font-mono); font-size: 9px; }
.scrim { display: none; }
.main { display: flex; flex: 1 1 auto; min-width: 0; flex-direction: column; }
.topbar { position: sticky; top: 18px; z-index: 30; display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: var(--topbar-h); padding: 12px 24px; background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.inline { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: 13px; color: var(--ink-3); font-size: 12px; white-space: nowrap; }
.crumb-divider { color: var(--line-strong); }
.crumb strong { color: var(--ink); font-weight: 600; }
.topbar-actions { display: flex; align-items: center; gap: 7px; }
.user { display: inline-flex; align-items: center; gap: 9px; margin-right: 7px; padding-right: 17px; color: var(--ink-2); border-right: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
.avatar { display: grid; flex: 0 0 32px; place-items: center; width: 32px; height: 32px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 50%; font-size: 12px; font-weight: 650; }
.only-light, .only-dark { display: grid; place-items: center; }
.only-dark, [data-theme="dark"] .only-light { display: none; }
[data-theme="dark"] .only-dark { display: grid; }
.topbar .drawer-toggle { display: none; }
.content { width: 100%; max-width: var(--content-max); flex: 1 1 auto; margin: 0 auto; padding: 30px 2px 48px; }
.content:focus { outline: none; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 25px; }
.page-eyebrow { display: block; margin-bottom: 6px; color: var(--ink-4); font-size: 9px; font-weight: 650; letter-spacing: .18em; }
.page-head h1 { color: var(--ink); font-size: 27px; font-weight: 700; letter-spacing: .02em; line-height: 1.4; }
.page-head p { max-width: 72ch; margin-top: 7px; color: var(--ink-3); font-size: 12px; line-height: 1.7; }
.page-actions { display: flex; flex-wrap: wrap; gap: 10px; padding-bottom: 3px; }
.page-content { min-width: 0; }

/* 反馈与操作 */
.alert { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 20px; padding: 13px 16px; color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius-sm); font-size: 12px; overflow-wrap: anywhere; }
.alert svg { width: 17px; height: 17px; flex: 0 0 17px; margin-top: 2px; }
.alert-ok { border-left-color: var(--ok); }
.alert-ok svg { color: var(--ok); }
.alert-warn { border-left-color: var(--warn); }
.alert-warn svg { color: var(--warn); }
.alert-danger { border-left-color: var(--danger); }
.alert-danger svg { color: var(--danger); }
.alert-info svg { color: var(--accent); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 39px; padding: 9px 16px; color: var(--ink-2); background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: 500 12px/1.4 var(--font-sans); cursor: pointer; white-space: nowrap; text-decoration: none; transition: color var(--duration) var(--ease),background-color var(--duration) var(--ease),border-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease); }
.btn svg { width: 16px; height: 16px; flex: 0 0 16px; stroke-width: 1.8; }
.btn:hover { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.btn:disabled { opacity: .55; cursor: wait; }
.btn-primary { color: #fff; background: #3468ee; border-color: rgba(52,104,238,.5); box-shadow: 0 4px 10px rgba(52,104,238,.16),inset 0 1px 0 rgba(255,255,255,.15); }
.btn-primary:hover { color: #fff; background: #2455d8; border-color: #2455d8; box-shadow: 0 5px 14px rgba(52,104,238,.24); }
[data-theme="dark"] .btn-primary { color: #10224a; background: #8bacff; border-color: #8bacff; }
[data-theme="dark"] .btn-primary:hover { color: #10224a; background: #acc3ff; border-color: #acc3ff; }
.btn-ghost { background: var(--surface-2); border-color: var(--line); }
.btn-danger { color: var(--danger); border-color: var(--line-strong); }
.btn-danger:hover { color: var(--danger); background: var(--danger-soft); border-color: var(--danger); }
.btn-sm { min-height: 32px; padding: 6px 11px; font-size: 11px; }
.btn-icon { width: 36px; min-height: 36px; padding: 0; }
.topbar .btn-icon { background: transparent; border-color: transparent; border-radius: 10px; }
.topbar .btn-icon:hover { background: var(--accent-soft); }

/* 玻璃卡片与指标 */
.card { min-width: 0; margin-bottom: 20px; overflow: hidden; background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 70px; padding: 20px 24px 17px; border-bottom: 1px solid var(--line); }
.card-head h2 { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 14px; font-weight: 650; line-height: 1.5; }
.card-head p { max-width: 60%; color: var(--ink-3); font-size: 11px; line-height: 1.65; text-align: right; }
.heading-icon { display: grid; flex: 0 0 28px; place-items: center; width: 28px; height: 28px; color: var(--accent); background: var(--accent-soft); border-radius: 9px; }
.heading-icon svg { width: 15px; height: 15px; }
.heading-icon.is-cyan, .stat-icon.is-cyan { color: var(--cyan); background: var(--cyan-soft); }
.heading-icon.is-violet, .stat-icon.is-violet { color: var(--violet); background: var(--violet-soft); }
.heading-icon.is-green, .stat-icon.is-green { color: var(--ok); background: var(--ok-soft); }
.card-body { padding: 23px 24px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; min-height: 66px; padding: 14px 24px; color: var(--ink-3); background: var(--surface-2); border-top: 1px solid var(--line); font-size: 11px; }
.card-foot.is-end { justify-content: flex-end; }
.card-foot .inline { gap: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 18px; margin-bottom: 24px; }
.stat-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.stat { position: relative; min-width: 0; padding: 23px; overflow: hidden; background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--radius-md); box-shadow: var(--shadow-1); }
.stat-icon { position: absolute; top: 20px; right: 20px; display: grid; place-items: center; width: 36px; height: 36px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-radius: 12px; }
.stat-icon svg { width: 18px; height: 18px; stroke-width: 1.7; }
.stat-label { padding-right: 33px; color: var(--ink-2); font-size: 11px; }
.stat-value { margin-top: 15px; overflow: hidden; color: var(--ink); font-size: 30px; font-weight: 650; letter-spacing: -.035em; line-height: 1.25; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; }
.stat-value.is-small { display: flex; align-items: center; min-height: 38px; font-size: 16px; letter-spacing: 0; }
.stat-caption { margin-top: 10px; color: var(--ink-4); font-size: 10px; }
.unit { margin-left: 5px; color: var(--ink-3); font-size: 11px; font-weight: 500; letter-spacing: 0; }
.stat-plain { box-shadow: none; background: var(--surface-2); }
.split { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(300px,1fr); gap: 22px; align-items: start; }
.settings-grid { display: grid; grid-template-columns: minmax(0,1.1fr) minmax(0,1fr); gap: 20px; align-items: start; }
.settings-grid > .card { margin-bottom: 0; }
.settings-wide { grid-column: 1 / -1; }
.settings-color { grid-template-columns: minmax(0,.7fr) minmax(0,1.3fr); }
.settings-comment { grid-template-columns: minmax(0,1.3fr) minmax(0,.85fr); }

/* 轻量图表 */
.chart { display: flex; align-items: flex-end; gap: 14px; height: 236px; padding: 4px 6px 0; }
.chart-col { display: flex; flex: 1 1 0; flex-direction: column; align-items: center; gap: 9px; min-width: 0; height: 100%; }
.chart-bar-track { position: relative; flex: 1 1 auto; width: 100%; max-width: 36px; overflow: hidden; background: var(--chart-track); border-radius: 8px; }
.chart-bar { position: absolute; right: 0; bottom: 0; left: 0; min-height: 3px; background: linear-gradient(180deg,#87a9fa,#527fee); border-radius: 8px; }
[data-theme="dark"] .chart-bar { background: linear-gradient(180deg,#a3bbff,#638ce6); }
.chart-num { color: var(--ink-3); font-family: var(--font-mono); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart-day { display: flex; flex-direction: column; align-items: center; gap: 3px; line-height: 1.3; }
.chart-day b { color: var(--ink-2); font-size: 10px; font-weight: 500; }
.chart-day span { color: var(--ink-4); font-size: 9px; }
.chart-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 9px; height: 236px; color: var(--ink-4); background: var(--surface-2); border: 1px dashed var(--line-strong); border-radius: var(--radius-sm); font-size: 11px; text-align: center; }
.chart-empty b { color: var(--ink-2); font-size: 13px; font-weight: 550; }
.empty-icon { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 5px; color: var(--accent); background: var(--accent-soft); border-radius: 14px; }
.empty-icon svg { width: 22px; height: 22px; }
.dist { display: grid; gap: 17px; }
.dist-total { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 22px; padding: 12px 14px; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 11px; }
.dist-total strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }
.dist-row { display: grid; grid-template-columns: 76px minmax(0,1fr) 90px 48px; align-items: center; gap: 12px; font-size: 11px; }
.dist-label { color: var(--ink-2); font-weight: 500; }
.dist-track { height: 7px; overflow: hidden; background: var(--chart-track); border-radius: 99px; }
.dist-fill { height: 100%; min-width: 2px; border-radius: 99px; background: var(--chart-1); }
.dist-fill.t1 { background: var(--chart-1); }
.dist-fill.t2 { background: var(--chart-2); }
.dist-fill.t3 { background: var(--chart-3); }
.dist-fill.t4 { background: var(--chart-4); }
.dist-size, .dist-files { color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }

/* 表单、开关和数据表 */
.field { max-width: 600px; margin-bottom: 21px; }
.field:last-child { margin-bottom: 0; }
.field > label, .field > .label { display: block; margin-bottom: 8px; color: var(--ink-2); font-size: 12px; font-weight: 550; }
.field-row { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-bottom: 21px; }
.field-row > .field, .field-grid > .field { max-width: none; margin-bottom: 0; }
.field-row:last-child, .field-grid:last-child { margin-bottom: 0; }
.field-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 20px; margin-bottom: 21px; }
.input, .textarea, .select { width: 100%; min-height: 42px; padding: 10px 13px; color: var(--ink); background-color: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font: 12px/1.65 var(--font-sans); transition: border-color var(--duration) var(--ease),box-shadow var(--duration) var(--ease),background-color var(--duration) var(--ease); }
.input::placeholder, .textarea::placeholder { color: var(--ink-4); opacity: 1; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--accent-line); }
.input:focus, .textarea:focus, .select:focus { outline: 0; background-color: var(--surface-solid); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.textarea { min-height: 100px; resize: vertical; font-family: var(--font-mono); font-size: 12px; line-height: 1.8; }
.select { appearance: none; padding-right: 35px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8798' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 13px center; }
.select option { color: var(--ink); background: var(--surface-solid); }
.hint { margin-top: 7px; color: var(--ink-4); font-size: 11px; line-height: 1.75; overflow-wrap: anywhere; }
.code { color: var(--ink-2); font-size: 12px; overflow-wrap: anywhere; }
.code-block { display: block; max-width: none; padding: 15px 17px; overflow: auto; color: var(--ink-2); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.repeat-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.repeat-row:last-child { margin-bottom: 0; }
.repeat-row .input { flex: 1 1 auto; min-width: 0; }
.repeat-row .input.is-id { flex: 0 0 85px; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 11px; cursor: pointer; user-select: none; }
.switch input, .check-item input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch-track { position: relative; width: 38px; height: 22px; flex: 0 0 38px; background: var(--line-strong); border-radius: 99px; transition: background-color var(--duration) var(--ease); }
.switch-track::after { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; background: #fff; border-radius: 50%; box-shadow: 0 1px 4px rgba(24,48,85,.16); content: ""; transition: transform var(--duration) var(--ease); }
.switch input:checked + .switch-track { background: var(--accent); }
.switch input:checked + .switch-track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch-track, .check-item input:focus-visible + .check-box { outline: 2px solid var(--accent); outline-offset: 3px; }
.switch-text { color: var(--ink-2); font-size: 12px; }
.check-list { display: grid; gap: 11px; max-width: 600px; }
.check-item { position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; transition: border-color var(--duration) var(--ease); }
.check-item:hover { border-color: var(--accent-line); }
.check-item:has(input:checked) { border-color: var(--accent-line); background: var(--accent-soft); }
.check-box { position: relative; width: 18px; height: 18px; flex: 0 0 18px; margin-top: 1px; background: var(--input-bg); border: 1.5px solid var(--line-strong); border-radius: 5px; }
.check-item input:checked + .check-box { background: var(--accent); border-color: var(--accent); }
.check-item input:checked + .check-box::after { position: absolute; top: 2px; left: 5px; width: 4px; height: 9px; border: 2px solid #fff; border-top: 0; border-left: 0; content: ""; transform: rotate(45deg); }
[data-theme="dark"] .check-item input:checked + .check-box::after { border-color: #10224a; }
.check-title { display: block; color: var(--ink); font-size: 12px; font-weight: 550; }
.check-desc { display: block; margin-top: 3px; color: var(--ink-3); font-size: 11px; line-height: 1.65; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 12px; text-align: left; }
th { padding: 13px 16px; color: var(--ink-3); background: var(--surface-2); font-size: 11px; font-weight: 550; white-space: nowrap; }
td { padding: 14px 16px; color: var(--ink-2); border-top: 1px solid var(--line); }
tbody tr:hover { background: var(--accent-soft); }
.tag { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; color: var(--ink-2); background: var(--surface-3); border: 1px solid var(--line); border-radius: 7px; font-size: 10px; font-weight: 500; line-height: 1.5; white-space: nowrap; }
.tag-ok { color: var(--ok); background: var(--ok-soft); border-color: transparent; }
.tag-warn { color: var(--warn); background: var(--warn-soft); border-color: transparent; }
.tag-danger { color: var(--danger); background: var(--danger-soft); border-color: transparent; }
.dot { width: 5px; height: 5px; flex: 0 0 5px; background: currentColor; border-radius: 50%; }
.kv { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 42px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; }
.kv:first-child { padding-top: 0; }
.kv:last-child { padding-bottom: 0; border-bottom: 0; }
.kv-key { flex: 0 0 auto; color: var(--ink-3); }
.kv-val { min-width: 0; color: var(--ink-2); text-align: right; overflow-wrap: anywhere; }
.section-title { margin: 22px 0 12px; color: var(--ink-2); font-size: 12px; font-weight: 550; }
.empty { padding: 30px 16px; color: var(--ink-4); text-align: center; font-size: 12px; }
.swatch { width: 42px; height: 42px; flex: 0 0 42px; padding: 5px; background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); cursor: pointer; }
.swatch::-webkit-color-swatch-wrapper { padding: 0; }
.swatch::-webkit-color-swatch { border: 0; border-radius: 6px; }
.swatch::-moz-color-swatch { border: 0; border-radius: 6px; }
.prose { color: var(--ink-2); font-size: 12px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.auth-domain { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding: 18px 20px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); }
.auth-domain-host { color: var(--accent); font-family: var(--font-mono); font-size: 20px; font-weight: 600; overflow-wrap: anywhere; }
.auth-domain-port { color: var(--ink-3); font-family: var(--font-mono); font-size: 12px; }

/* 登录与首次安装 */
.auth-wrap { display: grid; grid-template-columns: minmax(0,.9fr) minmax(0,1.1fr); align-items: center; gap: 42px; max-width: 1360px; min-height: 100vh; margin: 0 auto; padding: 34px; }
.auth-aside { position: sticky; top: 34px; align-self: start; display: flex; flex-direction: column; justify-content: space-between; min-height: max(610px,calc(100vh - 68px)); padding: 50px 43px 30px; background: var(--sidebar); border: 1px solid var(--glass-edge); border-radius: 30px; box-shadow: var(--shadow-2); }
.auth-brand .brand-mark { width: 46px; height: 46px; margin-bottom: 32px; border-radius: 15px; }
.auth-eyebrow { display: block; margin-bottom: 19px; color: var(--ink-3); font-size: 11px; letter-spacing: .08em; }
.auth-brand h1 { color: var(--ink); font-size: clamp(29px,3.2vw,43px); font-weight: 700; letter-spacing: -.02em; line-height: 1.5; }
.auth-brand > p { max-width: 30ch; margin-top: 19px; color: var(--ink-3); font-size: 12px; line-height: 1.9; }
.auth-points { display: grid; gap: 22px; margin-top: 40px; padding-top: 27px; border-top: 1px solid var(--line); }
.auth-points > div { padding-left: 14px; border-left: 2px solid var(--accent-line); }
.auth-points dt { margin-bottom: 4px; color: var(--ink-2); font-size: 12px; font-weight: 550; }
.auth-points dd { color: var(--ink-3); font-size: 11px; line-height: 1.8; }
.auth-meta { display: flex; gap: 16px; margin-top: 35px; color: var(--ink-4); font: 10px var(--font-mono); }
.auth-main { display: grid; min-width: 0; place-items: center; padding: 24px 0; }
.auth-card { width: min(100%,440px); padding: 36px; background: var(--surface); border: 1px solid var(--glass-edge); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.auth-card-icon { display: grid; place-items: center; width: 43px; height: 43px; margin-bottom: 22px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: 14px; }
.auth-card-icon svg { width: 21px; height: 21px; stroke-width: 1.7; }
.auth-card h2 { color: var(--ink); font-size: 24px; font-weight: 650; }
.auth-card > p { margin: 7px 0 29px; color: var(--ink-3); font-size: 12px; line-height: 1.8; }
.auth-submit { width: 100%; min-height: 44px; margin-top: 7px; }
.auth-note { margin-top: 22px; }
.auth-standalone { display: grid; place-items: center; min-height: 100vh; padding: 24px 14px; }
.auth-result { min-height: 22px; margin-top: 18px; color: var(--ink-2); font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.auth-back { display: block; margin-top: 16px; padding-top: 18px; color: var(--ink-3); border-top: 1px solid var(--line); font-size: 12px; text-align: center; }
.auth-back:hover { color: var(--accent); }
.captcha-row { display: flex; align-items: stretch; gap: 10px; }
.captcha-row .input { flex: 1 1 auto; min-width: 0; }
.captcha-code { display: grid; place-items: center; min-width: 94px; padding: 0 13px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); font: 600 18px var(--font-mono); letter-spacing: .16em; cursor: pointer; user-select: none; }
.captcha-code:hover { border-color: var(--accent); }
.install-main { align-items: start; padding: 0; }
.install-card { width: 100%; }
.install-section { margin-top: 25px; padding-top: 23px; border-top: 1px solid var(--line); }
.install-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.install-section-head h3 { color: var(--ink); font-size: 13px; font-weight: 650; }
.install-section-head span { color: var(--ink-4); font-size: 10px; }
.install-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
.install-grid .field { max-width: none; }
.install-wide { grid-column: 1 / -1; }
.install-submit { width: 100%; min-height: 44px; margin-top: 28px; }

/* 评论入库工作台 */
.comment-layout { display: grid; grid-template-columns: minmax(0,1.5fr) minmax(280px,.75fr); gap: 22px; align-items: start; }
.comment-workbench { margin-bottom: 0; }
.comment-head { align-items: center; min-height: 96px; }
.comment-head h2 { margin-top: 5px; font-size: 17px; }
.comment-head p { max-width: none; margin-top: 5px; text-align: left; }
.eyebrow { color: var(--accent); font: 600 9px/1.4 var(--font-mono); letter-spacing: .15em; }
.comment-alert { margin: 20px 24px 0; }
.comment-steps { display: flex; align-items: center; padding: 24px 24px 0; }
.comment-step { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.comment-step span { display: grid; place-items: center; width: 27px; height: 27px; color: var(--ink-3); background: var(--surface-3); border: 1px solid var(--line); border-radius: 9px; font: 500 10px var(--font-mono); }
.comment-step b { font-weight: 500; }
.comment-step.is-current { color: var(--accent); }
.comment-step.is-current span { color: var(--accent); background: var(--accent-soft); border-color: var(--accent-line); }
.comment-step.is-done { color: var(--ok); }
.comment-step.is-done span { color: var(--ok); background: var(--ok-soft); }
.comment-steps > i { flex: 1 1 auto; min-width: 10px; height: 1px; margin: 0 13px; background: var(--line-strong); }
.comment-form-body { padding-top: 26px; }
.comment-form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px; margin-bottom: 21px; }
.comment-form-grid .field { max-width: none; margin-bottom: 0; }
.input-with-action { display: flex; gap: 8px; }
.input-with-action .input { min-width: 0; }
.input-with-action .btn { flex: 0 0 auto; }
.comment-result-field { max-width: none; margin-top: 2px; }
.comment-submit { width: 100%; min-height: 44px; margin-top: 3px; }
.comment-log-wrap { padding: 0 24px 24px; }
.comment-log-wrap .section-title { margin-top: 0; }
.comment-log { min-height: 112px; max-height: 270px; overflow: auto; white-space: normal; font-size: 11px; }
.comment-aside .card { margin-bottom: 20px; }
.comment-aside .card:last-child { margin-bottom: 0; }
.comment-rule { display: flex; align-items: flex-start; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.comment-rule:first-child { padding-top: 0; }
.comment-rule:last-child { padding-bottom: 0; border-bottom: 0; }
.comment-rule-index { display: grid; flex: 0 0 25px; place-items: center; width: 25px; height: 25px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; font: 500 11px var(--font-mono); }
.comment-rule b { color: var(--ink-2); font-size: 12px; font-weight: 550; }
.comment-rule p { margin-top: 5px; color: var(--ink-3); font-size: 11px; line-height: 1.8; }
.comment-endpoint-note { margin-top: 15px; padding-top: 12px; border-top: 1px dashed var(--line); }
.comment-local-path { display: flex; align-items: center; gap: 12px; padding: 14px; background: var(--accent-soft); border: 1px solid var(--accent-line); border-radius: var(--radius-sm); }
.comment-local-path-mark { display: grid; flex: 0 0 50px; place-items: center; height: 34px; color: var(--accent); background: var(--surface); border: 1px solid var(--accent-line); border-radius: 8px; font: 600 12px var(--font-mono); }
.comment-local-path b { display: block; color: var(--ink); font-size: 12px; font-weight: 550; }
.comment-local-path p { margin-top: 3px; color: var(--ink-3); font-size: 11px; }
.comment-local-path .tag { margin-left: auto; flex: 0 0 auto; }
.comment-auth-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; min-height: 34px; }
.log-line { display: flex; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.log-line:last-child { border-bottom: 0; }
.log-time { flex: 0 0 auto; color: var(--ink-4); font: 10px/1.8 var(--font-mono); }
.log-line.is-ok { color: var(--ok); }
.log-line.is-danger { color: var(--danger); }

/* 自适应与无障碍 */
@media (min-width: 1800px) { .shell { gap: 32px; padding-right: 32px; } }
@media (max-width: 1250px) {
  :root { --sidebar-w: 216px; }
  .shell { gap: 20px; padding-right: 20px; }
  .sidebar { padding-right: 11px; padding-left: 11px; }
  .brand { gap: 10px; padding-right: 4px; padding-left: 4px; }
  .brand-name { font-size: 16px; }
  .brand-sub { font-size: 9px; }
  .stat { padding: 20px; }
  .stat-icon { right: 15px; }
  .stat-value { font-size: 27px; }
  .split { grid-template-columns: minmax(0,1.3fr) minmax(280px,1fr); gap: 18px; }
  .card-head, .card-body, .card-foot { padding-right: 20px; padding-left: 20px; }
  .dist-row { grid-template-columns: 70px minmax(0,1fr) 64px 44px; gap: 9px; }
  .comment-layout { gap: 18px; }
  .comment-steps { padding-right: 20px; padding-left: 20px; }
  .comment-step { gap: 5px; }
  .comment-steps > i { margin: 0 8px; }
  .auth-wrap { gap: 28px; }
  .auth-aside { padding-right: 30px; padding-left: 30px; }
}
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .stat-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .settings-grid { grid-template-columns: minmax(0,1fr); }
  .settings-wide { grid-column: auto; }
  .comment-layout { grid-template-columns: minmax(0,1fr); }
  .comment-aside { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; }
  .comment-aside .card { margin-bottom: 0; }
  .auth-wrap { padding: 26px; }
  .auth-aside { top: 26px; min-height: calc(100vh - 52px); }
  .auth-card { padding: 28px; }
}
@media (max-width: 900px) {
  body:has(.shell.is-open) { overflow: hidden; }
  .shell { display: block; padding: 14px 18px; }
  .sidebar { position: fixed; top: 12px; bottom: 12px; left: 12px; width: 240px; height: calc(100vh - 24px); height: calc(100dvh - 24px); transform: translateX(calc(-100% - 24px)); transition: transform 180ms var(--ease); visibility: hidden; }
  .shell.is-open .sidebar { transform: translateX(0); visibility: visible; }
  .shell.is-open .scrim { position: fixed; inset: 0; z-index: 35; display: block; background: rgba(14,28,52,.3); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
  .topbar .drawer-toggle { display: inline-flex; }
  .topbar { top: 12px; min-height: 62px; padding: 10px 16px; }
  .content { padding-top: 25px; }
  .page-head h1 { font-size: 25px; }
  .auth-wrap { grid-template-columns: minmax(0,1fr); gap: 0; max-width: 680px; padding: 26px; }
  .auth-aside { display: none; }
  .auth-main { padding: 20px 0; }
  .install-main { padding: 0; }
}
@media (max-width: 680px) {
  .shell { padding: 12px 14px; }
  .topbar { gap: 8px; padding: 10px 12px; border-radius: 16px; }
  .topbar .inline { gap: 4px; }
  .crumb { gap: 8px; font-size: 11px; }
  .user { gap: 7px; margin-right: 0; padding-right: 10px; }
  .user > span:last-child { display: none; }
  .topbar-actions { gap: 2px; }
  .page-head { align-items: flex-start; flex-direction: column; gap: 18px; margin-bottom: 21px; }
  .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 11px; }
  .page-actions { gap: 8px; }
  .page-actions .btn { min-height: 36px; }
  .stat-grid, .stat-grid-3 { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 18px; }
  .stat { padding: 18px; border-radius: 17px; }
  .stat-icon { top: 16px; right: 14px; width: 30px; height: 30px; border-radius: 10px; }
  .stat-icon svg { width: 16px; height: 16px; }
  .stat-value { margin-top: 17px; font-size: 26px; }
  .split { grid-template-columns: minmax(0,1fr); gap: 0; }
  .card { margin-bottom: 18px; border-radius: 17px; }
  .card-head { align-items: flex-start; flex-direction: column; gap: 7px; min-height: 0; padding: 18px; }
  .card-head p { max-width: none; text-align: left; }
  .card-body { padding: 20px 18px; }
  .card-foot { align-items: stretch; flex-direction: column; padding: 15px 18px; }
  .card-foot .inline { justify-content: flex-end; }
  .card-foot.is-end { align-items: flex-end; }
  .field-row, .field-grid { grid-template-columns: minmax(0,1fr); }
  .field-row { gap: 21px; }
  .chart { height: 216px; gap: 9px; padding-right: 0; padding-left: 0; }
  .chart-empty { height: 216px; padding: 18px; }
  .dist-row { grid-template-columns: 74px minmax(0,1fr) 58px 43px; }
  .dist-total { flex-wrap: wrap; gap: 5px 12px; }
  .comment-aside { grid-template-columns: minmax(0,1fr); }
  .comment-head { gap: 12px; }
  .comment-head .tag { align-self: flex-start; }
  .comment-form-grid { grid-template-columns: minmax(0,1fr); gap: 21px; }
  .comment-steps { padding: 21px 18px 0; }
  .comment-step { gap: 6px; font-size: 10px; }
  .comment-step span { width: 24px; height: 24px; }
  .comment-steps > i { margin: 0 7px; }
  .comment-log-wrap { padding: 0 18px 20px; }
  .comment-alert { margin: 18px 18px 0; }
  .auth-domain-host { font-size: 16px; }
}
@media (max-width: 420px) {
  .shell { padding: 10px; }
  .topbar { top: 10px; padding-right: 9px; padding-left: 9px; }
  .crumb > span:first-child, .crumb-divider { display: none; }
  .topbar-actions { gap: 1px; }
  .content { padding-top: 23px; }
  .stat { padding: 17px 15px; }
  .stat-icon { position: static; width: 29px; height: 29px; margin-bottom: 12px; }
  .stat-label { padding: 0; }
  .stat-value { margin-top: 9px; font-size: 24px; }
  .stat-caption { font-size: 9px; }
  .stat-value.is-small { min-height: 30px; }
  .stat-value .tag { padding-right: 7px; padding-left: 7px; font-size: 9px; }
  .input, .select, .textarea { font-size: 16px; }
  .dist-row { grid-template-columns: 70px minmax(0,1fr) 42px; gap: 9px; }
  .dist-size { display: none; }
  .chart-num { font-size: 9px; }
  .chart { gap: 6px; }
  .chart-bar-track { max-width: 27px; }
  .repeat-row { gap: 8px; }
  .repeat-row .input.is-id { flex-basis: 68px; }
  .comment-steps > i { margin: 0 5px; }
  .comment-step { gap: 4px; }
  .comment-step span { width: 22px; height: 22px; font-size: 9px; }
  .auth-wrap { padding: 14px; }
  .auth-card { padding: 28px 22px; border-radius: 22px; }
  .install-grid { grid-template-columns: minmax(0,1fr); }
  .install-wide { grid-column: auto; }
  .install-section-head { gap: 8px; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .sidebar, .topbar, .card, .stat, .auth-aside, .auth-card { background: var(--surface-solid); border-color: var(--line); }
}
@media (prefers-reduced-transparency: reduce) {
  .sidebar, .topbar, .card, .stat, .auth-aside, .auth-card { background: var(--surface-solid); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: #fff; color: #000; }
  body::before, .sidebar, .topbar, .page-actions, .skip-link { display: none; }
  .shell { display: block; padding: 0; }
  .card, .stat { background: #fff; border: 1px solid #ddd; box-shadow: none; backdrop-filter: none; break-inside: avoid; }
  .content { max-width: none; padding: 0; }
}
