:root {
  --jade-950: #071f1b;
  --jade-900: #0a2b25;
  --jade-800: #103d34;
  --jade-700: #176050;
  --gold-500: #c89b3d;
  --gold-400: #d8ae53;
  --gold-300: #e8cc83;
  --paper: #fffaf0;
  --paper-deep: #f3e7cc;
  --ink: #173c34;
  --muted: #6a746c;
  --coral: #d96848;
  --success: #247a5e;
  --danger: #b54437;
  --line: rgba(23, 60, 52, .16);
  --shadow: 0 26px 72px rgba(4, 24, 20, .28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--jade-950);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 50% -10%, rgba(69, 119, 100, .44), transparent 45%),
    linear-gradient(145deg, var(--jade-900), var(--jade-950));
  font-family: Inter, "Avenir Next", "Segoe UI", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
[role="button"]:focus-visible {
  outline: 3px solid var(--gold-300);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.book-cinematic {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 32px;
  overflow: hidden;
  color: white;
  background:
    radial-gradient(circle at 50% 46%, rgba(104, 151, 126, .25), transparent 32%),
    radial-gradient(circle at 50% 15%, #244f43 0, #0c3029 48%, #061c18 100%);
}

.cinematic-mist {
  position: absolute;
  inset: 0;
  opacity: .52;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 18% 72%, rgba(232, 217, 177, .15), transparent 29%),
    radial-gradient(ellipse at 80% 65%, rgba(232, 217, 177, .12), transparent 30%),
    linear-gradient(110deg, transparent 25%, rgba(255, 244, 206, .08) 52%, transparent 74%);
  animation: mistDrift 8s ease-in-out infinite alternate;
}

.intro-book-art,
.outro-book-art {
  position: relative;
  width: min(920px, 86vw);
  aspect-ratio: 1692 / 930;
  display: grid;
  place-items: center;
  filter: drop-shadow(0 34px 30px rgba(0, 0, 0, .42));
}

.intro-book-image,
.outro-book-image {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  animation: bookFloat 5.6s ease-in-out infinite;
}

.outro-book-art {
  width: min(760px, 76vw);
}

.book-shadow {
  position: absolute;
  z-index: 0;
  left: 13%;
  right: 13%;
  bottom: 2%;
  height: 15%;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  filter: blur(28px);
}

.book-spine-light {
  position: absolute;
  z-index: 3;
  top: 12%;
  bottom: 12%;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(transparent, rgba(255, 226, 150, .72), transparent);
  filter: blur(.5px);
}

.cinematic-kicker {
  position: relative;
  z-index: 3;
  margin: -2px 0 0;
  color: var(--gold-300);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .28em;
  text-align: center;
}

.cinematic-button {
  position: relative;
  z-index: 3;
  min-width: 210px;
  padding: 15px 28px;
  border: 1px solid rgba(237, 211, 142, .68);
  border-radius: 999px;
  color: #102f28;
  background: linear-gradient(180deg, #f1d999, #c79739);
  box-shadow: 0 12px 36px rgba(0, 0, 0, .3), inset 0 1px rgba(255, 255, 255, .62);
  font-weight: 800;
  letter-spacing: .03em;
  transition: transform .2s ease, filter .2s ease;
}

.cinematic-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
}

.sound-note {
  position: relative;
  z-index: 3;
  margin: 0;
  color: rgba(255, 255, 255, .65);
  font-size: 12px;
  letter-spacing: .03em;
}

.parent-guide {
  position: relative;
  z-index: 3;
  width: min(760px, 92vw);
  color: #f8edcb;
  border: 1px solid rgba(236, 209, 139, .35);
  border-radius: 16px;
  background: rgba(6, 38, 32, .76);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  box-shadow: 0 16px 34px rgba(0, 0, 0, .2);
}

.parent-guide summary {
  min-height: 44px;
  padding: 12px 18px;
  cursor: pointer;
  color: #f0d58d;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  list-style-position: inside;
}

.parent-guide div {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  padding: 0 14px 14px;
}

.parent-guide span {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 11px;
  border-radius: 11px;
  color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .06);
  font-size: 12px;
  line-height: 1.55;
}

.parent-guide span b {
  display: inline-grid;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 50%;
  color: #123a31;
  background: #e5c66f;
  font-size: 11px;
}

.parent-operation-note {
  margin: 12px 0 0;
  padding: 11px 13px;
  border-left: 4px solid var(--gold-500);
  border-radius: 10px;
  color: #5d512e;
  background: #fff4d7;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 12px;
  line-height: 1.6;
}

.parent-operation-note b {
  color: #9a6c10;
}

.book-intro.opening .intro-book-image {
  animation: openBook 1.45s cubic-bezier(.2, .75, .2, 1) forwards;
}

.book-intro.opening {
  animation: cinematicFade 1.45s ease forwards;
}

.book-outro.closing .outro-book-image {
  animation: closeBook 1.5s ease both;
}

.course {
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background:
    radial-gradient(circle at 38% 14%, rgba(209, 187, 123, .15), transparent 24%),
    linear-gradient(135deg, #e7d8b9 0, #f7efdd 34%, #efe3ca 100%);
}

.course[aria-hidden="true"] {
  visibility: hidden;
  pointer-events: none;
}

.course-enter {
  animation: courseEnter .65s ease both;
}

.course-leave {
  animation: courseLeave 1.5s ease both;
}

.coursebar {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto minmax(250px, 1fr);
  align-items: center;
  gap: 24px;
  min-height: 74px;
  padding: 13px clamp(20px, 3vw, 48px);
  color: white;
  background: rgba(8, 38, 32, .97);
  border-bottom: 1px solid rgba(227, 196, 113, .42);
  box-shadow: 0 8px 24px rgba(8, 35, 29, .18);
}

.coursebar,
.lesson-stage,
.controls {
  width: 100%;
  min-width: 0;
  max-width: 100vw;
}

.coursebar > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.eyebrow,
.chapter-heading small,
.scene-label,
.activity-kicker,
.reading-copy > span {
  color: var(--gold-300);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.coursebar strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: -.01em;
}

.chapter-heading {
  display: grid;
  gap: 3px;
  min-width: 190px;
  padding: 0 30px;
  text-align: center;
  border-inline: 1px solid rgba(255, 255, 255, .14);
}

.chapter-heading strong {
  font-family: inherit;
  font-size: 13px;
  letter-spacing: .02em;
}

.header-actions {
  min-width: 0;
  justify-self: end;
  display: flex;
  align-items: center;
  gap: 9px;
}

.sound-toggle,
.hint-toggle,
.lesson-count,
.icon-button {
  min-height: 38px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 999px;
  color: white;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  font-weight: 750;
  transition: background .2s ease, border-color .2s ease;
}

.sound-toggle[aria-pressed="true"],
.hint-toggle[aria-pressed="true"] {
  color: #112f28;
  background: var(--gold-300);
  border-color: var(--gold-300);
}

.lesson-count {
  color: var(--gold-300);
  border-color: rgba(232, 204, 131, .5);
}

.lesson-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(360px, .78fr);
  gap: clamp(14px, 2vw, 28px);
  padding: clamp(16px, 2vw, 30px) clamp(18px, 3vw, 48px);
}

.art-panel,
.activity {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(31, 71, 60, .2);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.art-panel {
  position: relative;
  isolation: isolate;
  display: grid;
  align-items: stretch;
  background: var(--jade-900);
  cursor: default;
}

.art-panel.picture-interactive {
  cursor: pointer;
}

.scene-image {
  grid-area: 1 / 1;
  z-index: 0;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background:
    radial-gradient(circle at 50% 45%, #315b4e, #0d3028 72%);
}

.wash {
  grid-area: 1 / 1;
  z-index: 2;
  align-self: end;
  height: 46%;
  pointer-events: none;
  background: linear-gradient(transparent, rgba(4, 28, 23, .22) 24%, rgba(4, 28, 23, .88));
}

.story-copy {
  grid-area: 1 / 1;
  z-index: 5;
  align-self: end;
  max-width: 78%;
  padding: 34px clamp(26px, 4vw, 54px) 34px;
  color: white;
  pointer-events: none;
}

.story-copy h1 {
  margin: 8px 0 7px;
  color: white;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 4vw, 58px);
  line-height: .98;
  letter-spacing: -.035em;
  text-shadow: 0 3px 18px rgba(0, 0, 0, .28);
}

.story-copy p {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 14px;
  line-height: 1.5;
}

.scene-action,
.scene-response {
  position: absolute;
  z-index: 8;
  top: 18px;
  left: 18px;
  max-width: calc(100% - 36px);
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .42);
  border-radius: 999px;
  color: white;
  background: rgba(7, 38, 31, .84);
  backdrop-filter: blur(9px);
  box-shadow: 0 7px 20px rgba(0, 0, 0, .19);
  font-size: 12px;
  font-weight: 800;
}

.scene-response {
  top: 68px;
  border-color: rgba(233, 205, 126, .72);
  color: #123b32;
  background: rgba(255, 247, 225, .94);
}

.scene-response:empty {
  display: none;
}

.motion-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  overflow: hidden;
  pointer-events: none;
}

.rock-glow {
  position: absolute;
  left: 38%;
  top: 30%;
  width: 18%;
  aspect-ratio: 1;
  border-radius: 50%;
  opacity: 0;
  background: rgba(255, 215, 107, .36);
  filter: blur(18px);
}

.p1.scene-awake .rock-glow {
  animation: rockPulse 1.25s ease;
}

.water-ribbon,
.waterfall-stream,
.waterfall-mist,
.leap-trail,
.route-marker {
  display: none;
}

.image-word-hotspots,
.route-image-hotspots {
  position: absolute;
  z-index: 9;
  display: none;
}

.p2 .image-word-hotspots {
  top: 10%;
  right: 3.3%;
  width: 41%;
  height: 72%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3%;
}

.image-word-hotspots button {
  border: 2px solid transparent;
  border-radius: 17px;
  color: transparent;
  background: transparent;
}

.image-word-hotspots button:hover,
.image-word-hotspots button:focus-visible {
  border-color: var(--gold-300);
  background: rgba(255, 225, 136, .12);
  box-shadow: 0 0 0 4px rgba(232, 204, 131, .18);
}

.image-word-hotspots button.wrong {
  animation: shake .35s ease;
  border-color: transparent;
  background: transparent;
}

.p3 .route-image-hotspots {
  inset: 0;
  display: block;
}

.route-image-hotspots button {
  position: absolute;
  min-height: 80px;
  border: 2px solid transparent;
  color: transparent;
  background: transparent;
  transition: border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.route-image-hotspots button[data-route-image="1"] {
  top: 48%;
  left: 67%;
  width: 31%;
  height: 50%;
  border-radius: 58% 42% 34% 66%;
}

.route-image-hotspots button[data-route-image="2"] {
  top: 62%;
  left: 8%;
  width: 58%;
  height: 36%;
  border-radius: 46% 54% 30% 38%;
}

.route-image-hotspots button[data-route-image="3"] {
  top: 5%;
  left: 48%;
  width: 29%;
  height: 56%;
  border-radius: 42% 58% 32% 68%;
}

.route-image-hotspots button[data-route-image="4"] {
  top: 1%;
  left: 77%;
  width: 22%;
  height: 47%;
  border-radius: 38% 62% 54% 46%;
}

.route-image-hotspots button::after {
  content: attr(data-route-image);
  position: absolute;
  top: 50%;
  left: 50%;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  transform: translate(-50%, -50%);
  border: 1px solid rgba(255, 255, 255, .5);
  border-radius: 50%;
  color: white;
  background: rgba(10, 54, 45, .72);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  font-weight: 900;
}

.route-image-hotspots button::before {
  content: attr(aria-label);
  position: absolute;
  top: calc(50% + 24px);
  left: 50%;
  padding: 5px 10px;
  transform: translate(-50%, 4px);
  border-radius: 999px;
  color: white;
  background: rgba(10, 54, 45, .86);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .2);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  opacity: 0;
  transition: opacity .18s ease, transform .18s ease;
}

.route-image-hotspots button:hover,
.route-image-hotspots button:focus-visible {
  border-color: var(--gold-300);
  background: rgba(232, 204, 131, .13);
  box-shadow: inset 0 0 28px rgba(232, 204, 131, .16);
}

.route-image-hotspots button:hover::before,
.route-image-hotspots button:focus-visible::before,
.route-image-hotspots button.visited::before {
  transform: translate(-50%, 0);
  opacity: 1;
}

.route-image-hotspots button.visited {
  border-color: rgba(124, 197, 154, .82);
  background: rgba(29, 113, 88, .13);
}

.route-image-hotspots button.visited::after {
  content: "✓";
  background: rgba(22, 116, 88, .88);
}

.route-image-hotspots button.wrong {
  animation: shake .35s ease;
  border-color: transparent;
}

.route-marker {
  position: absolute;
}

.activity {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 3vw, 44px);
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(193, 152, 64, .2), transparent 5px),
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(255, 250, 239, .98));
}

.reading-copy {
  margin-bottom: 18px;
}

.reading-copy h1 {
  margin: 8px 0 8px;
  color: var(--jade-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(27px, 3vw, 43px);
  line-height: 1.03;
  letter-spacing: -.035em;
}

.reading-copy p,
.definition,
.word-direction,
.route-instruction,
.retell-instruction {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.mission-rule {
  width: 100%;
  height: 1px;
  margin: 2px 0 22px;
  background: linear-gradient(90deg, var(--gold-500), rgba(200, 155, 61, 0));
}

.activity > h2 {
  margin: 8px 0 12px;
  color: var(--jade-900);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(25px, 2.7vw, 38px);
  line-height: 1.08;
}

.tap-hint {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.choice-grid {
  display: grid;
  gap: 10px;
  margin: 2px 0 14px;
}

.choice-grid button {
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  color: var(--ink);
  background: rgba(255, 255, 255, .8);
  box-shadow: 0 7px 16px rgba(20, 57, 48, .06);
  text-align: left;
  font-weight: 750;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.choice-grid button:hover {
  transform: translateX(3px);
  border-color: var(--gold-500);
  background: #fff7e2;
}

.choice-grid button.correct {
  color: white;
  border-color: var(--success);
  background: var(--success);
}

.choice-grid button.incorrect {
  color: white;
  border-color: var(--danger);
  background: var(--danger);
  animation: shake .35s ease;
}

.feedback,
.retell-feedback,
.recording-result {
  min-height: 46px;
  padding: 12px 14px;
  border-radius: 12px;
  color: var(--muted);
  background: rgba(23, 96, 80, .07);
  font-size: 13px;
  line-height: 1.45;
}

.feedback.active {
  color: var(--ink);
  background: rgba(200, 155, 61, .14);
}

.word-mission-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
  color: var(--gold-500);
  font-size: 11px;
  letter-spacing: .08em;
}

.word-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 16px 0 12px;
}

.word-progress > div {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, .72);
  font-size: 11px;
}

.word-progress span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: white;
  background: #9aa39e;
  font-weight: 900;
}

.word-progress .current {
  color: var(--ink);
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(200, 155, 61, .12);
}

.word-progress .current span {
  background: var(--gold-500);
}

.word-progress .complete span {
  background: var(--success);
}

.continue,
.record,
.finish-lesson,
.download-recording {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  margin-top: 12px;
  padding: 11px 17px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: var(--jade-800);
  font-weight: 800;
  text-decoration: none;
}

.continue:disabled,
.record:disabled {
  cursor: not-allowed;
  opacity: .45;
}

.route {
  display: grid;
  gap: 9px;
  margin: 18px 0 14px;
}

.route-step {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: white;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.route-step span {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  color: white;
  background: #97a39e;
}

.route-step.current {
  color: var(--ink);
  border-color: var(--gold-500);
  background: #fff6dd;
}

.route-step.current span {
  background: var(--gold-500);
}

.route-step.visited span {
  background: var(--success);
}

.coach {
  margin: 0;
  color: var(--jade-700);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  font-weight: 700;
}

.retell {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin: 16px 0 12px;
}

.retell button {
  min-height: 78px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--ink);
  background: white;
}

.retell button span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0 auto 6px;
  border-radius: 50%;
  color: white;
  background: var(--gold-500);
  font-weight: 900;
}

.retell button small {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.retell button.completed {
  color: white;
  border-color: var(--success);
  background: var(--success);
}

.retell button.wrong {
  animation: shake .35s ease;
  border-color: var(--danger);
}

.recording-result:empty {
  display: none;
}

.recording-result {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.recording-result audio {
  width: 100%;
}

.recording-live {
  color: var(--coral);
}

.live-caption {
  margin-top: 10px;
  padding: 13px 15px;
  border: 1px solid rgba(23, 96, 80, .2);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(23, 96, 80, .1), rgba(200, 155, 61, .1));
}

.live-caption[hidden] {
  display: none;
}

.live-caption small,
.monkey-reply > small {
  display: block;
  color: var(--gold-500);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: .14em;
}

.live-caption p {
  min-height: 21px;
  margin: 5px 0 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.45;
}

.score-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, .75);
}

.score-card.unavailable {
  grid-template-columns: 1fr;
}

.score-number {
  color: var(--gold-500);
  font-family: Georgia, serif;
  font-size: 34px;
  font-weight: 800;
}

.score-number small {
  font-size: 12px;
}

.score-card b,
.score-card span {
  display: block;
  line-height: 1.45;
}

.score-card span {
  color: var(--muted);
  font-size: 11px;
}

.score-card.ai-score {
  grid-template-columns: auto 1fr;
  align-items: start;
  padding: 15px;
  border: 1px solid rgba(200, 155, 61, .2);
  background: linear-gradient(145deg, rgba(255, 255, 255, .92), rgba(255, 246, 221, .72));
}

.score-card.ai-score .score-number {
  min-width: 62px;
  text-align: center;
}

.score-card.ai-score .score-number small {
  display: block;
  color: var(--muted);
}

.idea-checklist {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 2px;
}

.idea-chip {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 10px !important;
  font-weight: 800;
}

.idea-chip.found {
  color: #145544;
  background: rgba(31, 139, 106, .13);
}

.idea-chip.missing {
  color: #8b5229;
  background: rgba(216, 106, 82, .13);
}

.monkey-reply {
  padding: 16px;
  border: 1px solid rgba(200, 155, 61, .3);
  border-radius: 16px;
  background: #173f35;
  box-shadow: 0 12px 28px rgba(16, 49, 40, .12);
}

.monkey-reply blockquote {
  margin: 7px 0 12px;
  color: #fff7df;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.5;
}

.monkey-reply button {
  width: 100%;
  min-height: 58px;
  padding: 13px 20px;
  border: 1px solid rgba(255, 247, 223, .48);
  border-radius: 999px;
  color: #173f35;
  background: linear-gradient(135deg, var(--gold-300), var(--gold-400));
  box-shadow: 0 8px 22px rgba(4, 24, 20, .24);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: .02em;
}

.monkey-listening {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 17px 18px;
  border: 1px solid rgba(200, 155, 61, .44);
  border-radius: 16px;
  color: #fff7df;
  background: linear-gradient(135deg, #173f35, #0f3129);
  box-shadow: 0 12px 30px rgba(10, 43, 37, .18);
}

.monkey-listening small,
.monkey-listening strong {
  display: block;
}

.monkey-listening small {
  margin-bottom: 4px;
  color: var(--gold-300);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
}

.monkey-listening strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.35;
}

.voice-wave {
  flex: 0 0 auto;
  color: var(--gold-300);
  font-size: 9px;
  letter-spacing: 2px;
  animation: voicePulse 1s ease-in-out infinite;
}

.monkey-reply button:disabled {
  opacity: .82;
}

.monkey-reply button.speaking {
  animation: voicePulse 1.15s ease-in-out infinite;
}

.monkey-voice-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 11px;
  color: rgba(255, 247, 223, .78);
  font-size: 11px;
  font-weight: 750;
}

.monkey-voice-status::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-300);
  box-shadow: 0 0 0 5px rgba(232, 204, 131, .12);
  content: "";
}

.monkey-reply audio:not([hidden]) {
  display: block;
  width: 100%;
  margin-top: 10px;
}

@keyframes voicePulse {
  0%,
  100% {
    transform: translateY(0);
    box-shadow: 0 8px 22px rgba(4, 24, 20, .24);
  }
  50% {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(232, 204, 131, .34);
  }
}

.chinese-hint {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  margin-top: auto;
  padding: 12px 14px;
  border: 1px solid rgba(200, 155, 61, .24);
  border-radius: 12px;
  color: #64512a;
  background: #fff5d9;
  font-family: "Microsoft YaHei", sans-serif;
  font-size: 12px;
  line-height: 1.55;
}

.chinese-hint b {
  color: var(--gold-500);
}

.controls {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: center;
  gap: 30px;
  min-height: 82px;
  padding: 12px clamp(20px, 3vw, 48px);
  color: white;
  background: var(--jade-900);
  border-top: 1px solid rgba(226, 196, 114, .42);
}

.timeline-wrap {
  display: grid;
  grid-template-columns: auto minmax(110px, 230px) minmax(80px, 1fr);
  align-items: center;
  gap: 16px;
}

.lesson-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(255, 255, 255, .14);
}

#lesson-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--gold-300);
  transition: width .35s ease;
}

#dots {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: transparent;
}

.dot.complete {
  background: rgba(255, 255, 255, .52);
}

.dot.active {
  width: 24px;
  border-radius: 99px;
  border-color: var(--gold-300);
  background: var(--gold-300);
}

#scene-position,
#completion-label {
  color: rgba(255, 255, 255, .65);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.control-row {
  display: flex;
  gap: 10px;
}

.control-row > button {
  min-width: 112px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 12px;
  color: white;
  background: rgba(255, 255, 255, .09);
  font-weight: 800;
}

.control-row > button:last-child {
  color: var(--jade-950);
  border-color: var(--gold-300);
  background: var(--gold-300);
}

.control-row > button:disabled {
  cursor: not-allowed;
  opacity: .4;
}

.control-row .dot {
  width: 9px;
  min-width: 9px;
  height: 9px;
  min-height: 9px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: 50%;
  background: transparent;
}

.control-row .dot.active {
  width: 24px;
  min-width: 24px;
  border-radius: 99px;
  border-color: var(--gold-300);
  background: var(--gold-300);
}

.course-map {
  width: min(900px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  padding: 0;
  border: 1px solid rgba(205, 169, 84, .65);
  border-radius: 24px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 32px 90px rgba(0, 0, 0, .45);
}

.course-map::backdrop {
  background: rgba(4, 24, 20, .7);
  backdrop-filter: blur(7px);
}

.course-map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 25px 28px 18px;
}

.course-map-head h2 {
  margin: 6px 0 0;
  font-family: Georgia, serif;
}

.icon-button {
  width: 40px;
  padding: 0;
  color: var(--jade-900);
  border-color: var(--line);
  background: white;
  font-size: 22px;
}

.current-lesson-card {
  margin: 0 28px 18px;
  padding: 17px;
  border-left: 4px solid var(--gold-500);
  border-radius: 12px;
  background: var(--paper-deep);
}

.current-lesson-card strong,
.current-lesson-card span {
  display: block;
}

.current-lesson-card span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 330px;
  margin: 0;
  padding: 0 28px;
  overflow: auto;
  list-style: none;
}

.lesson-grid button,
.lesson-grid a {
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: white;
  text-align: left;
  text-decoration: none;
}

.lesson-grid button span,
.lesson-grid button strong,
.lesson-grid button small,
.lesson-grid a span,
.lesson-grid a strong,
.lesson-grid a small {
  display: block;
}

.lesson-grid button span,
.lesson-grid a span {
  color: var(--gold-500);
  font-size: 10px;
  font-weight: 900;
}

.lesson-grid button strong,
.lesson-grid a strong {
  margin: 5px 0;
  color: var(--ink);
  font-size: 11px;
}

.lesson-grid button small,
.lesson-grid a small {
  font-size: 9px;
}

.lesson-grid button.current,
.lesson-grid a.current {
  color: white;
  border-color: var(--jade-800);
  background: var(--jade-800);
}

.lesson-grid button.current strong,
.lesson-grid a.current strong {
  color: white;
}

.lesson-grid a:not(.current):hover,
.lesson-grid a:not(.current):focus-visible {
  border-color: var(--gold-500);
  box-shadow: 0 0 0 3px rgba(193, 145, 42, .14);
}

.course-map-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 18px 28px 26px;
}

.course-map-actions button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: white;
  font-weight: 750;
}

.course-map-actions button:last-child {
  color: white;
  background: var(--jade-800);
}

@keyframes mistDrift {
  from { transform: translate3d(-2%, 1%, 0) scale(1); }
  to { transform: translate3d(2%, -1%, 0) scale(1.04); }
}

@keyframes bookFloat {
  0%, 100% { transform: translateY(0) rotateX(0); }
  50% { transform: translateY(-9px) rotateX(1deg); }
}

@keyframes openBook {
  0% { transform: scale(1); filter: brightness(1); }
  55% { transform: scale(1.035); filter: brightness(1.15); }
  100% { transform: scale(1.25); filter: brightness(1.25); opacity: 0; }
}

@keyframes closeBook {
  from { transform: scale(.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes cinematicFade {
  0%, 64% { opacity: 1; }
  100% { opacity: 0; visibility: hidden; }
}

@keyframes courseEnter {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes courseLeave {
  to { opacity: 0; transform: scale(.985); }
}

@keyframes rockPulse {
  0% { opacity: 0; transform: scale(.75); }
  45% { opacity: 1; transform: scale(1.3); }
  100% { opacity: 0; transform: scale(1.75); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@media (max-width: 1050px) {
  .coursebar {
    grid-template-columns: 1fr auto;
  }

  .chapter-heading {
    display: none;
  }

  .lesson-stage {
    grid-template-columns: minmax(0, 1.25fr) minmax(300px, .85fr);
    padding-inline: 18px;
  }

  .activity {
    padding: 25px;
  }

  .story-copy {
    max-width: 90%;
    padding-inline: 28px;
  }
}

@media (max-width: 820px) {
  body {
    overflow: auto;
  }

  .book-cinematic {
    gap: 12px;
    padding: 20px 14px;
    overflow-y: auto;
  }

  .parent-guide {
    width: min(94vw, 520px);
  }

  .parent-guide div {
    grid-template-columns: 1fr;
  }

  .parent-guide span {
    padding: 8px 10px;
  }

  .course {
    display: block;
  }

  .coursebar {
    position: sticky;
    top: 0;
    grid-template-columns: 1fr;
    gap: 9px;
    padding: 12px 16px;
  }

  .coursebar > div:first-child {
    padding-right: 140px;
  }

  .header-actions {
    position: absolute;
    top: 16px;
    right: 14px;
  }

  .lesson-count {
    display: none;
  }

  .lesson-stage {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .art-panel {
    min-height: 52vw;
    aspect-ratio: 1.44;
    border-radius: 20px;
  }

  .activity {
    min-height: 480px;
    border-radius: 20px;
  }

  .story-copy h1 {
    font-size: clamp(27px, 8vw, 48px);
  }

  .controls {
    position: sticky;
    bottom: 0;
    grid-template-columns: 1fr auto;
    gap: 12px;
    min-height: 72px;
    padding: 10px 14px;
  }

  .timeline-wrap {
    grid-template-columns: auto 1fr;
    gap: 10px;
  }

  #dots {
    display: none;
  }

  .control-row > button {
    min-width: 86px;
  }

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

@media (max-width: 520px) {
  .book-cinematic {
    padding: 20px;
  }

  .intro-book-art {
    width: 112vw;
  }

  .outro-book-art {
    width: 92vw;
  }

  .cinematic-kicker {
    font-size: 9px;
  }

  .coursebar strong {
    font-size: 15px;
  }

  .header-actions {
    gap: 5px;
  }

  .sound-toggle,
  .hint-toggle {
    padding: 7px 9px;
    font-size: 10px;
  }

  .art-panel {
    min-height: 64vw;
  }

  .story-copy {
    max-width: 100%;
    padding: 22px 20px;
  }

  .story-copy p,
  .scene-label {
    display: none;
  }

  .scene-action {
    top: 10px;
    left: 10px;
  }

  .scene-response {
    top: 54px;
    left: 10px;
  }

  .activity {
    padding: 22px 19px;
  }

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

  .word-progress {
    grid-template-columns: 1fr;
  }

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

  .control-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #completion-label,
  .lesson-progress {
    display: none;
  }

  .chinese-hint {
    grid-template-columns: 1fr;
  }
}

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