:root {
  --bg: #f6f7fb;
  --card: #ffffff;
  --ink: #1c2333;
  --ink-2: #4b5568;
  --ink-3: #8a93a6;
  --brand: #3452d9;
  --brand-2: #6366f1;
  --brand-soft: #eef1fe;
  --line: #e5e8f0;
  --ok: #0e9f6e;
  --warn: #d97706;
  --bad: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(28, 35, 51, 0.05), 0 8px 24px rgba(28, 35, 51, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
}
.logo:hover { text-decoration: none; }
.logo .badge {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 800;
}
.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
  align-items: center;
}
.nav a {
  color: var(--ink-2);
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 15px;
}
.nav a:hover { background: var(--brand-soft); color: var(--brand); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* ---------- layout ---------- */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}
.page-title { font-size: 28px; font-weight: 800; margin: 8px 0 4px; }
.page-sub { color: var(--ink-3); margin: 0 0 28px; font-size: 15px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
}

.grid {
  display: grid;
  gap: 18px;
}
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 860px) {
  .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; }
  .nav a { padding: 8px 8px; font-size: 14px; }
  .nav { gap: 0; }
}

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, #1e2a5a 0%, #3452d9 55%, #6366f1 100%);
  color: #fff;
  border-radius: 18px;
  padding: 44px 40px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -80px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}
.hero h1 { margin: 0 0 8px; font-size: 30px; font-weight: 800; }
.hero p { margin: 0; color: rgba(255, 255, 255, 0.85); max-width: 620px; }
.hero .tags { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; }
.hero .tag {
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 13px;
}

/* countdown */
.countdown-wrap {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 26px;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}
.countdown-box {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  padding: 10px 18px;
  text-align: center;
  min-width: 82px;
}
.countdown-box .num { font-size: 28px; font-weight: 800; line-height: 1.2; font-variant-numeric: tabular-nums; }
.countdown-box .lbl { font-size: 12px; color: rgba(255, 255, 255, 0.75); }
.countdown-note { font-size: 13px; color: rgba(255, 255, 255, 0.7); }

/* ---------- section title ---------- */
.section { margin-top: 36px; }
.section > h2 {
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section > h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 2px;
  background: linear-gradient(var(--brand), var(--brand-2));
}

/* ---------- subject cards ---------- */
.subject-card h3 { margin: 0 0 6px; font-size: 17px; }
.subject-card .meta { font-size: 13px; color: var(--ink-3); margin-bottom: 10px; }
.subject-card p { margin: 0; font-size: 14px; color: var(--ink-2); }
.subject-card .icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  margin-bottom: 12px;
}

/* ---------- module nav cards ---------- */
.module-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.module-card:hover { transform: translateY(-2px); text-decoration: none; }
.module-card .icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: var(--brand-soft);
  color: var(--brand);
}
.module-card h3 { margin: 0; font-size: 16px; }
.module-card p { margin: 0; font-size: 13.5px; color: var(--ink-3); }

/* ---------- accordion (knowledge) ---------- */
details.chapter {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 14px;
  overflow: hidden;
}
details.chapter > summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 22px;
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  user-select: none;
}
details.chapter > summary::-webkit-details-marker { display: none; }
details.chapter > summary .ch-index {
  font-size: 12px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 2px 8px;
  font-weight: 700;
}
details.chapter > summary .arrow { margin-left: auto; color: var(--ink-3); transition: transform 0.2s; }
details.chapter[open] > summary .arrow { transform: rotate(90deg); }
details.chapter .chapter-body {
  padding: 4px 22px 20px;
  border-top: 1px solid var(--line);
}
.chapter-body h4 { margin: 18px 0 8px; font-size: 15px; }
.chapter-body ul, .chapter-body ol { margin: 6px 0; padding-left: 22px; }
.chapter-body li { margin: 4px 0; font-size: 14.5px; color: var(--ink-2); }
.chapter-body strong { color: var(--ink); }
.kb-note {
  background: var(--brand-soft);
  border-left: 3px solid var(--brand);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  font-size: 14px;
  color: var(--ink-2);
  margin: 12px 0;
}
table.tbl {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 10px 0;
}
table.tbl th, table.tbl td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
}
table.tbl th { background: #f8f9fd; font-weight: 700; }
table.tbl tr:nth-child(even) td { background: #fafbfe; }

/* ---------- quiz ---------- */
.quiz-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 16px;
}
.quiz-item .q {
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  gap: 10px;
}
.quiz-item .q .no {
  flex: none;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 6px;
  height: 24px;
  min-width: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
}
.opt { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 8px; cursor: pointer; border: 1px solid transparent; }
.opt:hover { background: #f5f7ff; }
.opt input { margin-top: 5px; accent-color: var(--brand); }
.opt label { cursor: pointer; font-size: 14.5px; }
.quiz-item .explanation {
  display: none;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.quiz-item .explanation.show { display: block; }
.explanation.good { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.explanation.bad { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.quiz-toolbar {
  position: sticky;
  bottom: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  backdrop-filter: blur(8px);
}
.btn {
  border: none;
  border-radius: 9px;
  padding: 9px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--brand); color: #fff; }
.btn.primary:hover { background: #2a44bd; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink-2); }
.score-text { font-weight: 700; font-size: 15px; }

/* ---------- essay ---------- */
.essay-frame {
  background: #fffdf5;
  border: 1px solid #f0e6c8;
  border-radius: var(--radius);
  padding: 22px 26px;
  margin: 14px 0;
}
.essay-frame h4 { margin: 0 0 8px; color: #92400e; font-size: 15px; }
.essay-frame p, .essay-frame li { font-size: 14.5px; color: #6b5b33; }
.topic-list li { margin: 6px 0; }

/* ---------- plan ---------- */
.plan-phase { margin-bottom: 22px; }
.plan-phase h3 { font-size: 16px; margin: 0 0 10px; display: flex; gap: 10px; align-items: center; }
.plan-phase .phase-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 999px;
}
.phase-tag.p1 { background: #eef1fe; color: var(--brand); }
.phase-tag.p2 { background: #ecfdf5; color: var(--ok); }
.phase-tag.p3 { background: #fff7ed; color: var(--warn); }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px 20px 40px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
}
.site-footer p { margin: 4px 0; }

/* ---------- 404 ---------- */
.center-box { text-align: center; padding: 80px 20px; }
.center-box h1 { font-size: 64px; margin: 0; color: var(--brand); }
