/* ================================================================
   知新 · 思政刷题 — design system
   ================================================================ */

:root {
  --bg: #f5f3ec;
  --bg-deep: #ece9df;
  --surface: #fffdf8;
  --surface-2: #f2efe5;
  --surface-3: #e9e5d8;
  --ink: #18241f;
  --ink-2: #35443c;
  --muted: #6c7871;
  --faint: #98a099;
  --line: #e2ded1;
  --line-strong: #cfc9b9;
  --primary: #1e5b47;
  --primary-strong: #143f31;
  --primary-bright: #2d7a5f;
  --primary-soft: #e6f0ea;
  --primary-tint: #f0f6f2;
  --accent: #c9802b;
  --accent-strong: #a66418;
  --accent-soft: #fbefdd;
  --danger: #b3473d;
  --danger-soft: #fbeae7;
  --success: #2e7650;
  --success-soft: #e7f2eb;
  --warning: #a66d13;
  --warning-soft: #fbf0d8;
  --on-primary: #f8f5eb;
  --shadow: 0 24px 60px -28px rgba(27, 43, 34, 0.28);
  --shadow-soft: 0 12px 28px -20px rgba(27, 43, 34, 0.24);
  --shadow-lift: 0 18px 38px -20px rgba(27, 43, 34, 0.3);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-body: "Avenir Next", "Inter", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", Georgia, serif;
  --font-mono: "SFMono-Regular", "Cascadia Code", Consolas, "Liberation Mono", monospace;
  --sidebar: 244px;
  --ease: cubic-bezier(.22, .8, .25, 1);
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0f1512;
  --bg-deep: #0a100d;
  --surface: #17201b;
  --surface-2: #1d2822;
  --surface-3: #26332b;
  --ink: #e9e5da;
  --ink-2: #c9d2ca;
  --muted: #98a49c;
  --faint: #748077;
  --line: #2b372f;
  --line-strong: #3a4a40;
  --primary: #2f7c5f;
  --primary-strong: #123d2e;
  --primary-bright: #6eae91;
  --primary-soft: #1d3228;
  --primary-tint: #18271f;
  --accent: #e0a14b;
  --accent-strong: #f0b86b;
  --accent-soft: #332815;
  --danger: #e07c6f;
  --danger-soft: #37211e;
  --success: #71b78e;
  --success-soft: #1b3325;
  --warning: #d6a250;
  --warning-soft: #322816;
  --on-primary: #f6f3e9;
  --shadow: 0 26px 64px -30px rgba(0, 0, 0, 0.6);
  --shadow-soft: 0 12px 28px -20px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 18px 40px -20px rgba(0, 0, 0, 0.6);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(201, 128, 43, 0.07), transparent 60%),
    radial-gradient(900px 450px at -10% 10%, rgba(30, 91, 71, 0.06), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1200px 500px at 88% -10%, rgba(224, 161, 75, 0.05), transparent 60%),
    radial-gradient(900px 450px at -10% 8%, rgba(111, 174, 145, 0.06), transparent 55%),
    var(--bg);
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; }

h1, h2, h3, h4, p { margin: 0; }
h1, h2, h3 { line-height: 1.25; letter-spacing: -0.015em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
svg { display: block; }
.svg-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: 0 0 auto; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- boot ---------- */
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; }
.boot-mark {
  width: 64px; height: 64px; border-radius: 20px;
  display: grid; place-items: center;
  background: var(--primary); color: var(--on-primary);
  font-family: var(--font-display); font-size: 32px;
  box-shadow: var(--shadow-soft);
  animation: breathe 1.8s var(--ease) infinite;
}
.boot-text { color: var(--muted); font-size: 14px; letter-spacing: .08em; }
@keyframes breathe { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(-5px); opacity: .78; } }

/* ---------- common ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 20px; height: 2px; border-radius: 2px; background: var(--accent); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 13px; }
.tiny { font-size: 12px; }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.spacer { flex: 1; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

.display { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.02em; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
}
.card-flush { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.divider { height: 1px; background: var(--line); border: 0; margin: 0; }

.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  background: var(--surface-2); color: var(--muted);
  font-size: 12px; font-weight: 650; white-space: nowrap;
}
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-outline { background: transparent; border: 1px solid var(--line); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 13px;
  background: var(--surface-2); color: var(--ink);
  font-size: 14px; font-weight: 700; white-space: nowrap;
  transition: transform .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 8px 18px -10px rgba(20, 63, 49, .7); }
.btn-primary:hover { background: var(--primary-strong); }
.btn-accent { background: var(--accent); color: #241506; }
.btn-accent:hover { background: var(--accent-strong); }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); border-color: var(--line-strong); }
.btn-soft { background: var(--primary-soft); color: var(--primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--primary-soft) 70%, var(--primary) 10%); }
.btn-danger-soft { background: var(--danger-soft); color: var(--danger); }
.btn-sm { min-height: 36px; padding: 0 13px; border-radius: 10px; font-size: 13px; }
.btn-lg { min-height: 52px; padding: 0 24px; border-radius: 15px; font-size: 15px; }
.btn-block { width: 100%; }
.btn-icon { width: 42px; height: 42px; min-height: 42px; padding: 0; border-radius: 12px; background: transparent; }
.btn-icon:hover { background: var(--surface-2); }

.input, .select {
  width: 100%; height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  background: var(--surface);
  color: var(--ink);
  outline: none;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.input::placeholder { color: var(--faint); }
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.select {
  appearance: none;
  padding-right: 38px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field { display: grid; gap: 7px; }
.field label { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field-hint { font-size: 12px; color: var(--faint); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 46px; }
.input-action {
  position: absolute; right: 7px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); display: grid; place-items: center;
}
.input-action:hover { background: var(--surface-2); color: var(--ink); }

.form-error {
  display: none; align-items: flex-start; gap: 9px;
  padding: 11px 13px; border-radius: 12px;
  background: var(--danger-soft); color: var(--danger);
  font-size: 13px; line-height: 1.5;
}
.form-error.show { display: flex; }

/* ---------- auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(430px, .92fr); }
.auth-theme { position: fixed; right: 22px; top: 20px; z-index: 5; background: var(--surface); border: 1px solid var(--line); color: var(--muted); }
.auth-art {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: clamp(34px, 5vw, 68px);
  background:
    radial-gradient(600px 420px at 88% 8%, rgba(201, 128, 43, .24), transparent 62%),
    linear-gradient(150deg, #174a38 0%, #123c2d 58%, #0d2e23 100%);
  color: #f5f1e5;
}
.auth-art::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 58px 58px;
  mask-image: linear-gradient(180deg, #000, transparent 82%);
  pointer-events: none;
}
.auth-art::after {
  content: ""; position: absolute; width: 540px; height: 540px; border-radius: 50%;
  border: 1px solid rgba(255,255,255,.13);
  right: -230px; bottom: -240px;
  box-shadow: 0 0 0 70px rgba(255,255,255,.025), 0 0 0 140px rgba(255,255,255,.02);
  pointer-events: none;
}
.auth-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.brand-mark {
  width: 45px; height: 45px; border-radius: 14px;
  display: grid; place-items: center;
  background: #f4d39b; color: #173e2f;
  font-family: var(--font-display); font-size: 25px; font-weight: 700;
  box-shadow: 0 10px 24px -12px rgba(0,0,0,.55);
}
.brand-name { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: .08em; }
.brand-sub { font-size: 11px; letter-spacing: .24em; opacity: .62; text-transform: uppercase; }
.auth-quote { position: relative; z-index: 1; max-width: 560px; margin: auto 0; padding: 44px 0; }
.auth-quote .quote-mark { font-family: var(--font-display); font-size: 78px; line-height: .6; color: #f4d39b; opacity: .8; }
.auth-quote h1 { font-family: var(--font-display); font-size: clamp(32px, 4.2vw, 56px); line-height: 1.3; font-weight: 700; margin: 22px 0 20px; letter-spacing: .01em; }
.auth-quote p { max-width: 430px; color: rgba(245,241,229,.64); font-size: 14px; line-height: 1.9; }
.auth-facts { position: relative; z-index: 1; display: flex; gap: 34px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.14); padding-top: 22px; }
.auth-fact strong { display: block; font-family: var(--font-display); font-size: 25px; color: #f4d39b; }
.auth-fact span { font-size: 11px; letter-spacing: .1em; color: rgba(245,241,229,.55); }
.auth-panel { display: flex; align-items: center; justify-content: center; padding: clamp(26px, 5vw, 60px); }
.auth-box { width: min(418px, 100%); animation: fadeUp .55s var(--ease) both; }
.auth-kicker { font-size: 12px; font-weight: 750; letter-spacing: .16em; color: var(--accent-strong); text-transform: uppercase; }
.auth-box h2 { font-family: var(--font-display); font-size: clamp(28px, 3vw, 38px); margin: 9px 0 8px; }
.auth-box > p { color: var(--muted); font-size: 14px; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin: 28px 0 24px; background: var(--surface-2); border-radius: 14px; }
.auth-tab { height: 42px; border: 0; border-radius: 10px; background: transparent; color: var(--muted); font-weight: 700; font-size: 14px; transition: .18s var(--ease); }
.auth-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 3px 12px -4px rgba(0,0,0,.12); }
.auth-form { display: grid; gap: 16px; }
.auth-form .btn { margin-top: 6px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 12px; color: var(--faint); line-height: 1.8; }
.auth-mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 26px; }
.auth-mobile-brand .brand-name { color: var(--ink); }
.auth-mobile-brand .brand-sub { color: var(--faint); }
.spinner {
  width: 15px; height: 15px; display: inline-block; vertical-align: -2px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spinner .7s linear infinite;
}
@keyframes spinner { to { transform: rotate(360deg); } }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  padding: 28px 16px 20px;
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 74%, transparent);
  backdrop-filter: blur(12px);
  z-index: 30;
}
.sidebar-brand { display: flex; align-items: center; gap: 11px; padding: 0 10px 26px; }
.sidebar-brand .brand-mark { width: 38px; height: 38px; border-radius: 12px; font-size: 21px; background: var(--primary); color: var(--on-primary); box-shadow: none; }
.sidebar-brand .brand-name { font-size: 21px; letter-spacing: .06em; }
.sidebar-brand .brand-sub { font-size: 9px; letter-spacing: .2em; color: var(--faint); }
.side-nav { display: grid; gap: 5px; }
.side-link {
  display: flex; align-items: center; gap: 12px;
  height: 47px; padding: 0 13px;
  border-radius: 13px; color: var(--muted);
  font-size: 14px; font-weight: 650;
  transition: background .18s var(--ease), color .18s var(--ease), transform .18s var(--ease);
}
.side-link:hover { background: var(--surface-2); color: var(--ink); }
.side-link.active { background: var(--primary); color: var(--on-primary); box-shadow: 0 9px 20px -14px rgba(20,63,49,.8); }
.side-link .icon { width: 19px; height: 19px; opacity: .9; }
.side-link .side-count { margin-left: auto; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-weight: 800; }
.side-link.active .side-count { background: rgba(255,255,255,.14); color: var(--on-primary); }
.sidebar-mid { margin-top: 26px; }
.side-label { padding: 0 13px; margin-bottom: 10px; font-size: 10px; font-weight: 800; letter-spacing: .18em; color: var(--faint); text-transform: uppercase; }
.side-goal { margin: 0 2px; padding: 15px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); }
.side-goal-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--muted); }
.side-goal-top strong { color: var(--ink); font-size: 17px; font-family: var(--font-display); }
.goal-track { height: 6px; border-radius: 99px; background: var(--surface-2); margin-top: 10px; overflow: hidden; }
.goal-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width .5s var(--ease); }
.sidebar-bottom { margin-top: auto; padding-top: 20px; }
.side-user { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px; transition: background .18s; }
.side-user:hover { background: var(--surface-2); }
.avatar {
  width: 38px; height: 38px; border-radius: 12px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  font-family: var(--font-display); font-size: 17px; font-weight: 700;
}
.avatar.sm { width: 31px; height: 31px; border-radius: 10px; font-size: 14px; }
.avatar.accent { background: var(--accent-soft); color: var(--accent-strong); }
.side-user-name { font-size: 13px; font-weight: 700; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-role { font-size: 10px; color: var(--faint); letter-spacing: .06em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-logout { margin-left: auto; width: 32px; height: 32px; min-height: 32px; color: var(--faint); }
.side-logout:hover { color: var(--danger); background: var(--danger-soft); }

.main { min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  height: 74px; display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(20px, 4vw, 46px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.top-mobile-brand { display: none; align-items: center; gap: 8px; font-family: var(--font-display); font-size: 19px; font-weight: 700; letter-spacing: .05em; }
.top-mobile-brand .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: 17px; }
.top-title { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); }
.top-title strong { color: var(--ink); font-size: 14px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.top-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 11px; border-radius: 11px;
  border: 1px solid var(--line); background: var(--surface);
  color: var(--muted); font-size: 12px; font-weight: 650;
}
.top-chip .icon { color: var(--accent); }
.top-avatar { display: none; }
.page { width: min(100%, 1320px); margin: 0 auto; padding: 14px clamp(20px, 4vw, 46px) 64px; animation: fadeUp .36s var(--ease) both; }
.mobile-nav { display: none; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; margin: 14px 0 28px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-size: clamp(30px, 3.4vw, 44px); margin: 7px 0 8px; }
.page-head p { color: var(--muted); font-size: 14px; max-width: 650px; }
.page-head.compact h1 { font-size: clamp(28px, 3vw, 38px); }
.page-actions { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }

/* ---------- home ---------- */
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 18px; margin-bottom: 18px; }
.hero {
  position: relative; overflow: hidden;
  padding: clamp(25px, 3.4vw, 38px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(500px 300px at 100% 0%, rgba(244, 211, 155, .18), transparent 65%),
    linear-gradient(140deg, #174a38 0%, #113c2d 62%, #0d3024 100%);
  color: var(--on-primary);
  box-shadow: var(--shadow);
}
.hero::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  right: -120px; bottom: -170px; border: 1px solid rgba(255,255,255,.14);
  box-shadow: 0 0 0 55px rgba(255,255,255,.025), 0 0 0 110px rgba(255,255,255,.018);
  pointer-events: none;
}
.hero-top { position: relative; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.hero .eyebrow { color: rgba(248,245,235,.55); }
.hero .eyebrow::before { background: #e4b160; }
.hero h1 { position: relative; z-index: 1; font-family: var(--font-display); font-size: clamp(29px, 3.6vw, 43px); margin: 15px 0 9px; letter-spacing: .01em; }
.hero h1 em { color: #f0c985; font-style: normal; }
.hero p { position: relative; z-index: 1; color: rgba(248,245,235,.6); font-size: 13.5px; max-width: 460px; }
.hero-goal { position: relative; z-index: 1; display: flex; align-items: center; gap: 20px; margin-top: 28px; flex-wrap: wrap; }
.goal-ring {
  --progress: 0;
  width: 92px; height: 92px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center;
  background: conic-gradient(#e9b768 calc(var(--progress) * 1%), rgba(255,255,255,.13) 0);
  position: relative;
}
.goal-ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #123b2d; }
.goal-ring-inner { position: relative; z-index: 1; text-align: center; line-height: 1.15; }
.goal-ring-inner strong { display: block; font-family: var(--font-display); font-size: 24px; color: #f4d39b; }
.goal-ring-inner span { font-size: 9px; letter-spacing: .12em; color: rgba(248,245,235,.5); }
.hero-goal-text { min-width: 140px; }
.hero-goal-text strong { display: block; font-size: 14px; margin-bottom: 3px; }
.hero-goal-text span { display: block; color: rgba(248,245,235,.55); font-size: 12px; }
.hero-actions { position: relative; z-index: 1; display: flex; gap: 9px; margin-top: 24px; flex-wrap: wrap; }
.hero-actions .btn-primary { background: #f0ce90; color: #193d2e; box-shadow: none; }
.hero-actions .btn-primary:hover { background: #f7dda9; }
.hero-actions .btn-ghost { color: var(--on-primary); border-color: rgba(255,255,255,.22); }
.hero-actions .btn-ghost:hover { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.35); }
.hero-streak { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 999px; background: rgba(255,255,255,.09); color: #f0c985; font-size: 11px; font-weight: 700; white-space: nowrap; }

.exam-teaser {
  display: flex; flex-direction: column;
  padding: 25px; border-radius: var(--radius-xl);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  position: relative; overflow: hidden;
}
.exam-teaser::before { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; right: -70px; top: -70px; background: var(--accent-soft); }
.exam-teaser .badge { position: relative; z-index: 1; align-self: flex-start; }
.exam-teaser h2 { position: relative; z-index: 1; font-family: var(--font-display); font-size: 24px; margin: 18px 0 7px; }
.exam-teaser p { position: relative; z-index: 1; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.exam-structure { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 18px 0; }
.exam-structure div { padding: 10px 11px; border-radius: 11px; background: var(--surface-2); }
.exam-structure strong { display: block; font-family: var(--font-display); font-size: 19px; color: var(--primary); }
.exam-structure span { font-size: 10px; color: var(--faint); letter-spacing: .06em; }
.exam-teaser .btn { margin-top: auto; }
.exam-best { display: flex; align-items: baseline; gap: 6px; margin-bottom: 16px; font-size: 11px; color: var(--faint); }
.exam-best strong { font-family: var(--font-display); font-size: 24px; color: var(--accent-strong); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 18px; }
.stat-card { padding: 19px 20px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.stat-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 12px; }
.stat-icon { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); }
.stat-icon.accent { background: var(--accent-soft); color: var(--accent-strong); }
.stat-icon.danger { background: var(--danger-soft); color: var(--danger); }
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-value { margin-top: 11px; font-family: var(--font-display); font-size: 28px; font-weight: 700; line-height: 1.1; }
.stat-value small { font-family: var(--font-body); font-size: 12px; font-weight: 600; color: var(--faint); margin-left: 2px; }
.stat-foot { margin-top: 4px; color: var(--faint); font-size: 11px; }

.home-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(290px, .75fr); gap: 18px; align-items: start; }
.section-card { padding: 23px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-soft); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 19px; }
.section-head h3 { font-family: var(--font-display); font-size: 20px; }
.section-head .small { color: var(--muted); }
.link-btn { border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 750; display: inline-flex; align-items: center; gap: 4px; padding: 4px; }
.link-btn:hover { text-decoration: underline; }

.chapter-list { display: grid; gap: 15px; }
.chapter-row { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 14px; align-items: center; }
.chapter-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 7px; }
.chapter-meta strong { font-size: 13px; font-weight: 700; }
.chapter-meta span { font-size: 11px; color: var(--faint); }
.chapter-track { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.chapter-fill { height: 100%; border-radius: inherit; background: var(--primary); transition: width .6s var(--ease); }
.chapter-fill.warn { background: var(--accent); }
.chapter-fill.low { background: var(--danger); }
.chapter-pct { text-align: right; font-family: var(--font-display); font-size: 18px; color: var(--ink); }
.chapter-pct small { display: block; font-family: var(--font-body); font-size: 9px; color: var(--faint); letter-spacing: .08em; }
.mini-empty { padding: 18px; text-align: center; color: var(--faint); font-size: 12px; background: var(--surface-2); border-radius: 12px; }

.side-stack { display: grid; gap: 18px; }
.week-card { padding: 21px 22px; }
.week-bars { display: flex; align-items: flex-end; gap: 8px; height: 74px; margin: 16px 0 7px; }
.week-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.week-bar i { display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--primary-soft); transition: height .5s var(--ease); }
.week-bar.today i { background: var(--accent); }
.week-bar span { font-size: 9px; color: var(--faint); }
.week-foot { display: flex; justify-content: space-between; color: var(--faint); font-size: 10px; }

.leader-list { display: grid; gap: 2px; }
.leader-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; }
.leader-rank { width: 22px; font-family: var(--font-display); font-size: 15px; color: var(--faint); text-align: center; }
.leader-row:nth-child(1) .leader-rank { color: var(--accent-strong); }
.leader-row:nth-child(2) .leader-rank { color: var(--muted); }
.leader-row:nth-child(3) .leader-rank { color: #a9744c; }
.leader-name { font-size: 12.5px; font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leader-score { margin-left: auto; text-align: right; }
.leader-score strong { font-family: var(--font-display); font-size: 17px; }
.leader-score span { display: block; font-size: 9px; color: var(--faint); }
.me-row { margin-top: 8px; padding: 10px; border-radius: 11px; background: var(--primary-tint); border: 1px dashed color-mix(in srgb, var(--primary) 25%, transparent); }

.recent-exams { display: grid; gap: 8px; }
.recent-exam { display: flex; align-items: center; gap: 12px; padding: 12px 13px; border-radius: 12px; background: var(--surface-2); transition: background .18s; }
.recent-exam:hover { background: var(--surface-3); }
.recent-exam-date { font-size: 11px; color: var(--faint); }
.recent-exam-score { margin-left: auto; font-family: var(--font-display); font-size: 21px; }
.recent-exam-score small { font-family: var(--font-body); font-size: 9px; color: var(--faint); }

/* ---------- practice ---------- */
.filter-bar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 11px; gap: 2px; }
.segmented button { height: 34px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; transition: .18s var(--ease); }
.segmented button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(0,0,0,.12); }
.select-sm { height: 40px; width: auto; min-width: 136px; border-radius: 11px; font-size: 12.5px; background-position: calc(100% - 17px) 18px, calc(100% - 12px) 18px; }
.practice-grid { display: grid; grid-template-columns: minmax(0, 1fr) 294px; gap: 20px; align-items: start; }
.question-card { position: relative; padding: clamp(22px, 3.3vw, 38px); }
.q-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 22px; }
.q-index { margin-left: auto; font-size: 11px; color: var(--faint); letter-spacing: .08em; }
.q-stem { font-family: var(--font-display); font-size: clamp(20px, 2.2vw, 28px); line-height: 1.62; font-weight: 600; letter-spacing: .005em; }
.q-hint { margin-top: 10px; color: var(--faint); font-size: 12px; display: flex; align-items: center; gap: 6px; }
.options { display: grid; gap: 11px; margin-top: 27px; }
.option {
  display: flex; align-items: flex-start; gap: 13px;
  width: 100%; padding: 15px 17px; text-align: left;
  border: 1.5px solid var(--line); border-radius: 15px;
  background: var(--surface); color: var(--ink);
  transition: border-color .16s var(--ease), background .16s var(--ease), transform .16s var(--ease), box-shadow .16s var(--ease);
}
.option:hover:not(.disabled) { border-color: color-mix(in srgb, var(--primary) 45%, var(--line)); background: var(--primary-tint); transform: translateX(2px); }
.option.selected { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 1px var(--primary) inset; }
.option.correct { border-color: var(--success); background: var(--success-soft); }
.option.wrong { border-color: var(--danger); background: var(--danger-soft); }
.option.dim { opacity: .62; }
.option.disabled { cursor: default; }
.option-key {
  width: 30px; height: 30px; border-radius: 9px; flex: 0 0 auto;
  display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted);
  font-family: var(--font-mono); font-size: 13px; font-weight: 700;
  transition: .16s var(--ease);
}
.option.selected .option-key { background: var(--primary); color: var(--on-primary); }
.option.correct .option-key { background: var(--success); color: #fff; }
.option.wrong .option-key { background: var(--danger); color: #fff; }
.option-text { flex: 1; padding-top: 3px; font-size: 14.5px; line-height: 1.65; }
.option-state { width: 20px; padding-top: 4px; color: inherit; }
.option-state .icon { width: 18px; height: 18px; }

.feedback { margin-top: 22px; padding: 17px 18px; border-radius: 15px; border: 1px solid transparent; animation: fadeUp .3s var(--ease) both; }
.feedback.good { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 22%, transparent); }
.feedback.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 22%, transparent); }
.feedback-head { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 14px; }
.feedback.good .feedback-head { color: var(--success); }
.feedback.bad .feedback-head { color: var(--danger); }
.feedback-body { margin-top: 6px; color: var(--muted); font-size: 12.5px; line-height: 1.7; }
.answer-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 12.5px; }
.answer-chip { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 7px; border-radius: 8px; background: var(--success); color: #fff; font-family: var(--font-mono); font-weight: 800; font-size: 12px; }
.answer-chip.miss { background: var(--danger); }
.q-actions { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.q-actions .spacer { flex: 1; }
.key-hint { color: var(--faint); font-size: 11px; display: flex; align-items: center; gap: 6px; }
kbd { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--line-strong); border-bottom-width: 2px; background: var(--surface); font-family: var(--font-mono); font-size: 10px; color: var(--muted); }

.practice-side { display: grid; gap: 16px; position: sticky; top: 92px; }
.session-card { padding: 21px; }
.session-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 750; }
.session-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 16px; }
.session-stat { padding: 11px 12px; border-radius: 11px; background: var(--surface-2); }
.session-stat strong { display: block; font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.session-stat span { font-size: 10px; color: var(--faint); }
.session-foot { margin-top: 14px; padding-top: 13px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); }
.side-callout { padding: 19px; border-radius: var(--radius-md); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent); }
.side-callout h4 { font-size: 13px; display: flex; align-items: center; gap: 7px; }
.side-callout p { margin: 7px 0 12px; font-size: 11.5px; color: var(--muted); line-height: 1.65; }
.side-callout .btn { width: 100%; }

.practice-empty { padding: 60px 24px; text-align: center; }
.empty-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); }
.practice-empty h2 { font-family: var(--font-display); font-size: 25px; margin-bottom: 7px; }
.practice-empty p { color: var(--muted); font-size: 13px; max-width: 420px; margin: 0 auto 20px; }

/* ---------- wrong book ---------- */
.wrong-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 18px; }
.wrong-stat { padding: 17px 19px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.wrong-stat strong { display: block; font-family: var(--font-display); font-size: 27px; }
.wrong-stat span { font-size: 11px; color: var(--faint); }
.toolbar { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar .search-box { position: relative; flex: 1; min-width: 190px; max-width: 330px; }
.toolbar .search-box .icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--faint); width: 17px; height: 17px; }
.toolbar .search-box .input { height: 40px; padding-left: 38px; font-size: 12.5px; }
.tabs { display: inline-flex; gap: 2px; padding: 3px; border-radius: 11px; background: var(--surface-2); }
.tabs button { height: 34px; padding: 0 13px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 700; }
.tabs button.active { background: var(--surface); color: var(--ink); box-shadow: 0 2px 8px -3px rgba(0,0,0,.12); }
.tabs button b { margin-left: 4px; font-size: 10px; color: var(--faint); }
.wrong-list { display: grid; gap: 11px; }
.wrong-card { padding: 19px 21px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); transition: border-color .18s, box-shadow .18s; }
.wrong-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-soft); }
.wrong-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wrong-head .wrong-time { margin-left: auto; font-size: 10px; color: var(--faint); }
.wrong-stem { margin: 12px 0 13px; font-size: 14.5px; line-height: 1.75; font-weight: 600; }
.wrong-actions { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.wrong-reveal { display: none; margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.wrong-card.open .wrong-reveal { display: block; animation: fadeUp .25s var(--ease) both; }
.reveal-option { display: flex; gap: 9px; padding: 6px 0; font-size: 12.5px; color: var(--muted); }
.reveal-option.correct { color: var(--success); font-weight: 650; }
.reveal-key { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); font-family: var(--font-mono); font-size: 10px; flex: 0 0 auto; }
.reveal-option.correct .reveal-key { background: var(--success); color: #fff; }
.wrong-meta-line { display: flex; gap: 12px; flex-wrap: wrap; font-size: 10px; color: var(--faint); margin-top: 10px; }
.load-more-wrap { display: flex; justify-content: center; margin-top: 18px; }
.list-empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.list-empty .empty-icon { margin-bottom: 14px; }
.list-empty h3 { font-family: var(--font-display); font-size: 23px; color: var(--ink); margin-bottom: 5px; }

/* ---------- exams ---------- */
.exam-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(260px, .7fr); gap: 26px; padding: clamp(25px, 3.5vw, 40px); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; }
.exam-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 240px; height: 240px; border-radius: 50%; background: var(--accent-soft); opacity: .7; }
.exam-hero-copy { position: relative; z-index: 1; }
.exam-hero h2 { font-family: var(--font-display); font-size: clamp(28px, 3.4vw, 40px); margin: 10px 0 10px; }
.exam-hero p { color: var(--muted); font-size: 13px; max-width: 540px; }
.exam-rules { display: flex; gap: 8px; flex-wrap: wrap; margin: 19px 0 23px; }
.rule-pill { display: flex; align-items: center; gap: 7px; padding: 7px 11px; border-radius: 9px; background: var(--surface-2); font-size: 11px; color: var(--ink-2); }
.rule-pill .icon { width: 14px; height: 14px; color: var(--primary); }
.exam-side { position: relative; z-index: 1; display: flex; flex-direction: column; justify-content: center; gap: 15px; padding-left: 22px; border-left: 1px dashed var(--line); }
.exam-side-stat { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.exam-side-stat span { font-size: 11px; color: var(--faint); }
.exam-side-stat strong { font-family: var(--font-display); font-size: 23px; }
.exam-side .btn { margin-top: 6px; }
.exam-active { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 15px; background: var(--warning-soft); border: 1px solid color-mix(in srgb, var(--warning) 24%, transparent); margin-bottom: 18px; flex-wrap: wrap; }
.exam-active .icon { color: var(--warning); }
.exam-active strong { font-size: 13px; }
.exam-active p { font-size: 11px; color: var(--muted); }
.exam-active .btn { margin-left: auto; }

.history-list { display: grid; gap: 9px; }
.history-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 72px 90px 74px; align-items: center; gap: 13px; padding: 13px 15px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line); transition: border-color .18s, transform .18s; }
.history-row:hover { border-color: var(--line-strong); transform: translateX(2px); }
.history-icon { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--primary); }
.history-title { font-size: 12.5px; font-weight: 700; }
.history-sub { font-size: 10px; color: var(--faint); }
.history-score { font-family: var(--font-display); font-size: 22px; text-align: right; }
.history-score small { font-family: var(--font-body); font-size: 9px; color: var(--faint); }
.history-status { text-align: center; }
.history-row .btn { justify-self: end; }

/* ---------- exam runner ---------- */
.exam-page { width: min(100%, 1380px); margin: 0 auto; padding: 0 clamp(16px, 3vw, 34px) 50px; }
.exam-topbar { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; min-height: 70px; padding: 10px 0; background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); }
.exam-top-title { display: flex; align-items: center; gap: 10px; }
.exam-top-title .brand-mark { width: 34px; height: 34px; border-radius: 10px; font-size: 18px; background: var(--primary); color: var(--on-primary); }
.exam-top-title strong { display: block; font-family: var(--font-display); font-size: 16px; line-height: 1.3; }
.exam-top-title span { display: block; font-size: 9px; color: var(--faint); letter-spacing: .12em; }
.exam-timer { margin-left: auto; display: flex; align-items: center; gap: 9px; padding: 8px 13px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); }
.exam-timer .icon { color: var(--primary); }
.exam-timer strong { font-family: var(--font-mono); font-size: 20px; letter-spacing: .04em; line-height: 1; }
.exam-timer span { display: block; font-size: 8px; color: var(--faint); letter-spacing: .12em; }
.exam-timer.warning { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.exam-timer.warning .icon, .exam-timer.warning strong { color: var(--danger); }
.save-state { display: inline-flex; align-items: center; gap: 5px; color: var(--faint); font-size: 10px; white-space: nowrap; }
.save-state .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.save-state.saving .dot { background: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .25; } }
.exam-body { display: grid; grid-template-columns: minmax(0, 1fr) 306px; gap: 20px; align-items: start; padding-top: 20px; }
.exam-main { min-width: 0; }
.exam-question { padding: clamp(21px, 3vw, 34px); }
.exam-question .q-stem { font-size: clamp(19px, 2vw, 25px); }
.exam-question .option-text { font-size: 14px; }
.exam-nav { display: flex; align-items: center; gap: 9px; margin-top: 24px; flex-wrap: wrap; }
.exam-nav .spacer { flex: 1; }
.palette-card { position: sticky; top: 90px; padding: 18px; }
.palette-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.palette-head h3 { font-size: 13px; }
.palette-legend { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 13px; font-size: 9px; color: var(--faint); }
.palette-legend span { display: inline-flex; align-items: center; gap: 4px; }
.legend-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line); }
.legend-dot.done { background: var(--primary); border-color: var(--primary); }
.legend-dot.mark { background: var(--accent); border-color: var(--accent); }
.legend-dot.now { background: transparent; border: 2px solid var(--primary); }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; max-height: 440px; overflow-y: auto; padding-right: 2px; }
.palette-btn { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--muted); font-family: var(--font-mono); font-size: 10px; transition: .14s var(--ease); position: relative; }
.palette-btn:hover { border-color: var(--primary); color: var(--primary); }
.palette-btn.done { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.palette-btn.mark::after { content: ""; position: absolute; right: 2px; top: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.palette-btn.current { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--accent); }
.palette-foot { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); display: flex; justify-content: space-between; font-size: 10px; color: var(--faint); }
.exam-submit-bar { display: none; }
.mobile-palette-btn { display: none; }

/* ---------- result ---------- */
.result-hero { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 30px; align-items: center; padding: clamp(24px, 3.5vw, 38px); border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); margin-bottom: 18px; }
.score-ring { --pct: 0; width: 178px; height: 178px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; background: conic-gradient(var(--ring, var(--success)) calc(var(--pct) * 1%), var(--surface-2) 0); position: relative; }
.score-ring::before { content: ""; position: absolute; inset: 9px; border-radius: 50%; background: var(--surface); }
.score-ring-inner { position: relative; z-index: 1; text-align: center; }
.score-ring-inner strong { display: block; font-family: var(--font-display); font-size: 54px; line-height: 1; }
.score-ring-inner span { font-size: 11px; color: var(--faint); letter-spacing: .12em; }
.result-copy h1 { font-family: var(--font-display); font-size: clamp(28px, 3.5vw, 41px); margin: 8px 0 8px; }
.result-copy p { color: var(--muted); font-size: 13px; }
.result-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 22px; }
.result-stat strong { display: block; font-family: var(--font-display); font-size: 23px; }
.result-stat span { font-size: 10px; color: var(--faint); }
.result-actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 22px; }
.breakdown-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(260px, .9fr); gap: 18px; margin-bottom: 18px; }
.breakdown-list { display: grid; gap: 12px; }
.bd-row { display: grid; grid-template-columns: minmax(0, 1fr) 46px; gap: 12px; align-items: center; }
.bd-track { height: 7px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin-top: 6px; }
.bd-fill { height: 100%; border-radius: inherit; background: var(--primary); }
.bd-fill.accent { background: var(--accent); }
.bd-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11.5px; }
.bd-meta span { color: var(--faint); font-size: 10px; }
.bd-pct { font-family: var(--font-display); font-size: 18px; text-align: right; }
.review-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 22px 0 13px; }
.review-toolbar h2 { font-family: var(--font-display); font-size: 24px; margin-right: auto; }
.review-list { display: grid; gap: 10px; }
.review-card { padding: 18px 20px; border-radius: var(--radius-md); background: var(--surface); border: 1px solid var(--line); }
.review-card.wrong { border-left: 4px solid var(--danger); }
.review-card.right { border-left: 4px solid var(--success); }
.review-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.review-head .review-num { margin-left: auto; font-size: 10px; color: var(--faint); }
.review-stem { font-size: 13.5px; font-weight: 650; line-height: 1.7; margin: 10px 0 8px; }
.review-options { display: grid; gap: 3px; }
.review-option { display: flex; gap: 8px; padding: 5px 7px; border-radius: 7px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.review-option .k { font-family: var(--font-mono); font-size: 10px; font-weight: 800; color: var(--faint); width: 14px; flex: 0 0 auto; }
.review-option.correct { background: var(--success-soft); color: var(--success); }
.review-option.chosen-wrong { background: var(--danger-soft); color: var(--danger); }
.review-summary { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 9px; font-size: 11px; color: var(--muted); }
.review-summary b { color: var(--ink); }
.loading-block { display: grid; gap: 14px; padding-top: 20px; }
.skeleton { border-radius: var(--radius-md); background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 37%, var(--surface-2) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; }
.skeleton.h1 { height: 42px; width: 42%; }
.skeleton.card { height: 160px; }
.skeleton.row { height: 76px; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.error-panel { padding: 50px 25px; text-align: center; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line); }
.error-panel h2 { font-family: var(--font-display); font-size: 25px; margin: 12px 0 6px; }
.error-panel p { color: var(--muted); font-size: 13px; margin-bottom: 18px; }

/* ---------- modal + toast ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 100; background: rgba(9, 16, 12, .48); backdrop-filter: blur(5px); display: grid; place-items: center; padding: 20px; animation: fadeIn .18s ease both; }
.modal { width: min(480px, 100%); max-height: 88vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 40px 100px -30px rgba(0,0,0,.5); padding: 26px; animation: modalIn .28s var(--ease) both; }
.modal.wide { width: min(620px, 100%); }
.modal-head { display: flex; align-items: flex-start; gap: 12px; }
.modal-icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-strong); flex: 0 0 auto; }
.modal-icon.danger { background: var(--danger-soft); color: var(--danger); }
.modal h3 { font-family: var(--font-display); font-size: 23px; margin-bottom: 5px; }
.modal p { color: var(--muted); font-size: 13px; line-height: 1.7; }
.modal-body { margin-top: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; flex-wrap: wrap; }
.modal-close { margin-left: auto; width: 34px; height: 34px; min-height: 34px; color: var(--faint); }
.confirm-list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.confirm-item { padding: 11px 13px; border-radius: 10px; background: var(--surface-2); font-size: 12px; }
.confirm-item strong { display: block; font-size: 19px; font-family: var(--font-display); }
.confirm-item span { color: var(--faint); font-size: 10px; }

.toast-root { position: fixed; right: 20px; bottom: 22px; z-index: 120; display: grid; gap: 8px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 9px; max-width: min(360px, calc(100vw - 40px)); padding: 12px 15px; border-radius: 12px; background: var(--ink); color: var(--bg); box-shadow: 0 16px 40px -12px rgba(0,0,0,.4); font-size: 12.5px; font-weight: 600; animation: toastIn .3s var(--ease) both; }
.toast.success { background: var(--success); color: #fff; }
.toast.error { background: var(--danger); color: #fff; }
.toast.leaving { animation: toastOut .22s ease both; }

@keyframes fadeIn { from { opacity: 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(9px); } to { opacity: 1; transform: none; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .hero-grid, .home-grid { grid-template-columns: minmax(0, 1fr) 285px; }
  .practice-grid { grid-template-columns: minmax(0, 1fr) 270px; }
  .exam-body { grid-template-columns: minmax(0, 1fr) 276px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 980px) {
  .shell { grid-template-columns: 76px minmax(0, 1fr); }
  .sidebar { padding: 23px 11px 18px; align-items: center; }
  .sidebar-brand { padding: 0 0 24px; }
  .sidebar-brand .brand-name, .sidebar-brand .brand-sub { display: none; }
  .side-nav { width: 100%; }
  .side-link { justify-content: center; padding: 0; }
  .side-link span.label, .side-count { display: none; }
  .sidebar-mid, .side-user-name, .side-user-role, .side-logout { display: none; }
  .side-user { justify-content: center; padding: 4px; }
  .sidebar-bottom { width: 100%; }
  .hero-grid, .home-grid { grid-template-columns: 1fr; }
  .exam-teaser { min-height: 220px; }
  .practice-grid { grid-template-columns: 1fr; }
  .practice-side { position: static; grid-template-columns: 1fr 1fr; }
  .exam-body { grid-template-columns: 1fr; }
  .palette-card { display: none; }
  .mobile-palette-btn { display: inline-flex; }
  .exam-hero { grid-template-columns: 1fr; }
  .exam-side { border-left: 0; border-top: 1px dashed var(--line); padding: 18px 0 0; }
  .breakdown-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  body { font-size: 14px; }
  .shell { display: block; padding-bottom: 74px; }
  .sidebar { display: none; }
  .topbar { height: 62px; padding: 0 16px; }
  .top-title { display: none; }
  .top-mobile-brand { display: inline-flex; }
  .top-avatar { display: grid; }
  .top-chip { display: none; }
  .page { padding: 6px 16px 34px; }
  .page-head { margin: 12px 0 20px; align-items: flex-start; }
  .page-head h1 { font-size: 29px; }
  .page-head p { font-size: 12.5px; }
  .mobile-nav {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; z-index: 50; left: 0; right: 0; bottom: 0;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 94%, transparent);
    border-top: 1px solid var(--line);
    backdrop-filter: blur(16px);
  }
  .mobile-link { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 0; border-radius: 10px; color: var(--faint); font-size: 9px; font-weight: 650; }
  .mobile-link .icon { width: 21px; height: 21px; }
  .mobile-link.active { color: var(--primary); background: var(--primary-tint); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { min-height: 198px; padding: 24px 22px; }
  .auth-quote { padding: 22px 0 0; margin: 0; }
  .auth-quote .quote-mark { display: none; }
  .auth-quote h1 { font-size: 27px; margin: 0 0 8px; }
  .auth-quote p { display: none; }
  .auth-facts { display: none; }
  .auth-panel { padding: 30px 22px 40px; }
  .auth-mobile-brand { display: flex; }
  .auth-box h2 { font-size: 29px; }
  .auth-tabs { margin-top: 22px; }
  .hero { padding: 23px 21px; border-radius: 22px; }
  .hero h1 { font-size: 29px; }
  .hero p { font-size: 12px; }
  .hero-goal { gap: 14px; margin-top: 21px; }
  .goal-ring { width: 78px; height: 78px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 24px; }
  .stat-head { font-size: 11px; }
  .stat-icon { width: 27px; height: 27px; border-radius: 8px; }
  .stat-icon .icon { width: 15px; height: 15px; }
  .section-card { padding: 18px; }
  .chapter-row { grid-template-columns: minmax(0, 1fr) 47px; }
  .practice-side { grid-template-columns: 1fr; }
  .question-card { padding: 20px 17px; border-radius: 19px; }
  .q-meta { margin-bottom: 17px; }
  .q-stem { font-size: 19px; line-height: 1.65; }
  .options { margin-top: 20px; gap: 9px; }
  .option { padding: 13px 13px; border-radius: 13px; gap: 11px; }
  .option-text { font-size: 13.5px; }
  .option-key { width: 27px; height: 27px; border-radius: 8px; }
  .q-actions { gap: 8px; }
  .q-actions .btn { flex: 1; }
  .key-hint { display: none; }
  .wrong-stats { gap: 7px; }
  .wrong-stat { padding: 13px; }
  .wrong-stat strong { font-size: 22px; }
  .wrong-card { padding: 15px; }
  .toolbar .search-box { max-width: none; width: 100%; flex: 1 0 100%; }
  .exam-hero { padding: 22px 19px; border-radius: 22px; }
  .exam-hero h2 { font-size: 29px; }
  .exam-rules { margin: 15px 0 19px; }
  .history-row { grid-template-columns: 38px minmax(0, 1fr) 54px; gap: 9px; padding: 11px; }
  .history-icon { width: 34px; height: 34px; }
  .history-status, .history-row .btn { display: none; }
  .history-score { font-size: 19px; }
  .exam-page { padding: 0 12px 30px; }
  .exam-topbar { gap: 8px; min-height: 62px; }
  .exam-top-title span { display: none; }
  .exam-top-title strong { font-size: 14px; }
  .exam-timer { padding: 6px 9px; gap: 6px; }
  .exam-timer strong { font-size: 17px; }
  .save-state { display: none; }
  .exam-body { padding-top: 13px; }
  .exam-question { padding: 19px 16px; }
  .exam-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .exam-nav .btn { width: 100%; }
  .exam-nav .spacer { display: none; }
  .result-hero { grid-template-columns: 1fr; gap: 20px; padding: 24px 18px; text-align: center; }
  .score-ring { width: 145px; height: 145px; }
  .score-ring-inner strong { font-size: 44px; }
  .result-stats { justify-content: center; gap: 20px; }
  .result-actions { justify-content: center; }
  .breakdown-grid { gap: 12px; }
  .review-toolbar h2 { width: 100%; }
  .modal { padding: 21px; }
  .toast-root { left: 14px; right: 14px; top: 70px; bottom: auto; justify-items: stretch; }
  .toast { max-width: none; }
  .confirm-list { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .stat-grid { grid-template-columns: 1fr; }
  .hero-actions .btn { flex: 1; }
  .palette-grid { grid-template-columns: repeat(5, 1fr); }
  .history-row { grid-template-columns: 34px minmax(0, 1fr) 46px; }
  .history-icon { width: 30px; height: 30px; }
}

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