:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #f9fafb;
  --ink: #1f2937;
  --ink-soft: #4b5563;
  --ink-mute: #9ca3af;
  --line: #e5e7eb;
  --primary: #4f46e5;
  --primary-soft: #eef2ff;
  --green: #059669;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(31, 41, 55, 0.08);
  --radius: 18px;
  --nav-h: 76px;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% -10%, rgba(79, 70, 229, 0.10), transparent 32%),
    radial-gradient(circle at 92% 8%, rgba(5, 150, 105, 0.08), transparent 28%),
    var(--bg);
  min-height: 100vh;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px 70px; }
.home-page .shell { padding-top: calc(var(--nav-h) + 28px); }
.topic-page .shell { padding-top: calc(var(--nav-h) + 24px); }

/* 固定顶部导航 */
.site-header, .topic-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  z-index: 50;
  background: rgba(248, 250, 252, 0.86);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 6px 24px rgba(31, 41, 55, 0.05);
}
.nav-inner {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 13px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: #fff; font-size: 22px; font-weight: 800;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.26);
}
.brand-mark img { width: 30px; height: 30px; display: block; }
.brand h1 { margin: 0; font-size: 18px; letter-spacing: 0.3px; }
.brand p { margin: 1px 0 0; font-size: 12px; color: var(--ink-mute); }

.header-tag {
  padding: 8px 14px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  color: var(--ink-soft); font-size: 13px; box-shadow: var(--shadow);
  white-space: nowrap;
}

/* 首页主视觉 */
.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr);
  gap: 26px;
  min-height: 360px;
  padding: 46px 48px 34px;
  border-radius: 30px;
  color: #fff;
  background: linear-gradient(125deg, #1e1b4b 0%, #312e81 45%, #0f766e 100%);
  box-shadow: 0 26px 60px rgba(30, 27, 75, 0.26);
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom right, #000, transparent 75%);
  opacity: .5;
}
.hero-content { position: relative; z-index: 2; align-self: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 12px; letter-spacing: .08em;
  color: rgba(255,255,255,.88);
}
.eyebrow span { width: 7px; height: 7px; border-radius: 50%; background: #67e8f9; box-shadow: 0 0 0 4px rgba(103,232,249,.18); }
.hero h2 { margin: 20px 0 14px; font-size: 44px; line-height: 1.18; letter-spacing: .5px; }
.hero p { margin: 0; max-width: 520px; color: rgba(255,255,255,.78); font-size: 16px; }
.hero-badges { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero-badges span {
  padding: 7px 13px; border-radius: 10px;
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.18);
  font-size: 13px; color: rgba(255,255,255,.9);
}

.hero-visual { position: relative; min-height: 250px; z-index: 1; }
.visual-glow {
  position: absolute; width: 280px; height: 280px; border-radius: 50%;
  right: 10px; top: -20px;
  background: radial-gradient(circle, rgba(103,232,249,.35), transparent 68%);
  filter: blur(6px);
}
.visual-card {
  position: absolute; left: 50%; top: 50%;
  width: 275px; padding: 18px;
  border-radius: 18px;
  background: rgba(255,255,255,.13);
  border: 1px solid rgba(255,255,255,.24);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 24px 50px rgba(15,23,42,.28);
  transform: translate(-50%, -50%) rotate(-3deg);
}
.visual-top { display: flex; gap: 6px; margin-bottom: 16px; }
.visual-top span { width: 8px; height: 8px; border-radius: 50%; background: rgba(255,255,255,.35); }
.visual-line { height: 7px; width: 58%; border-radius: 99px; background: rgba(255,255,255,.28); margin-bottom: 10px; }
.visual-line.long { width: 82%; background: rgba(255,255,255,.45); }
.visual-code {
  display: grid; gap: 7px; margin-top: 20px;
  padding: 14px; border-radius: 12px;
  background: rgba(15,23,42,.36);
}
.visual-code i { display: block; height: 6px; border-radius: 99px; background: rgba(103,232,249,.5); }
.visual-code i:nth-child(2) { width: 72%; margin-left: 16px; }
.visual-code i:nth-child(3) { width: 56%; margin-left: 16px; }
.visual-code i:nth-child(4) { width: 40%; }
.visual-progress { height: 6px; margin-top: 16px; border-radius: 99px; background: rgba(255,255,255,.18); overflow: hidden; }
.visual-progress b { display: block; width: 68%; height: 100%; border-radius: inherit; background: #67e8f9; }
.visual-chip {
  position: absolute;
  padding: 8px 14px; border-radius: 12px;
  background: rgba(255,255,255,.92); color: #312e81;
  font-size: 13px; font-weight: 700;
  box-shadow: 0 12px 28px rgba(15,23,42,.22);
}
.chip-one { left: 12px; top: 24px; transform: rotate(-7deg); }
.chip-two { right: 4px; top: 78px; transform: rotate(6deg); }
.chip-three { left: 34px; bottom: 18px; transform: rotate(4deg); }

.stats {
  grid-column: 1 / -1;
  position: relative; z-index: 2;
  display: flex; gap: 0;
  margin-top: 10px; padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,.18);
}
.stats > div { padding-right: 42px; margin-right: 42px; border-right: 1px solid rgba(255,255,255,.18); }
.stats > div:last-child { border-right: 0; }
.stat-value { font-size: 28px; font-weight: 800; line-height: 1.1; }
.stat-label { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 4px; }

.search-box { position: relative; max-width: 320px; width: 100%; }
.search-box input {
  width: 100%; padding: 12px 14px 12px 40px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.search-box input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-box::before {
  content: "⌕"; position: absolute; left: 14px; top: 50%; transform: translateY(-52%);
  color: var(--ink-mute); font-size: 20px;
}
.nav-search { max-width: 260px; }
.nav-search input { padding: 9px 12px 9px 36px; font-size: 13px; }
.nav-search::before { left: 13px; font-size: 18px; }

/* 首页专题轮播 */
.carousel-shell {
  position: relative;
  padding: 18px;
  border-radius: 30px;
  background: linear-gradient(135deg, #eef2ff, #e0e7ff 58%, #f5f3ff);
  box-shadow: 0 20px 50px rgba(49, 46, 129, 0.10);
}
.carousel-main {
  --accent: var(--primary);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 34px;
  min-height: 390px;
  padding: 26px;
  border-radius: 24px;
  background: rgba(255,255,255,.66);
  border: 1px solid rgba(255,255,255,.9);
}
.slide-preview { display: grid; place-items: center; min-width: 0; }
.browser {
  width: 100%; max-width: 500px;
  border-radius: 16px; overflow: hidden;
  background: #fff; border: 1px solid #e5e7eb;
  box-shadow: 0 18px 40px rgba(31,41,55,.14);
}
.browser-bar {
  display: flex; align-items: center; gap: 6px;
  padding: 11px 14px; background: #f8fafc; border-bottom: 1px solid #eef2f7;
}
.browser-bar > span { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; }
.browser-url {
  margin-left: 12px; padding: 4px 14px; border-radius: 999px;
  background: #fff; border: 1px solid #e5e7eb; color: #9ca3af; font-size: 11px;
}
.browser-body { display: grid; grid-template-columns: 44px minmax(0,1fr); min-height: 250px; }
.browser-side {
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding-top: 20px; border-right: 1px solid #f1f5f9; background: #fafbfc;
}
.browser-side i { width: 14px; height: 14px; border-radius: 5px; background: #e5e7eb; }
.browser-side i:first-child { background: var(--accent); opacity: .35; }
.browser-page { padding: 24px 28px; }
.preview-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center; font-size: 23px;
}
.preview-title { margin-top: 14px; font-size: 18px; font-weight: 700; color: var(--ink); }
.preview-lines { display: grid; gap: 8px; margin-top: 16px; }
.preview-lines i { display: block; height: 7px; border-radius: 99px; background: #eef2f7; }
.preview-lines i:nth-child(1) { width: 86%; }
.preview-lines i:nth-child(2) { width: 68%; }
.preview-lines i:nth-child(3) { width: 78%; }
.preview-card {
  margin-top: 18px; padding: 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--accent) 9%, white);
  border: 1px solid color-mix(in srgb, var(--accent) 20%, white);
}
.preview-card b { display: block; width: 40%; height: 8px; border-radius: 99px; background: var(--accent); opacity: .45; }
.preview-card i { display: block; height: 6px; margin-top: 9px; border-radius: 99px; background: rgba(148,163,184,.35); }
.preview-card i:last-child { width: 60%; }

.slide-info { align-self: center; min-width: 0; }
.slide-index { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: .12em; }
.slide-info h4 { margin: 10px 0 6px; font-size: 34px; line-height: 1.25; }
.slide-meta { margin: 0 0 18px; font-size: 13px; color: var(--ink-mute); }
.slide-desc { margin: 0; font-size: 16px; line-height: 1.9; color: var(--ink-soft); }
.slide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 28px; }
.slide-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 11px 18px; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}
.slide-btn b { font-size: 17px; }
.carousel-arrow {
  position: absolute; top: 42%; z-index: 3;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(229,231,235,.9); background: rgba(255,255,255,.9);
  color: var(--primary); font-size: 24px; line-height: 1;
  box-shadow: 0 8px 20px rgba(31,41,55,.10);
}
.carousel-arrow.prev { left: -6px; }
.carousel-arrow.next { right: -6px; }
.carousel-arrow:hover:not(:disabled) { border-color: var(--primary); }
.carousel-arrow:disabled { opacity: .35; cursor: not-allowed; }

.carousel-tabs {
  display: grid; grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 18px; align-items: center; padding: 20px 10px 6px;
}
.carousel-tab {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 8px 6px 12px; border: 0; border-bottom: 2px solid transparent;
  background: none; text-align: left; color: var(--ink-mute);
}
.carousel-tab > span { font-size: 13px; font-weight: 700; opacity: .7; }
.carousel-tab strong { display: block; font-size: 14px; color: var(--ink-soft); }
.carousel-tab small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.carousel-tab.active { border-bottom-color: var(--accent); }
.carousel-tab.active > span, .carousel-tab.active strong { color: var(--accent); }

.card-grid { display: none; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.card-grid.visible { display: grid; }
.topic-card {
  min-height: 214px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 26px; box-shadow: 0 12px 30px rgba(31,41,55,.06);
  position: relative; overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.topic-card::before {
  content: ""; position: absolute; top: 0; left: 26px; right: 26px; height: 3px;
  border-radius: 0 0 99px 99px;
  background: var(--accent, var(--primary)); opacity: .9;
}
.topic-card::after {
  content: ""; position: absolute; right: -60px; bottom: -70px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent, var(--primary)), transparent 68%);
  opacity: .08; pointer-events: none;
}
.topic-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 48px rgba(31,41,55,.13);
  border-color: var(--accent, var(--primary));
}
.topic-card:focus-visible { outline: 3px solid var(--primary-soft); }
.card-index {
  position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
  font-size: 56px; font-weight: 800; line-height: 1;
  color: var(--accent, var(--primary)); opacity: .06; pointer-events: none;
}
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: relative; z-index: 1; }
.card-icon {
  width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--primary)) 12%, white);
  font-size: 26px;
}
.card-count {
  font-size: 12px; color: var(--ink-soft); background: var(--surface-soft);
  border: 1px solid var(--line); padding: 5px 11px; border-radius: 999px;
}
.topic-card h4 { margin: 18px 0 6px; font-size: 20px; position: relative; z-index: 1; }
.topic-card p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; min-height: 48px; position: relative; z-index: 1; }
.card-foot {
  margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line);
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--accent, var(--primary)); font-weight: 600;
  position: relative; z-index: 1;
}
.card-foot b {
  width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--accent, var(--primary)) 12%, white);
  transition: transform .2s ease;
}
.topic-card:hover .card-foot b { transform: translateX(4px); }
.empty { padding: 40px; text-align: center; color: var(--ink-mute); }

/* 专题页 */
.topic-header .nav-inner { gap: 16px; }
.back-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 14px; border-radius: 10px; background: var(--surface);
  border: 1px solid var(--line); font-size: 14px; box-shadow: var(--shadow);
  white-space: nowrap;
}
.back-link:hover { border-color: var(--primary); color: var(--primary); }
.topic-heading { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topic-heading .dot { width: 11px; height: 11px; border-radius: 50%; background: var(--accent, var(--primary)); flex: 0 0 auto; }
.topic-heading h2 { margin: 0; font-size: 18px; white-space: nowrap; }
.topic-heading p { margin: 0; font-size: 12px; color: var(--ink-mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.question-layout {
  position: relative;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
.topic-rail {
  grid-column: 1;
  position: fixed;
  top: calc(var(--nav-h) + 24px);
  left: max(24px, calc((100vw - 1180px) / 2 + 24px));
  width: 220px;
  max-height: calc(100vh - var(--nav-h) - 48px);
  display: flex; flex-direction: column;
  padding: 16px;
  border-radius: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.rail-title {
  font-size: 13px; color: var(--ink-soft); font-weight: 700;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.rail-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 26px);
  justify-content: start;
  gap: 6px;
  flex: 0 1 auto;
  min-height: 0;
  max-height: calc(100vh - var(--nav-h) - 128px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148, 163, 184, 0.45) transparent;
}
.rail-list::-webkit-scrollbar { width: 5px; }
.rail-list::-webkit-scrollbar-track { background: transparent; }
.rail-list::-webkit-scrollbar-thumb { background: rgba(148, 163, 184, 0.45); border-radius: 99px; }
.rail-list button {
  width: 26px; height: 26px; padding: 0;
  border-radius: 7px; border: 1px solid var(--line);
  background: var(--surface-soft); color: var(--ink-soft);
  font-size: 11px;
}
.rail-list button:hover { border-color: var(--accent, var(--primary)); color: var(--accent, var(--primary)); }
.rail-list button.active {
  background: var(--accent, var(--primary));
  border-color: var(--accent, var(--primary));
  color: #fff; font-weight: 700;
}
.question-card {
  grid-column: 2;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  box-shadow: var(--shadow); padding: 32px 38px 28px; min-height: 480px;
}
.q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 22px; }
.q-badge {
  font-size: 12px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  color: var(--primary); background: var(--primary-soft);
}
.q-badge.alt { color: var(--green); background: #ecfdf5; }
.q-badge.warn { color: #b45309; background: #fffbeb; }
.q-paper { font-size: 13px; color: var(--ink-soft); }
.q-index { margin-left: auto; font-size: 13px; color: var(--ink-mute); }

.q-stem { font-size: 17px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.q-stem p { margin: 0 0 10px; }
.question-image { margin: 18px 0; text-align: center; }
.question-image img {
  max-width: 100%; max-height: 420px;
  border-radius: 12px; border: 1px solid var(--line);
  box-shadow: 0 8px 22px rgba(31,41,55,.08);
}
.task-section { margin: 16px 0; }
.task-section h4 {
  margin: 0 0 6px; font-size: 17px; font-weight: 700; color: var(--ink);
}
.task-section p { margin: 0; color: var(--ink-soft); }
.task-sample { margin: 20px 0 8px; }
.task-sample h4 { margin: 0 0 8px; font-size: 17px; font-weight: 700; color: var(--ink); }
.sample-lines {
  margin: 0; padding: 4px 0 4px 2em;
  font-family: inherit; font-size: 16px; line-height: 1.9;
  color: var(--ink-soft); white-space: pre-wrap;
}
.code-wrap { position: relative; margin: 16px 0; white-space: normal; }
.copy-code {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  padding: 5px 11px; border-radius: 8px;
  border: 1px solid rgba(148,163,184,.4);
  background: rgba(30,41,59,.95); color: #e2e8f0;
  font-size: 12px; line-height: 1.4;
}
.copy-code:hover { background: #334155; border-color: #67e8f9; color: #fff; }
.code-block {
  margin: 0; padding: 16px 18px; border-radius: 12px;
  background: #0f172a; color: #e2e8f0; font-family: Consolas, "Courier New", monospace;
  font-size: 14px; line-height: 1.7; white-space: pre-wrap; overflow-x: auto;
}
.blank {
  background: rgba(251, 191, 36, .22); color: #fde68a;
  border: 1px dashed rgba(253, 230, 138, .55); border-radius: 5px; padding: 0 4px;
}

.options { margin-top: 22px; display: grid; gap: 10px; }
.option {
  display: flex; align-items: flex-start; gap: 12px; width: 100%; text-align: left;
  padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-soft); color: var(--ink); transition: all .16s ease;
}
.option:hover { border-color: var(--primary); background: var(--primary-soft); }
.option .letter {
  flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center; background: #fff; border: 1px solid var(--line);
  font-weight: 700; font-size: 14px; color: var(--ink-soft);
}
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .letter { background: var(--primary); border-color: var(--primary); color: #fff; }
.option.correct { border-color: #86efac; background: #ecfdf5; }
.option.correct .letter { background: var(--green); border-color: var(--green); color: #fff; }
.option.wrong { border-color: #fca5a5; background: #fef2f2; }
.option.wrong .letter { background: var(--red); border-color: var(--red); color: #fff; }

.answer-zone { margin-top: 24px; border-top: 1px dashed var(--line); padding-top: 20px; }
.reveal-btn {
  padding: 10px 20px; border: 0; border-radius: 10px;
  background: var(--primary); color: #fff; font-weight: 600;
  box-shadow: 0 6px 16px rgba(79,70,229,.24);
}
.reveal-btn:hover { background: #4338ca; }
.submit-zone { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.submit-zone > span { color: var(--ink-soft); font-size: 14px; }
.submit-btn {
  padding: 11px 20px; border: 0; border-radius: 10px;
  background: var(--green); color: #fff; font-weight: 700;
  box-shadow: 0 8px 20px rgba(5,150,105,.22);
}
.submit-btn:hover { background: #047857; }
.result-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 18px; padding: 10px 14px; border-radius: 12px;
  background: var(--primary-soft); color: var(--primary); font-size: 13px; font-weight: 600;
}
.result-bar button {
  border: 0; background: none; color: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.result-head button {
  padding: 7px 14px; border: 1px solid #c7d2fe; border-radius: 999px;
  background: rgba(255,255,255,.8); color: var(--primary);
  font-size: 13px; font-weight: 700; cursor: pointer;
  transition: background .18s, transform .18s;
}
.result-head button:hover { background: #fff; transform: translateY(-1px); }
.result-panel {
  margin-bottom: 20px; padding: 18px 20px; border-radius: 16px;
  background: linear-gradient(135deg, #eef2ff, #ecfdf5);
  border: 1px solid #c7d2fe;
}
.result-head { display: flex; align-items: center; justify-content: space-between; }
.result-head h4 { margin: 0; font-size: 17px; }
.result-stats { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0; }
.result-stats span {
  padding: 8px 14px; border-radius: 10px; background: rgba(255,255,255,.75);
  color: var(--ink-soft); font-size: 13px;
}
.result-stats b { margin-right: 5px; font-size: 17px; color: var(--ink); }
.wrong-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 8px; }
.wrong-list button {
  padding: 6px 12px; border-radius: 8px; border: 1px solid #fecaca;
  background: #fff; color: var(--red); font-size: 13px;
}
.wrong-list button:hover { background: #fef2f2; }
.all-right { margin: 12px 0 4px; color: var(--green); font-size: 14px; font-weight: 600; }
.result-tip { margin: 8px 0 0; color: var(--ink-mute); font-size: 12px; }
.answer-body { margin-top: 16px; padding: 16px 18px; border-radius: 12px; background: #ecfdf5; border: 1px solid #a7f3d0; }
.answer-body.ok { background: #f0fdf4; }
.answer-body.muted { background: var(--surface-soft); border-color: var(--line); }
.answer-body strong { color: var(--green); }
.answer-body.muted strong { color: var(--ink-soft); }
.answer-body p { margin: 6px 0 0; font-size: 14px; color: var(--ink-soft); }
.rail-list button.wrong:not(.active) { border-color: #fca5a5; background: #fef2f2; color: var(--red); }

.sample-link {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px;
  padding: 10px 16px; border-radius: 10px; background: #ecfdf5; color: var(--green);
  border: 1px solid #a7f3d0; font-weight: 600; font-size: 14px;
}
.sample-link:hover { background: #d1fae5; }
.step-list { margin: 16px 0 0; padding-left: 22px; color: var(--ink-soft); font-size: 15px; line-height: 1.8; }
.step-list li { margin: 6px 0; }
.step-note { margin: 14px 0 0; padding: 10px 14px; border-radius: 10px; background: var(--surface-soft); color: var(--ink-soft); font-size: 14px; }

.side-nav {
  position: fixed; top: 52%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--surface); color: var(--primary);
  display: grid; place-items: center; box-shadow: var(--shadow); font-size: 24px;
  z-index: 20; transition: transform .16s, opacity .16s;
}
.side-nav:hover:not(:disabled) { transform: translateY(-50%) scale(1.08); border-color: var(--primary); }
.side-nav:disabled { opacity: .35; cursor: not-allowed; }
.side-nav.prev { left: 22px; }
.side-nav.next { right: 22px; }
.side-row { display: none; }

@media (max-width: 1320px) {
  .side-nav.prev, .side-nav.next { display: none; }
  .side-row { display: flex; justify-content: space-between; margin-top: 18px; }
  .side-nav { position: static; transform: none; width: auto; height: auto; padding: 9px 16px; border-radius: 10px; font-size: 14px; }
  .side-nav:hover:not(:disabled) { transform: none; }
}

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; padding: 36px 32px 30px; }
  .hero-visual { min-height: 220px; }
  .hero h2 { font-size: 36px; }
  .carousel-main { grid-template-columns: 1fr; gap: 22px; }
  .slide-info h4 { font-size: 30px; }
  .question-layout { display: block; }
  .topic-rail {
    position: static; width: auto; height: auto; left: auto;
    margin-bottom: 16px; padding: 12px 14px;
  }
  .rail-list { display: flex; max-height: none; overflow-x: auto; padding-bottom: 4px; }
  .rail-list button { flex: 0 0 26px; }
}

@media (max-width: 720px) {
  :root { --nav-h: 68px; }
  .shell { padding-left: 14px; padding-right: 14px; }
  .nav-inner { padding: 0 14px; }
  .brand h1 { font-size: 15px; }
  .brand p, .header-tag { display: none; }
  .nav-search { max-width: 130px; }
  .topic-heading p { display: none; }
  .hero { padding: 30px 22px 26px; border-radius: 24px; }
  .hero h2 { font-size: 30px; }
  .hero-visual { display: none; }
  .stats { flex-wrap: wrap; gap: 14px 0; }
  .stats > div { padding-right: 22px; margin-right: 22px; }
  .search-box { max-width: none; }
  .carousel-shell { padding: 10px; border-radius: 22px; }
  .carousel-main { padding: 20px; min-height: 0; }
  .slide-preview { display: none; }
  .slide-info h4 { font-size: 26px; }
  .carousel-tabs { grid-template-columns: 1fr; gap: 0; padding-top: 14px; }
  .carousel-tab { padding: 9px 4px; }
  .carousel-tab small { display: none; }
  .carousel-arrow { top: 38%; width: 36px; height: 36px; }
  .carousel-arrow.prev { left: -2px; }
  .carousel-arrow.next { right: -2px; }
  .card-grid { grid-template-columns: 1fr; }
  .question-card { padding: 24px 20px; }
  .q-index { margin-left: 0; width: 100%; }
}
