/* Dark is also the CSS fallback when JavaScript or browser storage is unavailable. */
:root{
  color-scheme:dark;
  --bg:#0c1422;--surface:#111d30;--surface-soft:#1b2b42;--surface-hover:#21334c;
  --text:#e2e8f0;--text-secondary:#c1cee0;--muted:#a8b8ce;--border:#34465f;
  --blue:#8fb3ff;--action:#2866eb;--action-hover:#205ad7;--on-accent:#fff;
  --accent-soft:#203653;--link:#a9c6ff;--focus:#a9c6ff;--disabled:#8798b0;
  --red:#ff9eb3;--green:#52d3b4;--orange:#f1b969;
  --warning-bg:#352a18;--warning-border:#7b6033;--warning-text:#f3ce89;
  --error-bg:#471e2b;--error-border:#9b4258;--error-text:#ffd7df;
  --shadow:#0004;--backdrop:#020817b3;--floating:#111d30f5;
  --nav:#111c32;--nav-text:#c7d1e2;--nav-muted:#a4b4cc;--nav-border:#34465f;--nav-hover:#1b2a45;
  --font:'Segoe UI','Microsoft YaHei',sans-serif;
}
:root[data-theme="light"]{
  color-scheme:light;
  --bg:#f4f6fa;--surface:#fff;--surface-soft:#f0f4fa;--surface-hover:#eaf1fc;
  --text:#17243c;--text-secondary:#405675;--muted:#61728a;--border:#dce4ef;
  --blue:#2866eb;--link:#285bb0;--focus:#2866eb;--accent-soft:#eaf1ff;--disabled:#74839a;
  --red:#b83e55;--green:#117b66;--orange:#9b670d;
  --warning-bg:#fff7e7;--warning-border:#dec89e;--warning-text:#805916;
  --error-bg:#fff1f2;--error-border:#e5a7b2;--error-text:#a52c43;
  --shadow:#17243c1a;--backdrop:#14223d70;--floating:#fffffff5;
}
html{background:var(--bg);scrollbar-color:var(--muted) var(--surface);accent-color:var(--action)}
body{background:var(--bg);color:var(--text)}
input,select,textarea{color-scheme:inherit}
input::placeholder{color:var(--muted);opacity:1}
dialog{background:var(--surface)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex:none;min-height:34px;min-width:70px;width:auto;padding:6px 10px;border:1px solid var(--border);border-radius:7px;background:var(--surface);color:var(--text);font:inherit;font-size:12px;line-height:1.4;cursor:pointer;white-space:nowrap}
.theme-toggle:hover{background:var(--surface-hover)}
.theme-toggle:focus-visible{outline:2px solid var(--focus);outline-offset:3px}
.theme-toggle>span:first-child{font-size:18px;line-height:1}
.login-theme{position:fixed;right:24px;top:20px;z-index:1}
@media(max-width:580px){.top-actions{gap:8px}.topbar{gap:8px}.topbar .slash{padding:0 6px}.theme-toggle{min-width:64px;padding:5px 8px}.login-theme{right:16px;top:14px}}
