:root {
  color-scheme: light;
  --ink: #465044;
  --muted: #788174;
  --paper: #dfe5da;
  --paper-2: #e7ece3;
  --band: #d9dfd3;
  --primary: #63745d;
  --primary-dark: #4f5f4b;
  --primary-2: #8b7c66;
  --moss: #75836d;
  --clay: #9c8b75;
  --line: rgba(255, 255, 255, 0.24);
  --white: #e7ece3;
  --shadow-light: -12px -12px 26px rgba(255, 255, 255, 0.68);
  --shadow-dark: 12px 12px 26px rgba(130, 140, 123, 0.34);
  --shadow: var(--shadow-light), var(--shadow-dark);
  --shadow-soft: -7px -7px 16px rgba(255, 255, 255, 0.56), 7px 7px 16px rgba(130, 140, 123, 0.25);
  --shadow-inset: inset -7px -7px 14px rgba(255, 255, 255, 0.52), inset 7px 7px 14px rgba(130, 140, 123, 0.22);
  --soft-radius: 30px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.32), transparent 28rem),
    radial-gradient(circle at 82% 20%, rgba(130, 140, 123, 0.18), transparent 26rem),
    linear-gradient(145deg, #e9eee5 0%, var(--paper) 48%, #d7ded1 100%);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.34) 1px, transparent 1px),
    linear-gradient(rgba(116, 126, 110, 0.12) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(to bottom, #000, transparent 82%);
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  position: relative;
  overflow: hidden;
  min-height: 92vh;
  padding: 22px clamp(18px, 4vw, 64px) 42px;
  background:
    radial-gradient(circle at 88% 18%, rgba(255, 255, 255, 0.26), transparent 25rem),
    linear-gradient(145deg, #e8ede4, #d6ddcf);
  color: var(--ink);
}

.app-shell::before,
.app-shell::after {
  content: "";
  position: absolute;
  z-index: 0;
  pointer-events: none;
  filter: blur(0);
}

.app-shell::before {
  width: 42vw;
  height: 42vw;
  min-width: 360px;
  min-height: 360px;
  right: -13vw;
  top: 12vh;
  border-radius: 50%;
  background: #dfe5da;
  box-shadow: var(--shadow);
  opacity: 0.72;
}

.app-shell::after {
  width: 30vw;
  height: 24vw;
  left: -8vw;
  bottom: -6vw;
  border-radius: 44px;
  background: #dfe5da;
  box-shadow: var(--shadow-inset);
  opacity: 0.76;
}

.topbar {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1160px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 16px;
  background: var(--paper);
  color: var(--primary-dark);
  box-shadow: var(--shadow-soft);
}

.nav-links {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 0.95rem;
}

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  gap: clamp(32px, 6vw, 80px);
  max-width: 1160px;
  min-height: calc(92vh - 88px);
  margin: 0 auto;
  padding-top: 42px;
}

.hero-copy {
  max-width: 720px;
  padding-bottom: clamp(20px, 8vh, 82px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--primary);
  font-weight: 800;
  letter-spacing: 0;
}

.hero .eyebrow {
  color: var(--primary-2);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 20px;
  font-size: clamp(2.55rem, 6vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  line-height: 1.2;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.25rem;
  line-height: 1.3;
}

.lead {
  max-width: 660px;
  color: var(--muted);
  font-size: 1.15rem;
}

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

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 18px;
  padding: 0 18px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  background: var(--paper);
  color: var(--primary-dark);
  box-shadow: var(--shadow-soft);
}

.ghost-button {
  background: var(--paper);
  color: var(--muted);
  box-shadow: var(--shadow-inset);
}

.primary-button:hover,
.ghost-button:hover,
.option-button:hover {
  box-shadow: var(--shadow-inset);
}

.small {
  min-height: 40px;
  margin-top: 18px;
}

.score-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 30px;
  background: var(--paper);
  backdrop-filter: none;
  box-shadow: var(--shadow);
}

.score-panel div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(120, 130, 112, 0.14);
}

.score-panel div:last-child {
  border-bottom: 0;
}

.stat {
  font-size: 2.35rem;
  font-weight: 900;
  line-height: 1;
}

.label {
  color: var(--muted);
}

.section {
  position: relative;
  overflow: hidden;
  padding: 72px clamp(18px, 4vw, 64px);
}

.section::before {
  content: "";
  position: absolute;
  width: 220px;
  height: 180px;
  right: clamp(16px, 6vw, 82px);
  top: 34px;
  z-index: -1;
  border-radius: 50px;
  background: var(--paper);
  box-shadow: var(--shadow-inset);
  opacity: 0.58;
}

.section > * {
  max-width: 1160px;
  margin-left: auto;
  margin-right: auto;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 28px;
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
}

.muted {
  background:
    radial-gradient(circle at 12% 22%, rgba(255, 255, 255, 0.28), transparent 23rem),
    linear-gradient(145deg, var(--band), #e5eadf);
}

.exam-grid,
.quiz-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.course-card,
.quiz-card,
.memory-card {
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: var(--soft-radius);
  padding: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.course-card {
  position: relative;
  overflow: hidden;
}

.course-card::after {
  content: "";
  position: absolute;
  width: 132px;
  height: 118px;
  right: -42px;
  bottom: -34px;
  border-radius: 36px;
  background: var(--paper);
  box-shadow: var(--shadow-inset);
}

.course-card.accent {
  border-color: rgba(255, 255, 255, 0.32);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 0 10px;
  background: var(--paper);
  color: var(--primary);
  box-shadow: var(--shadow-inset);
  font-size: 0.84rem;
  font-weight: 800;
}

.course-card p,
.memory-card p {
  color: var(--muted);
}

ul {
  margin: 16px 0 0;
  padding-left: 20px;
}

li + li {
  margin-top: 8px;
}

.notice-band {
  margin-top: 18px;
  border-left: 0;
  border-radius: 24px;
  padding: 18px 20px;
  background: var(--paper);
  color: var(--muted);
  box-shadow: var(--shadow-inset);
}

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

.timeline article {
  min-height: 220px;
  border-radius: var(--soft-radius);
  padding: 20px;
  background: var(--paper);
  border-top: 0;
  box-shadow: var(--shadow);
}

.timeline span {
  display: block;
  margin-bottom: 22px;
  color: var(--primary-2);
  font-weight: 900;
}

.timeline p {
  color: var(--muted);
}

.quiz-card {
  min-height: 420px;
}

.quiz-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
  color: var(--muted);
}

.options {
  display: grid;
  gap: 10px;
}

.option-button {
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 12px 16px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.option-button:hover,
.option-button:focus-visible {
  border-color: rgba(255, 255, 255, 0.34);
  outline: none;
}

.option-button.correct {
  border-color: rgba(99, 116, 93, 0.24);
  background: #dde5d8;
  box-shadow: var(--shadow-inset);
}

.option-button.wrong {
  border-color: rgba(139, 124, 102, 0.28);
  background: #e4ddd2;
  box-shadow: var(--shadow-inset);
}

.feedback {
  min-height: 54px;
  margin-top: 14px;
  color: var(--muted);
}

.memory-card {
  align-self: start;
  background: var(--paper);
  color: var(--ink);
}

.memory-card p {
  color: var(--muted);
}

.planner {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 700;
}

input {
  width: 100%;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 18px;
  padding: 0 14px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  box-shadow: var(--shadow-inset);
}

.plan-result {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.plan-result article {
  border-radius: 26px;
  padding: 18px;
  background: var(--paper);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: var(--shadow);
}

.plan-result h3 {
  color: var(--primary);
}

.sources {
  display: grid;
  gap: 10px;
  padding-top: 42px;
}

.sources h2 {
  font-size: 1.35rem;
}

.sources a {
  color: var(--primary);
  font-weight: 800;
}

footer {
  padding: 28px 18px;
  background: var(--paper);
  color: var(--muted);
  box-shadow: var(--shadow-inset);
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 880px) {
  .topbar,
  .hero {
    align-items: start;
  }

  .topbar {
    flex-direction: column;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero,
  .exam-grid,
  .quiz-layout,
  .planner,
  .plan-result {
    grid-template-columns: 1fr;
  }

  .score-panel {
    align-self: start;
  }

  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .app-shell {
    min-height: auto;
  }

  .hero {
    min-height: auto;
  }

  .section {
    padding-top: 52px;
    padding-bottom: 52px;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
