:root {
  --yellow: #ffd400;
  --yellow-soft: #fff4b8;
  --yellow-pale: #fffbed;
  --ink: #111111;
  --ink-2: #3f3f3f;
  --muted: #6b6b67;
  --line: #d7d5ca;
  --paper: #fffef9;
  --surface: #f4f3ec;
  --white: #ffffff;
  --success: #167451;
  --danger: #b42318;
  --gsat: #315ea8;
  --review: #087a68;
  --other: #4a4a45;
  --max: 1180px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 16px 40px rgb(17 17 17 / 8%);
  --step--1: clamp(.82rem, .78rem + .12vw, .9rem);
  --step-0: clamp(1rem, .96rem + .18vw, 1.12rem);
  --step-1: clamp(1.18rem, 1.06rem + .5vw, 1.48rem);
  --step-2: clamp(1.5rem, 1.28rem + .9vw, 2.08rem);
  --step-3: clamp(2rem, 1.55rem + 1.8vw, 3.25rem);
  --step-4: clamp(2.75rem, 1.9rem + 3.4vw, 5.4rem);
}

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

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

html.standalone-document { scroll-padding-top: 0; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: "Microsoft JhengHei", "PingFang TC", sans-serif;
  font-size: var(--step-0);
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 5px;
  z-index: 100;
  background: var(--yellow);
}

img { max-width: 100%; }
button, input, select { font: inherit; }
button { color: inherit; }
a { color: inherit; text-underline-offset: .18em; }
a:hover { text-decoration-thickness: 3px; }

:focus-visible {
  outline: 4px solid var(--yellow);
  outline-offset: 3px;
  box-shadow: 0 0 0 2px var(--ink);
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 10px 16px;
  color: var(--ink);
  background: var(--yellow);
  border: 2px solid var(--ink);
  font-weight: 800;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--ink);
  background: rgb(255 254 249 / 94%);
  backdrop-filter: blur(12px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
  letter-spacing: -.02em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  aspect-ratio: 1;
  background: var(--yellow);
  border: 2px solid var(--ink);
  border-radius: 50%;
  font-size: .78rem;
}

.top-nav { display: flex; align-items: center; gap: 6px; }
.top-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: var(--step--1);
  font-weight: 750;
}
.top-nav a:hover, .top-nav a[aria-current="page"] { background: var(--yellow); }

.page-progress {
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 3px;
  background: var(--ink);
}

.outline-trigger {
  position: fixed;
  left: 0;
  top: 138px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 10px;
  border: 2px solid var(--ink);
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  font-weight: 900;
  line-height: 1;
  writing-mode: vertical-rl;
  cursor: pointer;
}
.outline-trigger:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.outline-backdrop { position: fixed; inset: 0; z-index: 110; background: rgb(17 17 17 / 54%); }
.outline-backdrop[hidden] { display: none; }
.outline-drawer {
  width: min(420px, calc(100% - 32px));
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border-right: 3px solid var(--ink);
  background: var(--paper);
  box-shadow: 16px 0 0 rgb(17 17 17 / 18%);
}
.outline-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 28px; border-bottom: 8px solid var(--yellow); }
.outline-head .eyebrow { margin-bottom: 8px; }
.outline-head h2 { font-size: var(--step-2); }
.outline-close { width: 44px; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; background: var(--white); font-size: 1.8rem; font-weight: 900; line-height: 1; cursor: pointer; }
.outline-nav { overflow-y: auto; padding: 12px 0 34px; }
.outline-link {
  width: 100%;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 15px 28px;
  border: 0;
  border-left: 8px solid transparent;
  color: var(--ink);
  background: transparent;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}
.outline-link > span { font-family: "Cascadia Mono", Consolas, monospace; font-size: .78rem; font-weight: 900; }
.outline-link > b { line-height: 1.42; }
.outline-link:hover, .outline-link.active { border-left-color: var(--ink); background: var(--yellow); }
.outline-link:disabled, .outline-link[aria-disabled="true"] { opacity: .38; cursor: not-allowed; }
body.outline-open { overflow: hidden; }

.container { width: min(calc(100% - 40px), var(--max)); margin-inline: auto; }
.narrow { width: min(calc(100% - 40px), 820px); margin-inline: auto; }
.reading { max-width: 72ch; }

.hero {
  position: relative;
  min-height: min(760px, calc(100svh - 72px));
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 1px solid var(--ink);
  background:
    linear-gradient(90deg, transparent 49.8%, rgb(17 17 17 / 8%) 50%, transparent 50.2%),
    var(--yellow);
}

.hero::after {
  content: "";
  position: absolute;
  width: min(34vw, 430px);
  aspect-ratio: 1;
  right: -7vw;
  bottom: -16vw;
  border: clamp(34px, 5vw, 70px) solid var(--ink);
  border-radius: 50%;
  opacity: .09;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(250px, .65fr);
  gap: clamp(36px, 7vw, 90px);
  align-items: end;
  padding-block: clamp(72px, 9vw, 126px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: var(--step--1);
  font-weight: 900;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 28px; height: 3px; background: currentColor; }

h1, h2, h3, h4 { margin: 0; font-family: "Noto Sans TC", "Microsoft JhengHei UI", sans-serif; line-height: 1.18; letter-spacing: -.035em; }
h1 { max-width: 13ch; font-size: var(--step-4); font-weight: 950; }
h2 { font-size: var(--step-3); font-weight: 950; }
h3 { font-size: var(--step-2); font-weight: 900; }
h4 { font-size: var(--step-1); font-weight: 850; }
p { margin: 0 0 1em; }

.hero-lead { max-width: 44ch; margin: 28px 0 0; font-size: var(--step-1); font-weight: 650; }
.hero-meta { border-top: 3px solid var(--ink); }
.hero-meta div { display: grid; grid-template-columns: 70px 1fr; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--ink); }
.hero-meta dt { font-size: var(--step--1); font-weight: 800; }
.hero-meta dd { margin: 0; font-weight: 700; }

.section { padding-block: clamp(72px, 9vw, 128px); border-bottom: 1px solid var(--line); }
.section-yellow { background: var(--yellow); border-color: var(--ink); }
.section-dark { color: var(--white); background: var(--ink); border-color: var(--ink); }
.section-soft { background: var(--surface); }

.section-heading {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-bottom: clamp(38px, 6vw, 72px);
}

.section-number {
  display: grid;
  place-items: center;
  width: 72px;
  aspect-ratio: 1;
  border: 3px solid currentColor;
  border-radius: 50%;
  font-weight: 950;
  letter-spacing: -.04em;
}
.section-heading p { max-width: 60ch; margin: 16px 0 0; color: var(--ink-2); }
.section-dark .section-heading p { color: #c9c9c3; }

.marker { background: linear-gradient(transparent 54%, var(--yellow) 54%); }
.section-yellow .marker { background: linear-gradient(transparent 54%, var(--white) 54%); }
.section-dark .marker { color: var(--ink); background: var(--yellow); padding-inline: .12em; }

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

.card {
  padding: clamp(22px, 3vw, 34px);
  background: var(--white);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
}
.card > :last-child { margin-bottom: 0; }
.card-dark { color: var(--white); background: var(--ink); }
.card-yellow { background: var(--yellow); }
.card-soft { background: var(--surface); border-color: var(--line); }
.card h3, .card h4 { margin-bottom: 14px; }
.card p { color: var(--ink-2); }
.card-dark p { color: #d1d1ca; }

.stat-card { min-height: 210px; display: flex; flex-direction: column; justify-content: space-between; }
.stat-card strong { font-size: var(--step-4); line-height: 1; }
.stat-card span { font-weight: 800; }

.pill-row, .tag-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pill, .tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 11px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font-size: var(--step--1);
  font-weight: 750;
}
.tag { background: var(--yellow-soft); border-color: #786500; }

.timeline { position: relative; display: grid; gap: 14px; }
.timeline::before { content: ""; position: absolute; left: 27px; top: 28px; bottom: 28px; width: 2px; background: var(--ink); }
.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
}
.timeline-dot { z-index: 1; display: grid; place-items: center; width: 56px; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 950; }
.timeline-time { padding-top: 13px; font-weight: 850; }
.timeline-copy h3 { margin-bottom: 8px; font-size: var(--step-1); }
.timeline-copy p { margin: 0; color: var(--ink-2); }

.callout {
  position: relative;
  margin-block: 28px;
  padding: 26px 28px 26px 34px;
  border: 2px solid var(--ink);
  border-left-width: 12px;
  background: var(--yellow-pale);
}
.callout > :last-child { margin-bottom: 0; }
.callout-dark { color: var(--white); background: var(--ink); }
.callout-label { display: block; margin-bottom: 6px; font-size: var(--step--1); font-weight: 900; letter-spacing: .08em; }

.quote {
  margin: clamp(36px, 6vw, 76px) 0;
  padding: 0 0 0 clamp(24px, 5vw, 60px);
  border-left: clamp(8px, 1.2vw, 16px) solid var(--yellow);
  font-size: var(--step-2);
  font-weight: 850;
  line-height: 1.45;
}

.compare { display: grid; grid-template-columns: 1fr 64px 1fr; gap: 18px; align-items: stretch; }
.compare-panel { padding: clamp(24px, 4vw, 42px); border: 1.5px solid var(--ink); border-radius: var(--radius); background: var(--white); }
.compare-panel.bad { background: var(--surface); }
.compare-panel.good { background: var(--yellow); }
.compare-label { display: inline-block; margin-bottom: 18px; padding: 3px 9px; color: var(--white); background: var(--ink); font-size: var(--step--1); font-weight: 900; }
.compare-arrow { display: grid; place-items: center; font-size: 2rem; font-weight: 950; }

.d-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.d-card { position: relative; overflow: hidden; min-height: 350px; padding: 28px; border: 2px solid var(--ink); border-radius: var(--radius-lg); background: var(--white); }
.d-card::before { content: attr(data-letter); position: absolute; right: -12px; bottom: -36px; color: var(--yellow); font-size: 13rem; font-weight: 950; line-height: 1; z-index: 0; }
.d-card > * { position: relative; z-index: 1; }
.d-card ol { padding-left: 1.25em; }
.d-card li { margin-bottom: 8px; font-weight: 650; }

.table-wrap { overflow-x: auto; border: 1px solid var(--ink); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; min-width: 720px; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { background: var(--yellow); font-size: var(--step--1); }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--yellow-pale); }

.major-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.major-card { position: relative; min-height: 290px; display: flex; flex-direction: column; }
.major-index { position: absolute; right: 20px; top: 18px; font-size: 2.6rem; font-weight: 950; color: rgb(17 17 17 / 13%); }
.major-card h3 { padding-right: 52px; }
.major-card .tag-row { margin-top: auto; padding-top: 18px; }

.tabs { display: flex; gap: 8px; margin-bottom: 26px; overflow-x: auto; padding-bottom: 5px; }
.tab-button, .filter-button {
  flex: 0 0 auto;
  padding: 10px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font-weight: 850;
  cursor: pointer;
}
.tab-button[aria-selected="true"], .filter-button.active { background: var(--yellow); box-shadow: 3px 3px 0 var(--ink); }
.tab-panel[hidden] { display: none; }

.accordion { border-top: 1px solid var(--ink); }
details { border-bottom: 1px solid var(--ink); }
summary { display: flex; justify-content: space-between; gap: 24px; padding: 22px 4px; cursor: pointer; font-weight: 900; font-size: var(--step-1); }
summary::after { content: "+"; font-size: 1.4em; line-height: 1; }
details[open] summary::after { content: "−"; }
.details-body { padding: 0 4px 30px; }

.button-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 48px;
  padding: 10px 20px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--yellow);
  box-shadow: 4px 4px 0 var(--ink);
  text-decoration: none;
  font-weight: 900;
  cursor: pointer;
}
.button:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.button-secondary { background: var(--white); }
.button-ghost { background: transparent; box-shadow: none; border-color: var(--line); }
.button-danger { color: var(--danger); background: var(--white); border-color: var(--danger); box-shadow: none; }

.course-tools {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 30;
  display: flex;
  gap: 8px;
}
.round-button { width: 46px; height: 46px; border: 2px solid var(--ink); border-radius: 50%; background: var(--yellow); font-weight: 950; cursor: pointer; }

.quiz-shell { min-height: calc(100svh - 73px); padding-block: clamp(34px, 6vw, 70px); background: var(--surface); }
.quiz-card { width: min(calc(100% - 32px), 880px); margin-inline: auto; padding: clamp(26px, 5vw, 56px); background: var(--white); border: 2px solid var(--ink); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.quiz-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 24px; font-size: var(--step--1); font-weight: 850; }
.quiz-progress { height: 10px; margin-bottom: 36px; overflow: hidden; border: 1px solid var(--ink); border-radius: 999px; background: var(--white); }
.quiz-progress-bar { width: 0; height: 100%; background: var(--yellow); transition: width .25s ease; }
.quiz-chapter-visual { margin: 0 0 26px; overflow: hidden; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--surface); }
.quiz-chapter-visual img { width: 100%; aspect-ratio: 16 / 9; display: block; object-fit: cover; }
.quiz-question-heading { margin-bottom: 28px; }
.question-chapter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 13px; margin: 0 0 12px; }
.question-chapter span { padding: 3px 8px; border: 1px solid var(--ink); background: var(--yellow); font-family: "Cascadia Mono", Consolas, monospace; font-size: var(--step--1); font-weight: 900; }
.question-chapter strong { font-size: var(--step-2); line-height: 1.2; }
.question-context { margin: 0 0 8px; color: var(--ink-2); font-size: var(--step-0); font-weight: 750; }
.question-title { font-size: var(--step-2); }
.option-list { display: grid; gap: 12px; margin: 0 0 28px; padding: 0; border: 0; }
.option-card { position: relative; display: block; cursor: pointer; }
.option-card input { position: absolute; opacity: 0; }
.option-content { display: grid; grid-template-columns: 34px 1fr; gap: 13px; align-items: start; padding: 17px 18px; border: 1.5px solid var(--line); border-radius: var(--radius-sm); background: var(--paper); transition: .15s ease; }
.option-letter { display: grid; place-items: center; width: 30px; aspect-ratio: 1; border: 1.5px solid var(--ink); border-radius: 50%; font-size: .82rem; font-weight: 900; }
.option-card:hover .option-content { border-color: var(--ink); transform: translateY(-1px); }
.option-card input:checked + .option-content { border-color: var(--ink); background: var(--yellow); box-shadow: 4px 4px 0 var(--ink); }
.option-card input:focus-visible + .option-content { outline: 4px solid var(--yellow); outline-offset: 3px; box-shadow: 0 0 0 2px var(--ink); }
.quiz-actions { display: flex; justify-content: space-between; gap: 12px; }
.quiz-error { min-height: 30px; margin-top: 18px; color: var(--danger); font-weight: 800; }

.result-hero { display: grid; grid-template-columns: .9fr 1.1fr; gap: 24px; margin-bottom: 28px; }
.rank-card { padding: 28px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--yellow); }
.rank-card:first-child { grid-row: span 2; }
.rank-number { display: block; font-size: .82rem; font-weight: 900; letter-spacing: .08em; }
.rank-score { font-size: var(--step-3); font-weight: 950; line-height: 1; }
.score-list { display: grid; gap: 14px; margin-block: 28px; }
.score-row { display: grid; grid-template-columns: 82px 1fr 56px; gap: 12px; align-items: center; }
.score-track { height: 14px; overflow: hidden; border: 1px solid var(--ink); border-radius: 999px; background: var(--surface); }
.score-fill { height: 100%; background: var(--yellow); }
.score-row strong:last-child { text-align: right; }

.template-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.template-box { min-height: 240px; padding: 24px; border: 2px solid var(--ink); border-radius: var(--radius); background: var(--white); }
.template-box h3 { display: flex; align-items: center; gap: 10px; }
.template-letter { display: grid; place-items: center; width: 40px; aspect-ratio: 1; border-radius: 50%; background: var(--yellow); font-weight: 950; }

.idea-card { margin-bottom: 20px; }
.idea-card[hidden] { display: none; }
.idea-head { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: start; margin-bottom: 24px; }
.idea-section { padding-top: 20px; border-top: 1px solid var(--line); }
.idea-section + .idea-section { margin-top: 20px; }
.idea-section ul { margin-bottom: 0; }

.source-list { margin: 0; padding-left: 1.2em; }
.source-list li { margin-bottom: 8px; }
.source-note { color: var(--muted); font-size: var(--step--1); }

/* Evidence-led course and admissions atlas */
.rule-reader { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 28px; align-items: start; }
.evidence-rail-list { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.evidence-rail-list::before { content: ""; position: absolute; left: 23px; top: 24px; bottom: 24px; width: 8px; background: var(--yellow); border-inline: 2px solid var(--ink); }
.evidence-rail-list li { position: relative; display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 0 0 30px; }
.evidence-rail-list li > span { z-index: 1; display: grid; place-items: center; width: 54px; aspect-ratio: 1; border: 2px solid var(--ink); background: var(--paper); font-family: "Cascadia Mono", Consolas, monospace; font-weight: 900; }
.evidence-rail-list h3 { margin-bottom: 7px; font-size: var(--step-1); }
.evidence-rail-list p { margin: 0; }
.source-ticket { position: sticky; top: 100px; padding: 24px; border: 2px solid var(--ink); background: var(--yellow); box-shadow: 8px 8px 0 var(--ink); }
.source-ticket span, .source-ticket strong { display: block; font-family: "Cascadia Mono", Consolas, monospace; }
.source-ticket strong { margin-block: 6px 16px; font-size: var(--step-3); }

.deadline-rail { display: grid; grid-template-columns: repeat(3, 1fr); border: 2px solid var(--ink); background: var(--ink); gap: 2px; }
.deadline-rail article { position: relative; padding: 30px; background: var(--paper); }
.deadline-rail article::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 8px; background: var(--yellow); }
.deadline-rail span { font-family: "Cascadia Mono", Consolas, monospace; font-size: var(--step--1); font-weight: 900; }
.deadline-rail h3 { margin-block: 14px 10px; font-size: var(--step-1); }
.deadline-rail p { margin: 0; }

.admission-overview { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.data-story { display: grid; grid-template-columns: 190px 1fr; gap: 24px; align-items: center; padding: clamp(24px, 3vw, 34px); border: 2px solid var(--ink); background: var(--white); }
.data-story h3 { margin-bottom: 12px; }
.donut-chart, .admission-pie { position: relative; display: grid; place-items: center; width: 180px; aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; background: var(--surface); }
.donut-chart::after, .admission-pie::after { content: ""; position: absolute; width: 66%; aspect-ratio: 1; border: 1px solid var(--ink); border-radius: 50%; background: var(--white); }
.donut-chart > div, .admission-pie > div { position: relative; z-index: 1; text-align: center; }
.donut-chart strong, .admission-pie strong { display: block; font-family: "Cascadia Mono", Consolas, monospace; font-size: var(--step-1); line-height: 1; }
.donut-chart span, .admission-pie span { display: block; max-width: 10ch; margin-top: 7px; font-size: .76rem; font-weight: 800; line-height: 1.25; }
.pie-legend { display: grid; gap: 8px; margin-block: 16px; }
.pie-legend > div { display: grid; grid-template-columns: 12px 1fr auto; gap: 8px; align-items: center; }
.pie-legend i { width: 10px; height: 10px; }
.pie-gsat { background: var(--gsat); }
.pie-review { background: var(--review); }
.pie-other { background: var(--other); }

.problem-rail, .evidence-strip { display: flex; flex-wrap: wrap; gap: 2px; padding: 2px; border: 2px solid var(--ink); background: var(--ink); }
.problem-rail > *, .evidence-strip > * { flex: 1 1 170px; margin: 0; padding: 13px 15px; background: var(--paper); }
.problem-rail > strong { background: var(--yellow); }
.quiz-principles > article { padding: 20px; }
.quiz-principles > article:first-child { background: var(--yellow); }
.quiz-principles > article:last-child { color: var(--white); background: var(--ink); }
.quiz-principles h3 { margin-bottom: 9px; font-size: var(--step-1); }
.quiz-principles p { margin: 0; }
.annotated-copy { font-size: var(--step-1); font-weight: 700; line-height: 2.1; }
.annotated-copy mark { position: relative; margin-inline: .1em; padding: .1em .18em; color: inherit; background: linear-gradient(transparent 55%, var(--yellow) 55%); }
.annotated-copy mark::after { content: attr(data-annotation); display: inline-block; margin-left: .35em; padding: 2px 5px; border: 1px solid currentColor; background: var(--white); font-size: .66em; font-weight: 900; line-height: 1.2; vertical-align: middle; }

.case-file { padding: clamp(24px, 4vw, 42px); color: var(--ink); background: var(--paper); border-top: 10px solid var(--yellow); }
.case-file-head { padding-bottom: 22px; border-bottom: 2px solid var(--ink); }
.case-facts { padding-block: 24px; }
.case-interpretation { padding: 22px; border-left: 10px solid var(--yellow); background: var(--white); }
.case-interpretation > span { display: block; margin-bottom: 10px; font-family: "Cascadia Mono", Consolas, monospace; font-size: var(--step--1); font-weight: 900; }
.case-interpretation p:last-child, .case-facts p:last-child { margin-bottom: 0; }
.accuracy-note, .accuracy-banner { margin-block: 22px; padding: 18px 20px; border: 1px dashed var(--ink); background: var(--yellow-pale); }
.accuracy-note p, .accuracy-banner p { margin: 4px 0 0; }

.filter-year-control { display: flex; grid-column: 1 / -1; gap: 18px; align-items: center; padding-bottom: 18px; border-bottom: 2px solid var(--ink); }
.filter-year-label { font-size: var(--step--1); font-weight: 900; white-space: nowrap; }
.filter-year-label::before { content: ""; display: inline-block; width: 28px; margin-right: 9px; border-top: 3px solid var(--ink); vertical-align: middle; }
.admissions-year-switch { display: inline-flex; padding: 3px; border: 2px solid var(--ink); background: var(--paper); }
.admissions-year-switch button { min-width: 72px; min-height: 48px; padding: 8px 16px; border: 0; color: var(--ink); background: transparent; font-family: "Cascadia Mono", Consolas, monospace; font-size: var(--step-1); font-weight: 950; cursor: pointer; }
.admissions-year-switch button + button { border-left: 1px solid var(--ink); }
.admissions-year-switch button[aria-pressed="true"] { color: var(--yellow); background: var(--ink); }
.admissions-year-switch button:disabled { cursor: wait; opacity: .55; }
.admission-dashboard { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr); gap: 22px; align-items: stretch; }
.filter-panel { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; padding: 24px; border: 2px solid var(--ink); background: var(--white); }
.filter-field { display: grid; gap: 6px; }
.filter-field-wide { grid-column: 1 / -1; }
.filter-field span { font-size: var(--step--1); font-weight: 850; }
.filter-field input, .filter-field select { width: 100%; min-height: 46px; padding: 9px 11px; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); background: var(--paper); }
.filter-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.filter-fieldset legend { margin-bottom: 6px; padding: 0; font-size: var(--step--1); font-weight: 850; }
.checkbox-picker { position: relative; border: 0; }
.checkbox-picker > summary { min-height: 46px; align-items: center; padding: 9px 11px; border: 1.5px solid var(--ink); border-radius: var(--radius-sm); background: var(--paper); font-size: var(--step-0); font-weight: 700; }
.checkbox-picker > summary::after { font-size: 1.2em; }
.checkbox-picker[open] > summary { border-radius: var(--radius-sm) var(--radius-sm) 0 0; background: var(--yellow-pale); }
.checkbox-picker-body { max-height: 290px; overflow: auto; padding: 12px; border: 1.5px solid var(--ink); border-top: 0; background: var(--white); }
.checkbox-filter-search { position: sticky; top: -12px; z-index: 1; display: block; padding-block: 0 10px; background: var(--white); }
.checkbox-filter-search input { width: 100%; min-height: 40px; padding: 7px 9px; border: 1px solid var(--ink); border-radius: 7px; }
.checkbox-list { display: grid; gap: 4px; }
.checkbox-list label { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; align-items: start; padding: 5px 7px; border-radius: 6px; line-height: 1.38; cursor: pointer; }
.checkbox-list label:hover { background: var(--yellow-pale); }
.checkbox-list input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--ink); }
.checkbox-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.filter-selection { color: var(--muted); font-size: .78rem; }
.dynamic-pie-card { display: grid; place-items: center; align-content: start; padding: 26px; border: 2px solid var(--ink); background: var(--yellow); text-align: center; }
.dynamic-pie-card .admission-pie { margin-block: 20px; }
.dynamic-pie-card .pie-legend { width: 100%; padding: 14px; background: var(--white); text-align: left; }
.guide-results-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; padding-bottom: 16px; border-bottom: 6px solid var(--yellow); }
.guide-results-head p { margin: 0; }
.admission-results { border-top: 2px solid var(--ink); }
.admission-record { border: 0; border-bottom: 1px solid var(--ink); background: var(--white); }
.admission-record > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto 24px; align-items: center; padding: 18px; font-size: var(--step-0); }
.admission-record > summary::after { grid-column: 3; grid-row: 1; }
.admission-record > summary > span:first-child { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: center; }
.data-code { display: inline-block; font-family: "Cascadia Mono", Consolas, monospace; font-size: .83rem; font-weight: 900; }
.record-summary { display: flex; flex-wrap: wrap; justify-content: end; gap: 7px; align-items: center; }
.record-summary b, .status-badge { display: inline-flex; justify-content: center; align-items: center; min-height: 28px; box-sizing: border-box; padding: 4px 7px; border: 1px solid var(--ink); font-family: "Cascadia Mono", Consolas, monospace; font-size: .74rem; line-height: 1.2; text-align: center; white-space: nowrap; }
.record-summary b { flex: 0 0 4.5rem; }
.status-badge { flex: 0 0 6.75rem; }
.status-badge.yes { background: var(--yellow); }
.status-badge.no { background: var(--surface); }
.status-badge.warn { color: var(--danger); border-color: var(--danger); }
.admission-record > .details-body { padding: 8px 18px 30px; }
.guide-detail-grid { display: grid; gap: 18px; margin-block: 24px; }
.guide-detail-section { min-width: 0; padding: 22px; border: 1px solid var(--line); background: var(--paper); }
.guide-detail-section h4 { margin-bottom: 14px; }
.guide-detail-section > :last-child { margin-bottom: 0; }
.group-badges { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.group-badges .tag { background: var(--white); }
.admission-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; padding: 2px; border: 2px solid var(--ink); background: var(--ink); }
.admission-fact { display: grid; gap: 12px; align-content: space-between; min-width: 0; min-height: 116px; padding: 16px 18px; background: var(--white); }
.admission-fact.quota { background: var(--yellow); }
.fact-label { color: var(--muted); font-size: var(--step--1); font-weight: 850; }
.admission-fact.quota .fact-label { color: var(--ink); }
.fact-value { color: var(--ink); font-family: "Cascadia Mono", Consolas, monospace; font-size: clamp(1.15rem, 2.2vw, 1.75rem); font-weight: 950; line-height: 1.15; overflow-wrap: anywhere; }
.fact-value small { margin-left: .25em; font-size: .55em; }
.admission-fact.f-status.is-counted { background: var(--ink); }
.admission-fact.f-status.is-counted .fact-label { color: var(--white); }
.admission-fact.f-status.is-counted .fact-value { color: var(--yellow); }
.admission-fact.f-status.not-counted { background: var(--surface); }
.admission-trend { margin-top: 18px; }
.admission-trend table { min-width: 900px; margin: 0; }
.admission-trend th, .admission-trend td { padding: 11px 12px; font-size: .82rem; vertical-align: top; }
.admission-trend tbody th { width: 68px; font-family: "Cascadia Mono", Consolas, monospace; font-size: .9rem; }
.admission-trend .is-current > * { background: var(--yellow-pale); }
.admission-trend .is-current > th { background: var(--yellow); }
.trend-delta { display: inline-block; margin-left: 6px; padding: 1px 4px; border: 1px solid currentColor; font-family: "Cascadia Mono", Consolas, monospace; font-size: .7rem; font-weight: 900; }
.trend-delta.up { color: #176b3a; }
.trend-delta.down { color: var(--danger); }
.trend-f { display: inline-block; min-width: 58px; padding: 2px 5px; border: 1px solid var(--ink); text-align: center; white-space: nowrap; }
.trend-f.yes { background: var(--yellow); }
.trend-f.no { background: var(--surface); }
.review-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.review-item { padding: 14px; border-left: 6px solid var(--yellow); background: var(--white); }
.review-item strong { display: block; margin-bottom: 5px; }
.detail-copy { white-space: pre-line; }
.detail-list { margin: 10px 0 20px; padding-left: 1.35em; }
.detail-list li + li { margin-top: 8px; }
.compact-table table { min-width: 560px; }
.compact-table th, .compact-table td { padding: 10px 12px; font-size: .86rem; }
.nested-details { margin-block: 18px; border: 1px solid var(--line); }
.nested-details summary { padding-inline: 15px; font-size: var(--step-0); }
.nested-details .details-body { padding-inline: 15px; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 24px; }
.pagination .button { min-width: 110px; }
.empty-state { padding: 50px 24px; text-align: center; background: var(--white); }
.source-rail { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 18px; border-block: 2px solid var(--ink); }
.source-rail > span { padding: 5px 8px; background: var(--yellow); font-weight: 900; }
.source-rail p { margin: 0; }

/* Standalone admissions guide: one title, one action, then the data. */
.standalone-guide { background: var(--surface); }
.standalone-cover {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: clamp(32px, 7vw, 96px) 20px;
  border-bottom: 3px solid var(--ink);
  background: var(--yellow);
}
.cover-atlas { position: absolute; z-index: -1; inset: 18px; border: 1px solid rgb(17 17 17 / 35%); pointer-events: none; }
.cover-atlas svg { width: 100%; height: 100%; }
.atlas-route { fill: none; stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; opacity: .42; stroke-dasharray: 1800; animation: atlas-route-in 1.3s cubic-bezier(.2,.7,.2,1) backwards; }
.atlas-route-b { stroke-width: 4; animation-delay: .12s; }
.atlas-route-c { animation-delay: .24s; }
.atlas-nodes circle { fill: var(--white); stroke: var(--ink); stroke-width: 2.5; vector-effect: non-scaling-stroke; transform-box: fill-box; transform-origin: center; animation: atlas-node-in .52s cubic-bezier(.2,.8,.2,1) backwards; }
.atlas-nodes circle:nth-child(3n+1) { animation-delay: .35s; }
.atlas-nodes circle:nth-child(3n+2) { animation-delay: .5s; }
.atlas-nodes circle:nth-child(3n) { animation-delay: .65s; }
.standalone-cover-inner { position: relative; display: grid; justify-items: center; gap: clamp(38px, 7vh, 72px); padding: clamp(20px, 4vw, 48px); text-align: center; }
.standalone-cover h1 { display: grid; margin: 0; padding: .06em .12em; background: rgb(255 212 0 / 90%); font-family: "Arial Black", "Microsoft JhengHei", "PingFang TC", sans-serif; font-size: clamp(3.6rem, 8.5vw, 8.4rem); font-weight: 950; letter-spacing: -.055em; line-height: 1.03; animation: cover-title-in .72s cubic-bezier(.2,.8,.2,1) .18s backwards; }
.standalone-cover h1 span { white-space: nowrap; }
.cover-enter {
  display: inline-flex;
  align-items: center;
  gap: 22px;
  min-height: 64px;
  padding: 14px 24px 14px 30px;
  border: 3px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  box-shadow: 7px 7px 0 var(--ink);
  font-size: var(--step-1);
  font-weight: 900;
  text-decoration: none;
  animation: cover-action-in .55s cubic-bezier(.2,.8,.2,1) .72s backwards;
}
.cover-enter span:last-child { font-size: 1.7em; line-height: .8; transition: transform .16s ease; }
.cover-enter:hover { transform: translate(3px, 3px); box-shadow: 4px 4px 0 var(--ink); }
.cover-enter:hover span:last-child { transform: translateY(4px); }
.standalone-search { scroll-margin-top: 0; }
.standalone-section-title { padding-bottom: 18px; border-bottom: 8px solid var(--yellow); }
[data-guide-layout="unified"] .admission-dashboard { grid-template-columns: minmax(0, 1.45fr) minmax(400px, .55fr); gap: 28px; }
[data-guide-layout="unified"] .filter-panel { gap: 18px; padding: 28px; box-shadow: 8px 8px 0 rgb(17 17 17 / 10%); }
[data-guide-layout="unified"] .filter-field input,
[data-guide-layout="unified"] .filter-field select,
[data-guide-layout="unified"] .checkbox-picker > summary { min-height: 50px; }
[data-guide-layout="unified"] .checkbox-picker > summary:hover { background: var(--yellow-pale); }
[data-guide-layout="unified"] .filter-reset { grid-column: 1 / -1; justify-self: end; min-width: 190px; }
[data-guide-layout="unified"] .dynamic-pie-card { place-items: stretch; align-content: center; padding: 28px; background: var(--white); text-align: left; }
[data-guide-layout="unified"] .dynamic-pie-card > h3 { margin: 0; padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
[data-guide-layout="unified"] .chart-heading { padding-bottom: 16px; border-bottom: 2px solid var(--ink); }
[data-guide-layout="unified"] .chart-heading h3 { margin: 5px 0 0; }
.chart-year { display: block; padding-left: 10px; border-left: 7px solid var(--yellow); font-family: "Cascadia Mono", Consolas, monospace; font-size: var(--step--1); font-weight: 950; }
[data-guide-layout="unified"] .chart-composition { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 22px; align-items: center; margin-top: 24px; }
[data-guide-layout="unified"] .dynamic-pie-card .admission-pie { width: 170px; margin: 0; }
[data-guide-layout="unified"] .admission-pie::after { width: 61%; }
[data-guide-layout="unified"] .dynamic-pie-card .pie-legend { width: 100%; margin: 0; padding: 0; background: transparent; }
[data-guide-layout="unified"] .dynamic-pie-card .pie-legend span { max-width: none; white-space: nowrap; }
[data-guide-layout="unified"] .dynamic-pie-card .pie-legend > div { min-height: 42px; padding-block: 8px; border-bottom: 1px solid var(--line); }
[data-guide-layout="unified"] .dynamic-pie-card .pie-legend > div:last-child { border-bottom: 0; }
[data-guide-layout="unified"] .guide-results-head { align-items: center; }
[data-guide-layout="unified"] .guide-results-head h2,
[data-guide-layout="unified"] .guide-results-head h3 { font-size: var(--step-2); }
[data-guide-layout="unified"] .admission-record > summary { transition: background-color .16s ease; }
[data-guide-layout="unified"] .admission-record > summary:hover { background: var(--yellow-pale); }
[data-guide-layout="unified"] .admission-record[open] > summary { background: var(--yellow-soft); }
[data-guide-layout="unified"] .gsat-structure-row td { background: var(--yellow-pale); font-weight: 800; }
.standalone-footer { padding-block: 34px; color: var(--white); background: var(--ink); }
.standalone-footer .container { display: grid; gap: 12px; }
.standalone-footer p { margin: 0; color: #c9c9c3; font-size: var(--step--1); }
.standalone-footer .standalone-source-disclosure { color: #b8b8b2; }
.standalone-source-disclosure a { text-decoration: underline; text-underline-offset: 3px; }
.standalone-footer .standalone-license { color: #9f9f99; font-size: .75rem; line-height: 1.6; }
.standalone-license a { text-decoration: underline; }

@keyframes atlas-route-in {
  from { opacity: 0; stroke-dashoffset: 1800; }
  to { opacity: .42; stroke-dashoffset: 0; }
}

@keyframes atlas-node-in {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes cover-title-in {
  from { opacity: 1; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cover-action-in {
  from { opacity: 1; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.site-footer { padding-block: 50px; color: var(--white); background: var(--ink); }
.footer-grid { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
.site-footer p { margin: 0; color: #c9c9c3; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 10px 18px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }
.strong { font-weight: 850; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 20px; }
.mt-4 { margin-top: 40px; }
.mb-0 { margin-bottom: 0; }

@media (max-width: 960px) {
  .hero-grid, .result-hero { grid-template-columns: 1fr; }
  .hero { min-height: auto; }
  .hero-meta { max-width: 560px; }
  .grid-4, .major-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-3, .d-grid, .template-grid { grid-template-columns: 1fr; }
  .d-card { min-height: 270px; }
  .rule-reader, .admission-dashboard { grid-template-columns: 1fr; }
  [data-guide-layout="unified"] .admission-dashboard { grid-template-columns: 1fr; }
  [data-guide-layout="unified"] .chart-composition { grid-template-columns: 190px minmax(0, 1fr); }
  [data-guide-layout="unified"] .dynamic-pie-card .admission-pie { width: 190px; }
  .source-ticket { position: static; }
  .admission-overview { grid-template-columns: 1fr; }
  .admission-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .nav-shell { width: min(calc(100% - 24px), var(--max)); min-height: 64px; }
  .brand span:last-child { display: none; }
  .top-nav { gap: 2px; }
  .top-nav a { padding: 8px; font-size: .76rem; }
  .container, .narrow { width: min(calc(100% - 28px), var(--max)); }
  .section-heading { grid-template-columns: 52px 1fr; gap: 15px; }
  .section-number { width: 50px; border-width: 2px; }
  .grid-2, .grid-4, .major-grid { grid-template-columns: 1fr; }
  .compare { grid-template-columns: 1fr; }
  .compare-arrow { transform: rotate(90deg); }
  .timeline::before { left: 21px; }
  .timeline-item { grid-template-columns: 44px 1fr; gap: 12px; padding: 18px; }
  .timeline-dot { width: 44px; }
  .timeline-time { grid-column: 2; grid-row: 1; padding-top: 7px; }
  .timeline-copy { grid-column: 2; }
  .deadline-rail { grid-template-columns: 1fr; }
  .data-story { grid-template-columns: 1fr; }
  .filter-panel { grid-template-columns: 1fr; padding: 18px; }
  .filter-field-wide { grid-column: auto; }
  .admission-record > summary { grid-template-columns: 1fr 24px; gap: 10px; }
  .admission-record > summary::after { grid-column: 2; }
  .admission-record > summary > span:first-child { grid-template-columns: 66px 1fr; }
  .record-summary { grid-column: 1 / -1; justify-content: start; }
  .guide-results-head { align-items: start; flex-direction: column; }
  .source-rail { grid-template-columns: 1fr; align-items: start; }
  .source-rail > span { width: fit-content; }
  .quiz-shell { padding-block: 18px; }
  .quiz-card { width: min(calc(100% - 20px), 880px); padding: 24px 18px; border-radius: var(--radius); }
  .quiz-chapter-visual { margin-inline: -18px; border-inline: 0; border-radius: 0; }
  .quiz-actions .button { flex: 1; padding-inline: 12px; }
  .score-row { grid-template-columns: 66px 1fr 46px; gap: 8px; }
  .footer-grid { grid-template-columns: 1fr; }
  .outline-trigger { left: 10px; top: auto; bottom: 14px; padding: 11px 13px; border-left: 2px solid var(--ink); border-radius: var(--radius-sm); writing-mode: horizontal-tb; }
  .outline-drawer { width: calc(100% - 18px); }
  .outline-head { padding: 22px 20px; }
  .outline-link { padding-inline: 20px; }
  .checkbox-list.compact, .review-grid { grid-template-columns: 1fr; }
  .standalone-cover { min-height: 100svh; }
  .cover-atlas { inset: 12px; }
  .cover-atlas svg { width: 170%; max-width: none; transform: translateX(-21%); }
  .standalone-cover-inner { padding-inline: 8px; }
  .standalone-cover h1 { font-size: clamp(2.55rem, 11vw, 4rem); }
  .cover-enter { min-height: 58px; padding: 11px 19px 11px 23px; }
  .standalone-search { padding-block: 64px; }
  .filter-year-control { align-items: stretch; flex-direction: column; gap: 10px; }
  .admissions-year-switch { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .admissions-year-switch button { min-width: 0; }
  [data-guide-layout="unified"] .filter-panel { padding: 20px; box-shadow: 5px 5px 0 rgb(17 17 17 / 10%); }
  [data-guide-layout="unified"] .filter-reset { grid-column: auto; justify-self: stretch; width: 100%; }
  [data-guide-layout="unified"] .chart-composition { grid-template-columns: 1fr; justify-items: center; }
  [data-guide-layout="unified"] .dynamic-pie-card .pie-legend { max-width: 320px; }
}

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