:root {
  --ink: #172033;
  --muted: #5d687a;
  --paper: #fbfaf7;
  --panel: #ffffff;
  --accent: #8b5cf6;
  --accent2: #0ea5e9;
  --good: #16835d;
  --bad: #c2413b;
  --line: #e3e0d8;
  --code: #f4f2ee;
  --shadow: 0 12px 35px rgba(28, 35, 50, .08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(139,92,246,.08), transparent 30%),
    radial-gradient(circle at 85% 10%, rgba(14,165,233,.08), transparent 30%),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.68;
}
.container { max-width: 1120px; margin: 0 auto; padding: 32px 24px 100px; }
header.hero {
  position: relative;
  overflow: hidden;
  margin-bottom: 34px;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, #fff, #f5f3ff 55%, #eff8ff);
  box-shadow: var(--shadow);
}
header.hero .eyebrow {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(139,92,246,.12);
  color: #6d28d9;
  font-size: 13px;
  font-weight: 750;
  letter-spacing: .08em;
  text-transform: uppercase;
}
h1, h2, h3, h4 { line-height: 1.22; font-family: Georgia, "Times New Roman", "Songti SC", serif; }
h1 { margin: 14px 0 12px; font-size: clamp(34px, 5vw, 58px); letter-spacing: -.02em; }
h2 { margin-top: 42px; font-size: clamp(26px, 3.2vw, 36px); }
h3 { margin-top: 28px; font-size: 22px; }
p { font-size: 17px; }
a { color: #5b21b6; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #1d4ed8; }
.meta { color: var(--muted); font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 18px; }
.route-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
  counter-reset: route;
}
.route-map article {
  position: relative;
  padding: 18px;
  border: 1px solid #ddd6fe;
  border-radius: 16px;
  background: linear-gradient(180deg, #fff, #f8f5ff);
}
.route-map article strong { display: block; margin-bottom: 6px; color: #4c1d95; }
.route-map span {
  display: inline-block;
  margin-bottom: 8px;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(14,165,233,.12);
  color: #075985;
  font-size: 12px;
  font-weight: 750;
}
.route-map p { margin: 0; color: var(--muted); font-size: 14px; }
.stage-tag {
  display: inline-block;
  margin-bottom: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
}
.card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 5px 18px rgba(28,35,50,.04);
}
.card h3 { margin-top: 0; }
.card p:last-child { margin-bottom: 0; }
.callout {
  margin: 26px 0;
  padding: 20px 24px;
  border-left: 5px solid var(--accent);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(28,35,50,.04);
}
.callout.blue { border-left-color: var(--accent2); }
.callout.good { border-left-color: var(--good); }
.callout.warn { border-left-color: #d97706; }
.callout strong:first-child { display: block; margin-bottom: 6px; color: #4c1d95; }
.callout.blue strong:first-child { color: #075985; }
.callout.warn strong:first-child { color: #9a3412; }
pre, code, kbd { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
code { padding: .12em .36em; border-radius: 6px; background: var(--code); color: #313d52; font-size: .94em; }
pre {
  overflow-x: auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #202a3d;
  color: #f8fafc;
  font-size: 14px;
  line-height: 1.62;
}
pre code { padding: 0; background: transparent; color: inherit; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 4px 16px rgba(28,35,50,.04); }
th, td { padding: 13px 15px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: #f7f5ff; color: #392a6b; }
tr:last-child td { border-bottom: 0; }
figure { margin: 30px 0; }
figure img, figure video {
  display: block;
  width: 100%;
  max-width: 880px;
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
}
figcaption { margin-top: 10px; color: var(--muted); font-size: 14px; text-align: center; }
.quiz {
  margin: 30px 0;
  padding: 24px;
  border: 1px solid #ddd6fe;
  border-radius: 18px;
  background: linear-gradient(180deg, #fff, #faf8ff);
}
.quiz h3 { margin-top: 0; }
.options { display: grid; gap: 10px; }
.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font: inherit;
  transition: .15s ease;
}
.option:hover { border-color: #a78bfa; transform: translateY(-1px); }
.option.correct { border-color: var(--good); background: #ecfdf5; }
.option.incorrect { border-color: var(--bad); background: #fff1f0; }
.option:disabled { cursor: default; transform: none; }
.feedback { min-height: 28px; margin-top: 14px; font-weight: 700; }
.feedback.correct { color: var(--good); }
.feedback.incorrect { color: var(--bad); }
.explanation { display: none; margin-top: 10px; color: var(--muted); }
.explanation.show { display: block; }
.checklist { list-style: none; padding-left: 0; }
.checklist li { position: relative; padding-left: 34px; margin: 10px 0; }
.checklist input { position: absolute; left: 0; top: 5px; width: 20px; height: 20px; accent-color: var(--accent); }
.lesson-nav { display: flex; justify-content: space-between; gap: 18px; margin-top: 55px; }
.lesson-nav a {
  flex: 1;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(28,35,50,.04);
}
.lesson-nav a:hover { border-color: #a78bfa; }
.badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-family: Inter, sans-serif;
  font-size: 12px;
  font-weight: 700;
}
.progress-wrap { position: sticky; top: 0; z-index: 5; padding: 12px 0; background: rgba(251,250,247,.92); backdrop-filter: blur(8px); }
.course-topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.9);
  backdrop-filter: blur(8px);
}
.course-topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.course-topbar .compact { max-width: 1120px; }
.course-topbar span { color: var(--muted); font-size: 13px; font-weight: 700; }
.progress-bar { height: 8px; border-radius: 999px; background: #e5e7eb; overflow: hidden; }
.progress-bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: .25s ease; }
.source-note { margin-top: 50px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
@media (max-width: 720px) {
  header.hero { padding: 30px; border-radius: 20px; }
  .container { padding: 18px 14px 70px; }
  .course-topbar .container { flex-direction: column; align-items: flex-start; gap: 4px; }
  .lesson-nav { flex-direction: column; }
  table { display: block; overflow-x: auto; }
}
@media print {
  body { background: #fff; }
  .quiz, .lesson-nav, .progress-wrap { display: none; }
  header.hero { box-shadow: none; }
  .card, .callout { box-shadow: none; break-inside: avoid; }
}
