:root {
  color-scheme: light dark;
  --bg: light-dark(#f5f6f8, #0e0e10);
  --bg-glow: light-dark(#e9edf3, #19191c);
  --panel: light-dark(#ffffff, #151517);
  --tile: light-dark(#f7f8fa, #1c1c1f);
  --tile-hover: light-dark(#eef0f4, #242428);
  --field: light-dark(#ffffff, #121214);
  --track: light-dark(#e3e6ec, #2a2a2e);
  --line: light-dark(rgba(0, 0, 0, .08), rgb(255 255 255 / .06));
  --line-2: light-dark(rgba(0, 0, 0, .12), rgb(255 255 255 / .10));
  --line-hover: light-dark(rgba(0, 0, 0, .18), rgb(255 255 255 / .16));
  --fg: light-dark(#1a1d24, #f2f2f3);
  --muted: light-dark(#5f6775, #9b9ba3);
  --teal: light-dark(#167f66, #3fd8b0);
  --on-teal: light-dark(#ffffff, #08221b);
  --amber: light-dark(#b45309, #f2b544);
  --red: light-dark(#b91c1c, #f87171);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: var(--fg);
  background: var(--bg);
  font-synthesis: none;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--fg);
  background: radial-gradient(120% 60% at 50% -10%, var(--bg-glow) 0%, var(--bg) 60%) fixed var(--bg);
}
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }

/* controls */
.btn {
  height: 32px; padding: 0 12px; border-radius: 6px; cursor: pointer; white-space: nowrap;
  font: inherit; font-size: 13px; color: var(--fg);
  border: 1px solid var(--line-2); background: var(--tile);
  transition: background-color .15s, color .15s;
}
.btn:hover:not(:disabled) { background: var(--tile-hover); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--on-teal); font-weight: 600; }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--teal) 86%, #fff); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.field input {
  font-variant-numeric: tabular-nums;
  height: 36px; min-width: 0; padding: 0 8px; border-radius: 6px;
  font: inherit; font-size: 14px; color: var(--fg); background: var(--field); border: 1px solid var(--line-2);
}
.error { margin: 0 0 12px; font-size: 13px; color: var(--red); }
.brand { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em; color: var(--fg); text-decoration: none; white-space: nowrap; }

/* login */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.login-card { width: 100%; max-width: 360px; padding: 28px 24px 24px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.login-card .brand { font-size: 18px; margin-bottom: 20px; }
.login .field { font-size: 13px; }
.login .field input { height: 40px; padding: 0 10px; font-size: 15px; }
.login .btn.primary { width: 100%; height: 40px; font-size: 15px; }
.beian { font-size: 12px; color: var(--muted); text-align: center; margin-top: 24px; }
.beian a { color: inherit; }
.beian a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

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