:root {
  --paper: #fafaf6;
  --concrete: #d9d9d2;
  --ink: #0b0b0b;
  --muted: #3e3e39;
  --yellow: #f6e800;
  --blue: #1242ff;
  --red: #b71d2b;
  --mint: #6fffc9;
  --green: var(--mint);
  --white: #ffffff;
  --shadow: 9px 9px 0 var(--ink);
  --shadow-small: 5px 5px 0 var(--ink);
  --max: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(90deg, rgba(11, 11, 11, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(11, 11, 11, 0.08) 1px, transparent 1px),
    var(--concrete);
  background-size: 38px 38px;
  color: var(--ink);
  font-family: "Noto Sans TC", "Microsoft JhengHei", "PingFang TC", Arial, sans-serif;
  line-height: 1.65;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
}

button,
select,
textarea {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 12px max(20px, calc((100vw - var(--max)) / 2));
  background: var(--paper);
  border-bottom: 5px solid var(--ink);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 1000;
  text-decoration: none;
  text-transform: uppercase;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background:
    linear-gradient(135deg, var(--yellow) 0 50%, var(--red) 51% 100%);
  box-shadow: var(--shadow-small);
  transform: rotate(-6deg);
}

.main-nav {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  overflow-x: auto;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
}

.main-nav a {
  padding: 7px 10px;
  border: 3px solid var(--ink);
  background: var(--white);
  text-decoration: none;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus-visible,
.main-nav a.is-active {
  background: var(--mint);
  box-shadow: var(--shadow-small);
}

.progress-shell {
  grid-column: 1 / -1;
  height: 8px;
  background: var(--white);
  border: 3px solid var(--ink);
}

.progress-shell span {
  display: block;
  width: 0%;
  height: 100%;
  background: repeating-linear-gradient(90deg, var(--blue) 0 22px, var(--yellow) 22px 44px, var(--red) 44px 66px);
}

.hero {
  position: relative;
  min-height: 88vh;
  display: grid;
  align-items: center;
  overflow: hidden;
  border-bottom: 8px solid var(--ink);
  background: var(--concrete);
}

.hero-media,
.hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media {
  object-fit: cover;
}

.hero-shade {
  background: linear-gradient(90deg, rgba(246, 232, 0, 0.16), rgba(255, 255, 255, 0.15));
}

.hero-content {
  position: relative;
  width: min(720px, calc(100% - 48px));
  margin-left: max(24px, calc((100vw - var(--max)) / 2));
  padding: 132px 0 160px;
}

.course-label,
.section-kicker {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 10px;
  border: 4px solid var(--ink);
  background: var(--mint);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 1000;
  transform: rotate(-2deg);
}

.hero h1 {
  width: min(760px, 94vw);
  margin: 0;
  padding: 16px 20px 20px;
  border: 7px solid var(--ink);
  background: var(--yellow);
  box-shadow: var(--shadow);
  font-size: clamp(2.45rem, 6vw, 5.6rem);
  line-height: 1.06;
  font-weight: 1000;
  letter-spacing: 0;
}

.hero-subtitle,
.hero-copy {
  max-width: 650px;
  border: 5px solid var(--ink);
  background: var(--white);
  box-shadow: var(--shadow-small);
}

.hero-subtitle {
  margin: 24px 0 0;
  padding: 10px 14px;
  color: var(--ink);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 1000;
}

.hero-copy {
  margin: 14px 0 0;
  padding: 14px;
  color: var(--ink);
  font-size: 1.03rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 0.96rem;
  font-weight: 1000;
  text-decoration: none;
  box-shadow: var(--shadow-small);
  cursor: pointer;
}

.button.primary {
  background: var(--blue);
  color: var(--white);
}

.button.ghost {
  background: var(--yellow);
}

.button:hover,
.button:focus-visible {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.hero-strip {
  position: absolute;
  left: max(24px, calc((100vw - var(--max)) / 2));
  right: max(24px, calc((100vw - var(--max)) / 2));
  bottom: 24px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 10px;
  align-items: center;
  color: var(--ink);
  font-weight: 1000;
}

.hero-strip span {
  min-width: 0;
  padding: 10px 14px;
  border: 4px solid var(--ink);
  background: var(--white);
  text-align: center;
  box-shadow: var(--shadow-small);
}

.hero-strip span:nth-child(2) {
  background: var(--red);
  color: var(--white);
}

.reader-map,
.quiz-band,
.page-shell {
  width: min(var(--max), calc(100% - 48px));
  margin: 0 auto;
}

.reader-map {
  padding: 70px 0 36px;
}

.reader-map h2,
.quiz-band h2,
.content-section h2 {
  margin: 0;
  line-height: 1.22;
  letter-spacing: 0;
  font-weight: 1000;
}

.reader-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.reader-grid article,
.content-section,
.rail-card,
.quiz-card,
.source-grid article,
.reflection-card,
.chart-card {
  border: 5px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.reader-grid article {
  min-height: 158px;
  padding: 18px;
}

.reader-grid article:nth-child(1) {
  background: var(--yellow);
}

.reader-grid article:nth-child(2) {
  background: var(--mint);
}

.reader-grid article:nth-child(3) {
  background: var(--white);
}

.reader-grid article:nth-child(4) {
  background: var(--blue);
  color: var(--white);
}

.reader-grid strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 1000;
}

.reader-grid span {
  display: block;
  margin-top: 10px;
}

.quiz-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.78fr) minmax(320px, 1.22fr);
  gap: 28px;
  align-items: start;
  padding: 30px;
  margin-top: 42px;
  border: 6px solid var(--ink);
  background: var(--blue);
  color: var(--white);
  box-shadow: var(--shadow);
}

.quiz-band .section-kicker {
  background: var(--yellow);
  color: var(--ink);
}

.quiz-band p {
  color: inherit;
}

.page-shell {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 34px;
  padding: 72px 0 96px;
}

.side-rail {
  position: relative;
}

.rail-card {
  position: sticky;
  top: 124px;
  padding: 18px;
  background: var(--yellow);
}

.rail-title {
  display: block;
  font-weight: 1000;
}

.rail-card ol {
  padding-left: 20px;
  margin: 12px 0 0;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 800;
}

.sections {
  display: grid;
  gap: 34px;
}

.content-section {
  padding: clamp(28px, 5vw, 52px);
}

.content-section:nth-child(2n) {
  background: #f2f2ec;
}

.accent-section {
  background: var(--yellow);
}

.conclusion-section {
  background: var(--mint);
}

.section-heading {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: start;
  margin-bottom: 28px;
}

.section-number {
  display: inline-flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  border: 5px solid var(--ink);
  background: var(--ink);
  color: var(--white);
  font-weight: 1000;
  font-size: 1.05rem;
  box-shadow: var(--shadow-small);
}

.split-layout,
.media-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
  gap: 30px;
  align-items: center;
}

.media-row.reverse {
  grid-template-columns: minmax(300px, 0.95fr) minmax(0, 1fr);
}

.prose p {
  margin: 0 0 16px;
}

.lead {
  padding-left: 14px;
  border-left: 8px solid var(--red);
  color: var(--ink);
  font-size: 1.18rem;
  font-weight: 1000;
}

.callout,
.liquidity-box,
.two-column-note {
  border: 5px solid var(--ink);
  border-radius: 0;
  background: var(--yellow);
  box-shadow: var(--shadow-small);
}

.callout {
  padding: 16px 18px;
  color: var(--ink);
  font-weight: 1000;
}

.two-column-note {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin-top: 22px;
  overflow: hidden;
}

.two-column-note div {
  padding: 18px;
  background: var(--white);
}

.two-column-note div + div {
  border-left: 5px solid var(--ink);
  background: var(--mint);
}

.two-column-note h3,
.liquidity-box h3,
.source-grid h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 1000;
}

.two-column-note p,
.liquidity-box p {
  margin: 0;
}

.section-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 5px solid var(--ink);
  border-radius: 0;
  box-shadow: var(--shadow);
  background: var(--paper);
}

.chart-card {
  margin: 0;
  overflow: hidden;
  cursor: pointer;
}

.chart-card:hover,
.chart-card:focus-within {
  transform: translate(-2px, -2px);
  box-shadow: 12px 12px 0 var(--ink);
}

.chart-card img {
  width: 100%;
  background: var(--paper);
}

.chart-card figcaption {
  padding: 12px 16px;
  color: var(--ink);
  font-size: 0.92rem;
  font-weight: 900;
  border-top: 5px solid var(--ink);
  background: var(--white);
}

.liquidity-box {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  margin-bottom: 28px;
  background: var(--white);
}

.liquidity-box ol {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.liquidity-box li {
  padding: 12px;
  border: 4px solid var(--ink);
  background: var(--mint);
  font-weight: 1000;
}

.quiz-stack {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}

.quiz-card {
  padding: 18px;
  color: var(--ink);
}

.quiz-band .quiz-card {
  background: var(--paper);
  color: var(--ink);
}

.quiz-title {
  margin: 0 0 10px;
  font-weight: 1000;
}

.quiz-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.choice-button,
.check-button,
.classifier-button {
  min-height: 42px;
  padding: 8px 14px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-weight: 1000;
  box-shadow: var(--shadow-small);
  cursor: pointer;
}

.choice-button:hover,
.choice-button:focus-visible,
.check-button:hover,
.check-button:focus-visible,
.classifier-button:hover,
.classifier-button:focus-visible,
.choice-button.is-selected,
.classifier-button.is-selected {
  background: var(--yellow);
}

.choice-button.is-correct,
.classifier-button.is-correct {
  background: var(--mint);
}

.choice-button.is-wrong,
.classifier-button.is-wrong {
  background: var(--red);
  color: var(--white);
}

.feedback {
  min-height: 26px;
  margin: 14px 0 0;
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 850;
}

.matching-grid,
.classifier-grid {
  display: grid;
  gap: 12px;
}

.matching-row {
  display: grid;
  grid-template-columns: minmax(130px, 0.6fr) minmax(180px, 1fr);
  gap: 10px;
  align-items: center;
}

.matching-row strong {
  display: block;
  font-weight: 1000;
}

.matching-row select {
  width: 100%;
  min-height: 44px;
  border: 4px solid var(--ink);
  border-radius: 0;
  padding: 8px 10px;
  background: var(--white);
  color: var(--ink);
  font-weight: 800;
}

.classifier-item {
  padding: 14px;
  border: 4px solid var(--ink);
  background: var(--white);
}

.classifier-item p {
  margin: 0 0 10px;
  font-weight: 1000;
}

.reflection-panel {
  display: grid;
  gap: 14px;
  margin-top: 24px;
}

.reflection-card {
  padding: 18px;
  background: var(--paper);
}

.reflection-card label {
  display: block;
  margin-bottom: 10px;
  font-weight: 1000;
}

.reflection-card textarea {
  width: 100%;
  min-height: 110px;
  resize: vertical;
  border: 4px solid var(--ink);
  border-radius: 0;
  padding: 12px;
  background: var(--white);
  color: var(--ink);
}

.source-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.source-grid article {
  padding: 20px;
  background: var(--white);
}

.source-grid ul {
  padding-left: 20px;
  margin: 0;
}

.source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
}

.source-links a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 12px;
  border: 4px solid var(--ink);
  color: var(--ink);
  font-weight: 1000;
  text-decoration: none;
  background: var(--yellow);
  box-shadow: var(--shadow-small);
}

.source-note {
  margin: 18px 0 0;
  color: var(--ink);
  font-weight: 850;
}

.chart-drawer {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 50;
  width: min(430px, calc(100% - 40px));
  padding: 22px;
  border: 5px solid var(--ink);
  border-radius: 0;
  background: var(--yellow);
  box-shadow: var(--shadow);
}

.drawer-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 4px solid var(--ink);
  border-radius: 0;
  background: var(--white);
  color: var(--ink);
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 1000;
  cursor: pointer;
}

.chart-drawer h3 {
  margin: 0 40px 8px 0;
}

.chart-drawer ul {
  padding-left: 20px;
  margin-bottom: 0;
}

@media (max-width: 980px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .main-nav {
    justify-content: flex-start;
  }

  .reader-grid,
  .source-grid {
    grid-template-columns: 1fr 1fr;
  }

  .quiz-band,
  .page-shell,
  .split-layout,
  .media-row,
  .media-row.reverse,
  .liquidity-box {
    grid-template-columns: 1fr;
  }

  .side-rail {
    display: none;
  }

  .liquidity-box ol {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .reader-map,
  .quiz-band,
  .page-shell {
    width: min(100% - 28px, var(--max));
  }

  .site-header {
    width: 100%;
    padding-left: 14px;
    padding-right: 14px;
  }

  .main-nav {
    flex-wrap: wrap;
    overflow: visible;
  }

  .hero {
    min-height: 94vh;
  }

  .hero-media {
    object-position: 44% center;
  }

  .hero-content {
    width: calc(100% - 28px);
    margin-left: 14px;
    padding-top: 98px;
  }

  .hero h1 {
    padding: 12px;
  }

  .hero-strip {
    left: 14px;
    right: 14px;
    grid-template-columns: 1fr;
  }

  .hero-strip span {
    padding: 8px 10px;
  }

  .reader-grid,
  .source-grid,
  .two-column-note,
  .matching-row {
    grid-template-columns: 1fr;
  }

  .two-column-note div + div {
    border-left: 0;
    border-top: 5px solid var(--ink);
  }

  .content-section,
  .quiz-band {
    padding: 22px;
  }

  .section-heading {
    grid-template-columns: 1fr;
  }

  .section-number {
    width: 52px;
    height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button:hover,
  .button:focus-visible,
  .chart-card:hover,
  .chart-card:focus-within {
    transform: none;
  }
}
