/* ============================================================
   FGAuth 用户中心 · 珍珠玻璃主题
   层次：令牌 → 基础 → 材质 → 控件 → 仪器 → 外壳 → 页面
   ============================================================ */

/* ── 令牌 ───────────────────────────────────────────────────── */
:root {
  font-family: "SF Pro Display", "SF Pro Text", "PingFang SC", -apple-system, BlinkMacSystemFont, "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-synthesis: none;
  color-scheme: light;

  --ink: #101418;
  --ink-muted: #596368;
  --ink-soft: #7e888c;
  --ink-faint: #99a2a5;
  --leaf-text: #58a021;

  --blue: #236de9;
  --blue-hover: #1d61d5;
  --blue-soft: rgba(35, 109, 233, .1);
  --lime: #82dd2d;
  --lime-soft: rgba(130, 221, 45, .14);
  --red: #ff5a50;
  --red-text: #e0443b;
  --red-soft: rgba(255, 90, 80, .11);
  --amber-text: #a8730c;
  --amber-soft: rgba(232, 170, 40, .14);
  --focus: rgba(35, 109, 233, .8);

  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 20px;
  --r-xl: 24px;

  --shade: 46, 58, 62;
  --line: rgba(var(--shade), .085);
  --line-strong: rgba(var(--shade), .11);
  --glass-line: rgba(255, 255, 255, .88);
  --glass-line-soft: rgba(255, 255, 255, .7);

  --e1: 0 1px 2px rgba(var(--shade), .05), 0 5px 14px rgba(var(--shade), .04);
  --e2: 0 1px 3px rgba(var(--shade), .06), 0 12px 30px rgba(var(--shade), .055);
  --e3: 0 2px 6px rgba(var(--shade), .07), 0 22px 50px rgba(var(--shade), .08);
  --e-accent: 0 1px 2px rgba(20, 66, 148, .28), 0 8px 18px rgba(35, 109, 233, .24);
  --e-accent-hover: 0 1px 2px rgba(20, 66, 148, .32), 0 12px 24px rgba(35, 109, 233, .3);
  --e-danger: 0 1px 2px rgba(150, 40, 34, .26), 0 8px 18px rgba(255, 90, 80, .24);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .92);
  --edge-strong: inset 0 1px 0 rgba(255, 255, 255, .98);

  --stage: #dfe3e2;
  --frame: #17191d;
  --canvas: #f6f8f7;
  --rail-bg: rgba(250, 251, 250, .92);
  --pill-bg: linear-gradient(145deg, rgba(255, 255, 255, .93), rgba(246, 251, 249, .62));
  --pill-inset: inset 0 -1px 0 rgba(105, 122, 128, .08);
  --float-bg: rgba(246, 248, 247, .86);
  --float-inset: inset 0 0 0 1px rgba(120, 132, 135, .13), inset 0 1px 0 rgba(255, 255, 255, .72);
  --surface: linear-gradient(145deg, rgba(255, 255, 255, .97), rgba(249, 252, 251, .93));
  --surface-solid: #fbfcfc;
  --groove-bg: rgba(225, 231, 229, .5);
  --groove-inset: inset 0 1px 0 rgba(255, 255, 255, .46);
  --input-bg: rgba(255, 255, 255, .78);
  --hover-bg: rgba(var(--shade), .045);
  --press-bg: rgba(var(--shade), .075);
  --overlay: rgba(16, 20, 24, .26);

  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --fs-display-xl: 56px;
  --fs-display-l: 40px;
  --fs-display-m: 28px;
  --track-eyebrow: .14em;

  --hatch-ink: rgba(var(--shade), .16);
  --hatch: repeating-linear-gradient(135deg, var(--hatch-ink) 0 1.5px, transparent 1.5px 6px);
  --tick: rgba(var(--shade), .22);
  --tick-strong: rgba(var(--shade), .5);
  --plate-bg: rgba(21, 24, 26, .9);
  --plate-line: rgba(255, 255, 255, .1);
  --plate-ink: #f2f5f4;
  --plate-soft: rgba(255, 255, 255, .56);

  --ambient-a: rgba(130, 221, 45, .07);
  --ambient-b: rgba(35, 109, 233, .055);

  --ease-premium: cubic-bezier(.16, 1, .3, 1);

  --rail-w: 232px;
  --topbar-h: 64px;
  --control-h: 36px;
  --control-h-sm: 30px;
  --row-h: 52px;
  --cell-px: 16px;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --ink: #eef2f1;
  --ink-muted: #b0babd;
  --ink-soft: #8d979a;
  --ink-faint: #6c7679;
  --leaf-text: #9be35a;

  --blue: #4c8dff;
  --blue-hover: #3d7ff2;
  --blue-soft: rgba(76, 141, 255, .16);
  --lime-soft: rgba(130, 221, 45, .16);
  --red-text: #ff7a71;
  --red-soft: rgba(255, 90, 80, .16);
  --amber-text: #ecc779;
  --amber-soft: rgba(232, 190, 96, .16);
  --focus: rgba(76, 141, 255, .85);

  --shade: 0, 0, 0;
  --line: rgba(255, 255, 255, .07);
  --line-strong: rgba(255, 255, 255, .1);
  --glass-line: rgba(255, 255, 255, .1);
  --glass-line-soft: rgba(255, 255, 255, .07);

  --e1: 0 1px 2px rgba(0, 0, 0, .3), 0 5px 14px rgba(0, 0, 0, .2);
  --e2: 0 1px 3px rgba(0, 0, 0, .32), 0 12px 30px rgba(0, 0, 0, .28);
  --e3: 0 2px 6px rgba(0, 0, 0, .36), 0 22px 50px rgba(0, 0, 0, .42);
  --e-accent: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px rgba(76, 141, 255, .26);
  --e-accent-hover: 0 1px 2px rgba(0, 0, 0, .4), 0 12px 24px rgba(76, 141, 255, .34);
  --e-danger: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 18px rgba(255, 90, 80, .26);
  --edge: inset 0 1px 0 rgba(255, 255, 255, .06);
  --edge-strong: inset 0 1px 0 rgba(255, 255, 255, .09);

  --stage: #090b0c;
  --frame: #000;
  --canvas: #121517;
  --rail-bg: rgba(22, 26, 28, .94);
  --pill-bg: linear-gradient(145deg, rgba(255, 255, 255, .11), rgba(255, 255, 255, .05));
  --pill-inset: inset 0 -1px 0 rgba(0, 0, 0, .2);
  --float-bg: rgba(30, 34, 37, .9);
  --float-inset: inset 0 0 0 1px rgba(255, 255, 255, .04), inset 0 1px 0 rgba(255, 255, 255, .06);
  --surface: linear-gradient(145deg, rgba(29, 33, 36, .98), rgba(25, 29, 31, .96));
  --surface-solid: #1b1f21;
  --groove-bg: rgba(0, 0, 0, .22);
  --groove-inset: inset 0 1px 2px rgba(0, 0, 0, .28);
  --input-bg: rgba(255, 255, 255, .04);
  --hover-bg: rgba(255, 255, 255, .05);
  --press-bg: rgba(255, 255, 255, .08);
  --overlay: rgba(0, 0, 0, .5);

  --hatch-ink: rgba(255, 255, 255, .12);
  --tick: rgba(255, 255, 255, .16);
  --tick-strong: rgba(255, 255, 255, .42);
  --plate-bg: rgba(8, 10, 11, .78);

  --ambient-a: rgba(130, 221, 45, .05);
  --ambient-b: rgba(76, 141, 255, .07);
}

@property --fill { syntax: "<percentage>"; inherits: false; initial-value: 0%; }

/* ── 基础 ───────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  min-width: 320px;
  min-height: 100dvh;
  color: var(--ink);
  background: var(--stage);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
#app { min-height: 100dvh; }
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; padding: 0; cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; }
table { border-collapse: collapse; border-spacing: 0; }
[hidden] { display: none !important; }
::selection { background: var(--blue-soft); }

:focus { outline: none; }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.tnum { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-size: 12px; }
.muted { color: var(--ink-muted); }
.soft { color: var(--ink-soft); }
.faint { color: var(--ink-faint); }
.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;
}

* { scrollbar-width: thin; scrollbar-color: rgba(var(--shade), .18) transparent; }
:root[data-theme="dark"] * { scrollbar-color: rgba(255, 255, 255, .14) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border-radius: 999px; background: rgba(var(--shade), .16); border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-track { background: transparent; }

/* 段落标题：前置一颗带光晕的青柠点 */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 650;
  letter-spacing: -.01em;
  color: var(--ink);
}
.section-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--lime);
  box-shadow: 0 0 0 5px var(--lime-soft);
  flex: none;
}

/* 细颗粒层：打散大面积渐变的色带 */
.grain-layer {
  position: fixed;
  inset: 0;
  z-index: 300;
  pointer-events: none;
  opacity: .032;
  background-image: url("grain.f1639ddad8d5.svg");
  background-size: 180px 180px;
}
:root[data-theme="dark"] .grain-layer { opacity: .045; }
@media (prefers-contrast: more) { .grain-layer { display: none; } }

/* ── 材质 ───────────────────────────────────────────────────── */
.m-rail {
  background: var(--rail-bg);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}
.m-pill {
  border: 1px solid var(--glass-line);
  background: var(--pill-bg);
  box-shadow: var(--e2), var(--edge-strong), var(--pill-inset);
  backdrop-filter: blur(22px) saturate(1.18);
  -webkit-backdrop-filter: blur(22px) saturate(1.18);
}
.m-float {
  border: 1px solid var(--glass-line);
  background: var(--float-bg);
  box-shadow: var(--e3), var(--float-inset);
  backdrop-filter: blur(28px) saturate(1.08);
  -webkit-backdrop-filter: blur(28px) saturate(1.08);
}
.m-surface {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--edge), var(--e1);
}
.m-groove {
  border: 1px solid var(--glass-line-soft);
  background: var(--groove-bg);
  box-shadow: var(--groove-inset);
}
/* 指针光：跟随鼠标的柔光，只是材质 */
.m-glow { --px: 50%; --py: 50%; position: relative; isolation: isolate; }
.m-glow > .glow-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle 140px at var(--px) var(--py), rgba(255, 255, 255, .9), rgba(130, 221, 45, .08) 42%, transparent 72%);
  mix-blend-mode: screen;
  transition: opacity .28s ease;
}
:root[data-theme="dark"] .m-glow > .glow-layer {
  background: radial-gradient(circle 140px at var(--px) var(--py), rgba(255, 255, 255, .07), rgba(130, 221, 45, .05) 42%, transparent 72%);
  mix-blend-mode: normal;
}
@media (hover: hover) { .m-glow:hover > .glow-layer { opacity: .72; } }
@media (pointer: coarse), (prefers-reduced-motion: reduce) { .m-glow > .glow-layer { display: none; } }
@media (prefers-reduced-transparency: reduce) {
  .m-rail, .m-pill, .m-float { backdrop-filter: none; -webkit-backdrop-filter: none; }
  .m-float, .m-rail { background: var(--surface-solid); }
}

/* ── 按钮 ───────────────────────────────────────────────────── */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: var(--control-h);
  padding: 0 15px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 620;
  white-space: nowrap;
  flex: none;
  user-select: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease, box-shadow .2s ease, transform .12s ease;
}
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .5; }
.btn svg { width: 15px; height: 15px; flex: none; }
.btn-sm { height: var(--control-h-sm); padding: 0 11px; font-size: 12.5px; border-radius: var(--r-xs); gap: 5px; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 46px; font-size: 14px; border-radius: var(--r-md); }
.btn-block { width: 100%; }
.btn-primary { color: #fff; background: var(--blue); box-shadow: var(--e-accent); font-weight: 660; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); box-shadow: var(--e-accent-hover); }
.btn-secondary { color: var(--ink); }
.btn-secondary:hover:not(:disabled) { box-shadow: var(--e2), var(--edge-strong), var(--pill-inset), 0 0 0 1px var(--line-strong); }
.btn-ghost { color: var(--ink-muted); }
.btn-ghost:hover:not(:disabled) { color: var(--ink); background: var(--hover-bg); }
.btn-danger { color: #fff; background: var(--red); box-shadow: var(--e-danger); font-weight: 660; }
.btn-danger:hover:not(:disabled) { background: #f14c42; }
.btn-text { color: var(--blue); height: 28px; padding: 0 8px; border-radius: var(--r-xs); font-weight: 600; }
.btn-text:hover:not(:disabled) { background: var(--blue-soft); }
.btn-text.is-danger { color: var(--red-text); }
.btn-text.is-danger:hover:not(:disabled) { background: var(--red-soft); }
.btn-text.is-muted { color: var(--ink-muted); }
.btn-text.is-muted:hover:not(:disabled) { background: var(--hover-bg); color: var(--ink); }
.btn.is-busy { color: transparent !important; }
.btn.is-busy::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #fff;
  border-right-color: transparent;
  animation: spin .7s linear infinite;
}
.btn-secondary.is-busy::after, .btn-text.is-busy::after, .btn-ghost.is-busy::after { border-color: var(--ink-soft); border-right-color: transparent; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--r-xs);
  color: var(--ink-soft);
  flex: none;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn:hover:not(:disabled) { color: var(--ink); background: var(--hover-bg); }
.icon-btn.is-bordered { border: 1px solid var(--line-strong); background: var(--input-bg); box-shadow: var(--edge); }

.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 640;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .72);
  box-shadow: var(--edge);
  white-space: nowrap;
  transition: background .2s ease, box-shadow .25s ease;
}
.pill-btn svg { width: 14px; height: 14px; }
:root[data-theme="dark"] .pill-btn { background: rgba(255, 255, 255, .06); }
.pill-btn:hover:not(:disabled) { box-shadow: var(--edge), var(--e1); }
.pill-btn.is-dark, :root[data-theme="dark"] .pill-btn.is-dark { color: #fff; border-color: transparent; background: var(--blue); box-shadow: var(--e-accent); }
.pill-btn.is-dark:hover:not(:disabled) { background: var(--blue-hover); box-shadow: var(--e-accent-hover); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── 表单 ───────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field-label { font-size: 12px; font-weight: 600; color: var(--ink-muted); }
.field-hint { font-size: 11.5px; color: var(--ink-soft); line-height: 1.6; }
.form-stack { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px 18px; align-items: end; }
.form-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.expiry-hint { margin-top: -6px; }
.expiry-hint.is-warn { color: var(--amber-text); }
.input-shell input[type="date"] { color-scheme: inherit; }

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  height: var(--control-h);
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--input-bg);
  box-shadow: var(--edge);
  color: var(--ink-soft);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.input-shell > svg { width: 16px; height: 16px; flex: none; }
.input-shell:hover { border-color: rgba(var(--shade), .18); }
:root[data-theme="dark"] .input-shell:hover { border-color: rgba(255, 255, 255, .16); }
.input-shell:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; border-color: transparent; }
.input-shell:has(input:read-only:not([type=checkbox])) { background: var(--groove-bg); }
.input-shell:has(:disabled) { opacity: .6; background: var(--groove-bg); }
.input-shell.is-multiline { height: auto; align-items: stretch; padding: 10px 12px; }
.input-shell input, .input-shell textarea, .input-shell select {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.input-shell textarea { resize: vertical; min-height: 180px; line-height: 1.65; }
.input-shell input::placeholder, .input-shell textarea::placeholder { color: var(--ink-faint); }
.input-shell select { appearance: none; -webkit-appearance: none; cursor: pointer; padding-right: 22px; }
.input-shell select option { background: var(--surface-solid); color: var(--ink); }
.input-shell.is-select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  rotate: 45deg;
  pointer-events: none;
}
.input-shell.is-sm { height: var(--control-h-sm); border-radius: var(--r-xs); padding: 0 10px; }

/* 自定义下拉：原生 select 隐藏在外壳内，只负责表单值 */
.input-shell.is-enhanced { padding: 0; cursor: pointer; }
.input-shell.is-enhanced::after { display: none; }
.input-shell.is-enhanced select { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.input-shell.is-open { border-color: transparent; outline: 2px solid var(--focus); outline-offset: 2px; }
.select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0 10px 0 12px;
  border-radius: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.select-trigger:focus-visible { outline: none; }
.input-shell.is-sm .select-trigger { padding: 0 8px 0 10px; font-size: 12.5px; }
.select-value { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 8px; overflow: hidden; white-space: nowrap; }
.select-text { overflow: hidden; text-overflow: ellipsis; }
.select-sub { flex: none; font-size: 12px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.select-caret { width: 15px; height: 15px; flex: none; color: var(--ink-soft); transition: rotate .24s var(--ease-premium), color .2s ease; }
.is-open .select-caret { rotate: 180deg; color: var(--ink); }

.select-menu {
  position: fixed;
  inset: auto;
  z-index: 170;
  margin: 0;
  max-height: min(320px, calc(100dvh - 24px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border-radius: var(--r-md);
  color: var(--ink);
  transform-origin: 50% 0;
  animation: pop-in .22s var(--ease-premium) both;
}
.select-menu.is-up { transform-origin: 50% 100%; animation-name: pop-up; }
@keyframes pop-up { from { opacity: 0; transform: translateY(6px) scale(.96); } }
.select-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 14px 0 8px;
  border-radius: var(--r-xs);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}
.select-option.is-active { background: var(--hover-bg); }
.select-option.is-selected { font-weight: 640; }
.opt-check { display: inline-flex; align-items: center; justify-content: center; width: 18px; flex: none; color: var(--blue); }
.opt-check svg { width: 15px; height: 15px; stroke-width: 2.2; }
.opt-label { flex: 1; min-width: 0; }
.input-shell.is-enhanced input[type="date"] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; pointer-events: none; }
.date-ico { width: 16px; height: 16px; flex: none; color: var(--ink-soft); }

/* 日历浮层 */
.date-menu {
  position: fixed;
  inset: auto;
  z-index: 170;
  margin: 0;
  width: 304px;
  padding: 12px;
  border-radius: var(--r-lg);
  color: var(--ink);
  transform-origin: 50% 0;
  animation: pop-in .22s var(--ease-premium) both;
}
.date-menu.is-up { transform-origin: 50% 100%; animation-name: pop-up; }
.icon-btn-sm { width: 30px; height: 30px; }
.icon-btn-sm svg { width: 16px; height: 16px; }
.icon-btn:disabled { opacity: .35; cursor: not-allowed; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px; }
.cal-title { font-size: 14px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.cal-week, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-week span { padding: 6px 0; text-align: center; font-size: 11px; font-weight: 600; color: var(--ink-faint); }
.day {
  height: 36px;
  border-radius: var(--r-xs);
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  transition: background .15s ease, color .15s ease;
}
.day:hover:not(:disabled):not(.is-selected) { background: var(--hover-bg); }
.day.is-other { color: var(--ink-muted); font-weight: 500; }
.day:disabled { color: var(--ink-faint); font-weight: 400; opacity: .38; cursor: not-allowed; }
.day.is-today { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.day.is-selected { color: #fff; font-weight: 700; background: var(--blue); box-shadow: var(--e-accent); }
.day:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; }
.cal-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.cal-foot .spacer { flex: 1; }
.cal-chip {
  height: 28px;
  padding: 0 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 620;
  color: var(--ink-muted);
  border: 1px solid var(--line-strong);
  background: var(--input-bg);
  transition: color .2s ease, border-color .2s ease, background .2s ease;
}
.cal-chip:hover { color: var(--blue); border-color: var(--blue); background: var(--blue-soft); }
.opt-sub { margin-left: 18px; font-size: 12px; font-weight: 500; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.input-shell.is-sm select { font-size: 12.5px; }
.input-shell.is-sm.is-select::after { right: 11px; }

/* 表单错误：空时不占位 */
.error:empty { display: none; }
.error, .form-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-sm);
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--red-text);
  background: var(--red-soft);
  overflow-wrap: anywhere;
}

/* 开关：轨道从灰「注满」青柠 */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; user-select: none; font-size: 13px; color: var(--ink-muted); position: relative; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  --fill: 0%;
  position: relative;
  width: 38px;
  height: 22px;
  border-radius: 999px;
  flex: none;
  background: linear-gradient(90deg, var(--lime) var(--fill), rgba(var(--shade), .14) var(--fill));
  box-shadow: inset 0 1px 2px rgba(var(--shade), .14);
  transition: --fill .32s var(--ease-premium);
}
:root[data-theme="dark"] .switch-track { background: linear-gradient(90deg, var(--lime) var(--fill), rgba(255, 255, 255, .14) var(--fill)); }
.switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 20, 24, .22), 0 2px 6px rgba(16, 20, 24, .1);
  transition: translate .32s var(--ease-premium);
}
.switch input:checked + .switch-track { --fill: 100%; }
.switch input:checked + .switch-track .switch-knob { translate: 16px 0; }
.switch input:focus-visible + .switch-track { outline: 2px solid var(--focus); outline-offset: 3px; }

/* 分段选择器 */
.segmented { position: relative; display: inline-flex; padding: 3px; border-radius: var(--r-sm); flex: none; }
.segmented label { position: relative; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; width: 0; height: 0; }
.segmented span {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 13px;
  border-radius: var(--r-xs);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
  white-space: nowrap;
  border: 1px solid transparent;
  transition: color .2s ease, background .2s ease, box-shadow .2s ease;
}
.segmented label:hover span { color: var(--ink); }
.segmented input:checked + span { color: var(--ink); border-color: var(--glass-line); background: var(--pill-bg); box-shadow: var(--e1), var(--edge-strong); }
.segmented input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ── 标签与头像 ─────────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink-muted);
  background: rgba(var(--shade), .065);
  vertical-align: middle;
}
:root[data-theme="dark"] .tag { background: rgba(255, 255, 255, .07); }
.tag-dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; flex: none; }
.tag.tone-ok { color: var(--leaf-text); background: var(--lime-soft); }
.tag.tone-ok .tag-dot { background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
.tag.tone-info { color: var(--blue); background: var(--blue-soft); }
.tag.tone-warn { color: var(--amber-text); background: var(--amber-soft); }
.tag.tone-danger { color: var(--red-text); background: var(--red-soft); }
.tag.tone-neutral .tag-dot { background: var(--ink-faint); }

.avatar {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  flex: none;
  font-size: 13px;
  font-weight: 680;
  color: #fff;
  background: linear-gradient(145deg, var(--h1, #4c8dff), var(--h2, #236de9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28), 0 1px 2px rgba(var(--shade), .12);
}
.avatar.is-lg { width: 44px; height: 44px; border-radius: 14px; font-size: 17px; }
.avatar:has(> img[data-game-avatar]) { border-radius: 0; }
.avatar > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }

/* ── 面板 ───────────────────────────────────────────────────── */
.panel { border-radius: var(--r-lg); min-width: 0; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.panel-meta { font-size: 12px; color: var(--ink-soft); font-weight: 500; }
.panel-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-body { padding: 0 20px 20px; }
.panel-body > p, .panel-note { font-size: 12.5px; line-height: 1.75; color: var(--ink-muted); }
.panel-body > p + p { margin-top: 8px; }
.notes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.notes li { position: relative; padding-left: 16px; font-size: 12.5px; line-height: 1.7; color: var(--ink-muted); }
.notes li::before { content: ""; position: absolute; left: 2px; top: .68em; width: 5px; height: 5px; border-radius: 999px; background: var(--ink-faint); }

/* ── 表格 ───────────────────────────────────────────────────── */
.table-wrap { position: relative; overflow-x: auto; overflow-y: clip; }
.table { width: 100%; min-width: 680px; font-size: 13px; }
.table th {
  height: 40px;
  padding: 0 var(--cell-px);
  text-align: left;
  font-size: 12px;
  font-weight: 620;
  color: var(--ink-soft);
  white-space: nowrap;
  background: var(--surface-solid);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.table td {
  height: var(--row-h);
  padding: 8px var(--cell-px);
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  vertical-align: middle;
  white-space: nowrap;
}
.table tbody tr { transition: background .15s ease; }
.table tbody tr:hover { background: var(--hover-bg); }
.table tbody tr:last-child td { border-bottom: 0; }
.table .col-actions { text-align: right; width: 1%; }
.table th.col-actions, .table td.col-actions { position: sticky; right: 0; z-index: 1; background: var(--surface-solid); box-shadow: inset 1px 0 0 var(--line); }
.table tbody tr:hover td.col-actions { background: linear-gradient(var(--hover-bg), var(--hover-bg)), var(--surface-solid); }
.table.is-compact { min-width: 520px; }
.row-actions { display: inline-flex; align-items: center; justify-content: flex-end; gap: 2px; }
.cell-main { display: flex; align-items: center; gap: 11px; min-width: 0; }
.cell-title { font-weight: 620; color: var(--ink); }
.cell-sub { font-size: 12px; color: var(--ink-soft); margin-top: 1px; }
.cell-wrap { white-space: normal; overflow-wrap: anywhere; min-width: 220px; }
.code-chip {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--ink-muted);
  background: rgba(var(--shade), .06);
  white-space: nowrap;
}
:root[data-theme="dark"] .code-chip { background: rgba(255, 255, 255, .06); }
.mono-time { font-family: var(--font-mono); font-size: 12px; color: var(--ink-muted); }
.panel-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}
.panel-foot b { color: var(--ink); font-weight: 650; }

/* ── 代码块与键值 ───────────────────────────────────────────── */
.code-block {
  margin: 0;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink);
  border: 1px solid var(--line-strong);
  background: var(--groove-bg);
  box-shadow: var(--groove-inset);
  overflow-wrap: anywhere;
  word-break: break-all;
  white-space: pre-wrap;
}
:root[data-theme="dark"] .code-block { color: #d9e1e4; background: rgba(0, 0, 0, .3); }
.copy-row { display: flex; align-items: stretch; gap: 10px; }
.copy-row .code-block { flex: 1; min-width: 0; display: flex; align-items: center; }
.copy-row > .btn { height: auto; min-height: var(--control-h); flex: none; }
.kv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border-radius: var(--r-md); overflow: hidden; background: var(--line); border: 1px solid var(--line); }
.kv { padding: 12px 14px; background: var(--surface-solid); min-width: 0; }
.kv-label { font-size: 11px; font-weight: 600; color: var(--ink-soft); margin-bottom: 4px; }
.kv-value { font-size: 13px; color: var(--ink); overflow-wrap: anywhere; }
/* 公告 Markdown 正文 */
.md { font-size: 13.5px; line-height: 1.85; color: var(--ink-muted); overflow-wrap: anywhere; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 10px; }
.md h3, .md h4, .md h5, .md h6 { margin: 16px 0 6px; color: var(--ink); font-weight: 680; line-height: 1.4; }
.md h3 { font-size: 16px; }
.md h4 { font-size: 14.5px; }
.md h5, .md h6 { font-size: 13.5px; }
.md strong { color: var(--ink); font-weight: 680; }
.md ul, .md ol { padding-left: 1.4em; }
.md li + li { margin-top: 2px; }
.md a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.md code { font-family: var(--font-mono); font-size: .92em; padding: 1px 5px; border-radius: 5px; background: var(--groove-bg); color: var(--ink); }
.md pre { padding: 10px 12px; border-radius: var(--r-sm); background: var(--groove-bg); overflow-x: auto; }
.md pre code { padding: 0; background: none; white-space: pre; }
.md blockquote { padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: var(--ink-soft); }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 14px 0; }
.bodytext, .release-notes { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.85; font-size: 13.5px; color: var(--ink-muted); }

/* ── 空态与加载 ─────────────────────────────────────────────── */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 44px 16px;
  font-size: 13px;
  color: var(--ink-soft);
  text-align: center;
}
.empty-ico { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: var(--r-md); color: var(--ink-faint); }
.empty-ico svg { width: 20px; height: 20px; }
.empty-title { font-weight: 640; font-size: 14px; color: var(--ink-muted); }
.empty-actions { margin-top: 8px; }
.loading { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 80px 16px; color: var(--ink-soft); }
.loading::before { content: ""; width: 16px; height: 16px; border-radius: 999px; border: 2px solid var(--line-strong); border-top-color: var(--blue); animation: spin .8s linear infinite; }
.fail-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 20px; border-radius: var(--r-lg); color: var(--red-text); }

/* 首次读取保留页面结构，重复导航直接使用当前会话的短期缓存。 */
.placeholder-heading { margin: 0 0 28px; }
.placeholder-heading h1 { color: var(--ink); font-size: 28px; font-weight: 740; letter-spacing: -.035em; }
.placeholder-heading span { display: block; margin-top: 8px; color: var(--ink-soft); }
.placeholder-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.placeholder-card { display: grid; gap: 20px; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.placeholder-card.is-wide { grid-column: 1/-1; gap: 24px; }
.placeholder-card i, .placeholder-card b { display: block; height: 12px; width: 65%; border-radius: 5px; background: var(--groove-bg); }
.placeholder-card b { height: 34px; width: 38%; }
.placeholder-card i:last-child { width: 85%; }
.placeholder-card.is-wide i { width: 100%; }
.health-dot.is-offline { background: var(--amber-text); box-shadow: none; }

/* 服务暂不可用：网页与服务器状态分开说明，重试不丢失当前会话。 */
.service-page { min-height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); padding: 28px clamp(20px, 5vw, 72px); }
.service-header { display: flex; align-items: center; justify-content: space-between; }
.service-header .brand-name { color: var(--ink); font-size: 17px; }
.service-header .brand-sub { color: var(--ink-soft); }
.service-center { flex: 1; display: grid; place-items: center; padding: 56px 0; }
.service-card { width: min(100%, 610px); margin: 36px auto; border-radius: 28px; padding: clamp(28px, 5vw, 48px); text-align: center; }
.service-center .service-card { margin: 0; }
.service-symbol { display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 24px; border-radius: 21px; color: var(--blue); background: var(--blue-soft); box-shadow: inset 0 1px 0 var(--glass-line-soft); }
.service-symbol svg { width: 30px; height: 30px; stroke-width: 1.5; }
.service-card .eyebrow { font-size: 11px; color: var(--ink-soft); letter-spacing: .12em; }
.service-card h1 { margin: 10px 0 14px; color: var(--ink); font-size: clamp(25px, 3vw, 34px); font-weight: 750; letter-spacing: -.04em; line-height: 1.25; }
.service-description { max-width: 400px; margin: 0 auto; color: var(--ink-muted); font-size: 14px; line-height: 1.85; text-wrap: pretty; }
.service-route { display: flex; align-items: center; justify-content: center; margin: 32px 0; padding: 24px 20px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--hover-bg); }
.service-route > div { width: 110px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.service-node { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 5px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); }
.service-node.is-ready { color: var(--leaf-text); }
.service-node.is-waiting { color: var(--amber-text); }
.service-route strong { color: var(--ink-muted); font-size: 12px; font-weight: 650; }
.service-route small { color: var(--ink-soft); font-size: 11px; }
.service-route-line { width: 75px; align-self: flex-start; margin: 18px 5px 0; border-top: 2px dashed var(--line-strong); }
.service-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.service-actions .btn { min-height: 42px; padding-inline: 20px; }
.service-retry { margin-top: 16px; color: var(--ink-soft); font-size: 12px; min-height: 18px; }
.service-details { margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink-soft); text-align: left; font-size: 11px; line-height: 1.8; overflow-wrap: anywhere; }
.service-details summary { width: fit-content; margin-inline: auto; cursor: pointer; }
.service-details p { margin-top: 10px; }
.service-page > footer { color: var(--ink-faint); font-size: 11px; text-align: center; padding: 8px 0; }
@media (max-width: 600px) {
  .placeholder-grid { grid-template-columns: 1fr; }
  .placeholder-card { padding: 22px; }
  .service-page { padding: 20px 16px; }
  .service-center { padding: 36px 0; }
  .service-card { padding: 30px 22px; border-radius: 22px; }
  .service-route { padding: 20px 8px; }
  .service-route-line { width: 45px; }
}

/* ── 弹窗 ───────────────────────────────────────────────────── */
dialog.modal {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-xl);
  color: var(--ink);
  background: var(--surface-solid);
  box-shadow: var(--edge), var(--e3);
  overflow: auto;
}
dialog.modal::backdrop { background: var(--overlay); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
dialog.modal[open] { animation: modal-in .32s var(--ease-premium) both; }
dialog.modal[open]::backdrop { animation: fade-in .2s ease both; }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.97); } }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 22px 22px 4px; }
.modal-title { font-size: 17px; font-weight: 720; letter-spacing: -.015em; }
.modal-sub { font-size: 12.5px; color: var(--ink-soft); margin-top: 4px; line-height: 1.6; }
.modal-body { padding: 16px 22px 22px; }
.modal-body > p { font-size: 12.5px; line-height: 1.7; color: var(--ink-muted); }
.modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); }
.confirm-body { display: flex; gap: 14px; align-items: flex-start; padding: 24px 22px 18px; }
.confirm-icon { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: var(--r-sm); flex: none; color: var(--blue); background: var(--blue-soft); }
.confirm-icon svg { width: 18px; height: 18px; }
.confirm-icon.is-danger { color: var(--red-text); background: var(--red-soft); }
.confirm-title { font-size: 15px; font-weight: 700; }
.confirm-text { margin-top: 4px; font-size: 13px; color: var(--ink-muted); line-height: 1.7; }

/* ── 轻提示 ─────────────────────────────────────────────────── */
#notice {
  position: fixed;
  /* 重置 popover 默认的 inset 与 margin；边框和背景沿用 .m-float */
  inset: auto auto 28px 50%;
  margin: 0;
  overflow: visible;
  left: 50%;
  bottom: 28px;
  z-index: 400;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  min-height: 44px;
  padding: 10px 18px 10px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink);
  translate: -50% 0;
  pointer-events: none;
  opacity: 0;
  transform: translateY(14px) scale(.96);
  transition: opacity .2s ease, transform .42s var(--ease-premium);
  overflow-wrap: anywhere;
}
#notice.is-visible { opacity: 1; transform: none; pointer-events: auto; }
#notice::before { content: ""; width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
#notice.tone-ok::before { background: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft); }
#notice.tone-danger::before { background: var(--red); box-shadow: 0 0 0 4px var(--red-soft); }

/* ── 仪器：读数、铭牌、刻度尺 ───────────────────────────────── */
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em; color: var(--ink-faint); white-space: nowrap; }
.metric { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.metric-figure { display: inline-flex; align-items: flex-start; gap: 6px; font-weight: 720; letter-spacing: -.045em; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; }
.metric-xl .metric-figure { font-size: var(--fs-display-xl); }
.metric-l .metric-figure { font-size: var(--fs-display-l); }
.metric-m .metric-figure { font-size: var(--fs-display-m); letter-spacing: -.035em; }
.metric-unit { position: relative; top: .14em; font-size: .3em; font-weight: 640; letter-spacing: 0; color: var(--ink-soft); }
.metric-l .metric-unit, .metric-m .metric-unit { font-size: .4em; }

.ruler { position: relative; height: 30px; --ruler-major: 4; --ruler-minor: 5; }
.ruler-ticks {
  position: absolute;
  inset: 0 0 auto 0;
  height: 8px;
  background:
    linear-gradient(90deg, var(--tick-strong) 1px, transparent 1px) 0 0 / calc(100% / var(--ruler-major) - .01px) 8px repeat-x,
    linear-gradient(90deg, var(--tick) 1px, transparent 1px) 0 0 / calc(100% / var(--ruler-major) / var(--ruler-minor) - .01px) 4px repeat-x;
}
.ruler-ticks::after { content: ""; position: absolute; right: 0; top: 0; width: 1px; height: 8px; background: var(--tick-strong); }
.ruler-fill { position: absolute; left: 0; top: 0; height: 8px; background: var(--hatch); border-radius: 2px; transform-origin: left; animation: grow-x .9s var(--ease-premium) both; }
.ruler-labels { position: absolute; inset: 13px 0 0 0; }
.ruler-labels span { position: absolute; translate: -50% 0; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); white-space: nowrap; }
.ruler-labels span:first-child { translate: 0 0; }
.ruler-labels span:last-child { translate: -100% 0; }
.ruler-marker { position: absolute; top: -2px; width: 2px; height: 12px; margin-left: -1px; border-radius: 2px; background: var(--lime); box-shadow: 0 0 0 3px var(--lime-soft); }
@keyframes grow-x { from { transform: scaleX(0); } }

.readouts { margin: 0; display: grid; grid-template-columns: repeat(3, auto); justify-content: start; gap: 4px 26px; padding-top: 14px; border-top: 1px solid var(--line-strong); }
.readouts dt { font-size: 11px; color: var(--ink-faint); }
.readouts dd { margin: 3px 0 0; font-size: 15px; font-weight: 680; font-variant-numeric: tabular-nums; }

/* ── 外壳 ───────────────────────────────────────────────────── */
.stage { position: relative; min-height: 100dvh; padding: 8px; overflow: clip; background: var(--stage); }
.app-frame {
  position: relative;
  height: calc(100dvh - 16px);
  min-height: 560px;
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  overflow: clip;
  border: 1px solid var(--glass-line);
  border-radius: 28px;
  background:
    radial-gradient(55% 45% at 92% 0%, var(--ambient-a), transparent 70%),
    radial-gradient(45% 40% at 20% 100%, var(--ambient-b), transparent 70%),
    var(--canvas);
  box-shadow: 0 18px 50px rgba(var(--shade), .12), 0 2px 8px rgba(var(--shade), .08);
  transition: grid-template-columns .42s var(--ease-premium);
}
.app-frame.is-collapsed { --rail-w: 76px; }

.rail { position: relative; z-index: 5; display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line-strong); }
.rail-brand { display: flex; align-items: center; gap: 11px; height: var(--topbar-h); padding: 0 18px; flex: none; }
.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  flex: none;
}
/* 图标本身是透明背景，浅色和深色模式下都直接显示。 */
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { min-width: 0; }
.brand-name { font-size: 15px; font-weight: 720; letter-spacing: -.02em; white-space: nowrap; }
.brand-sub { font-size: 10px; letter-spacing: .08em; color: var(--ink-soft); white-space: nowrap; }
.nav-close { display: none; margin-left: auto; }

.rail-nav { position: relative; flex: 1; min-height: 0; overflow-y: auto; overflow-x: clip; padding: 8px 12px 16px; }
.nav-group + .nav-group { margin-top: 8px; }
.nav-group-title { padding: 6px 10px; font-size: 11px; font-weight: 650; letter-spacing: .06em; color: var(--ink-faint); white-space: nowrap; }
.nav-list { position: relative; display: flex; flex-direction: column; gap: 2px; }
.nav-thumb {
  position: absolute;
  left: 12px;
  right: 12px;
  top: 0;
  height: 38px;
  border-radius: var(--r-sm);
  z-index: 0;
  pointer-events: none;
  opacity: 0;
  transition: transform .46s var(--ease-premium), opacity .2s ease;
}
.nav-thumb.is-ready { opacity: 1; }
.nav-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-muted);
  text-align: left;
  white-space: nowrap;
  transition: color .2s ease, background-color .2s ease;
}
.nav-ico { width: 18px; height: 18px; flex: none; color: var(--ink-soft); transition: color .2s ease; }
.nav-item:hover { color: var(--ink); }
.nav-item:hover:not(.is-active) { background: var(--hover-bg); }
.nav-item:hover .nav-ico { color: var(--ink-muted); }
.nav-item.is-active:hover .nav-ico { color: var(--blue); }
.nav-item.is-active { color: var(--ink); font-weight: 650; }
.nav-item.is-active .nav-ico { color: var(--blue); }
.nav-item:focus-visible { outline-offset: -2px; }
.nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.update-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--red); box-shadow: 0 0 0 3px var(--red-soft); flex: none; }

.rail-foot { display: flex; align-items: center; gap: 9px; padding: 12px 22px 16px; border-top: 1px solid var(--line); flex: none; font-size: 11.5px; color: var(--ink-soft); white-space: nowrap; }
.health-dot { width: 8px; height: 8px; border-radius: 999px; flex: none; background: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft); }

.app-frame.is-collapsed .brand-text,
.app-frame.is-collapsed .nav-label,
.app-frame.is-collapsed .nav-group-title,
.app-frame.is-collapsed .rail-foot span:not(.health-dot) { display: none; }
.app-frame.is-collapsed .rail-brand { padding: 0; justify-content: center; }
.app-frame.is-collapsed .nav-item { justify-content: center; padding: 0; }
.app-frame.is-collapsed .nav-item .update-dot { position: absolute; top: 8px; right: 12px; }
.app-frame.is-collapsed .nav-group + .nav-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.app-frame.is-collapsed .rail-foot { justify-content: center; padding: 16px 0; }

.workspace { position: relative; min-width: 0; min-height: 0; display: grid; grid-template-rows: var(--topbar-h) minmax(0, 1fr); }
.topbar { position: relative; z-index: 2; display: flex; align-items: center; gap: 10px; padding: 0 18px 0 14px; border-bottom: 1px solid var(--line); min-width: 0; }
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0;
  background: var(--rail-bg);
  box-shadow: 0 1px 0 var(--line-strong), 0 10px 26px rgba(var(--shade), .07);
  transition: opacity .3s ease;
}
.workspace.is-scrolled .topbar::before { opacity: 1; }
.topbar .spacer { flex: 1; }
.crumbs { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--ink-soft); min-width: 0; white-space: nowrap; }
.crumbs svg { width: 12px; height: 12px; color: var(--ink-faint); }
.crumb-current { color: var(--ink); font-weight: 620; overflow: hidden; text-overflow: ellipsis; }

.user-chip { display: inline-flex; align-items: center; gap: 9px; height: 40px; padding: 0 10px 0 4px; border-radius: 999px; transition: background .2s ease; }
.user-chip:hover, .user-chip[aria-expanded="true"] { background: var(--hover-bg); }
.user-meta { display: flex; flex-direction: column; text-align: left; }
.user-name { font-size: 12.5px; font-weight: 640; line-height: 1.25; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--ink-soft); line-height: 1.25; }
.user-chip > svg { width: 14px; height: 14px; color: var(--ink-soft); }

.menu-pop { position: fixed; z-index: 150; min-width: 230px; padding: 6px; border-radius: var(--r-md); animation: pop-in .26s var(--ease-premium) both; transform-origin: 100% 0; }
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(.96); } }
.menu-head { padding: 10px 10px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head b { display: block; font-weight: 680; }
.menu-head span { font-size: 12px; color: var(--ink-soft); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px; border-radius: var(--r-xs); font-size: 13px; color: var(--ink); text-align: left; transition: background .15s ease, color .15s ease; }
.menu-item svg { width: 16px; height: 16px; color: var(--ink-soft); }
.menu-item:hover, .menu-item:focus-visible { background: var(--hover-bg); outline: none; }
.menu-item.is-danger, .menu-item.is-danger svg { color: var(--red-text); }

.content { position: relative; min-height: 0; overflow-y: auto; overflow-x: clip; overscroll-behavior: contain; }
.page { padding: 26px 28px 48px; max-width: 1480px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head-main { min-width: 0; display: flex; flex-direction: column; }
.page-date { display: block; margin-bottom: 8px; font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .04em; color: var(--ink-faint); }
.page-title { font-size: 28px; font-weight: 740; line-height: 1.15; letter-spacing: -.03em; text-wrap: balance; overflow-wrap: anywhere; }
.page-desc { margin-top: 6px; max-width: 680px; font-size: 13px; color: var(--ink-muted); text-wrap: pretty; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.cols-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }

/* 入场级联：阅读序依次浮现 */
.reveal { animation: reveal .56s var(--ease-premium) both; animation-delay: calc(var(--i, 0) * 70ms); }
@keyframes reveal { from { opacity: 0; transform: translateY(10px); } }
.no-reveal .reveal, .no-reveal .ruler-fill, .no-reveal .quota-bar i { animation: none; }

.nav-backdrop { display: none; }

/* ── 登录 ───────────────────────────────────────────────────── */
/* 整页一块画布：网格、光晕和节点连线铺满，左侧介绍与右侧登录卡浮在同一块背景上。
   浅色为珍珠白面 + 青柠光晕，深色为深色面 */
.login {
  --cv-bg: linear-gradient(150deg, #f1f7ec, #f7f9f8 48%, #edf2f1);
  --cv-ink: var(--ink);
  --cv-text: var(--ink-muted);
  --cv-soft: var(--ink-soft);
  --cv-faint: var(--ink-faint);
  --cv-grid: rgba(var(--shade), .055);
  --cv-glow-a: rgba(130, 221, 45, .26);
  --cv-glow-b: rgba(35, 109, 233, .1);
  --cv-glow-c: rgba(255, 255, 255, .85);
  --cv-tick: rgba(var(--shade), .16);
  --cv-tick-major: rgba(var(--shade), .32);
  --cv-tick-on: #6cc425;
  /* 节点连线颜色（RGB 三元组，由脚本读取） */
  --net-line: 46, 58, 62;
  --net-line-alpha: .2;
  --net-node: 46, 58, 62;
  --net-node-alpha: .38;
  --net-accent: 98, 178, 34;
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(400px, 1fr);
  overflow: clip;
  color: var(--cv-ink);
  background: var(--cv-bg);
}
:root[data-theme="dark"] .login {
  --cv-bg: linear-gradient(150deg, #0e1213, #0f1214 50%, #0c0f11);
  --cv-ink: #fff;
  --cv-text: rgba(255, 255, 255, .62);
  --cv-soft: rgba(255, 255, 255, .5);
  --cv-faint: rgba(255, 255, 255, .36);
  --cv-grid: rgba(255, 255, 255, .045);
  --cv-glow-a: rgba(130, 221, 45, .2);
  --cv-glow-b: rgba(76, 141, 255, .18);
  --cv-glow-c: rgba(76, 141, 255, .09);
  --cv-tick: rgba(255, 255, 255, .16);
  --cv-tick-major: rgba(255, 255, 255, .3);
  --cv-tick-on: var(--lime);
  --net-line: 255, 255, 255;
  --net-line-alpha: .16;
  --net-node: 255, 255, 255;
  --net-node-alpha: .5;
  --net-accent: 150, 230, 80;
}
.canvas-grid {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    linear-gradient(var(--cv-grid) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, var(--cv-grid) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: radial-gradient(85% 80% at 45% 48%, #000 30%, transparent 100%);
  mask-image: radial-gradient(85% 80% at 45% 48%, #000 30%, transparent 100%);
}
.canvas-glow {
  position: absolute;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(28% 40% at 42% 46%, var(--cv-glow-a), transparent 70%),
    radial-gradient(30% 40% at 8% 96%, var(--cv-glow-b), transparent 70%),
    radial-gradient(26% 42% at 79% 50%, var(--cv-glow-c), transparent 72%);
}
.neural-net { position: absolute; inset: 0; z-index: -1; width: 100%; height: 100%; pointer-events: none; }
.login-canvas { display: flex; flex-direction: column; min-width: 0; min-height: 100dvh; padding: 40px 0 32px 48px; }
.login-brand { display: flex; align-items: center; gap: 12px; }
.login-brand .brand-name { font-size: 16px; color: var(--cv-ink); }
.login-brand .brand-sub { color: var(--cv-soft); }
.login-canvas .eyebrow { color: var(--cv-soft); }
.canvas-main { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px; padding: 40px 0 24px; }
.canvas-copy { display: flex; flex-direction: column; gap: 18px; max-width: 600px; min-width: 0; }
.login-title { display: flex; flex-direction: column; font-size: clamp(34px, 3.5vw, 58px); font-weight: 760; line-height: 1.1; letter-spacing: -.04em; color: var(--cv-ink); }
.login-title span { white-space: nowrap; }
.login-lead { max-width: 460px; font-size: 14.5px; line-height: 1.75; color: var(--cv-text); text-wrap: pretty; }
.login-dial { position: relative; width: clamp(200px, 21vw, 290px); aspect-ratio: 1; flex: none; }
.login-dial svg { width: 100%; height: 100%; overflow: visible; }
.dial-tick { stroke: var(--cv-tick); stroke-width: .7; stroke-linecap: round; transition: stroke .35s ease; }
.dial-tick.is-major { stroke-width: 1.1; stroke: var(--cv-tick-major); }
.dial-tick.is-on { stroke: var(--cv-tick-on); }
.dial-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.dial-time { font-family: var(--font-mono); font-size: clamp(24px, 2.6vw, 34px); font-weight: 650; letter-spacing: -.02em; color: var(--cv-ink); font-variant-numeric: tabular-nums; }
.dial-date { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: var(--track-eyebrow); color: var(--cv-soft); }
.login-foot { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .06em; color: var(--cv-faint); }

.login-side { position: relative; display: grid; place-items: center; padding: 32px clamp(20px, 4vw, 64px); perspective: 1200px; }
.login-side > .icon-btn { position: absolute; top: 18px; right: 18px; z-index: 2; }
.login-card-wrap { position: relative; z-index: 1; width: 100%; max-width: 420px; }
.login-card { position: relative; width: 100%; border-radius: var(--r-xl); transform-style: preserve-3d; transition: transform .5s var(--ease-premium); }
.login-card-inner { position: relative; z-index: 1; padding: 32px 32px 28px; }
.login-card-title { margin-top: 8px; font-size: 26px; font-weight: 740; letter-spacing: -.03em; }
.login-card-sub { margin-top: 6px; font-size: 13px; line-height: 1.65; color: var(--ink-soft); }
.login-card form { margin-top: 24px; }
.login-card .input-shell { height: 42px; }
.login-card .btn-primary { margin-top: 6px; }
.captcha-row { display: flex; gap: 10px; min-width: 0; }
.captcha-row .input-shell { flex: 1; }
.captcha-img { flex: none; width: 126px; height: var(--control-h); padding: 0; overflow: hidden; border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: #f4f5f8; box-shadow: var(--edge); cursor: pointer; transition: border-color .2s ease, opacity .2s ease; }
.captcha-img:hover { border-color: rgba(var(--shade), .18); opacity: .88; }
.captcha-img:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.captcha-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
.login-card .captcha-img { height: 42px; }
.code-send { flex: none; min-width: 104px; }
.cols-2.is-stretch { align-items: stretch; }
.switch-row { display: flex; flex-wrap: wrap; gap: 12px 28px; }
.popup-body { max-height: min(52vh, 440px); overflow: auto; }
.popup-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 18px -22px -22px; padding: 14px 22px; border-top: 1px solid var(--line); }
.popup-foot .spacer { flex: 1; }
.profile-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.profile-id { flex: 1; min-width: 200px; }
.profile-name { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 700; color: var(--ink); overflow-wrap: anywhere; }
.profile-sub { margin-top: 4px; font-size: 12.5px; color: var(--ink-soft); overflow-wrap: anywhere; }
.profile-name-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; row-gap: 0; width: min(100%, 400px); }
.profile-name-form .field { flex: 1; min-width: 0; }
.profile-name-form .error { flex-basis: 100%; }
.profile-name-form .error:empty { display: none; }
.test-mail-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.settings-form > .form-actions { justify-content: flex-end; }
/* 设置页的输入框顶端对齐，说明文字长短不同时不会把输入框顶高。 */
.settings-form .form-grid { align-items: start; }
.backup-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
.backup-grid > * { min-width: 0; }
.backup-grid > div { display: grid; }
.backup-grid .span-2 { grid-column: span 2; }
@media (max-width: 820px) {
  .backup-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .backup-grid { grid-template-columns: minmax(0, 1fr); }
  .backup-grid .span-2 { grid-column: auto; }
}
.smtp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px 18px; align-items: start; }
.smtp-grid > div { display: grid; min-width: 0; }
.smtp-grid .span-2 { grid-column: span 2; }
.smtp-grid .span-3 { grid-column: 1 / -1; }
@media (max-width: 820px) {
  .smtp-grid { grid-template-columns: minmax(0, 1fr); }
  .smtp-grid .span-2 { grid-column: auto; }
}
.login-card .code-send { height: 42px; }
.login-forgot { display: flex; justify-content: flex-end; margin: -10px 0 -6px; }
.login-switch { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 18px; font-size: 12.5px; color: var(--ink-soft); }
.login-mobile-brand { display: none; }

/* ── 工作台 · Bento ─────────────────────────────────────────── */
.bento-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.bento {
  position: relative;
  min-width: 0;
  padding: 20px 22px;
  border-radius: var(--r-xl);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  box-shadow: var(--edge), var(--e1);
}
.bento > :not(.glow-layer) { position: relative; z-index: 1; }
.bento-hero {
  grid-column: span 8;
  grid-row: span 2;
  display: flex;
  flex-direction: column;
  gap: 18px;
  overflow: hidden;
  border-color: var(--glass-line);
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(130, 221, 45, .26), transparent 58%),
    radial-gradient(90% 80% at 100% 100%, rgba(255, 255, 255, .9), transparent 60%),
    linear-gradient(150deg, #eef8e2, #f8fbf6 55%, #fbfcfb);
  box-shadow: var(--edge-strong), var(--e2);
}
:root[data-theme="dark"] .bento-hero {
  background:
    radial-gradient(120% 90% at 0% 0%, rgba(130, 221, 45, .16), transparent 58%),
    linear-gradient(150deg, #1b2316, #171b1c 60%, #15191a);
}
.bento-side { grid-column: span 4; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; min-height: 176px; }
.bento-wide { grid-column: span 7; }
.bento-narrow { grid-column: span 5; }
.bento-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.bento-meta { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); white-space: nowrap; padding-top: 3px; }
.hero-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.hero-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.hero-figure { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero-sub { font-size: 12.5px; color: var(--ink-muted); }
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.side-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.side-label { font-size: 12.5px; font-weight: 600; color: var(--ink-soft); }
.side-ico { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-xs); color: var(--ink-soft); }
.side-ico svg { width: 16px; height: 16px; }
.side-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; min-width: 0; }
.side-foot > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.feed { display: flex; flex-direction: column; }
.feed-item { padding: 14px 0; border-top: 1px solid var(--line); min-width: 0; }
.feed-item:first-child { border-top: 0; padding-top: 2px; }
.feed-item h3 { font-size: 13.5px; font-weight: 650; overflow-wrap: anywhere; }
.feed-item p { margin-top: 5px; font-size: 12.5px; line-height: 1.7; color: var(--ink-muted); white-space: pre-line; overflow-wrap: anywhere; }
.feed-item time { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }
.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.timeline li { position: relative; display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; padding-bottom: 14px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 14px; bottom: 0; width: 1px; background: var(--line-strong); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 9px; height: 9px; margin: 4px 0 0 2px; border-radius: 999px; background: var(--surface-solid); border: 2px solid var(--blue); }
.timeline li:first-child .dot { border-color: var(--lime); box-shadow: 0 0 0 4px var(--lime-soft); }
.timeline .t-main { font-size: 12.5px; color: var(--ink); overflow-wrap: anywhere; }
.timeline .t-time { font-family: var(--font-mono); font-size: 11px; color: var(--ink-faint); }

/* ── 网易账号 ───────────────────────────────────────────────── */
.account-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.account-card { display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--r-xl); transition: box-shadow .25s ease, border-color .25s ease; }
.account-card.is-selected { border-color: transparent; box-shadow: 0 0 0 2px var(--blue), var(--e2); }
.account-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.account-title { display: flex; gap: 12px; align-items: center; min-width: 0; }
.account-title h2 { font-size: 16px; font-weight: 700; letter-spacing: -.01em; overflow-wrap: anywhere; }
.account-meta { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--r-md); font-size: 12.5px; color: var(--ink-muted); overflow-wrap: anywhere; }
.account-meta small { font-size: 11.5px; color: var(--ink-soft); }
.account-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; }
.account-actions .spacer { flex: 1; }
.quota { display: inline-flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-soft); }
.quota-bar { position: relative; width: 120px; height: 6px; border-radius: 999px; background: var(--hover-bg); overflow: hidden; }
.quota-bar i { position: absolute; inset: 0 auto 0 0; border-radius: inherit; background: var(--blue); transform-origin: left; animation: grow-x .9s var(--ease-premium) both; }
.quota b { color: var(--ink); font-weight: 680; font-variant-numeric: tabular-nums; }

/* ── 安全验证提示 ───────────────────────────────────────────── */
.verification-notice:not([hidden]) { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; margin: 4px 0; border-radius: var(--r-md); color: var(--red-text); background: var(--red-soft); border: 1px solid color-mix(in srgb, var(--red) 28%, transparent); }
.verification-notice.realname { color: var(--amber-text); background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber-text) 28%, transparent); }
.verification-icon { display: grid; place-items: center; flex: 0 0 18px; height: 18px; margin-top: 1px; background: currentColor; border-radius: 50%; }
.verification-icon::after { content: "!"; font-size: 12px; color: #fff; font-weight: 700; }
.verification-body { min-width: 0; flex: 1; }
.verification-body strong { display: block; font-size: 13.5px; }
.verification-body p { font-size: 12.5px; line-height: 1.7; margin: 6px 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.verification-body small { display: block; opacity: .85; line-height: 1.6; margin-top: 10px; font-size: 11.5px; }
.verification-sms { margin: 10px 0; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-solid); color: var(--ink); }
.verification-sms p { margin: 0 0 6px; color: var(--ink-muted); }
.verification-sms div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 12.5px; }
.verification-sms div span { color: var(--ink-soft); }
.verification-sms div strong { font-family: var(--font-mono); font-size: 13px; }
.verification-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.mobile-code-row { display: flex; gap: 10px; align-items: flex-end; }
.mobile-code-row .field { flex: 1; min-width: 0; }
.mobile-code-row .btn { flex: none; min-width: 112px; }
.choice-list:not([hidden]) { display: flex; flex-direction: column; gap: 8px; }
.choice-list label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 13px; cursor: pointer; transition: border-color .15s ease, background .15s ease; }
.choice-list label:hover { background: var(--hover-bg); }
.choice-list label:has(input:checked) { border-color: var(--focus); background: var(--hover-bg); }
.choice-list span { overflow-wrap: anywhere; }
.verification-actions a { display: inline-flex; align-items: center; height: var(--control-h-sm); padding: 0 14px; border-radius: var(--r-sm); font-size: 12.5px; font-weight: 680; color: #fff; text-decoration: none; background: #c2412d; box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: background .15s ease, transform .15s ease; }
.verification-actions a:hover { background: #a8362a; }
.verification-actions a:active { transform: translateY(1px); }
.verification-actions a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.verification-notice.realname .verification-actions a { background: #96650a; }
.verification-notice.realname .verification-actions a:hover { background: #7d5408; }
:root[data-theme="dark"] .verification-actions a { background: #d0503b; }
:root[data-theme="dark"] .verification-actions a:hover { background: #e0624c; }
:root[data-theme="dark"] .verification-notice.realname .verification-actions a { background: #d39a1c; text-shadow: 0 1px 1px rgba(0, 0, 0, .25); }
:root[data-theme="dark"] .verification-notice.realname .verification-actions a:hover { background: #e2aa2a; }

/* ── 系统更新 ───────────────────────────────────────────────── */
.update-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
.update-state { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-muted); }
.update-state .spin { width: 14px; height: 14px; border-radius: 999px; border: 2px solid var(--blue); border-right-color: transparent; animation: spin .7s linear infinite; }

/* ── 提醒条 ─────────────────────────────────────────────────── */
.alert-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 16px;
  border-radius: var(--r-md);
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-muted);
  border: 1px solid transparent;
}
.alert b { color: var(--ink); font-weight: 680; }
.alert-ico { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: var(--r-xs); flex: none; }
.alert-ico svg { width: 16px; height: 16px; }
.alert-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.alert.tone-danger { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 22%, transparent); }
.alert.tone-danger .alert-ico { color: var(--red-text); background: color-mix(in srgb, var(--red) 16%, transparent); }
.alert.tone-warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber-text) 22%, transparent); }
.alert.tone-warn .alert-ico { color: var(--amber-text); background: color-mix(in srgb, var(--amber-text) 14%, transparent); }
.alert.tone-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 20%, transparent); }
.alert.tone-info .alert-ico { color: var(--blue); background: color-mix(in srgb, var(--blue) 14%, transparent); }
.panel-body .alert-list { margin-bottom: 18px; }
.danger-text { color: var(--red-text); font-weight: 600; }
.update-dot.is-info { background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }

/* ── 认证趋势图 ─────────────────────────────────────────────── */
:root { --chart-ok: #236de9; --chart-fail: #e0443b; }
:root[data-theme="dark"] { --chart-ok: #4c8dff; --chart-fail: #e8574d; }
.bento-full { grid-column: 1 / -1; }
.chart-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.chart-readouts { display: flex; flex-wrap: wrap; gap: 4px 30px; margin-bottom: 18px; padding-top: 0; border-top: 0; }
.chart { min-width: 0; }
.chart-body { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: 180px auto; column-gap: 10px; row-gap: 8px; }
.chart-y { display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); }
/* 零高度标签框落在网格线上，文字以线为中心 */
.chart-y span { display: flex; align-items: center; height: 0; }
.chart-plot { position: relative; min-width: 0; }
.chart-grid { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid i { display: block; height: 1px; background: var(--line); }
.chart-grid i:last-child { background: var(--tick-strong); opacity: .5; }
.chart-bars { position: absolute; inset: 0; display: flex; align-items: stretch; gap: 2px; }
.bar-col { position: relative; flex: 1; min-width: 0; display: flex; align-items: flex-end; justify-content: center; border-radius: 6px 6px 0 0; outline-offset: 2px; transition: background .15s ease; }
.bar-col:hover, .bar-col:focus-visible { background: var(--hover-bg); }
.bar { display: flex; flex-direction: column; gap: 2px; width: min(70%, 28px); min-height: 3px; transform-origin: bottom; animation: grow-y .8s var(--ease-premium) both; }
.seg { display: block; min-height: 2px; flex-basis: 0; }
.seg:first-child { border-radius: 4px 4px 0 0; }
.seg.is-ok { background: var(--chart-ok); }
.seg.is-fail { background: var(--chart-fail); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .38) 0 1.5px, transparent 1.5px 5px); }
.bar-value { position: absolute; left: 50%; translate: -50% -4px; font-family: var(--font-mono); font-size: 10.5px; font-weight: 650; color: var(--ink); white-space: nowrap; pointer-events: none; }
.chart-x { display: flex; gap: 2px; min-width: 0; }
.chart-x span { flex: 1; min-width: 0; text-align: center; font-family: var(--font-mono); font-size: 10px; color: var(--ink-faint); white-space: nowrap; overflow: visible; }
.chart-x small { font-size: inherit; }
@media (max-width: 820px) { .chart-x .wd { display: none; } }
.chart-legend { display: flex; gap: 18px; margin-top: 14px; font-size: 12px; color: var(--ink-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; }
.swatch.is-ok { background: var(--chart-ok); }
.swatch.is-fail { background: var(--chart-fail); background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, .45) 0 1.5px, transparent 1.5px 4px); }
.chart-tip { position: fixed; z-index: 160; padding: 7px 11px; border-radius: var(--r-sm); font-size: 12px; font-weight: 560; color: var(--ink); white-space: nowrap; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); }
.no-reveal .bar { animation: none; }
@keyframes grow-y { from { transform: scaleY(0); } }
.timeline li.is-fail .dot { border-color: var(--red); }

/* ── 账号状态 ───────────────────────────────────────────────── */
.account-health { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; }
.account-health-main { display: inline-flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.account-error { margin-top: -6px; padding: 9px 12px; border-radius: var(--r-sm); font-size: 12px; line-height: 1.6; color: var(--red-text); background: var(--red-soft); overflow-wrap: anywhere; }
.account-card.is-invalid:not(.is-selected) { border-color: color-mix(in srgb, var(--red) 35%, transparent); }

/* ── 登录设备 ───────────────────────────────────────────────── */
.device-list { border-top: 1px solid var(--line); }
.device-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px; border-bottom: 1px solid var(--line); }
.device-ico { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--r-sm); color: var(--ink-soft); flex: none; }
.device-ico svg { width: 17px; height: 17px; }
.device-main { flex: 1; min-width: 0; }
.device-main .cell-sub { overflow-wrap: anywhere; }
.device-note { padding: 12px 20px 16px; }

/* ── 日志筛选 ───────────────────────────────────────────────── */
.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0 20px 14px; }
.log-toolbar .spacer { flex: 1; }
.log-search { width: 240px; height: var(--control-h-sm); border-radius: var(--r-xs); }
.log-search svg { width: 15px; height: 15px; }
.log-user { width: 150px; }
/* 固定列宽：筛选隐藏行时各列宽度不随可见内容变化 */
.table.is-log { table-layout: fixed; }
.table.is-log.has-user { min-width: 1000px; }
.table.is-log .col-time { width: 176px; }
.table.is-log .col-result { width: 128px; }
.table.is-log .col-user { width: 260px; }
.table.is-log .cell-wrap { min-width: 0; }
.table.is-log td { overflow: hidden; text-overflow: ellipsis; }
.log-request-path { white-space: normal; overflow-wrap: anywhere; }
.log-request-details { margin-top: 6px; font-size: 12px; white-space: normal; }
.log-request-details summary { width: fit-content; cursor: pointer; color: var(--ink-soft); }
.log-request-details dl { margin-top: 8px; display: grid; gap: 6px; }
.log-request-details dl > div { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; }
.log-request-details dt { color: var(--ink-soft); }
.log-request-details dd { margin: 0; font-family: var(--font-mono); overflow-wrap: anywhere; }

/* ── 用户详情弹窗 ───────────────────────────────────────────── */
dialog.modal.is-wide { width: min(760px, calc(100vw - 24px)); }
.kv-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.detail-title { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 10px; font-size: 14px; font-weight: 700; }
.detail-list { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.detail-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; }
.detail-row + .detail-row { border-top: 1px solid var(--line); }
.detail-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; min-width: 0; max-width: 55%; }
.detail-table { border: 1px solid var(--line); border-radius: var(--r-md); }
.detail-table .table { min-width: 560px; }
.detail-table .table th { border-top: 0; }

/* ── 公告管理 ───────────────────────────────────────────────── */
.publish-layout { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
.ann-list { border-top: 1px solid var(--line); }
.ann-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; padding: 12px 14px 12px 20px; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.ann-row:last-child { border-bottom: 0; }
.ann-row:hover { background: var(--hover-bg); }
.ann-main { min-width: 0; }
.ann-main .cell-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.viewer-list { max-height: min(56vh, 460px); overflow: auto; }
.ann-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.panel-tools .input-shell { max-width: 100%; }

/* ── 响应式 ─────────────────────────────────────────────────── */
@media (max-width: 1280px) {
  .bento-hero { grid-column: 1 / -1; grid-row: auto; }
  .bento-side { grid-column: span 6; }
  .bento-wide, .bento-narrow { grid-column: 1 / -1; }
}
@media (max-width: 1180px) {
  .app-frame:not(.is-collapsed) { --rail-w: 208px; }
  .canvas-main { grid-template-columns: minmax(0, 1fr); }
  .login-dial { display: none; }
}
@media (max-width: 1080px) {
  .cols-2, .publish-layout { grid-template-columns: minmax(0, 1fr); }
  .update-hero { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); padding: 0; }
  .login-canvas { display: none; }
  .login-side { min-height: 100dvh; padding: 72px 16px 32px; align-content: start; }
  .login-mobile-brand { display: flex; align-items: center; gap: 11px; position: absolute; top: 18px; left: 18px; z-index: 2; }
}
@media (max-width: 820px) {
  .stage { padding: 0; }
  .app-frame { height: 100dvh; min-height: 0; border: 0; border-radius: 0; grid-template-columns: minmax(0, 1fr); }
  .app-frame.is-collapsed { --rail-w: 232px; }
  .rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 272px;
    z-index: 110;
    box-shadow: var(--e3);
    translate: -105% 0;
    transition: translate .42s var(--ease-premium);
  }
  .navigation-open .rail { translate: 0 0; }
  .app-frame.is-collapsed .brand-text,
  .app-frame.is-collapsed .nav-label,
  .app-frame.is-collapsed .nav-group-title,
  .app-frame.is-collapsed .rail-foot span:not(.health-dot) { display: revert; }
  .app-frame.is-collapsed .rail-brand { padding: 0 18px; justify-content: flex-start; }
  .app-frame.is-collapsed .nav-item { justify-content: flex-start; padding: 0 11px; }
  .app-frame.is-collapsed .rail-foot { justify-content: flex-start; padding: 12px 22px 16px; }
  .nav-close { display: inline-flex; }
  .nav-backdrop:not([hidden]) { display: block; position: fixed; inset: 0; z-index: 105; background: var(--overlay); animation: fade-in .2s ease both; }
  .navigation-moving .rail { transition: none; will-change: translate; }
  .navigation-moving .nav-backdrop { animation: none; will-change: opacity; }
  /* 侧栏展开时锁定后方内容：遮罩不响应原生滚动，侧栏滚到尽头也不带动页面 */
  body.navigation-open, .navigation-open .content { overflow: hidden; overscroll-behavior: none; }
  .nav-backdrop { touch-action: none; }
  .rail-nav { overscroll-behavior-y: contain; }
  .topbar { padding: 0 12px 0 8px; }
  .page { padding: 18px 16px 36px; }
  .page-title { font-size: 22px; }
  .crumbs { display: none; }
  .user-meta { display: none; }
  .bento-side { grid-column: 1 / -1; }
  .bento-grid { gap: 12px; }
  .bento { padding: 18px; }
  .metric-xl .metric-figure { font-size: 46px; }
  .account-grid { grid-template-columns: minmax(0, 1fr); }
  .kv-grid, .kv-grid.is-3 { grid-template-columns: minmax(0, 1fr); }
  .log-search, .log-user { width: 100%; }
  .log-toolbar .spacer { display: none; }
  .chart-tools { justify-content: flex-start; }
  .bento-head:has(.chart-tools) { flex-direction: column; }
  .alert { flex-wrap: wrap; }
  .device-row { padding: 12px 16px; }
  .readouts { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px 12px; }
  #notice { bottom: 16px; }
}
@media (max-width: 520px) {
  .login-card-inner { padding: 26px 20px 22px; }
  .panel-head { padding: 14px 16px; }
  .panel-body { padding: 0 16px 16px; }
  .copy-row { flex-direction: column; }
  .copy-row > .btn { height: var(--control-h); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: .01ms !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
  }
}

/* 下载页：以竖线分隔的链接，下载弹窗按系统分行 */
.link-row { display: flex; flex-wrap: wrap; align-items: center; row-gap: 8px; margin-top: 12px; }
.link-row > a, .link-row > button { padding: 0 14px; border: 0; border-left: 1px solid var(--line-strong); background: none; color: var(--ink); font: inherit; font-size: 13.5px; font-weight: 600; line-height: 1.2; cursor: pointer; }
.link-row > :first-child { padding-left: 0; border-left: 0; }
.link-row > a:hover, .link-row > button:hover { color: var(--blue); text-decoration: none; }
.link-row > button:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.dl-list { display: flex; flex-direction: column; }
.dl-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.dl-row:first-child { padding-top: 0; }
.dl-row:last-child { border-bottom: 0; padding-bottom: 0; }
.dl-os { font-size: 14px; font-weight: 600; color: var(--ink); }
.dl-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.dl-actions .btn:hover { text-decoration: none; }
