:root {
  --red: #d62828;
  --gold: #f4c430;
  --ink: #1f2937;
  --paper: #f6f3ee;
  --card: #fff;
  --line: #e6dfd6;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
html, body { margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.45 "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
button, .btn, nav a { touch-action: manipulation; }
img { max-width: 100%; }
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: calc(8px + var(--safe-t)) 12px 8px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 2;
}
.brand { display: flex; align-items: center; }
.brand img { height: 40px; width: auto; }
nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
}
nav a.here { color: var(--red); }
.lang {
  display: flex;
  border: 2px solid var(--ink);
  border-radius: 999px;
  overflow: hidden;
}
.lang button {
  min-width: 36px;
  min-height: 40px;
  padding: 0 5px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  font-size: 13px;
  cursor: pointer;
}
.lang button.on { background: var(--ink); color: #fff; }
.wrap {
  width: min(100% - 32px, 480px);
  margin: 0 auto;
  padding: 22px 0 calc(28px + var(--safe-b));
}
h1 { font-size: 34px; line-height: 1.15; margin: 12px 0; letter-spacing: -0.02em; }
h2 { font-size: 22px; margin: 28px 0 10px; }
.lede { font-size: 18px; margin: 0 0 16px; }
.tag { color: var(--red); font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; font-size: 13px; margin: 0; }
.hero-logo { width: min(100%, 240px); display: block; margin: 4px 0 8px; }
.actions { display: flex; flex-direction: column; gap: 10px; margin: 16px 0 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 2px solid var(--red);
  background: var(--red);
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
.btn.ghost { background: transparent; color: var(--red); }
.btn[hidden] { display: none; }
.steps, .path, .phrases { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li, .card, .path li, .phrases li {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px 12px;
}
.steps b { display: block; font-size: 18px; }
.steps span, .path span, .meta { color: #5c6570; font-size: 15px; }
.examples { display: grid; gap: 8px; margin: 12px 0; }
.examples div { display: flex; justify-content: space-between; gap: 12px; font-size: 20px; font-weight: 800; }
.examples small { font-weight: 650; color: #5c6570; font-size: 15px; }
.path li { display: flex; justify-content: space-between; align-items: center; min-height: 52px; }
.mark {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  border: 2px solid var(--ink); font-size: 14px; font-weight: 800;
}
.mark.on { background: var(--gold); border-color: var(--gold); }
section { scroll-margin-top: 88px; }
.video {
  width: min(100%, calc(58dvh * 9 / 16));
  max-height: 58dvh;
  aspect-ratio: 9 / 16;
  margin-inline: auto;
  object-fit: contain;
  background: #111;
  border-radius: 18px;
  display: block;
}
.solo {
  display: inline-block;
  margin: 0 0 8px;
  font-weight: 800;
  color: var(--red);
}
.kicker { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #5c6570; margin: 18px 0 8px; }
.soon { opacity: .72; }
.soon li { display: flex; justify-content: space-between; align-items: center; }
.group-name { margin: 16px 0 8px; font-size: 15px; }
.objectives { margin: 8px 0 0; padding-left: 18px; }
.objectives li { margin: 6px 0; }
.phrases li { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.phrases strong { display: block; font-size: 22px; letter-spacing: 0.04em; }
.phrases small { color: #5c6570; }
.play-btn {
  min-width: 72px;
  min-height: 48px;
  border-radius: 12px;
  border: 2px solid var(--ink);
  background: var(--gold);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.play-btn.on { background: var(--ink); color: #fff; }
.stage {
  border-radius: 20px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: background .2s ease;
}
.stage-top { display: flex; justify-content: space-between; align-items: flex-end; }
.stage h1 { font-size: 22px; margin: 0; }
.progress {
  background: #fff;
  color: var(--ink);
  border-radius: 12px;
  min-width: 64px;
  text-align: center;
  padding: 4px 10px;
  font-weight: 800;
}
.prompt { text-align: center; min-height: 28px; font-weight: 800; }
.chars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
button.char {
  appearance: none;
  min-height: 88px;
  border: 3px solid var(--ink);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 36px;
  font-weight: 800;
  cursor: pointer;
}
button.char small { display: block; font-size: 12px; font-weight: 700; }
button.char.bad { animation: shake .32s linear; }
button.char:disabled { opacity: .45; }
@keyframes shake {
  25% { transform: translateX(-6px); }
  50% { transform: translateX(6px); }
  75% { transform: translateX(-3px); }
}
.reveal { display: none; flex-direction: column; align-items: center; gap: 8px; }
.reveal.show { display: flex; }
.reveal img {
  width: min(64vw, 240px);
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 16px;
  border: 3px solid var(--ink);
  background: #111;
}
.reveal b { font-size: 22px; letter-spacing: 0.04em; text-align: center; }
.quiz-top .brand img { height: 36px; width: 36px; }
.home-link { font-weight: 800; text-decoration: none; margin-right: auto; }
.quiz .wrap { padding-top: 12px; }
.quiz .stage { min-height: calc(100dvh - 96px - var(--safe-t) - var(--safe-b)); }
@media (max-width: 520px) {
  .brand { order: 1; }
  .lang { order: 2; margin-left: auto; }
  nav { order: 3; flex-basis: 100%; justify-content: space-between; }
  .brand img { height: 28px; }
  nav a { flex: 1; justify-content: center; min-height: 44px; padding: 0 2px; font-size: 15px; }
  h1 { font-size: 28px; }
  h2 { font-size: 20px; margin: 18px 0 8px; }
  .hero-logo { width: min(100%, 168px); }
  .wrap { width: min(100% - 20px, 480px); padding-top: 14px; }
  .video {
    width: min(100%, 280px);
    max-height: none;
    aspect-ratio: 9 / 16;
  }
  .stage { min-height: 0; padding: 12px; }
  button.char { min-height: 84px; font-size: 34px; }
  .quiz-top .brand img { height: 32px; width: 32px; }
  .quiz .stage { min-height: calc(100dvh - 72px - var(--safe-t) - var(--safe-b)); }
  .examples div { font-size: 18px; }
  section { scroll-margin-top: 104px; }
}
.chars.hide { display: none; }
.end {
  position: fixed; inset: 0; display: none; place-items: center;
  background: rgba(31, 41, 55, .45); padding: 24px; z-index: 3;
}
.end.show { display: grid; }
.end .card { width: min(100%, 340px); text-align: center; }
.end h2 { margin-top: 0; }
.stage.dark, .stage.dark .prompt, .stage.dark h1 { color: #f6f3ee; }
footer { color: #5c6570; font-size: 13px; margin-top: 28px; }
.words { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.words li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
}
.word-copy { display: grid; gap: 2px; flex: 1; min-width: 0; }
.word-gloss { font-weight: 800; }
.word-zh { font-size: 28px; line-height: 1.15; letter-spacing: 0.04em; }
.word-py { color: #5c6570; font-size: 15px; }
.verse h2 { margin: 22px 0 10px; }
.clip { width: 100%; max-height: 240px; border-radius: 12px; background: #111; }
.choices { display: grid; gap: 10px; }
.choice { display: flex; align-items: stretch; gap: 8px; }
.choice-pick {
  flex: 1;
  min-height: 76px;
  border: 3px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  padding: 10px 12px;
  font: inherit;
  cursor: pointer;
}
.choice-pick b { display: block; font-size: 26px; line-height: 1.15; letter-spacing: 0.03em; }
.choice-pick small { display: block; margin-top: 4px; color: #5c6570; font-size: 14px; font-weight: 700; }
.choice.good .choice-pick { background: var(--gold); }
.choice.bad .choice-pick { border-color: var(--red); animation: shake .32s linear; }
.choice-pick:disabled { cursor: default; }
.status { text-align: center; font-weight: 800; min-height: 24px; }
.status.good { color: #1b7f3a; }
.status.bad { color: var(--red); }
.prompt { font-size: 28px; line-height: 1.2; }
#next { margin-top: 4px; }
@media (min-width: 1024px) {
  .top {
    flex-wrap: nowrap;
    gap: 18px;
    padding: 14px 32px;
  }
  .brand img { height: 88px; }
  nav { flex: 0 1 auto; gap: 6px; }
  nav a { padding: 0 14px; font-size: 16px; }
  .lang { margin-left: auto; }
  .lang button { min-width: 46px; padding: 0 8px; font-size: 14px; }
  .wrap {
    width: min(100% - 80px, 1040px);
    padding-top: 40px;
  }
  body:not([data-page]) .wrap {
    display: grid;
    grid-template-columns: 280px 1fr;
    column-gap: 56px;
    align-items: center;
  }
  body:not([data-page]) .hero-logo {
    width: 280px;
    grid-row: 1 / span 3;
    margin: 0;
  }
  body:not([data-page]) h1 { font-size: 48px; margin: 8px 0 0; }
  body:not([data-page]) .actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
  }
  body:not([data-page]) .actions .btn { min-width: 160px; }
  body:not([data-page]) footer { grid-column: 1 / -1; }
  .words { grid-template-columns: 1fr 1fr; gap: 12px; }
  .word-zh { font-size: 32px; }
  .quiz .wrap { width: min(100% - 80px, 880px); }
  .quiz .stage { min-height: 0; padding: 8px 4px 20px; }
  .prompt { font-size: 40px; }
  .choices { grid-template-columns: 1fr 1fr; gap: 12px; }
  .choice-pick { min-height: 96px; }
  .choice-pick b { font-size: 30px; }
}
