:root {
  --ink: #14253d;
  --muted: #5f6e7d;
  --paper: #fbfaf6;
  --surface: #ffffff;
  --line: #dce3e7;
  --navy: #12375b;
  --teal: #087d78;
  --teal-dark: #05625e;
  --mint: #e6f4f1;
  --gold: #d99b2b;
  --gold-soft: #fff3d9;
  --rose: #a94c55;
  --rose-soft: #fff0f1;
  --blue-soft: #eaf2fa;
  --shadow: 0 18px 50px rgba(18, 55, 91, 0.09);
  --radius: 20px;
  --content: 1160px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 95% 0%, rgba(8, 125, 120, 0.08), transparent 34rem),
    linear-gradient(180deg, #f7faf9 0, var(--paper) 27rem);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-size: 16px;
  line-height: 1.72;
}

a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--navy); }

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 9px 14px;
  border-radius: 8px;
  color: white;
  background: var(--navy);
  transform: translateY(-150%);
}
.skip-link:focus { transform: none; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(18, 55, 91, 0.12);
  background: rgba(251, 250, 246, 0.9);
  backdrop-filter: blur(16px);
}

.nav {
  width: min(calc(100% - 32px), var(--content));
  min-height: 68px;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-weight: 760;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: white;
  background: linear-gradient(145deg, var(--navy), var(--teal));
  font-size: 13px;
  letter-spacing: 0.03em;
}

.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a {
  min-height: 42px;
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 650;
}
.nav-links a:hover,
.nav-links a[aria-current="page"] { color: var(--navy); background: var(--blue-soft); }

.hero {
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto;
  padding: 82px 0 54px;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
  gap: 54px;
  align-items: end;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1, h2, h3, h4 { margin-top: 0; line-height: 1.18; letter-spacing: -0.035em; }
h1 { margin-bottom: 22px; font-size: clamp(2.7rem, 7vw, 5.7rem); font-weight: 790; }
h2 { margin-bottom: 13px; font-size: clamp(1.9rem, 3.8vw, 3.15rem); font-weight: 760; }
h3 { font-size: 1.34rem; font-weight: 740; }
h4 { font-size: 1rem; letter-spacing: -0.01em; }

.hero h1 span { color: var(--teal); }
.lede { max-width: 760px; margin: 0; color: var(--muted); font-size: clamp(1.04rem, 2vw, 1.24rem); }

.hero-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid rgba(18, 55, 91, 0.13);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow);
}
.hero-card::before {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  top: -66px;
  right: -44px;
  border: 20px solid var(--gold-soft);
  border-radius: 50%;
}
.hero-card strong { display: block; margin-bottom: 3px; font-size: 1.9rem; color: var(--navy); }
.hero-card p { margin: 0; color: var(--muted); }

.stats {
  margin-top: 22px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.stat { padding: 12px 8px; border-radius: 12px; background: var(--paper); text-align: center; }
.stat b { display: block; color: var(--teal-dark); font-size: 1.25rem; line-height: 1.2; }
.stat span { color: var(--muted); font-size: 12px; }

.notice {
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto 64px;
  padding: 22px 24px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  border: 1px solid #edcf8b;
  border-radius: 16px;
  background: var(--gold-soft);
}
.notice-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #6f4a00;
  background: #ffdf91;
  font-weight: 800;
}
.notice p { margin: 0; color: #5d4b2c; }

.section {
  width: min(calc(100% - 32px), var(--content));
  margin: 0 auto;
  padding: 70px 0;
}
.section + .section { border-top: 1px solid var(--line); }
.section-heading { max-width: 820px; margin-bottom: 34px; }
.section-heading p { margin: 0; color: var(--muted); font-size: 1.05rem; }

.toolbar {
  margin: 24px 0 28px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.search {
  flex: 1 1 260px;
  min-height: 46px;
  padding: 10px 14px;
  border: 1px solid #bdcad0;
  border-radius: 12px;
  color: var(--ink);
  background: white;
}
.search:focus { outline: 3px solid rgba(8, 125, 120, 0.18); border-color: var(--teal); }

.filter-btn {
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid #bdcad0;
  border-radius: 999px;
  color: var(--muted);
  background: white;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
}
.filter-btn:hover,
.filter-btn[aria-pressed="true"] { border-color: var(--teal); color: white; background: var(--teal); }

.question-groups { display: grid; gap: 22px; }
.question-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 9px 30px rgba(18, 55, 91, 0.055);
}
.question-group > summary {
  min-height: 82px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  list-style: none;
}
.question-group > summary::-webkit-details-marker { display: none; }
.question-group > summary::after { content: "+"; margin-left: auto; color: var(--teal); font-size: 1.6rem; }
.question-group[open] > summary::after { content: "−"; }
.group-code {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: var(--navy);
  font-weight: 800;
}
.group-b .group-code { background: var(--teal); }
.group-c .group-code { color: #6b4300; background: #f2c360; }
.summary-copy strong { display: block; line-height: 1.35; }
.summary-copy span { color: var(--muted); font-size: 14px; }
.question-list { margin: 0; padding: 0 26px 26px 76px; }
.question-list li { padding: 11px 4px; border-bottom: 1px dashed #e3e8eb; }
.question-list li:last-child { border: 0; }
.question-source { margin-top: 3px; display: block; color: #74818e; font-size: 12.5px; line-height: 1.5; }
.question-source > span { color: #65727e; font-weight: 760; }
.question-source a { color: #5d7282; text-decoration-line: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
.question-source a[target="_blank"]::after,
.group-source-line a[target="_blank"]::after { content: " ↗"; text-decoration: none; }
.group-source-line { margin: 0 26px 14px 76px; padding: 11px 14px; border-left: 3px solid #ddb25a; border-radius: 0 10px 10px 0; color: #6c604b; background: #fff9eb; font-size: 13px; line-height: 1.55; }
.group-source-line strong { color: #5b4a28; }

.source-tag {
  margin-right: 8px;
  padding: 3px 8px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 0.08em;
  font-size: 11px;
  font-weight: 820;
  line-height: 1.35;
  letter-spacing: 0.02em;
}
.source-tag.official { border-color: #b9cce0; color: var(--navy); background: var(--blue-soft); }
.source-tag.experience { border-color: #a8d8d2; color: var(--teal-dark); background: var(--mint); }
.source-tag.inference { border-color: #e7c67e; color: #704900; background: var(--gold-soft); }
.question-source-note { margin: -4px 26px 24px 76px; color: var(--muted); font-size: 13px; }

.evidence-key {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.evidence-card { padding: 20px; border-radius: 16px; border: 1px solid var(--line); background: white; }
.evidence-card b { display: block; margin-bottom: 5px; }
.evidence-card p { margin: 0; color: var(--muted); font-size: 14px; }
.evidence-card.a { border-top: 4px solid var(--navy); }
.evidence-card.b { border-top: 4px solid var(--teal); }
.evidence-card.c { border-top: 4px solid var(--gold); }
.source-materials { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.source-materials > span { display: block; color: var(--muted); font-size: 11px; font-weight: 820; letter-spacing: .08em; text-transform: uppercase; }
.source-materials a { margin-top: 6px; display: block; font-size: 13px; font-weight: 700; line-height: 1.45; }

.prep-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.prep-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
}
.prep-no { display: block; margin-bottom: 22px; color: var(--teal); font-size: 13px; font-weight: 850; letter-spacing: 0.12em; }
.prep-card h3 { margin-bottom: 10px; }
.prep-card p, .prep-card li { color: var(--muted); }
.prep-card ul, .prep-card ol { padding-left: 20px; }

.cerf {
  padding: 32px;
  border-radius: var(--radius);
  color: white;
  background: linear-gradient(135deg, var(--navy), #174f6c 65%, var(--teal-dark));
}
.cerf h2, .cerf p { color: white; }
.cerf-steps { margin-top: 28px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cerf-step { padding: 18px; border: 1px solid rgba(255,255,255,.22); border-radius: 14px; background: rgba(255,255,255,.08); }
.cerf-step b { display: block; margin-bottom: 7px; color: #9ee6df; font-size: 1.35rem; }
.cerf-step span { font-size: 14px; color: rgba(255,255,255,.8); }

.timeline { display: grid; gap: 0; }
.day { position: relative; padding: 4px 0 28px 72px; }
.day::before { content: ""; position: absolute; left: 22px; top: 48px; bottom: 0; width: 1px; background: var(--line); }
.day:last-child::before { display: none; }
.day-badge { position: absolute; left: 0; top: 0; width: 46px; height: 46px; display: grid; place-items: center; border-radius: 14px; color: white; background: var(--teal); font-size: 13px; font-weight: 800; }
.day h3 { margin-bottom: 5px; }
.day p { margin: 0; color: var(--muted); }
.deliverable { display: inline-block; margin-top: 7px; padding: 3px 9px; border-radius: 7px; background: var(--mint); color: var(--teal-dark); font-size: 13px; font-weight: 700; }

.checklist { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.check-item { min-height: 60px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line); border-radius: 13px; background: white; }
.check-item input { width: 19px; height: 19px; margin-top: 4px; accent-color: var(--teal); }
.check-item:has(input:checked) span { color: var(--muted); text-decoration: line-through; }

.boundary { padding: 28px; border-left: 5px solid var(--rose); border-radius: 4px var(--radius) var(--radius) 4px; background: var(--rose-soft); }
.boundary h3 { color: #7f3540; }
.boundary li { margin-bottom: 8px; color: #68464a; }

.source-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; padding-left: 20px; }
.source-list li { padding: 4px 0; color: var(--muted); }
.source-list a { font-weight: 650; }
.citation { white-space: nowrap; font-size: 0.74em; vertical-align: super; font-weight: 800; }

/* Curriculum */
.route-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.route-card { padding: 28px; border: 1px solid var(--line); border-radius: var(--radius); background: white; }
.route-card.cs { border-top: 5px solid var(--navy); }
.route-card.ai { border-top: 5px solid var(--teal); }
.route-label { color: var(--muted); font-size: 13px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.route-card ul { padding-left: 20px; color: var(--muted); }
.course-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.course-chip { padding: 5px 9px; border-radius: 8px; color: var(--navy); background: var(--blue-soft); font-size: 12px; font-weight: 760; }
.ai .course-chip { color: var(--teal-dark); background: var(--mint); }

.credit-bar { overflow: hidden; height: 42px; display: flex; border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.credit-seg { min-width: 0; display: grid; place-items: center; color: white; font-size: 12px; font-weight: 800; }
.credit-seg:nth-child(1) { background: #12375b; }
.credit-seg:nth-child(2) { background: #225d78; }
.credit-seg:nth-child(3) { background: #087d78; }
.credit-seg:nth-child(4) { background: #2aa097; }
.credit-seg:nth-child(5) { background: #c8891b; }
.credit-seg:nth-child(6) { background: #915d71; }
.credit-seg:nth-child(7) { background: #667587; }
.credit-legend { margin-top: 18px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.credit-legend div { padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: white; }
.credit-legend b { display: block; font-size: 15px; }
.credit-legend span { color: var(--muted); font-size: 12px; }

.compare-table, .study-table { width: 100%; border-collapse: collapse; border-spacing: 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; background: white; }
.compare-table th, .compare-table td, .study-table th, .study-table td { padding: 15px 16px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare-table th, .study-table th { color: var(--navy); background: #f3f7f8; font-size: 13px; letter-spacing: .02em; }
.compare-table tr:last-child td, .study-table tr:last-child td { border-bottom: 0; }

.year-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 18px; }
.year-tab { min-height: 48px; padding: 9px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); background: white; cursor: pointer; font-weight: 750; }
.year-tab[aria-selected="true"] { border-color: var(--teal); color: white; background: var(--teal); }
.year-panel { display: none; }
.year-panel.active { display: block; }
.year-summary { margin-bottom: 14px; color: var(--muted); }

.course-directory { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.course {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}
.course h3 { margin: 0 0 7px; font-size: 1rem; letter-spacing: -0.01em; }
.course-code { margin-right: 7px; color: var(--teal-dark); font-weight: 850; }
.course p { margin: 0; color: var(--muted); font-size: 14px; }
.course[hidden] { display: none; }
.course-empty { display: none; grid-column: 1 / -1; padding: 28px; border: 1px dashed #bdcad0; border-radius: 14px; color: var(--muted); text-align: center; }
.course-empty.show { display: block; }

.callout { padding: 24px; border: 1px solid #b9ded9; border-radius: 16px; background: var(--mint); }
.callout h3 { color: var(--teal-dark); }
.callout p:last-child { margin-bottom: 0; }
.quote-template { margin: 18px 0 0; padding: 20px 22px; border-left: 4px solid var(--teal); background: white; font-size: 1.02rem; }

.footer { margin-top: 40px; padding: 46px 0 60px; color: #c8d4df; background: var(--navy); }
.footer-inner { width: min(calc(100% - 32px), var(--content)); margin: auto; display: flex; justify-content: space-between; gap: 24px; }
.footer p { margin: 0; }
.footer a { color: white; }

.back-top { position: fixed; right: 20px; bottom: 20px; width: 46px; height: 46px; display: none; place-items: center; border: 0; border-radius: 50%; color: white; background: var(--navy); box-shadow: var(--shadow); cursor: pointer; }
.back-top.show { display: grid; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 26px; padding-top: 56px; }
  .evidence-key, .cerf-steps, .credit-legend { grid-template-columns: repeat(2, 1fr); }
  .prep-grid, .route-grid, .course-directory { grid-template-columns: 1fr; }
  .source-list { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  body { font-size: 15px; }
  .nav { width: min(calc(100% - 20px), var(--content)); min-height: 62px; gap: 8px; }
  .brand-text { display: none; }
  .nav-links a { padding: 7px 9px; font-size: 13px; }
  .hero, .section, .notice { width: min(calc(100% - 24px), var(--content)); }
  .hero { padding-top: 44px; }
  h1 { font-size: clamp(2.45rem, 15vw, 4rem); }
  .section { padding: 52px 0; }
  .notice { grid-template-columns: 1fr; }
  .evidence-key, .cerf-steps, .credit-legend, .checklist { grid-template-columns: 1fr; }
  .question-group > summary { padding: 18px; }
  .question-list { padding: 0 18px 20px 48px; }
  .summary-copy > span { display: none; }
  .source-tag { margin-bottom: 4px; }
  .group-source-line { margin: 0 18px 14px 48px; }
  .question-source-note { margin-left: 48px; }
  .cerf { padding: 24px; }
  .year-tabs { grid-template-columns: repeat(2, 1fr); }
  .credit-seg { font-size: 0; }
  .footer-inner { flex-direction: column; }
}

@media print {
  :root { --paper: white; }
  body { background: white; color: black; font-size: 11pt; }
  .topbar, .toolbar, .back-top, .hero-card, .footer { display: none !important; }
  .hero { display: block; padding: 24px 0; }
  h1 { font-size: 30pt; }
  .section { padding: 26px 0; break-inside: avoid; }
  .question-group { break-inside: avoid; box-shadow: none; }
  .question-group:not([open]) > :not(summary) { display: block; }
  a { color: black; text-decoration: none; }
  .course-directory, .prep-grid { grid-template-columns: repeat(2, 1fr); }
  .course, .prep-card, .route-card { break-inside: avoid; box-shadow: none; }
}

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