/* ==========================================================================
   客观题刷题 · 视觉系统
   默认：纸感实验室（新粗野主义）
   主题：paper / neon / clean
   ========================================================================== */

@font-face {
  font-family: "Smiley Sans";
  src: url("../fonts/SmileySans-Oblique.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;
  --font-display: "Smiley Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --header-h: 76px;
  --container: 1180px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --display-weight: 400;
  --display-spacing: 0.01em;
}

/* ---------- 纸感实验室 ---------- */
html[data-theme="paper"] {
  color-scheme: light;
  --bg: #f3eddf;
  --bg-grid: rgba(11, 11, 11, 0.055);
  --surface: #fffdf8;
  --surface-2: #f7f1e3;
  --surface-3: #e8edff;
  --ink: #0b0b0b;
  --text: #0b0b0b;
  --text-soft: #2a2823;
  --muted: #625d52;
  --faint: #8f897b;
  --accent: #1f35ff;
  --accent-hover: #0b1fd6;
  --accent-soft: #e8edff;
  --accent-border: #1f35ff;
  --yellow: #ffe047;
  --green: #0a8f4d;
  --green-soft: #d9f7e6;
  --green-border: #0a8f4d;
  --red: #e8261f;
  --red-soft: #ffe0dd;
  --red-border: #e8261f;
  --orange: #e07800;
  --orange-soft: #ffefd3;
  --orange-border: #e07800;
  --border: #0b0b0b;
  --border-soft: rgba(11, 11, 11, 0.18);
  --header-bg: rgba(243, 237, 223, 0.9);
  --gradient: linear-gradient(135deg, #1f35ff, #0b0b0b);
  --ring: rgba(31, 53, 255, 0.25);
  --bw: 3px;
  --radius-sm: 0px;
  --radius: 0px;
  --radius-lg: 0px;
  --radius-pill: 999px;
  --font-display: "Smiley Sans", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display-weight: 400;
  --display-spacing: 0.01em;
  --shadow-sm: 4px 4px 0 var(--ink);
  --shadow-md: 7px 7px 0 var(--ink);
  --shadow-lg: 10px 10px 0 var(--ink);
  --shadow-btn: 4px 4px 0 var(--ink);
  --shadow-btn-hover: 7px 7px 0 var(--ink);
  --shadow-card: 6px 6px 0 var(--ink);
  --shadow-card-hover: 10px 10px 0 var(--ink);
  --shadow-option: 2px 2px 0 var(--ink);
  --shadow-option-hover: 4px 4px 0 var(--ink);
  --hover-x: -2px;
  --hover-y: -2px;
  --active-x: 3px;
  --active-y: 3px;
  --card-hover-bg: var(--yellow);
  --option-hover-bg: var(--surface-2);
  --option-selected-bg: var(--accent);
  --option-selected-color: #ffffff;
}

/* ---------- 暗夜霓虹 ---------- */
html[data-theme="neon"] {
  color-scheme: dark;
  --bg: #08090d;
  --bg-grid: rgba(255, 255, 255, 0.04);
  --surface: #10131b;
  --surface-2: #0c0f16;
  --surface-3: #1a1f2b;
  --ink: #f5f7ff;
  --text: #f5f7ff;
  --text-soft: #c7cede;
  --muted: #8b94a7;
  --faint: #5c667a;
  --accent: #38bdf8;
  --accent-hover: #7dd3fc;
  --accent-soft: #0e2434;
  --accent-border: #1e6b8f;
  --yellow: #ffd43b;
  --green: #34d399;
  --green-soft: #0d2a22;
  --green-border: #1f6b52;
  --red: #fb7185;
  --red-soft: #2d1219;
  --red-border: #7a2738;
  --orange: #fbbf24;
  --orange-soft: #2a2110;
  --orange-border: #6b4e17;
  --border: #263041;
  --border-soft: #1b2230;
  --header-bg: rgba(8, 9, 13, 0.78);
  --gradient: linear-gradient(135deg, #38bdf8, #a78bfa 55%, #ffd43b);
  --ring: rgba(56, 189, 248, 0.3);
  --bw: 1px;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  --font-display: var(--font-body);
  --display-weight: 900;
  --display-spacing: -0.04em;
  --shadow-sm: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 0 40px rgba(56, 189, 248, 0.12), 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-btn: 0 0 0 1px rgba(56, 189, 248, 0.18), 0 0 22px rgba(56, 189, 248, 0.12);
  --shadow-btn-hover: 0 0 0 1px rgba(56, 189, 248, 0.5), 0 0 30px rgba(56, 189, 248, 0.25);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.35);
  --shadow-card-hover: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 30px rgba(56, 189, 248, 0.12);
  --shadow-option: none;
  --shadow-option-hover: 0 0 0 1px var(--accent), 0 0 20px rgba(56, 189, 248, 0.15);
  --hover-x: 0px;
  --hover-y: -2px;
  --active-x: 0px;
  --active-y: 1px;
  --card-hover-bg: var(--surface-2);
  --option-hover-bg: #141a25;
  --option-selected-bg: var(--accent-soft);
  --option-selected-color: var(--text);
}

/* ---------- 极简清爽 ---------- */
html[data-theme="clean"] {
  color-scheme: light;
  --bg: #f6f8fa;
  --bg-grid: transparent;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --surface-3: #eef1f4;
  --ink: #1f2328;
  --text: #1f2328;
  --text-soft: #424a53;
  --muted: #656d76;
  --faint: #8c959f;
  --accent: #0969da;
  --accent-hover: #0550ae;
  --accent-soft: #ddf4ff;
  --accent-border: rgba(84, 174, 255, 0.45);
  --yellow: #fff8c5;
  --green: #1a7f37;
  --green-soft: #dafbe1;
  --green-border: rgba(74, 194, 107, 0.45);
  --red: #cf222e;
  --red-soft: #ffebe9;
  --red-border: rgba(255, 129, 130, 0.45);
  --orange: #bc4c00;
  --orange-soft: #fff1e5;
  --orange-border: rgba(251, 143, 68, 0.5);
  --border: #d0d7de;
  --border-soft: #eaeef2;
  --header-bg: rgba(246, 248, 250, 0.86);
  --gradient: linear-gradient(135deg, #0969da, #218bff);
  --ring: rgba(9, 105, 218, 0.3);
  --bw: 1px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-pill: 999px;
  --font-display: var(--font-body);
  --display-weight: 800;
  --display-spacing: -0.03em;
  --shadow-sm: 0 1px 0 rgba(27, 31, 36, 0.04), 0 1px 3px rgba(27, 31, 36, 0.06);
  --shadow-md: 0 8px 24px rgba(140, 149, 159, 0.16);
  --shadow-lg: 0 16px 40px rgba(140, 149, 159, 0.22);
  --shadow-btn: 0 1px 2px rgba(27, 31, 36, 0.06);
  --shadow-btn-hover: 0 4px 12px rgba(140, 149, 159, 0.18);
  --shadow-card: 0 1px 3px rgba(27, 31, 36, 0.06);
  --shadow-card-hover: 0 8px 24px rgba(140, 149, 159, 0.18);
  --shadow-option: none;
  --shadow-option-hover: none;
  --hover-x: 0px;
  --hover-y: -1px;
  --active-x: 0px;
  --active-y: 0px;
  --card-hover-bg: var(--surface);
  --option-hover-bg: var(--surface-2);
  --option-selected-bg: var(--accent-soft);
  --option-selected-color: var(--text);
}

/* ==========================================================================
   Reset & base
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html[data-theme="paper"] body {
  background-image:
    linear-gradient(90deg, var(--bg-grid) 1px, transparent 1px),
    linear-gradient(var(--bg-grid) 1px, transparent 1px);
  background-size: 32px 32px;
}

html[data-theme="neon"] body {
  background-image:
    radial-gradient(ellipse at 50% 110%, rgba(56, 189, 248, 0.16), transparent 55%),
    radial-gradient(ellipse at 12% -10%, rgba(167, 139, 250, 0.12), transparent 45%),
    radial-gradient(rgba(255, 255, 255, 0.55) 0.7px, transparent 0.8px);
  background-size: auto, auto, 26px 26px;
  background-attachment: fixed;
}

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

html[data-theme="neon"] ::selection {
  background: var(--accent);
  color: #04101f;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

img,
svg {
  display: block;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

html[data-theme="neon"] :focus-visible {
  outline-color: var(--yellow);
}

.icon {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 300;
  padding: 8px 14px;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  font-size: 13px;
  font-weight: 800;
  transform: translateY(-180%);
  transition: transform 0.15s var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

.container {
  width: min(var(--container), calc(100% - 48px));
  margin-inline: auto;
}

.noscript {
  max-width: 520px;
  margin: 40px auto;
  padding: 20px;
  border: var(--bw) solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-align: center;
}

main:focus {
  outline: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-btn);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition:
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease),
    border-color 0.16s var(--ease),
    color 0.16s var(--ease);
}

.btn:hover {
  transform: translate(var(--hover-x), var(--hover-y));
  box-shadow: var(--shadow-btn-hover);
}

.btn:active {
  transform: translate(var(--active-x), var(--active-y));
  box-shadow: none;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--border);
  color: #ffffff;
}

html[data-theme="paper"] .btn-primary {
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="neon"] .btn-primary {
  background: var(--gradient);
  color: #04101f;
  border-color: transparent;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

html[data-theme="neon"] .btn-primary:hover {
  background: var(--gradient);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--accent-soft);
  border-color: var(--border);
  color: var(--accent);
}

html[data-theme="neon"] .btn-secondary {
  border-color: var(--accent-border);
  background: transparent;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: var(--muted);
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: transparent;
  box-shadow: none;
}

.btn-danger {
  background: var(--red);
  border-color: var(--border);
  color: #ffffff;
}

.btn-sm {
  height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.btn-lg {
  height: 52px;
  padding: 0 22px;
  font-size: 14px;
}

.btn .icon {
  width: 17px;
  height: 17px;
}

.link-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.link-btn:hover {
  color: var(--accent);
}

.link-btn .icon {
  width: 14px;
  height: 14px;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: var(--bw) solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: box-shadow 0.2s var(--ease);
}

html[data-theme="paper"] .site-header {
  box-shadow: 0 4px 0 rgba(11, 11, 11, 0.06);
}

body.has-scrolled .site-header {
  box-shadow: 0 6px 0 rgba(11, 11, 11, 0.1);
}

html[data-theme="neon"] body.has-scrolled .site-header,
html[data-theme="clean"] body.has-scrolled .site-header {
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.28);
}

.scroll-progress {
  position: absolute;
  right: 0;
  bottom: calc(-1 * var(--bw));
  left: 0;
  height: 3px;
  pointer-events: none;
  z-index: 2;
}

#scroll-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--accent);
  transition: width 0.1s linear;
}

html[data-theme="neon"] #scroll-progress-bar {
  background: var(--gradient);
  box-shadow: 0 0 12px var(--ring);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
  transition: transform 0.2s var(--ease-bounce);
}

.brand:hover .brand-mark {
  transform: rotate(3deg) scale(1.04);
}

.brand-mark .icon {
  width: 22px;
  height: 22px;
  stroke-width: 3;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1;
}

.brand-text strong {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
}

.brand-text small {
  margin-top: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.13em;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.mode-toggle {
  display: flex;
  gap: 2px;
  padding: 4px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-btn);
}

.mode-toggle button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  transition:
    background-color 0.16s var(--ease),
    color 0.16s var(--ease),
    box-shadow 0.16s var(--ease);
}

.mode-toggle button:hover {
  color: var(--text);
}

.mode-toggle button.is-active {
  background: var(--yellow);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}

html[data-theme="neon"] .brand-mark {
  border-color: transparent;
  border-radius: 50%;
  background: var(--gradient);
  box-shadow: 0 0 28px var(--ring);
  color: #04101f;
  transform: none;
}

html[data-theme="neon"] .brand:hover .brand-mark {
  transform: scale(1.04);
}

html[data-theme="neon"] .brand-text strong {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

html[data-theme="neon"] .mode-toggle {
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: none;
}

html[data-theme="neon"] .mode-toggle button.is-active {
  background: var(--accent);
  color: #04101f;
  box-shadow: 0 0 18px var(--ring);
}

html[data-theme="clean"] .mode-toggle {
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: none;
}

html[data-theme="clean"] .mode-toggle button.is-active {
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.wrong-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-btn);
  font-size: 12px;
  font-weight: 800;
  transition:
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.wrong-link:hover {
  transform: translate(var(--hover-x), var(--hover-y));
  box-shadow: var(--shadow-btn-hover);
}

.wrong-link .icon {
  width: 15px;
  height: 15px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--red);
  color: #ffffff;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
}

.theme-menu {
  position: relative;
}

.theme-menu > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: var(--shadow-btn);
  color: var(--text);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  list-style: none;
  transition:
    transform 0.16s var(--ease),
    box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.theme-menu > summary::-webkit-details-marker {
  display: none;
}

.theme-menu > summary:hover {
  transform: translate(var(--hover-x), var(--hover-y));
  box-shadow: var(--shadow-btn-hover);
}

.theme-menu > summary .icon {
  width: 15px;
  height: 15px;
}

.theme-pop {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 100;
  width: 240px;
  padding: 10px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.18s var(--ease);
}

.theme-pop-head {
  padding: 4px 8px 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  text-align: left;
}

.theme-option:hover {
  background: var(--yellow);
}

html[data-theme="neon"] .theme-option:hover {
  background: var(--accent-soft);
}

html[data-theme="clean"] .theme-option:hover {
  background: var(--surface-2);
}

.theme-option .check {
  width: 16px;
  height: 16px;
  margin-left: auto;
  color: var(--accent);
  opacity: 0;
}

.theme-option.is-active .check {
  opacity: 1;
}

.swatch {
  flex: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-radius: 4px;
}

.swatch-paper {
  background: linear-gradient(135deg, #ffe047 0 50%, #1f35ff 50% 100%);
}

.swatch-neon {
  background:
    radial-gradient(circle at 30% 30%, #38bdf8, transparent 55%),
    radial-gradient(circle at 70% 70%, #ffd43b, transparent 45%),
    #08090d;
}

.swatch-clean {
  background: linear-gradient(135deg, #f6f8fa 0 50%, #0969da 50% 100%);
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  border-bottom: var(--bw) solid var(--border);
  background: var(--yellow);
}

.hero::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    620px circle at var(--mx, 50%) var(--my, 34%),
    rgba(255, 255, 255, 0.5),
    transparent 62%
  );
  content: "";
  pointer-events: none;
}

.hero-grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(11, 11, 11, 0.09) 1px, transparent 1px),
    linear-gradient(rgba(11, 11, 11, 0.09) 1px, transparent 1px);
  background-size: 42px 42px;
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 54px;
  align-items: center;
  padding: 76px 0 70px;
}

.hero-copy {
  min-width: 0;
}

.hero-stickers {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 20px;
  font-family: var(--font-display);
  font-size: clamp(3rem, 7vw, 6.2rem);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
  line-height: 0.98;
  text-wrap: balance;
  text-shadow: 5px 5px 0 var(--accent);
}

.hero-accent {
  color: var(--accent);
  text-shadow: 5px 5px 0 var(--ink);
}

.hero-lead {
  max-width: 52ch;
  margin: 0 0 26px;
  color: var(--text-soft);
  font-size: 16px;
  line-height: 1.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 26px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.hero-meta .icon {
  width: 14px;
  height: 14px;
  color: var(--accent);
}

.hero-side {
  position: relative;
  min-width: 0;
}

.overview {
  position: relative;
  z-index: 1;
  padding: 24px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow:
    12px 12px 0 var(--accent),
    12px 12px 0 calc(12px + var(--bw)) var(--border);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) rotate(1.5deg);
  transition: transform 0.16s ease-out;
}

html[data-theme="neon"] .overview {
  background: linear-gradient(180deg, rgba(20, 26, 38, 0.94), rgba(12, 16, 24, 0.94));
  border-color: rgba(56, 189, 248, 0.28);
  border-radius: var(--radius-lg);
  box-shadow: 0 0 60px rgba(56, 189, 248, 0.08), 0 24px 60px rgba(0, 0, 0, 0.5);
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}

html[data-theme="clean"] .overview {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  transform: none;
}

.overview-sticker {
  position: absolute;
  top: -18px;
  right: 18px;
  z-index: 2;
}

.overview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.overview-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: var(--display-weight);
}

.live-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.live-dot::before {
  width: 7px;
  height: 7px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--green);
  content: "";
}

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.metric {
  padding: 13px 14px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}

html[data-theme="neon"] .metric {
  border-color: var(--border-soft);
  border-radius: 12px;
  background: rgba(8, 11, 17, 0.65);
}

html[data-theme="clean"] .metric {
  border: 1px solid var(--border-soft);
  border-radius: 8px;
}

.metric-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.metric-label .icon {
  width: 13px;
  height: 13px;
}

.metric-value {
  margin-top: 7px;
  font-family: var(--font-mono);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.metric-value small {
  margin-left: 2px;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 600;
}

.metric-empty {
  color: var(--faint);
}

.overview-progress {
  margin-top: 18px;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.progress-track {
  overflow: hidden;
  height: 12px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: repeating-linear-gradient(
    45deg,
    var(--accent) 0 7px,
    #5367ff 7px 14px
  );
  transition: width 0.8s var(--ease);
}

html[data-theme="neon"] .progress-track {
  border-color: var(--accent-border);
  background: #0a0d14;
}

html[data-theme="neon"] .progress-fill {
  background: var(--gradient);
  box-shadow: 0 0 18px var(--ring);
}

html[data-theme="clean"] .progress-track {
  border: 1px solid var(--border);
  height: 8px;
}

html[data-theme="clean"] .progress-fill {
  background: var(--gradient);
}

.overview-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 2px dashed var(--border-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.overview-cta .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}

.overview-cta:hover .icon {
  transform: translateX(5px);
}

.floating-note {
  --rot: -4deg;
  position: absolute;
  bottom: -28px;
  left: -24px;
  z-index: 2;
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 13px;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  transform: rotate(-4deg);
  animation: float 5s ease-in-out infinite;
}

.floating-note strong {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--display-weight);
  line-height: 1;
}

.floating-note span {
  font-family: var(--font-mono);
  font-size: 9px;
}

html[data-theme="neon"] .floating-note {
  --rot: 0deg;
  border-color: var(--accent-border);
  background: #0c0f16;
  color: var(--yellow);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.18);
  border-radius: var(--radius-pill);
}

.hero-spark {
  position: absolute;
  z-index: 2;
  color: var(--accent);
  font-family: var(--font-display);
  line-height: 1;
  pointer-events: none;
  animation: float 6s ease-in-out infinite;
}

.hero-spark--one {
  top: -26px;
  left: -6px;
  font-size: 34px;
}

.hero-spark--two {
  right: -14px;
  bottom: -30px;
  color: var(--ink);
  font-size: 26px;
  animation-delay: -2.2s;
}

html[data-theme="neon"] .hero {
  border-bottom-color: var(--border-soft);
  background: transparent;
}

html[data-theme="neon"] .hero::before {
  background: radial-gradient(
    620px circle at var(--mx, 50%) var(--my, 34%),
    rgba(56, 189, 248, 0.16),
    transparent 62%
  );
}

html[data-theme="neon"] .hero-grid-bg {
  background-image:
    radial-gradient(rgba(255, 255, 255, 0.55) 0.7px, transparent 0.8px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 26px 26px, 52px 52px, 52px 52px;
  animation: twinkle 6s ease-in-out infinite alternate;
}

html[data-theme="neon"] .hero h1 {
  font-family: var(--font-body);
  font-size: clamp(2.4rem, 5.6vw, 4.8rem);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.04;
  text-shadow: none;
}

html[data-theme="neon"] .hero-accent {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 24px rgba(56, 189, 248, 0.3));
  text-shadow: none;
  animation: gradientShift 7s ease-in-out infinite;
}

html[data-theme="neon"] .hero-lead {
  color: var(--text-soft);
}

html[data-theme="neon"] .hero-meta {
  color: var(--muted);
}

html[data-theme="neon"] .hero-spark--one {
  color: var(--yellow);
  text-shadow: 0 0 18px rgba(255, 212, 59, 0.5);
}

html[data-theme="neon"] .hero-spark--two {
  color: var(--accent);
  text-shadow: 0 0 18px var(--ring);
}

/* ==========================================================================
   Stickers & tabs
   ========================================================================== */

.sticker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 14px 6px;
  border: var(--bw) solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  white-space: nowrap;
  transform: rotate(var(--rot, 0deg));
}

.sticker--yellow {
  background: var(--yellow);
}

.sticker--blue {
  background: var(--accent);
  color: #ffffff;
}

.sticker--ink {
  background: var(--ink);
  color: var(--yellow);
}

.sticker--red {
  background: var(--red);
  color: #ffffff;
}

.sticker--green {
  background: var(--green);
  color: #ffffff;
}

html[data-theme="neon"] .sticker {
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: rgba(16, 19, 27, 0.78);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.16);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 10px;
  letter-spacing: 0.04em;
  transform: none;
}

html[data-theme="neon"] .sticker--yellow {
  border-color: rgba(255, 212, 59, 0.5);
  color: var(--yellow);
}

html[data-theme="neon"] .sticker--blue {
  border-color: var(--accent-border);
  color: var(--accent);
}

html[data-theme="neon"] .sticker--ink {
  border-color: var(--border);
  color: var(--text);
}

html[data-theme="neon"] .sticker--red {
  border-color: var(--red-border);
  color: var(--red);
}

html[data-theme="clean"] .sticker {
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  box-shadow: none;
  color: var(--muted);
  font-size: 10px;
  transform: none;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 4px 15px 6px;
  border: var(--bw) solid var(--border);
  background: var(--ink);
  box-shadow: var(--shadow-sm);
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: var(--display-weight);
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(-2deg);
}

.tab--blue {
  background: var(--accent);
  color: #ffffff;
}

.tab--red {
  background: var(--red);
  color: #ffffff;
}

html[data-theme="neon"] .tab {
  padding: 5px 12px;
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  box-shadow: 0 0 22px rgba(56, 189, 248, 0.14);
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transform: none;
}

html[data-theme="neon"] .tab--red {
  border-color: var(--red-border);
  background: var(--red-soft);
  color: var(--red);
}

html[data-theme="clean"] .tab {
  padding: 4px 10px;
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 700;
  transform: none;
}

html[data-theme="clean"] .tab--red {
  border-color: var(--red-border);
  background: var(--red-soft);
  color: var(--red);
}

/* ==========================================================================
   Marquee
   ========================================================================== */

.marquee {
  overflow: hidden;
  padding: 10px 0;
  border-bottom: var(--bw) solid var(--border);
  background: var(--ink);
  color: var(--yellow);
}

.marquee-track {
  display: flex;
  width: max-content;
  animation: marquee 28s linear infinite;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 20px;
  padding-right: 20px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: var(--display-weight);
  line-height: 1.3;
  white-space: nowrap;
}

.marquee-group i {
  color: var(--accent);
  font-style: normal;
  font-size: 16px;
}

html[data-theme="neon"] .marquee {
  border-color: var(--accent-border);
  background: #0a0c12;
  color: var(--yellow);
  box-shadow: inset 0 0 40px rgba(56, 189, 248, 0.04);
}

html[data-theme="neon"] .marquee-group {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-shadow: 0 0 18px rgba(255, 212, 59, 0.3);
}

html[data-theme="neon"] .marquee-group i {
  color: var(--accent);
}

html[data-theme="clean"] .marquee {
  padding: 8px 0;
  border-color: var(--border-soft);
  background: var(--surface-2);
  color: var(--muted);
}

html[data-theme="clean"] .marquee-track {
  animation-duration: 40s;
}

html[data-theme="clean"] .marquee-group {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
}

html[data-theme="clean"] .marquee-group i {
  color: var(--accent);
  font-size: 10px;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.section {
  padding-top: 68px;
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 30px;
}

.section-title {
  min-width: 0;
}

.section-title .tab {
  margin-bottom: 18px;
}

.section-head h2 {
  max-width: 16ch;
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.3rem, 4.5vw, 4rem);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
  line-height: 1.02;
  text-wrap: balance;
}

.section-note {
  max-width: 36ch;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.9;
  text-align: right;
}

.count-chip {
  flex: none;
  padding: 4px 10px;
  border: var(--bw) solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

html[data-theme="neon"] .count-chip {
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--accent);
}

html[data-theme="clean"] .count-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: none;
  background: var(--surface);
}

/* ==========================================================================
   Chapter cards
   ========================================================================== */

.chapter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.chapter-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 13px;
  overflow: hidden;
  min-height: 238px;
  padding: 22px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  color: var(--text);
  transition:
    transform 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease),
    border-color 0.18s var(--ease);
}

.chapter-card::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 6px;
  background: var(--accent);
  content: "";
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s var(--ease);
}

.chapter-card::after {
  position: absolute;
  right: 8px;
  bottom: -16px;
  color: var(--ink);
  content: attr(data-index);
  font-family: var(--font-display);
  font-size: 92px;
  font-weight: var(--display-weight);
  line-height: 1;
  opacity: 0.055;
  pointer-events: none;
  transform: rotate(-6deg);
}

.chapter-card:hover {
  background: var(--card-hover-bg);
  border-color: var(--border);
  box-shadow: var(--shadow-card-hover);
  transform: translate(var(--hover-x), var(--hover-y));
}

.chapter-card:hover::before {
  transform: scaleX(1);
}

html[data-theme="neon"] .chapter-card {
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.94), rgba(11, 15, 22, 0.94));
  border-color: rgba(56, 189, 248, 0.16);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

html[data-theme="neon"] .chapter-card::before {
  height: 3px;
  background: var(--gradient);
  transform: scaleX(0);
}

html[data-theme="neon"] .chapter-card::after {
  color: var(--accent);
  opacity: 0.07;
}

html[data-theme="neon"] .chapter-card:hover {
  border-color: rgba(56, 189, 248, 0.55);
  background: linear-gradient(180deg, rgba(22, 29, 42, 0.98), rgba(12, 16, 24, 0.98));
  box-shadow: var(--shadow-card-hover);
}

html[data-theme="clean"] .chapter-card {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

html[data-theme="clean"] .chapter-card::before {
  display: none;
}

html[data-theme="clean"] .chapter-card::after {
  color: var(--muted);
  opacity: 0.04;
}

html[data-theme="clean"] .chapter-card:hover {
  border-color: var(--accent-border);
  background: var(--surface);
  box-shadow: var(--shadow-card-hover);
}

.chapter-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.chapter-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  padding: 3px 8px;
  border: 2px solid var(--border);
  background: var(--ink);
  box-shadow: 2px 2px 0 var(--accent);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

html[data-theme="neon"] .chapter-index {
  border-color: var(--accent-border);
  border-radius: 8px;
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent);
}

html[data-theme="clean"] .chapter-index {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: none;
  color: var(--muted);
}

.chapter-status {
  padding: 3px 9px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.chapter-status.is-progress {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.chapter-status.is-done {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

html[data-theme="neon"] .chapter-status {
  border-color: var(--border);
  background: transparent;
}

html[data-theme="neon"] .chapter-status.is-progress {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="neon"] .chapter-status.is-done {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}

html[data-theme="clean"] .chapter-status {
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.chapter-card h3 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
  line-height: 1.05;
}

html[data-theme="neon"] .chapter-card h3,
html[data-theme="clean"] .chapter-card h3 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.chapter-card .subtitle {
  position: relative;
  z-index: 1;
  min-height: 36px;
  margin: -5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.type-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.type-pill {
  padding: 2px 7px;
  border: 2px solid var(--border);
  background: var(--surface-2);
  box-shadow: 1px 1px 0 var(--ink);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
}

html[data-theme="neon"] .type-pill {
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

html[data-theme="clean"] .type-pill {
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: var(--surface-2);
  box-shadow: none;
  color: var(--muted);
}

.chapter-foot {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: auto;
}

.chapter-foot .track {
  flex: 1;
  overflow: hidden;
  height: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.chapter-foot .fill {
  height: 100%;
  width: 0;
  background: repeating-linear-gradient(
    45deg,
    var(--accent) 0 6px,
    #5367ff 6px 12px
  );
  transition: width 0.8s var(--ease);
}

html[data-theme="neon"] .chapter-foot .track {
  height: 8px;
  border: 1px solid var(--accent-border);
  background: #0a0d14;
}

html[data-theme="neon"] .chapter-foot .fill {
  background: var(--gradient);
  box-shadow: 0 0 14px var(--ring);
}

html[data-theme="clean"] .chapter-foot .track {
  height: 4px;
  border: 0;
  background: var(--surface-3);
}

html[data-theme="clean"] .chapter-foot .fill {
  background: var(--accent);
}

.chapter-foot .count {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9.5px;
}

.chapter-arrow {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  transition:
    transform 0.2s var(--ease),
    background-color 0.2s var(--ease),
    color 0.2s var(--ease);
}

.chapter-arrow .icon {
  width: 14px;
  height: 14px;
}

.chapter-card:hover .chapter-arrow {
  background: var(--ink);
  color: var(--yellow);
  transform: translateX(4px);
}

html[data-theme="neon"] .chapter-arrow {
  border-color: var(--accent-border);
  color: var(--accent);
}

html[data-theme="neon"] .chapter-card:hover .chapter-arrow {
  background: var(--accent);
  color: #04101f;
}

html[data-theme="clean"] .chapter-arrow {
  border: 1px solid var(--border);
}

html[data-theme="clean"] .chapter-card:hover .chapter-arrow {
  background: var(--accent);
  color: #ffffff;
}

/* ==========================================================================
   Utility / workflow
   ========================================================================== */

.workflow {
  padding-bottom: 20px;
}

.utility-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.utility-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 26px 22px 22px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

.step-number {
  position: absolute;
  top: -16px;
  left: 18px;
  padding: 2px 10px 4px;
  border: var(--bw) solid var(--border);
  background: var(--yellow);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1.2;
  transform: rotate(-3deg);
}

html[data-theme="neon"] .utility-card {
  border-color: var(--border);
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.92), rgba(11, 15, 22, 0.92));
  box-shadow: var(--shadow-card);
}

html[data-theme="neon"] .step-number {
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  box-shadow: 0 0 18px rgba(56, 189, 248, 0.16);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  transform: none;
}

html[data-theme="clean"] .utility-card {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

html[data-theme="clean"] .step-number {
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  box-shadow: none;
  color: var(--accent);
  font-family: var(--font-body);
  font-size: 11px;
  transform: none;
}

.utility-card h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--display-weight);
  line-height: 1.2;
}

html[data-theme="neon"] .utility-card h3,
html[data-theme="clean"] .utility-card h3 {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
}

.utility-card h3 .icon {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.utility-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}

.utility-card .mode-toggle {
  align-self: flex-start;
  margin-top: 2px;
}

.utility-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.utility-link .icon {
  width: 14px;
  height: 14px;
  transition: transform 0.2s var(--ease);
}

.utility-link:hover .icon {
  transform: translateX(4px);
}

.big-number {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: var(--display-weight);
  letter-spacing: -0.02em;
  line-height: 1;
}

html[data-theme="neon"] .big-number,
html[data-theme="clean"] .big-number {
  font-family: var(--font-mono);
  font-size: 40px;
  font-weight: 700;
}

.big-number small {
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
}

/* ==========================================================================
   Chapter page
   ========================================================================== */

.chapter-page {
  padding-bottom: 60px;
}

.chapter-hero {
  position: relative;
  overflow: hidden;
  border-bottom: var(--bw) solid var(--border);
  background: var(--yellow);
}

.chapter-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(11, 11, 11, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(11, 11, 11, 0.08) 1px, transparent 1px);
  background-size: 36px 36px;
  content: "";
  pointer-events: none;
}

.chapter-hero-watermark {
  position: absolute;
  top: -48px;
  right: 2%;
  z-index: 0;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: clamp(150px, 24vw, 340px);
  font-weight: var(--display-weight);
  line-height: 1;
  opacity: 0.06;
  pointer-events: none;
  user-select: none;
}

.chapter-hero-inner {
  position: relative;
  z-index: 1;
  padding: 34px 0 38px;
}

html[data-theme="neon"] .chapter-hero {
  border-color: var(--border-soft);
  background:
    radial-gradient(ellipse at 70% 20%, rgba(56, 189, 248, 0.12), transparent 50%),
    radial-gradient(ellipse at 15% 100%, rgba(167, 139, 250, 0.1), transparent 50%);
}

html[data-theme="neon"] .chapter-hero::before {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

html[data-theme="neon"] .chapter-hero-watermark {
  color: var(--accent);
  opacity: 0.07;
}

html[data-theme="clean"] .chapter-hero {
  border-color: var(--border-soft);
  background: var(--bg);
}

html[data-theme="clean"] .chapter-hero::before {
  display: none;
}

html[data-theme="clean"] .chapter-hero-watermark {
  color: var(--muted);
  opacity: 0.04;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 20px;
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
}

.back-link:hover {
  color: var(--accent);
}

.back-link .icon {
  width: 14px;
  height: 14px;
}

.chapter-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 44px;
  align-items: end;
}

.chapter-title-block .tab {
  margin-bottom: 18px;
}

.chapter-title-block h1 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: clamp(3.4rem, 7vw, 6rem);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
  line-height: 0.95;
  text-shadow: 5px 5px 0 var(--accent);
}

html[data-theme="neon"] .chapter-title-block h1 {
  font-family: var(--font-body);
  font-weight: 900;
  font-size: clamp(2.8rem, 6vw, 5rem);
  letter-spacing: -0.05em;
  text-shadow: 0 0 40px rgba(56, 189, 248, 0.25);
}

html[data-theme="clean"] .chapter-title-block h1 {
  font-family: var(--font-body);
  font-weight: 800;
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  letter-spacing: -0.04em;
  text-shadow: none;
}

.chapter-title-block .subtitle {
  margin: 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.7;
}

.chapter-hero .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 16px;
}

.meta-chip {
  padding: 4px 9px;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 2px 2px 0 var(--ink);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
}

html[data-theme="neon"] .meta-chip {
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
}

html[data-theme="clean"] .meta-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  box-shadow: none;
  background: var(--surface);
}

.chapter-stamp {
  position: relative;
  min-width: 210px;
  padding: 16px 20px 18px;
  border: var(--bw) solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  transform: rotate(2deg);
}

.chapter-stamp__label {
  display: block;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
}

.chapter-stamp__number {
  display: block;
  margin: 2px 0 10px;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 72px;
  font-weight: var(--display-weight);
  line-height: 0.9;
}

.chapter-stamp__stats {
  display: flex;
  gap: 20px;
  margin-bottom: 12px;
}

.chapter-stamp__stats strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 21px;
  line-height: 1.1;
}

.chapter-stamp__stats span {
  color: var(--muted);
  font-size: 9px;
}

.chapter-stamp__bar {
  overflow: hidden;
  height: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.chapter-stamp__bar span {
  display: block;
  width: 0;
  height: 100%;
  background: repeating-linear-gradient(
    45deg,
    var(--accent) 0 6px,
    #5367ff 6px 12px
  );
  transition: width 0.8s var(--ease);
}

html[data-theme="neon"] .chapter-stamp {
  border-color: var(--accent-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.95), rgba(11, 15, 22, 0.95));
  box-shadow: var(--shadow-lg);
  transform: none;
}

html[data-theme="neon"] .chapter-stamp__number {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font-body);
  font-weight: 900;
  animation: gradientShift 9s ease-in-out infinite;
}

html[data-theme="neon"] .chapter-stamp__bar {
  border-color: var(--accent-border);
  background: #0a0d14;
}

html[data-theme="neon"] .chapter-stamp__bar span {
  background: var(--gradient);
  box-shadow: 0 0 16px var(--ring);
}

html[data-theme="clean"] .chapter-stamp {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transform: none;
}

html[data-theme="clean"] .chapter-stamp__number {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text);
  font-size: 54px;
}

html[data-theme="clean"] .chapter-stamp__bar {
  border: 0;
  height: 6px;
  background: var(--surface-3);
}

html[data-theme="clean"] .chapter-stamp__bar span {
  background: var(--accent);
}

/* ==========================================================================
   Type navigation
   ========================================================================== */

.type-nav-wrap {
  position: sticky;
  top: var(--header-h);
  z-index: 50;
  border-bottom: var(--bw) solid var(--border);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.type-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 0;
}

.type-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 56px;
  padding: 0 12px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background-color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    color 0.15s var(--ease);
}

.type-tab:hover {
  background: var(--accent-soft);
  transform: translate(-1px, -1px);
  box-shadow: 4px 4px 0 var(--ink);
}

.type-tab.is-active {
  background: var(--yellow);
  color: var(--ink);
  transform: translate(-2px, -2px);
  box-shadow: 5px 5px 0 var(--ink);
}

.type-tab .icon {
  width: 16px;
  height: 16px;
}

.type-tab .count {
  padding: 1px 6px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 9px;
  line-height: 1.4;
}

html[data-theme="neon"] .type-nav-wrap {
  border-color: var(--border-soft);
}

html[data-theme="neon"] .type-tab {
  border-color: var(--border);
  border-radius: var(--radius);
  background: rgba(16, 19, 27, 0.82);
  box-shadow: none;
  color: var(--muted);
}

html[data-theme="neon"] .type-tab:hover {
  border-color: var(--accent-border);
  background: var(--surface-2);
  color: var(--text);
  transform: translateY(-2px);
}

html[data-theme="neon"] .type-tab.is-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 26px rgba(56, 189, 248, 0.18);
  color: var(--accent);
  transform: none;
}

html[data-theme="neon"] .type-tab .count {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="clean"] .type-nav-wrap {
  border-color: var(--border-soft);
}

html[data-theme="clean"] .type-tab {
  border-color: transparent;
  border-radius: var(--radius);
  background: transparent;
  box-shadow: none;
  color: var(--muted);
  height: 46px;
}

html[data-theme="clean"] .type-tab:hover {
  background: var(--surface-2);
  color: var(--text);
  transform: none;
}

html[data-theme="clean"] .type-tab.is-active {
  border-color: var(--border);
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--accent), var(--shadow-sm);
  color: var(--accent);
  transform: none;
}

html[data-theme="clean"] .type-tab .count {
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--muted);
}

html[data-theme="clean"] .type-tab.is-active .count {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

/* ==========================================================================
   Chapter main
   ========================================================================== */

.chapter-main {
  padding-top: 28px;
}

.list-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.list-head h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  font-size: 15px;
}

.list-head h2 .tab {
  font-size: 20px;
}

.list-head .sub {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.group-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.group-progress .track {
  overflow: hidden;
  width: 140px;
  height: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
}

.group-progress .fill {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.6s var(--ease);
}

html[data-theme="neon"] .group-progress .track {
  border-color: var(--accent-border);
  background: #0a0d14;
}

html[data-theme="neon"] .group-progress .fill {
  background: var(--gradient);
  box-shadow: 0 0 12px var(--ring);
}

html[data-theme="clean"] .group-progress .track {
  border: 0;
  height: 5px;
  background: var(--surface-3);
}

html[data-theme="clean"] .group-progress .fill {
  background: var(--accent);
}

.mode-hint {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 18px;
  padding: 12px 14px;
  border: var(--bw) solid var(--border);
  background: var(--accent-soft);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.75;
}

.mode-hint .icon {
  width: 16px;
  height: 16px;
  margin-top: 2px;
  color: var(--accent);
}

html[data-theme="neon"] .mode-hint {
  border-color: var(--accent-border);
  border-radius: var(--radius);
  background: rgba(14, 36, 52, 0.6);
  box-shadow: none;
  color: var(--text-soft);
}

html[data-theme="clean"] .mode-hint {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--accent-soft);
  box-shadow: none;
}

.question-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* ==========================================================================
   Question card
   ========================================================================== */

.q-card {
  position: relative;
  padding: 22px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-card);
  scroll-margin-top: calc(var(--header-h) + 92px);
  animation: cardIn 0.34s var(--ease) both;
  transition:
    background-color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    box-shadow 0.2s var(--ease);
}

.q-card.is-correct {
  border-color: var(--green);
  box-shadow: 6px 6px 0 var(--green);
  animation: cardIn 0.3s var(--ease) both, correctPulse 0.5s 0.06s var(--ease-bounce);
}

.q-card.is-wrong {
  border-color: var(--red);
  box-shadow: 6px 6px 0 var(--red);
  animation: cardIn 0.3s var(--ease) both, wrongShake 0.42s 0.04s var(--ease);
}

.q-card.is-incomplete {
  border-color: var(--orange);
  box-shadow: 6px 6px 0 var(--orange);
  animation: cardIn 0.3s var(--ease) both, softWobble 0.48s 0.04s var(--ease);
}

html[data-theme="neon"] .q-card {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.94), rgba(11, 15, 22, 0.94));
  box-shadow: var(--shadow-card);
}

html[data-theme="neon"] .q-card:hover {
  border-color: var(--accent-border);
}

html[data-theme="neon"] .q-card.is-correct {
  border-color: var(--green);
  box-shadow: 0 0 0 1px var(--green-border), 0 0 34px rgba(52, 211, 153, 0.16);
}

html[data-theme="neon"] .q-card.is-wrong {
  border-color: var(--red);
  box-shadow: 0 0 0 1px var(--red-border), 0 0 34px rgba(251, 113, 133, 0.16);
}

html[data-theme="neon"] .q-card.is-incomplete {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange-border), 0 0 34px rgba(251, 191, 36, 0.14);
}

html[data-theme="clean"] .q-card {
  border-color: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

html[data-theme="clean"] .q-card.is-correct {
  border-color: var(--green-border);
  box-shadow: inset 3px 0 0 var(--green), var(--shadow-sm);
}

html[data-theme="clean"] .q-card.is-wrong {
  border-color: var(--red-border);
  box-shadow: inset 3px 0 0 var(--red), var(--shadow-sm);
}

html[data-theme="clean"] .q-card.is-incomplete {
  border-color: var(--orange-border);
  box-shadow: inset 3px 0 0 var(--orange), var(--shadow-sm);
}

.q-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.q-num {
  padding: 2px 7px;
  border: 2px solid var(--border);
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
}

.q-type {
  padding: 2px 8px;
  border: 2px solid var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 9px;
  font-weight: 800;
}

.q-source {
  color: var(--muted);
  font-size: 9.5px;
}

.q-status {
  margin-left: auto;
  padding: 3px 9px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  white-space: nowrap;
}

.q-status.is-answered {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.q-status.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.q-status.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.q-status.is-incomplete {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
}

html[data-theme="neon"] .q-num {
  border-color: var(--accent-border);
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="neon"] .q-type {
  border-color: var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="neon"] .q-status {
  border-color: var(--border);
  background: transparent;
}

html[data-theme="neon"] .q-status.is-answered {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="neon"] .q-status.is-correct {
  border-color: var(--green-border);
  background: var(--green-soft);
  color: var(--green);
}

html[data-theme="neon"] .q-status.is-wrong {
  border-color: var(--red-border);
  background: var(--red-soft);
  color: var(--red);
}

html[data-theme="neon"] .q-status.is-incomplete {
  border-color: var(--orange-border);
  background: var(--orange-soft);
  color: var(--orange);
}

html[data-theme="clean"] .q-num {
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
  border-radius: 5px;
}

html[data-theme="clean"] .q-type {
  border: 1px solid var(--accent-border);
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
}

html[data-theme="clean"] .q-status {
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
}

.q-stem {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.9;
  word-break: break-word;
}

html[data-theme="neon"] .q-stem {
  font-size: 16px;
  font-weight: 500;
}

html[data-theme="clean"] .q-stem {
  font-size: 16px;
}

.blank-input {
  display: inline-block;
  width: 180px;
  max-width: 100%;
  height: 40px;
  margin: 0 4px;
  padding: 0 12px;
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  border-radius: 0;
  background: var(--surface-2);
  color: var(--text);
  font-size: 14px;
  vertical-align: baseline;
  transition:
    border-color 0.18s var(--ease),
    box-shadow 0.18s var(--ease),
    background-color 0.18s var(--ease);
}

.blank-input::placeholder {
  color: var(--faint);
  font-size: 11px;
}

.blank-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--accent);
}

.blank-input:disabled {
  opacity: 0.82;
}

html[data-theme="neon"] .blank-input {
  border-color: var(--border);
  border-bottom-width: 2px;
  border-radius: 10px;
  background: #0b0f16;
}

html[data-theme="neon"] .blank-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

html[data-theme="clean"] .blank-input {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-2);
}

html[data-theme="clean"] .blank-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--ring);
}

.q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-option);
  color: var(--text);
  font-size: 14px;
  line-height: 1.65;
  text-align: left;
  transition:
    transform 0.15s var(--ease),
    box-shadow 0.15s var(--ease),
    background-color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    color 0.15s var(--ease);
}

.option:hover:not(:disabled) {
  background: var(--option-hover-bg);
  box-shadow: var(--shadow-option-hover);
  transform: translate(var(--hover-x), var(--hover-y));
}

.option:disabled {
  color: var(--text);
}

.option-key {
  display: grid;
  place-items: center;
  flex: none;
  width: 30px;
  height: 30px;
  margin-top: 0;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  transition:
    background-color 0.15s var(--ease),
    border-color 0.15s var(--ease),
    color 0.15s var(--ease);
}

.q-card.type-multi .option-key {
  border-radius: 6px;
}

.option-text {
  flex: 1;
  min-width: 0;
}

.option-mark {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 5px;
  opacity: 0;
  transition: opacity 0.15s var(--ease);
}

.option-mark .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2.6;
}

.option.is-selected {
  border-color: var(--accent);
  background: var(--option-selected-bg);
  box-shadow: 4px 4px 0 var(--ink);
  color: var(--option-selected-color);
}

html[data-theme="paper"] .option.is-selected .option-key {
  border-color: var(--ink);
  background: var(--yellow);
  color: var(--ink);
}

.option.is-selected .option-key {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.option.is-selected .option-mark {
  color: var(--accent);
  opacity: 1;
}

html[data-theme="paper"] .option.is-selected .option-mark {
  color: #ffffff;
}

.option.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 3px 3px 0 var(--green);
  color: var(--text);
}

.option.is-correct .option-key {
  border-color: var(--green);
  background: var(--green);
  color: #ffffff;
}

.option.is-correct .option-mark {
  color: var(--green);
  opacity: 1;
}

.option.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 3px 3px 0 var(--red);
  color: var(--text);
}

.option.is-wrong .option-key {
  border-color: var(--red);
  background: var(--red);
  color: #ffffff;
}

.option.is-wrong .option-mark {
  color: var(--red);
  opacity: 1;
}

.option.is-incomplete {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: 3px 3px 0 var(--orange);
  color: var(--text);
}

.option.is-incomplete .option-key {
  border-color: var(--orange);
  background: var(--orange);
  color: #ffffff;
}

.option.is-incomplete .option-mark {
  color: var(--orange);
  opacity: 1;
}

.option.is-missed {
  border-style: dashed;
  border-color: var(--green);
  background: transparent;
  box-shadow: none;
}

.option.is-missed .option-key {
  border-color: var(--green);
  background: transparent;
  color: var(--green);
}

.option.is-missed .option-mark {
  color: var(--green);
  opacity: 1;
}

.option.is-dim {
  opacity: 0.5;
}

html[data-theme="neon"] .option {
  border-color: var(--border);
  border-radius: var(--radius);
  background: rgba(12, 16, 24, 0.72);
  box-shadow: none;
}

html[data-theme="neon"] .option:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--option-hover-bg);
  box-shadow: var(--shadow-option-hover);
}

html[data-theme="neon"] .option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: 0 0 0 1px var(--accent), 0 0 24px rgba(56, 189, 248, 0.16);
}

html[data-theme="neon"] .option.is-selected .option-key {
  border-color: var(--accent);
  background: var(--accent);
  color: #04101f;
}

html[data-theme="neon"] .option.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.12);
}

html[data-theme="neon"] .option.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 0 0 22px rgba(251, 113, 133, 0.12);
}

html[data-theme="neon"] .option.is-incomplete {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: 0 0 22px rgba(251, 191, 36, 0.12);
}

html[data-theme="neon"] .option.is-missed {
  border-color: var(--green);
  background: transparent;
  box-shadow: none;
}

html[data-theme="clean"] .option {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: none;
}

html[data-theme="clean"] .option:hover:not(:disabled) {
  border-color: var(--faint);
  background: var(--surface-2);
  transform: none;
}

html[data-theme="clean"] .option.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px var(--accent);
}

html[data-theme="clean"] .option.is-selected .option-key {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

html[data-theme="clean"] .option.is-correct {
  border-color: var(--green-border);
  background: var(--green-soft);
  box-shadow: none;
}

html[data-theme="clean"] .option.is-wrong {
  border-color: var(--red-border);
  background: var(--red-soft);
  box-shadow: none;
}

html[data-theme="clean"] .option.is-incomplete {
  border-color: var(--orange-border);
  background: var(--orange-soft);
  box-shadow: none;
}

html[data-theme="clean"] .option.is-missed {
  border-style: dashed;
  border-color: var(--green-border);
  box-shadow: none;
}

.q-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.q-feedback:focus {
  outline: none;
}

.q-feedback {
  margin-top: 16px;
  padding: 16px;
  border: 3px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
  box-shadow: 4px 4px 0 var(--border);
  animation: feedbackIn 0.3s var(--ease);
}

.q-feedback.is-correct {
  border-color: var(--green);
  background: var(--green-soft);
  box-shadow: 4px 4px 0 var(--green);
}

.q-feedback.is-wrong {
  border-color: var(--red);
  background: var(--red-soft);
  box-shadow: 4px 4px 0 var(--red);
}

.q-feedback.is-incomplete {
  border-color: var(--orange);
  background: var(--orange-soft);
  box-shadow: 4px 4px 0 var(--orange);
}

.q-feedback.is-neutral {
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: 4px 4px 0 var(--border);
}

.feedback-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
}

.feedback-head .icon {
  width: 19px;
  height: 19px;
}

.q-feedback.is-correct .feedback-head {
  color: var(--green);
}

.q-feedback.is-wrong .feedback-head {
  color: var(--red);
}

.q-feedback.is-incomplete .feedback-head {
  color: var(--orange);
}

.feedback-body {
  margin-top: 8px;
  color: var(--text-soft);
  font-size: 12.5px;
  line-height: 1.85;
}

.feedback-body strong {
  color: var(--text);
}

.feedback-body .user-answer {
  color: var(--muted);
}

.answer-text {
  color: var(--text);
  font-weight: 700;
}

.q-note {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10.5px;
}

html[data-theme="neon"] .q-feedback {
  border-width: 1px;
  border-radius: var(--radius);
  box-shadow: none;
}

html[data-theme="neon"] .q-feedback.is-correct {
  border-color: var(--green-border);
  background: var(--green-soft);
  box-shadow: inset 3px 0 0 var(--green);
}

html[data-theme="neon"] .q-feedback.is-wrong {
  border-color: var(--red-border);
  background: var(--red-soft);
  box-shadow: inset 3px 0 0 var(--red);
}

html[data-theme="neon"] .q-feedback.is-incomplete {
  border-color: var(--orange-border);
  background: var(--orange-soft);
  box-shadow: inset 3px 0 0 var(--orange);
}

html[data-theme="neon"] .q-feedback.is-neutral {
  border-color: var(--border);
  background: var(--surface-2);
  box-shadow: none;
}

html[data-theme="clean"] .q-feedback {
  border-width: 1px;
  box-shadow: none;
}

/* ==========================================================================
   Exam summary & bar
   ========================================================================== */

.exam-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 20px;
  padding: 24px;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  scroll-margin-top: calc(var(--header-h) + 92px);
  animation: feedbackIn 0.4s var(--ease);
}

.summary-sticker {
  position: absolute;
  top: -16px;
  right: 20px;
}

.score-ring {
  position: relative;
  display: grid;
  place-items: center;
  flex: none;
  width: 108px;
  height: 108px;
  border: 3px solid var(--border);
  border-radius: 50%;
  background: conic-gradient(
    var(--accent) calc(var(--score, 0) * 1%),
    var(--surface-3) 0
  );
  box-shadow: 4px 4px 0 var(--ink);
}

.score-ring::before {
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: var(--surface);
  content: "";
}

.score-ring > div {
  position: relative;
  text-align: center;
}

.score-ring span {
  font-family: var(--font-mono);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
}

.score-ring small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.summary-copy {
  min-width: 0;
}

.summary-copy h2 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--display-weight);
  line-height: 1.1;
}

.summary-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.summary-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.chip {
  padding: 3px 9px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
}

.chip.green {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--green);
}

.chip.red {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.chip.orange {
  border-color: var(--orange);
  background: var(--orange-soft);
  color: var(--orange);
}

.chip.blue {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent);
}

.summary-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

html[data-theme="neon"] .exam-summary {
  border-color: var(--accent-border);
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.96), rgba(11, 15, 22, 0.96));
  box-shadow: var(--shadow-lg);
}

html[data-theme="neon"] .score-ring {
  border-color: var(--accent-border);
  box-shadow: 0 0 30px rgba(56, 189, 248, 0.18);
}

html[data-theme="neon"] .score-ring::before {
  background: var(--surface);
}

html[data-theme="neon"] .summary-copy h2 {
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 800;
}

html[data-theme="clean"] .exam-summary {
  border-color: var(--border);
  box-shadow: var(--shadow-md);
}

html[data-theme="clean"] .score-ring {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

html[data-theme="clean"] .summary-copy h2 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
}

html[data-theme="clean"] .chip {
  border: 1px solid var(--border-soft);
}

.exam-bar {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 70;
  padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  border-top: var(--bw) solid var(--border);
  background: var(--ink);
  color: var(--yellow);
  box-shadow: 0 -8px 0 rgba(11, 11, 11, 0.08);
}

.exam-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.exam-bar-copy {
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 11px;
}

.exam-bar-copy strong {
  color: #ffffff;
  font-size: 14px;
}

.exam-bar .btn-primary {
  border-color: var(--yellow);
  background: var(--yellow);
  color: var(--ink);
  box-shadow: 4px 4px 0 rgba(255, 255, 255, 0.3);
}

.exam-bar .btn-primary:hover {
  background: #fff3a3;
}

html[data-theme="neon"] .exam-bar {
  border-color: var(--accent-border);
  background: rgba(8, 9, 13, 0.9);
  color: var(--text);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

html[data-theme="neon"] .exam-bar-copy {
  color: var(--muted);
}

html[data-theme="neon"] .exam-bar-copy strong {
  color: var(--accent);
}

html[data-theme="neon"] .exam-bar .btn-primary {
  border-color: transparent;
  background: var(--gradient);
  color: #04101f;
}

html[data-theme="clean"] .exam-bar {
  border-color: var(--border);
  background: var(--header-bg);
  color: var(--text);
  box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(14px);
}

html[data-theme="clean"] .exam-bar-copy {
  color: var(--muted);
}

html[data-theme="clean"] .exam-bar-copy strong {
  color: var(--text);
}

html[data-theme="clean"] .exam-bar .btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
  box-shadow: none;
}

body.has-exam-bar {
  padding-bottom: 88px;
}

/* ==========================================================================
   Wrong book
   ========================================================================== */

.wrong-page {
  padding-bottom: 60px;
}

.wrong-hero {
  position: relative;
  overflow: hidden;
  border-bottom: var(--bw) solid var(--border);
  background: var(--red-soft);
}

.wrong-hero::before {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(232, 38, 31, 0.08) 1px, transparent 1px),
    linear-gradient(rgba(232, 38, 31, 0.08) 1px, transparent 1px);
  background-size: 38px 38px;
  content: "";
  pointer-events: none;
}

.wrong-hero-inner {
  position: relative;
  z-index: 1;
  padding: 38px 0 34px;
}

.wrong-hero .tab {
  margin-bottom: 18px;
}

.wrong-hero h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 7vw, 6rem);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
  line-height: 0.95;
  text-shadow: 5px 5px 0 var(--red);
}

.wrong-hero .lead {
  max-width: 62ch;
  margin: 0;
  color: var(--text-soft);
  font-size: 14px;
  line-height: 1.85;
}

.wrong-hero-note {
  position: absolute;
  top: 38px;
  right: 24px;
  transform: rotate(-3deg);
}

.wrong-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.wrong-stat {
  min-width: 122px;
  padding: 12px 16px;
  border: var(--bw) solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.wrong-stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: var(--display-weight);
  letter-spacing: -0.02em;
  line-height: 1;
}

.wrong-stat span {
  color: var(--muted);
  font-size: 9.5px;
}

html[data-theme="neon"] .wrong-hero {
  border-color: var(--border-soft);
  background:
    radial-gradient(ellipse at 75% 20%, rgba(251, 113, 133, 0.12), transparent 52%),
    radial-gradient(ellipse at 15% 100%, rgba(167, 139, 250, 0.1), transparent 50%);
}

html[data-theme="neon"] .wrong-hero::before {
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
}

html[data-theme="neon"] .wrong-hero h1 {
  font-family: var(--font-body);
  font-weight: 900;
  text-shadow: 0 0 40px rgba(251, 113, 133, 0.22);
}

html[data-theme="neon"] .wrong-stat {
  border-color: var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.92), rgba(11, 15, 22, 0.92));
  box-shadow: var(--shadow-card);
}

html[data-theme="neon"] .wrong-stat strong {
  font-family: var(--font-mono);
  font-size: 30px;
  color: var(--red);
}

html[data-theme="clean"] .wrong-hero {
  border-color: var(--border-soft);
  background: var(--bg);
}

html[data-theme="clean"] .wrong-hero::before {
  display: none;
}

html[data-theme="clean"] .wrong-hero h1 {
  font-family: var(--font-body);
  font-size: clamp(2.4rem, 4vw, 3.4rem);
  text-shadow: none;
}

html[data-theme="clean"] .wrong-stat {
  border-color: var(--border);
  box-shadow: var(--shadow-sm);
}

html[data-theme="clean"] .wrong-stat strong {
  font-family: var(--font-mono);
  font-size: 28px;
}

.wrong-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 26px 0 20px;
  padding: 12px 14px;
  border: 2px solid var(--border);
  background: var(--accent-soft);
  box-shadow: 3px 3px 0 var(--ink);
  color: var(--text-soft);
  font-size: 11.5px;
  line-height: 1.75;
}

.wrong-tip .icon {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  color: var(--accent);
}

html[data-theme="neon"] .wrong-tip {
  border-color: var(--accent-border);
  border-radius: var(--radius);
  background: rgba(14, 36, 52, 0.6);
  box-shadow: none;
}

html[data-theme="clean"] .wrong-tip {
  border: 1px solid var(--border);
  box-shadow: none;
}

.wrong-group {
  margin-bottom: 32px;
}

.wrong-group-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 3px dashed var(--border);
}

.wrong-group-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: var(--display-weight);
  line-height: 1.1;
}

.wrong-group-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.wrong-group-head .count {
  margin-left: auto;
  padding: 3px 9px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--yellow);
  font-family: var(--font-mono);
  font-size: 9px;
}

html[data-theme="neon"] .wrong-group-head {
  border-color: var(--accent-border);
}

html[data-theme="neon"] .wrong-group-head h2 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
}

html[data-theme="neon"] .wrong-group-head .count {
  border-color: var(--accent-border);
  background: var(--accent-soft);
  color: var(--accent);
}

html[data-theme="clean"] .wrong-group-head {
  border-bottom-width: 1px;
  border-color: var(--border-soft);
}

html[data-theme="clean"] .wrong-group-head h2 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
}

html[data-theme="clean"] .wrong-group-head .count {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
}

.empty-state {
  position: relative;
  overflow: hidden;
  padding: 64px 20px;
  border: 3px dashed var(--border);
  background: var(--surface);
  box-shadow: 6px 6px 0 var(--ink);
  text-align: center;
}

.empty-stamp {
  position: absolute;
  right: 24px;
  bottom: -28px;
  color: var(--red);
  font-family: var(--font-display);
  font-size: 170px;
  font-weight: var(--display-weight);
  line-height: 1;
  opacity: 0.08;
  pointer-events: none;
}

.empty-state > .icon {
  width: 60px;
  height: 60px;
  margin: 0 auto 14px;
  color: var(--muted);
  stroke-width: 1.3;
}

.empty-state h2 {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: var(--display-weight);
}

.empty-state p {
  max-width: 42ch;
  margin: 0 auto 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

html[data-theme="neon"] .empty-state {
  border-color: var(--accent-border);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(18, 23, 34, 0.92), rgba(11, 15, 22, 0.92));
  box-shadow: var(--shadow-card);
}

html[data-theme="neon"] .empty-state h2 {
  font-family: var(--font-body);
  font-weight: 800;
}

html[data-theme="clean"] .empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  box-shadow: none;
}

html[data-theme="clean"] .empty-state h2 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 68px;
  padding: 36px 0 40px;
  border-top: var(--bw) solid var(--border);
  background: var(--ink);
  color: var(--paper, #fffdf8);
}

.footer-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 28px;
}

.footer-lead {
  max-width: 540px;
}

.footer-quote {
  margin: 0 0 16px;
  color: var(--yellow);
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.8vw, 2.2rem);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-spacing);
  line-height: 1.25;
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  color: rgba(255, 255, 255, 0.58);
  font-family: var(--font-mono);
  font-size: 9.5px;
  line-height: 1.75;
}

.footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.footer-actions .link-btn {
  color: rgba(255, 255, 255, 0.62);
}

.footer-actions .link-btn:hover {
  color: var(--yellow);
}

.footer-actions .danger:hover {
  color: var(--red);
}

html[data-theme="neon"] .site-footer {
  border-color: var(--accent-border);
  background: #05060a;
}

html[data-theme="neon"] .footer-quote {
  background: var(--gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-family: var(--font-body);
  font-weight: 900;
  animation: gradientShift 8s ease-in-out infinite;
}

html[data-theme="clean"] .brand-mark {
  border-color: transparent;
  border-radius: 10px;
  background: var(--accent);
  box-shadow: 0 4px 12px var(--ring);
  color: #ffffff;
  transform: none;
}

html[data-theme="clean"] .brand:hover .brand-mark {
  transform: none;
}

html[data-theme="clean"] .brand-text strong {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

html[data-theme="clean"] .badge {
  border: 0;
}

html[data-theme="clean"] .hero {
  border-bottom: 1px solid var(--border-soft);
  background: var(--bg);
}

html[data-theme="clean"] .hero::before {
  background: radial-gradient(
    620px circle at var(--mx, 50%) var(--my, 34%),
    rgba(9, 105, 218, 0.07),
    transparent 62%
  );
}

html[data-theme="clean"] .hero-grid-bg {
  display: none;
}

html[data-theme="clean"] .hero h1 {
  font-family: var(--font-body);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.08;
  text-shadow: none;
}

html[data-theme="clean"] .hero-accent {
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: none;
}

html[data-theme="clean"] .hero-lead {
  color: var(--muted);
  font-size: 15px;
}

html[data-theme="clean"] .hero-meta {
  color: var(--muted);
}

html[data-theme="clean"] .overview {
  transform: none;
}

html[data-theme="clean"] .floating-note,
html[data-theme="clean"] .hero-spark {
  display: none;
}

html[data-theme="clean"] .marquee {
  padding: 8px 0;
  border-color: var(--border-soft);
  background: var(--surface-2);
  color: var(--muted);
}

html[data-theme="clean"] .marquee-track {
  animation-duration: 40s;
}

html[data-theme="clean"] .marquee-group {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
}

html[data-theme="clean"] .marquee-group i {
  color: var(--accent);
  font-size: 10px;
}

html[data-theme="clean"] .section-head h2 {
  font-family: var(--font-body);
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
}

html[data-theme="clean"] .site-footer {
  border-color: var(--border-soft);
  background: var(--surface);
  color: var(--text);
}

html[data-theme="clean"] .footer-quote {
  color: var(--text);
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
}

html[data-theme="clean"] .footer-meta {
  color: var(--muted);
}

html[data-theme="clean"] .footer-actions .link-btn {
  color: var(--muted);
}

html[data-theme="clean"] .footer-actions .link-btn:hover {
  color: var(--text);
}

/* ==========================================================================
   Toast, modal, fatal
   ========================================================================== */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  z-index: 200;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--ink);
  color: var(--yellow);
  box-shadow: var(--shadow-md);
  font-size: 12px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

body.has-exam-bar .toast {
  bottom: 92px;
}

html[data-theme="neon"] .toast {
  border-color: var(--accent-border);
  background: #0c0f16;
  color: var(--accent);
  box-shadow: var(--shadow-lg);
}

html[data-theme="clean"] .toast {
  border-color: transparent;
  background: var(--text);
  color: var(--bg);
  box-shadow: var(--shadow-lg);
}

.modal {
  width: min(450px, calc(100% - 32px));
  padding: 0;
  border: var(--bw) solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}

.modal::backdrop {
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(3px);
}

.modal-body {
  padding: 24px;
}

.modal-body h2 {
  margin: 0 0 8px;
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--display-weight);
  line-height: 1.2;
}

.modal-body p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 24px 24px;
}

html[data-theme="neon"] .modal {
  border-color: var(--accent-border);
  box-shadow: var(--shadow-lg);
}

html[data-theme="neon"] .modal-body h2 {
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 800;
}

html[data-theme="clean"] .modal {
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

html[data-theme="clean"] .modal-body h2 {
  font-family: var(--font-body);
  font-size: 18px;
  font-weight: 700;
}

.fatal {
  max-width: 680px;
  margin: 64px auto;
  padding: 26px;
  border: var(--bw) solid var(--red);
  background: var(--surface);
  box-shadow: var(--shadow-md);
}

.fatal h1 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--display-weight);
}

.fatal p,
.fatal li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.85;
}

.fatal code {
  padding: 2px 5px;
  border: 1px solid var(--border-soft);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
}

/* ==========================================================================
   To top & confetti
   ========================================================================== */

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 60;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: var(--bw) solid var(--border);
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  opacity: 0;
  pointer-events: none;
  transform: translateY(14px) rotate(-8deg);
  transition:
    opacity 0.2s var(--ease),
    transform 0.2s var(--ease-bounce),
    box-shadow 0.2s var(--ease);
}

body.has-scrolled .to-top {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) rotate(0);
}

.to-top:hover {
  transform: translateY(-3px) rotate(6deg);
  box-shadow: var(--shadow-md);
}

.to-top .icon {
  width: 19px;
  height: 19px;
  stroke-width: 2.5;
}

body.has-exam-bar .to-top {
  bottom: 92px;
}

html[data-theme="neon"] .to-top {
  border-color: var(--accent-border);
  background: #0c0f16;
  color: var(--accent);
  box-shadow: 0 0 24px rgba(56, 189, 248, 0.2);
}

html[data-theme="clean"] .to-top {
  border-color: transparent;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 4px 14px var(--ring);
}

.confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 250;
  overflow: hidden;
  pointer-events: none;
}

.confetti {
  position: absolute;
  top: -24px;
  border: 1px solid rgba(11, 11, 11, 0.25);
  animation: confettiFall 1.4s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

/* ==========================================================================
   Reveal & animations
   ========================================================================== */

.js [data-reveal] {
  opacity: 0;
  translate: 0 22px;
  transition:
    opacity 0.55s var(--ease),
    translate 0.55s var(--ease);
  transition-delay: calc(var(--i, 0) * 65ms);
}

.js [data-reveal].is-visible {
  opacity: 1;
  translate: 0 0;
}

.rise {
  animation: rise 0.7s var(--ease) both;
}

.hero h1 {
  animation-delay: 0.06s;
}

.hero-lead {
  animation-delay: 0.18s;
}

.hero-actions {
  animation-delay: 0.28s;
}

.hero-meta {
  animation-delay: 0.38s;
}

.hero-side {
  animation-delay: 0.44s;
}

.sticker-in {
  animation: stickerIn 0.6s var(--ease) both;
}

.hero-stickers .sticker:nth-child(1) {
  animation-delay: 0.16s;
}

.hero-stickers .sticker:nth-child(2) {
  animation-delay: 0.24s;
}

.hero-stickers .sticker:nth-child(3) {
  animation-delay: 0.32s;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(28px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes stickerIn {
  from {
    opacity: 0;
    transform: translateY(18px) rotate(0) scale(0.94);
  }
  to {
    opacity: 1;
    transform: rotate(var(--rot, 0deg)) scale(1);
  }
}

@keyframes marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes popIn {
  from {
    opacity: 0;
    transform: translateY(-5px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes feedbackIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0) rotate(var(--rot, 0deg));
  }
  50% {
    transform: translateY(-7px) rotate(var(--rot, 0deg));
  }
}

@keyframes correctPulse {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(1.008);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes wrongShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-5px);
  }
  40% {
    transform: translateX(5px);
  }
  60% {
    transform: translateX(-3px);
  }
  80% {
    transform: translateX(3px);
  }
}

@keyframes softWobble {
  0%,
  100% {
    transform: rotate(0);
  }
  30% {
    transform: rotate(-0.5deg);
  }
  60% {
    transform: rotate(0.5deg);
  }
}

@keyframes confettiFall {
  0% {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
  100% {
    opacity: 0;
    transform: translateY(105vh) rotate(720deg);
  }
}

@keyframes twinkle {
  0% {
    opacity: 0.55;
  }
  100% {
    opacity: 1;
  }
}

@keyframes gradientShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* View transitions */
::view-transition-old(root) {
  animation: pageOut 0.2s ease both;
}

::view-transition-new(root) {
  animation: pageIn 0.32s var(--ease) both;
}

@keyframes pageOut {
  to {
    opacity: 0;
    transform: translateY(-6px);
  }
}

@keyframes pageIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1100px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 34px;
    padding: 54px 0 58px;
  }

  .hero-copy {
    max-width: 760px;
  }

  .hero h1 {
    font-size: clamp(3rem, 8vw, 5.2rem);
  }

  .hero-side {
    max-width: 580px;
  }

  .floating-note {
    left: auto;
    right: -8px;
  }

  .chapter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .utility-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .section-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }

  .section-note {
    max-width: 52ch;
    text-align: left;
  }

  .chapter-hero-grid {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
  }

  .chapter-stamp {
    min-width: 170px;
    padding: 14px 16px;
  }

  .chapter-stamp__number {
    font-size: 58px;
  }

  .wrong-hero-note {
    display: none;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 62px;
  }

  .container {
    width: calc(100% - 28px);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand-mark .icon {
    width: 19px;
    height: 19px;
  }

  .brand-text strong {
    font-size: 17px;
  }

  .brand-text small {
    display: none;
  }

  .header-actions {
    gap: 6px;
  }

  .mode-toggle {
    padding: 3px;
  }

  .mode-toggle button {
    height: 28px;
    padding: 0 9px;
    font-size: 11px;
  }

  .wrong-link {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
  }

  .wrong-link .hide-sm {
    display: none;
  }

  .theme-menu > summary {
    width: 38px;
    height: 38px;
    justify-content: center;
    padding: 0;
  }

  .theme-menu > summary .hide-sm {
    display: none;
  }

  .theme-pop {
    right: -4px;
  }

  .hero {
    border-bottom-width: 3px;
  }

  .hero-inner {
    padding: 42px 0 46px;
  }

  .hero-stickers {
    gap: 8px;
    margin-bottom: 18px;
  }

  .sticker {
    padding: 4px 10px 5px;
    font-size: 10px;
  }

  .hero h1 {
    font-size: clamp(2.7rem, 12vw, 4.2rem);
    text-shadow: 3px 3px 0 var(--accent);
  }

  .hero-accent {
    text-shadow: 3px 3px 0 var(--ink);
  }

  .hero-lead {
    font-size: 14px;
  }

  .hero-actions .btn {
    flex: 1;
  }

  .hero-meta {
    gap: 10px 14px;
    font-size: 9.5px;
  }

  .overview {
    padding: 20px;
    box-shadow:
      8px 8px 0 var(--accent),
      8px 8px 0 calc(8px + var(--bw)) var(--border);
  }

  .overview-grid {
    gap: 8px;
  }

  .metric {
    padding: 10px 11px;
  }

  .metric-value {
    font-size: 24px;
  }

  .floating-note {
    bottom: -18px;
    right: 8px;
    left: auto;
    padding: 5px 10px;
  }

  .floating-note strong {
    font-size: 19px;
  }

  .marquee-group {
    font-size: 17px;
    gap: 14px;
    padding-right: 14px;
  }

  .section {
    padding-top: 48px;
  }

  .section-head {
    margin-bottom: 22px;
  }

  .section-head h2 {
    font-size: clamp(2rem, 10vw, 3rem);
  }

  .chapter-grid,
  .utility-grid {
    grid-template-columns: 1fr;
  }

  .chapter-card {
    min-height: 0;
    padding: 18px;
  }

  .chapter-card h3 {
    font-size: 27px;
  }

  .chapter-card:hover {
    transform: translate(-1px, -1px);
  }

  .chapter-hero-inner {
    padding: 24px 0 26px;
  }

  .chapter-hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .chapter-title-block h1 {
    font-size: clamp(2.8rem, 12vw, 4.4rem);
    text-shadow: 3px 3px 0 var(--accent);
  }

  .chapter-title-block .subtitle {
    font-size: 13px;
  }

  .chapter-stamp {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    align-items: center;
    padding: 14px 16px;
    transform: none;
  }

  .chapter-stamp__label {
    grid-column: 1;
  }

  .chapter-stamp__number {
    grid-row: 1 / span 2;
    grid-column: 1;
    margin: 0;
    font-size: 52px;
  }

  .chapter-stamp__stats {
    grid-column: 2;
    margin: 0;
  }

  .chapter-stamp__bar {
    grid-column: 2;
    width: 100%;
  }

  .type-nav {
    gap: 5px;
    padding: 8px 0;
  }

  .type-tab {
    flex-direction: column;
    gap: 2px;
    height: 50px;
    padding: 0 4px;
    font-size: 11.5px;
    box-shadow: 2px 2px 0 var(--ink);
  }

  .type-tab .icon {
    width: 13px;
    height: 13px;
  }

  .type-tab .count {
    font-size: 8px;
    padding: 0 4px;
  }

  .type-tab.is-active {
    transform: translate(-1px, -1px);
    box-shadow: 3px 3px 0 var(--ink);
  }

  .chapter-main {
    padding-top: 22px;
  }

  .list-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .list-head h2 .tab {
    font-size: 17px;
  }

  .group-progress .track {
    width: 100px;
  }

  .mode-hint {
    font-size: 10.5px;
  }

  .q-card {
    padding: 16px 14px;
  }

  .q-stem {
    font-size: 15px;
    line-height: 1.85;
  }

  .blank-input {
    width: 150px;
    height: 36px;
  }

  .option {
    padding: 10px 11px;
    font-size: 13px;
  }

  .option-key {
    width: 27px;
    height: 27px;
  }

  .q-feedback {
    padding: 13px;
  }

  .exam-summary {
    flex-wrap: wrap;
    gap: 14px;
    padding: 18px;
  }

  .score-ring {
    width: 84px;
    height: 84px;
  }

  .score-ring span {
    font-size: 22px;
  }

  .summary-copy h2 {
    font-size: 23px;
  }

  .summary-actions {
    width: 100%;
    margin-left: 0;
  }

  .exam-bar-copy {
    font-size: 10px;
  }

  .exam-bar .btn {
    height: 38px;
    padding: 0 12px;
    font-size: 12px;
  }

  .wrong-hero-inner {
    padding: 26px 0 24px;
  }

  .wrong-hero h1 {
    font-size: clamp(2.8rem, 13vw, 4.4rem);
    text-shadow: 3px 3px 0 var(--red);
  }

  .wrong-stat {
    min-width: calc(50% - 6px);
    flex: 1;
  }

  .wrong-group-head {
    flex-wrap: wrap;
  }

  .wrong-group-head h2 {
    font-size: 21px;
  }

  .wrong-group-head .count {
    margin-left: 0;
  }

  .empty-state {
    padding: 48px 18px;
  }

  .site-footer {
    margin-top: 48px;
    padding: 28px 0 32px;
  }

  .footer-inner {
    flex-direction: column;
  }

  .to-top {
    right: 14px;
    bottom: 16px;
    width: 42px;
    height: 42px;
  }

  body.has-exam-bar .to-top {
    bottom: 84px;
  }

  .modal-body {
    padding: 20px;
  }

  .modal-actions {
    padding: 0 20px 20px;
  }
}

@media (max-width: 480px) {
  .brand-text strong {
    font-size: 15px;
  }

  .header-inner {
    gap: 8px;
  }

  .header-actions {
    gap: 4px;
  }

  .mode-toggle button {
    padding: 0 8px;
    font-size: 10.5px;
  }

  .wrong-link,
  .theme-menu > summary {
    width: 36px;
    height: 36px;
  }

  .hero h1 {
    font-size: 2.55rem;
  }

  .hero-stickers .sticker:nth-child(3) {
    display: none;
  }

  .hero-meta span:nth-child(2) {
    display: none;
  }

  .metric-value {
    font-size: 21px;
  }

  .type-tab .icon {
    display: none;
  }

  .type-tab {
    height: 46px;
    font-size: 11px;
  }

  .type-nav {
    gap: 4px;
  }

  .q-head {
    gap: 6px;
  }

  .q-status {
    margin-left: 0;
  }

  .q-num {
    font-size: 9px;
  }

  .q-type {
    font-size: 8.5px;
  }

  .summary-copy h2 {
    font-size: 21px;
  }

  .wrong-stat strong {
    font-size: 30px;
  }

  .footer-quote {
    font-size: 1.3rem;
  }

  .footer-meta {
    flex-direction: column;
    gap: 8px;
  }
}

/* ==========================================================================
   Reduced motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  .js [data-reveal] {
    opacity: 1;
    translate: none;
  }

  .floating-note,
  .hero-spark {
    animation: none;
  }
}
