/* ── 基础层：变量、重置、排版 ───────────────────────────────────────── */

:root {
  color-scheme: dark;

  --bg: #0e1117;
  --bg-elev: #161b26;
  --bg-elev-2: #1c2231;
  --bg-inset: #0a0d13;
  --line: #262d3d;
  --line-soft: #1e2532;

  --text: #e6eaf2;
  --text-dim: #98a2b8;
  --text-faint: #667085;

  --accent: #6ee7b7;
  --accent-dim: #2f6f5c;
  --accent-ink: #06251c;
  --correct: #4ade80;
  --correct-bg: rgba(74, 222, 128, 0.14);
  --wrong: #f87171;
  --wrong-bg: rgba(248, 113, 113, 0.14);
  --warn: #fbbf24;
  --info: #7dd3fc;

  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px -12px rgba(0, 0, 0, .6);

  --font: "Inter", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --key-size: 46px;
}

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

  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --bg-elev-2: #f0f2f7;
  --bg-inset: #eceff5;
  --line: #dde1ea;
  --line-soft: #e8ebf1;

  --text: #1a2030;
  --text-dim: #5b6478;
  --text-faint: #8b93a7;

  --accent: #0d9488;
  --accent-dim: #99e6db;
  --accent-ink: #ffffff;
  --correct: #16a34a;
  --correct-bg: rgba(22, 163, 74, .12);
  --wrong: #dc2626;
  --wrong-bg: rgba(220, 38, 38, .1);
  --warn: #b45309;
  --info: #0369a1;

  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -14px rgba(16, 24, 40, .25);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button { cursor: pointer; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.3; }

p { margin: 0; }

a { color: var(--accent); }

::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}

.mono { font-family: var(--mono); }

.hidden { display: none !important; }

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