@font-face {
  font-family: "Andika";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("assets/fonts/andika-latin-400.woff2") format("woff2");
}

/* 星词岛首页与六岛地图 */
.island-home {
  display: grid;
  gap: 16px;
  padding: 4px 0 18px;
}

.island-mission-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  align-items: center;
  min-height: 210px;
  padding: 24px 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  background: linear-gradient(145deg, #ffffff 0%, #f7fdff 68%, #dff8ee 100%);
  box-shadow: 0 18px 45px rgba(57, 103, 128, 0.13);
}

.island-eyebrow {
  margin: 0 0 8px;
  color: #3b9d7b;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.island-mission-card h2 {
  margin: 0 0 8px;
  color: #24324a;
  font-size: clamp(30px, 4vw, 48px);
}

.island-subtitle {
  margin: 0 0 18px;
  color: #6f7c91;
  font-size: 18px;
}

.island-task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.island-task-chips span {
  padding: 9px 14px;
  border-radius: 14px;
  color: #435064;
  background: #eef5f8;
  font-weight: 800;
}

.island-task-chips .review {
  color: #624eb0;
  background: #eeeaff;
}

.island-start-button {
  min-width: 190px;
}

.island-mascot {
  display: grid;
  place-items: center;
  width: 138px;
  height: 138px;
  border-radius: 48% 52% 45% 55%;
  background: #72d6ae;
  box-shadow: inset 0 -14px 0 rgba(37, 137, 101, 0.1);
  font-size: 58px;
  transform: rotate(3deg);
}

.island-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.island-card {
  position: relative;
  min-height: 142px;
  padding: 16px 19px;
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 48% 52% 44% 56% / 45% 43% 57% 55%;
  background: linear-gradient(145deg, #93e4bd, #61cb9e);
  box-shadow: 0 12px 0 rgba(45, 117, 126, 0.12), 0 20px 28px rgba(45, 117, 126, 0.13);
}

.island-card:nth-child(even) {
  background: linear-gradient(145deg, #ffe28a, #ffc958);
}

.island-card.current {
  outline: 5px solid rgba(255, 201, 74, 0.34);
}

.island-card.locked {
  filter: saturate(0.15);
  opacity: 0.65;
}

.island-card.complete::after {
  content: "★";
  position: absolute;
  top: 12px;
  right: 20px;
  color: #fff4a8;
  font-size: 34px;
  text-shadow: 0 3px 0 rgba(134, 100, 16, 0.18);
}

.island-card strong {
  display: block;
  color: #24324a;
  font-size: 21px;
}

.island-card-icon {
  margin: 4px 0 7px;
  font-size: 36px;
}

.island-levels {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.island-levels i {
  width: 40px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.island-level {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 4px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  color: #65501d;
  background: #ffc94a;
  font-weight: 900;
  box-shadow: 0 5px 0 rgba(91, 72, 23, 0.15);
}

.island-level.done {
  color: #fff;
  background: #3eb28a;
}

.mastery-counter {
  color: #287f63;
  background: #e9fff7;
}

@media (max-width: 920px) {
  .island-map { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .island-mission-card { grid-template-columns: 1fr 130px; }
  .island-mascot { width: 125px; height: 125px; font-size: 54px; }
}

@font-face {
  font-family: "Andika";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("assets/fonts/andika-latin-700.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ui-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  --word-font: "Andika", "Trebuchet MS", Arial, sans-serif;
  --bg: #edf8f5;
  --panel: #fbfdf8;
  --surface: #f3fbf3;
  --control: #fffdf7;
  --ink: #20343a;
  --muted: #61747a;
  --line: #cfe1da;
  --blue: #4f87a3;
  --green: #4f9378;
  --red: #b56560;
  --amber: #c8963f;
  --peach: #efaa90;
  --mint: #a7dbbd;
  --sky: #a8d8ef;
  --lemon: #efd665;
  --soft-blue: #e6f4fb;
  --soft-green: #e5f6ec;
  --soft-red: #f7e7e2;
  --shadow: 0 12px 28px rgba(32, 52, 58, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  touch-action: pan-x pan-y;
}

body {
  background:
    linear-gradient(90deg, rgba(79, 135, 163, 0.045) 1px, transparent 1px),
    linear-gradient(180deg, rgba(79, 147, 120, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, #fffdf5 0, #f4fbf7 280px, var(--bg) 100%),
    var(--bg);
  background-size: 28px 28px, 28px 28px, auto, auto;
  color: var(--ink);
  font-family: var(--ui-font);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(79, 135, 163, 0.18);
}

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

.app {
  width: min(980px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 20px 0 28px;
}

.orientation-lock {
  display: none;
}

@media (orientation: portrait) {
  .orientation-lock {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center;
    background: var(--bg);
    color: var(--ink);
    padding: 24px;
    text-align: center;
  }

  .orientation-lock > div {
    display: grid;
    gap: 10px;
    max-width: 360px;
  }

  .orientation-lock strong {
    font-size: 32px;
  }

  .orientation-lock span {
    color: var(--muted);
    font-size: 18px;
  }
}

.topbar,
.parent-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 253, 247, 0.94);
  padding: 12px;
  box-shadow: var(--shadow);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-actions,
.parent-top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.star-counter {
  display: inline-flex;
  min-height: 42px;
  min-width: 86px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(200, 150, 63, 0.42);
  border-radius: 8px;
  background: #fff6c8;
  color: #5b4b1a;
  padding: 0 14px;
  font-size: 18px;
  font-weight: 900;
  box-shadow: 0 3px 0 rgba(200, 150, 63, 0.12);
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, var(--sky) 0 48%, var(--lemon) 48% 82%, var(--peach) 82% 100%);
  color: #2f3f3c;
  font-weight: 800;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.42);
}

.brand h1 {
  font-size: 24px;
  line-height: 1.1;
}

#progressText,
.muted-text,
.field span,
.word-cn,
.quiz-meta,
.done-copy {
  color: var(--muted);
}

.child-view {
  display: grid;
  gap: 16px;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.child-view button,
.child-view canvas,
.child-view .hero-panel,
.child-view .quiz-card,
.child-view .study-card,
.child-view .write-card,
.child-view .done-card {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.child-view input,
.child-view select,
.child-view textarea {
  -webkit-user-select: text;
  user-select: text;
}

.app-version {
  margin-top: 14px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.hero-panel,
.panel,
.quiz-card,
.study-card,
.write-card,
.done-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel {
  display: grid;
  gap: 16px;
  padding: 22px;
}

.compact-hero {
  position: relative;
  overflow: hidden;
  padding: 14px 16px;
  box-shadow: none;
}

.compact-hero::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 8px;
  background: linear-gradient(180deg, var(--peach), var(--lemon), var(--mint), var(--sky));
}

.hero-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.hero-title {
  overflow-wrap: anywhere;
  font-size: clamp(30px, 6vw, 64px);
  line-height: 1.06;
  font-weight: 850;
}

.compact-hero .hero-title {
  font-size: 22px;
}

.hero-subtitle {
  margin-top: 8px;
  color: var(--muted);
  font-size: 18px;
}

.compact-hero .hero-subtitle {
  margin-top: 4px;
  font-size: 15px;
}

.word-progress {
  display: flex;
  gap: 7px;
  margin-top: 10px;
}

.word-dot {
  width: 12px;
  height: 12px;
  border: 1px solid rgba(79, 135, 163, 0.28);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.9);
}

.word-dot.done {
  border-color: rgba(79, 147, 120, 0.34);
  background: var(--mint);
}

.word-dot.active {
  border-color: rgba(200, 150, 63, 0.46);
  background: var(--lemon);
  box-shadow: 0 0 0 4px rgba(239, 214, 101, 0.24);
}

.word-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.word-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
  min-height: 92px;
}

.word-tile strong,
.record-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.word-tile strong,
.masked-word,
.choice-button,
.study-word,
.single-write-word,
.write-word,
.image-card strong {
  font-family: var(--word-font);
  font-variant-ligatures: none;
}

.word-cn {
  display: block;
  margin-top: 6px;
  font-size: 14px;
}

.step-indicator {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  max-width: min(560px, 48vw);
  pointer-events: none;
}

.step-pill {
  display: inline-grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
  min-height: 28px;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: default;
  user-select: none;
}

.step-index {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.95);
  color: #7b8278;
  box-shadow: inset 0 0 0 1px rgba(84, 99, 91, 0.16);
  font-size: 12px;
  font-weight: 900;
}

.step-name {
  white-space: nowrap;
}

.step-pill.active {
  color: #51472b;
}

.step-pill.done {
  color: #557765;
}

.step-pill.active .step-index {
  background: var(--lemon);
  color: #51472b;
  box-shadow: 0 0 0 4px rgba(239, 214, 101, 0.22);
}

.step-pill.done .step-index {
  background: #a8ddb8;
  color: #245c45;
  box-shadow: inset 0 0 0 1px rgba(79, 147, 120, 0.24);
  font-size: 15px;
}

.quiz-card,
.study-card,
.write-card,
.done-card {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.focus-card {
  position: relative;
  overflow: hidden;
  min-height: min(560px, calc(100vh - 210px));
  align-content: center;
  background:
    linear-gradient(180deg, rgba(255, 253, 247, 0.9), rgba(243, 251, 243, 0.84)),
    var(--panel);
  transition: border-color 120ms ease, background-color 120ms ease, transform 120ms ease;
}

.focus-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 10px;
  background: linear-gradient(90deg, var(--peach), var(--lemon), var(--mint), var(--sky));
}

.focus-card.ok {
  border-color: rgba(93, 127, 108, 0.55);
  background: var(--panel);
}

.focus-card.no {
  border-color: rgba(169, 155, 239, 0.58);
  background: var(--panel);
}

.quiz-top,
.write-top,
.panel-head {
  display: flex;
  justify-content: center;
  gap: 12px;
  align-items: center;
  text-align: center;
}

.quiz-top h2,
.write-top h2 {
  font-size: clamp(34px, 5.4vw, 56px);
  line-height: 1.08;
}

.study-card {
  grid-template-rows: minmax(0, 1fr) auto;
  text-align: center;
  align-content: stretch;
}

.study-card .submit-strip {
  justify-content: center;
  text-align: center;
}

.study-card .write-actions {
  justify-content: center;
}

.study-main {
  display: grid;
  gap: 18px;
  align-content: center;
  justify-items: center;
  min-height: 0;
}

.study-nav-strip {
  align-self: end;
  min-height: 112px;
}

.study-nav-actions {
  display: grid;
  grid-template-columns: minmax(132px, 132px) minmax(220px, max-content);
  justify-content: center;
  align-items: center;
  min-height: 48px;
}

.study-nav-button {
  min-width: 132px;
}

.study-next-button {
  min-width: 220px;
}

.invisible-nav-button {
  visibility: hidden;
  pointer-events: none;
}

.study-word {
  overflow-wrap: anywhere;
  font-size: clamp(46px, 10vw, 92px);
  line-height: 1.04;
  font-weight: 900;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.7);
}

.study-cn {
  color: #9d6058;
  font-size: clamp(24px, 5vw, 44px);
  font-weight: 800;
}

.study-example {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.study-example-row {
  display: inline-flex;
  max-width: min(680px, 100%);
  justify-content: center;
  align-items: center;
  gap: 10px;
  justify-self: center;
  flex-wrap: wrap;
}

.sound-button {
  justify-self: center;
  min-width: min(260px, 100%);
  min-height: 58px;
  border: 1px solid rgba(79, 147, 120, 0.38);
  border-radius: 8px;
  background: linear-gradient(180deg, #effbef, #dff4e6);
  color: #2f654f;
  font-weight: 850;
  box-shadow: 0 3px 0 rgba(79, 147, 120, 0.16);
}

.mini-sound-button {
  min-height: 34px;
  border: 1px solid rgba(79, 135, 163, 0.28);
  border-radius: 8px;
  background: var(--soft-blue);
  color: #4f7182;
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.quiz-sound-button {
  min-width: min(320px, 100%);
  min-height: 66px;
  font-size: 22px;
}

.dictation-hint {
  color: var(--muted);
  text-align: center;
  font-size: 20px;
  font-weight: 700;
}

.quiz-meta {
  font-weight: 700;
}

.masked-word {
  overflow-wrap: anywhere;
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.15;
  font-weight: 850;
  letter-spacing: 0;
  white-space: pre-wrap;
  text-align: center;
}

.choices {
  display: grid;
  grid-template-columns: repeat(3, minmax(92px, 1fr));
  gap: 14px;
  width: min(520px, 100%);
  justify-self: center;
}

.word-choices {
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  width: min(680px, 100%);
}

.choice-button {
  min-height: 104px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(79, 135, 163, 0.08);
}

.chunk-choice-button {
  font-size: clamp(30px, 5vw, 42px);
  letter-spacing: 0;
}

.word-choice-button {
  min-height: 92px;
  font-size: clamp(24px, 4vw, 34px);
}

.meaning-answer {
  display: grid;
  justify-items: center;
  gap: 14px;
}

.meaning-answer strong {
  overflow-wrap: anywhere;
  font-family: var(--word-font);
  font-size: clamp(44px, 8vw, 76px);
  line-height: 1.08;
}

.remember-button {
  justify-self: center;
  min-width: min(260px, 100%);
  min-height: 62px;
}

.choice-button:active {
  border-color: var(--blue);
  background: var(--soft-blue);
}

@media (hover: hover) and (pointer: fine) {
  .choice-button:hover,
  .plain-button:hover,
  .quiet-button:hover,
  .icon-button:hover {
    border-color: var(--blue);
    background: var(--soft-blue);
  }
}

.feedback {
  min-height: 28px;
  text-align: center;
  font-weight: 800;
}

.feedback.no {
  display: inline-flex;
  justify-self: center;
  min-height: 34px;
  align-items: center;
  border-radius: 8px;
  background: #fff4c9;
  padding: 0 14px;
}

.feedback.ok {
  color: var(--green);
}

.feedback.no {
  color: #745d1d;
}

.write-list {
  display: grid;
  gap: 14px;
}

.write-item {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

.write-prompt {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.write-word {
  overflow-wrap: anywhere;
  font-size: clamp(24px, 5vw, 42px);
  line-height: 1.08;
  font-weight: 850;
}

.single-write-word {
  overflow-wrap: anywhere;
  text-align: center;
  font-size: clamp(38px, 8vw, 82px);
  line-height: 1.05;
  font-weight: 900;
}

.single-write-item {
  background: transparent;
  border: 0;
  padding: 0;
}

.single-canvas {
  height: min(470px, 52vh);
}

.writing-canvas,
.correction-canvas {
  display: block;
  width: 100%;
  height: 210px;
  border: 1px solid #cfd8cf;
  border-radius: 8px;
  background:
    linear-gradient(0deg, transparent 31px, rgba(184, 206, 216, 0.22) 32px),
    #f2f6ea;
  background-size: 100% 32px, auto;
  box-shadow:
    inset 0 0 0 4px rgba(255, 255, 255, 0.32),
    inset 12px 0 0 rgba(232, 180, 158, 0.16);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.correction-canvas {
  height: 180px;
}

.write-actions,
.dialog-actions,
.stack-actions,
.correction-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.submit-strip {
  position: static;
  z-index: 5;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
}

.done-card {
  min-height: 420px;
  place-items: center;
  text-align: center;
}

.done-title {
  color: #557765;
  font-size: clamp(40px, 8vw, 76px);
  line-height: 1;
  font-weight: 900;
}

.reward-line {
  position: relative;
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  gap: 10px;
  overflow: hidden;
  margin-top: 24px;
  border: 1px solid rgba(200, 150, 63, 0.38);
  border-radius: 8px;
  background: #fff6c8;
  color: #5b4b1a;
  padding: 12px 18px;
  font-size: 24px;
  font-weight: 900;
  transform-origin: center;
  animation: reward-pop 520ms cubic-bezier(0.2, 1.2, 0.28, 1) both;
}

.reward-line::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0 35%, rgba(255, 255, 255, 0.52) 48%, transparent 62% 100%);
  transform: translateX(-120%);
  pointer-events: none;
  animation: reward-shine 900ms ease-out 160ms both;
}

.reward-star {
  display: inline-block;
  font-size: 32px;
  line-height: 1;
  transform-origin: 50% 80%;
  filter: drop-shadow(0 5px 0 rgba(200, 150, 63, 0.16));
  animation: reward-star-hop 900ms ease-out both;
}

.reward-total {
  margin-top: 10px;
  color: var(--muted);
  font-weight: 800;
}

.done-content {
  display: grid;
  gap: 8px;
  margin-top: 28px;
}

.done-content .done-copy {
  margin: 0;
}

.done-actions {
  display: flex;
  justify-content: center;
  margin-top: 26px;
}

.primary-button,
.plain-button,
.quiet-button,
.icon-button {
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 16px;
  background: var(--control);
  color: var(--ink);
}

.primary-button {
  border-color: rgba(79, 135, 163, 0.56);
  background: linear-gradient(180deg, #5d97b2, #4f7f99);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 3px 0 rgba(42, 86, 103, 0.18);
}

@keyframes reward-pop {
  0% {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  58% {
    opacity: 1;
    transform: translateY(-2px) scale(1.04);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes reward-star-hop {
  0% {
    transform: translateY(0) scale(0.82) rotate(-8deg);
  }
  28% {
    transform: translateY(-18px) scale(1.18) rotate(10deg);
  }
  48% {
    transform: translateY(0) scale(0.98) rotate(-4deg);
  }
  68% {
    transform: translateY(-8px) scale(1.08) rotate(5deg);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

@keyframes reward-shine {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(120%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .reward-line,
  .reward-line::after,
  .reward-star {
    animation: none;
  }
}

.quiet-button {
  color: var(--muted);
}

.icon-button {
  display: inline-grid;
  width: 42px;
  padding: 0;
  place-items: center;
  font-weight: 900;
}

.danger-button {
  color: var(--red);
}

.dialog {
  width: min(440px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
}

.dialog::backdrop {
  background: rgba(24, 32, 51, 0.38);
}

.dialog-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field input,
.field select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  padding: 0 12px;
}

.pin-input {
  -webkit-text-security: disc;
  text-security: disc;
  font-variant-numeric: tabular-nums;
}

.error-text {
  min-height: 22px;
  color: var(--red);
  font-weight: 700;
}

.parent-view {
  position: fixed;
  inset: 0;
  z-index: 30;
  overflow: auto;
  background:
    linear-gradient(180deg, #f5f7f1 0, var(--bg) 280px),
    var(--bg);
  padding: 20px;
}

.parent-shell {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.parent-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.panel {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.panel .panel-head {
  justify-content: space-between;
  text-align: left;
}

.status-panel {
  grid-column: 1 / -1;
}

.records-panel {
  grid-column: 1;
}

.handwriting-panel {
  grid-column: 2;
}

.settings-panel {
  grid-column: 1;
}

.sync-panel {
  grid-column: 2;
}

.sync-code-card {
  display: grid;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft-blue);
  padding: 12px;
}

.sync-code-card span {
  color: var(--muted);
  font-size: 13px;
}

.sync-code-card strong {
  font-size: 24px;
  letter-spacing: 0;
}

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

.status-card,
.record-card,
.image-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 12px;
}

.status-card strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 1.9vw, 22px);
  line-height: 1.18;
}

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

.status-card.primary-status {
  grid-column: span 2;
  border-color: rgba(79, 135, 163, 0.42);
  background: #fffdf7;
}

.status-card.primary-status strong {
  font-size: clamp(24px, 3vw, 34px);
}

.status-card.wide {
  grid-column: span 2;
}

.unit-gate-card {
  display: grid;
  gap: 8px;
  align-content: start;
}

.small-confirm-button {
  min-height: 38px;
  justify-self: start;
  padding-inline: 16px;
  font-size: 15px;
}

.records-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
}

.record-card {
  width: 100%;
  text-align: left;
}

.record-card.active {
  border-color: var(--blue);
  background: var(--soft-blue);
}

.record-detail {
  display: grid;
  gap: 12px;
}

.image-card img {
  display: block;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfaf2;
}

.handwriting-comparison {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.handwriting-shot {
  display: grid;
  gap: 6px;
}

.handwriting-shot span {
  color: var(--muted);
  font-size: 13px;
}

.grading-panel {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.grading-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.grading-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.grade-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--control);
  color: var(--ink);
  padding: 0 12px;
  font-size: 14px;
  font-weight: 800;
}

.grade-button.selected {
  border-color: rgba(79, 147, 120, 0.46);
  background: var(--soft-green);
  color: #2f654f;
  box-shadow: inset 0 0 0 1px rgba(79, 147, 120, 0.18);
}

.grade-button[data-grade="wrong"].selected,
.grade-button[data-grade="unclear"].selected {
  border-color: rgba(181, 101, 96, 0.48);
  background: var(--soft-red);
  color: #8c4d49;
}

.review-write-card {
  align-content: start;
}

.review-write-head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.review-write-head h2 {
  font-size: 34px;
}

.review-write-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-write-item {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1.2fr);
  gap: 10px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 10px;
}

.review-write-word,
.review-write-original {
  display: grid;
  gap: 6px;
}

.review-write-item strong {
  display: block;
  overflow-wrap: anywhere;
  font-family: var(--word-font);
  font-size: 24px;
}

.review-write-item span {
  color: var(--muted);
}

.review-write-label,
.correction-open-label {
  font-size: 13px;
}

.correction-button,
.small-button {
  min-height: 34px;
  padding: 0 12px;
  justify-self: start;
}

.review-index {
  display: inline-grid;
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  place-items: center;
  border-radius: 999px;
  background: var(--lemon);
  color: var(--ink);
  font-weight: 900;
}

.review-write-item img,
.missing-writing {
  width: 100%;
  min-height: 92px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.missing-writing {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.review-correction {
  display: grid;
  grid-column: 1 / -1;
  gap: 8px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}

.correction-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.correction-head span {
  color: var(--ink);
  font-weight: 800;
}

.correction-actions {
  justify-content: flex-end;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 50;
  transform: translateX(-50%) translateY(18px);
  max-width: min(520px, calc(100vw - 32px));
  border-radius: 8px;
  background: #3f5551;
  color: #fff;
  padding: 12px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%);
}

.update-banner {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 52;
  transform: translateX(-50%) translateY(18px);
  width: min(620px, calc(100vw - 32px));
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  background: #fffdf9;
  color: var(--ink);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.update-banner.show {
  opacity: 1;
  transform: translateX(-50%);
  pointer-events: auto;
}

.update-banner[hidden] {
  display: none;
}

.update-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 640px) {
  .app,
  .parent-view {
    width: 100%;
  }

  .app {
    padding: 12px 10px 24px;
  }

  .topbar,
  .hero-head,
  .submit-strip,
  .parent-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .word-strip,
  .choices,
  .status-cards,
  .parent-grid {
    grid-template-columns: 1fr;
  }

  .step-indicator {
    justify-content: flex-start;
    max-width: 100%;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .writing-canvas,
  .correction-canvas {
    height: 190px;
  }

  .review-write-list,
  .review-write-item {
    grid-template-columns: 1fr;
  }
}

/* v1.1 航海绘本视觉：与 Think Words 的卡片网格体系明确区分 */
:root {
  --bg: #e9efff;
  --panel: #fffaf0;
  --surface: #f4f0ff;
  --control: #ffffff;
  --ink: #17255f;
  --muted: #66709a;
  --line: #cbd4f5;
  --blue: #2948c7;
  --green: #31a987;
  --red: #dc554b;
  --amber: #e7a72d;
  --peach: #ff735c;
  --mint: #61d7b0;
  --sky: #79c9ff;
  --lemon: #ffd95a;
  --soft-blue: #e5ebff;
  --soft-green: #e3f8f0;
  --soft-red: #ffe7df;
  --shadow: 0 10px 0 rgba(23, 37, 95, 0.1), 0 20px 45px rgba(39, 58, 130, 0.1);
}

body {
  background:
    radial-gradient(circle at 8% 12%, rgba(255, 217, 90, 0.42) 0 5px, transparent 6px),
    radial-gradient(circle at 88% 22%, rgba(255, 115, 92, 0.28) 0 7px, transparent 8px),
    radial-gradient(circle at 72% 82%, rgba(41, 72, 199, 0.15) 0 5px, transparent 6px),
    linear-gradient(145deg, #fff8e7 0%, #eef3ff 42%, #e6f1ff 100%);
  background-size: 170px 170px, 230px 230px, 190px 190px, auto;
}

.app {
  width: min(1180px, calc(100vw - 32px));
  padding-top: 16px;
}

.voyage-topbar {
  margin-bottom: 20px;
  border: 0;
  border-radius: 28px;
  padding: 14px 18px;
  color: #fff;
  background: #243b9b;
  box-shadow: 0 8px 0 #172665, 0 18px 38px rgba(23, 38, 101, 0.2);
}

.voyage-topbar .brand-mark {
  width: 54px;
  height: 54px;
  border: 0;
  border-radius: 50%;
  color: #17255f;
  background: #ffd95a;
  box-shadow: inset -6px -7px 0 rgba(231, 167, 45, 0.35);
  font-size: 28px;
  transform: rotate(-8deg);
}

.voyage-topbar .brand h1 {
  margin: 0;
  color: #fff;
  font-size: 26px;
  letter-spacing: 0.05em;
}

.voyage-topbar #progressText {
  margin: 3px 0 0;
  color: #cdd7ff;
  font-size: 14px;
}

.voyage-topbar .topbar-actions {
  gap: 10px;
}

.voyage-stat {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 8px;
  min-height: 48px;
  padding: 8px 15px;
  border: 2px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
}

.voyage-stat span {
  color: #cdd7ff;
  font-size: 13px;
  font-weight: 800;
}

.voyage-stat strong {
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  white-space: nowrap;
}

.voyage-stat.star-stat strong::before {
  content: "★ ";
  color: #ffd95a;
}

.voyage-topbar .parent-entry {
  min-height: 48px;
  border: 0;
  border-radius: 18px;
  color: #17255f;
  background: #fff4d0;
  box-shadow: none;
  font-weight: 900;
}

.voyage-home {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(560px, 1.5fr);
  gap: 18px;
  min-height: 610px;
}

.captain-card {
  position: relative;
  display: flex;
  min-height: 610px;
  flex-direction: column;
  align-items: flex-start;
  overflow: hidden;
  padding: 28px;
  border: 4px solid #17255f;
  border-radius: 34px 34px 110px 34px;
  color: #17255f;
  background: #ff735c;
  box-shadow: 10px 12px 0 #17255f;
}

.captain-card::before,
.captain-card::after {
  content: "";
  position: absolute;
  border: 3px solid rgba(23, 37, 95, 0.18);
  border-radius: 50%;
}

.captain-card::before {
  right: -45px;
  top: 100px;
  width: 155px;
  height: 155px;
}

.captain-card::after {
  right: 36px;
  top: 206px;
  width: 28px;
  height: 28px;
}

.captain-label {
  padding: 7px 11px;
  border: 2px solid #17255f;
  border-radius: 999px;
  font-family: var(--word-font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  background: #fff4d0;
}

.captain-orbit {
  display: grid;
  width: 112px;
  height: 112px;
  margin: 28px 0 20px;
  place-items: center;
  border: 4px solid #17255f;
  border-radius: 50%;
  background: #ffd95a;
  box-shadow: 7px 7px 0 #17255f;
}

.captain-orbit span {
  font-family: var(--word-font);
  font-size: 54px;
  font-weight: 900;
}

.captain-kicker {
  margin: 0 0 5px;
  font-size: 14px;
  font-weight: 900;
}

.captain-card h2 {
  max-width: 280px;
  margin: 0;
  font-size: clamp(28px, 3.1vw, 42px);
  line-height: 1.08;
}

.captain-copy {
  margin: 12px 0 16px;
  color: #432e50;
  font-size: 16px;
  line-height: 1.6;
}

.voyage-task-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.voyage-task-chips span {
  padding: 8px 11px;
  border: 2px solid #17255f;
  border-radius: 12px;
  background: #fff4d0;
  font-weight: 900;
}

.voyage-task-chips .review {
  background: #dcd5ff;
}

.voyage-start-button {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  border: 3px solid #17255f;
  border-radius: 18px;
  color: #fff;
  background: #2948c7;
  box-shadow: 5px 6px 0 #17255f;
  font-size: 18px;
}

.voyage-start-button b {
  font-size: 27px;
}

.captain-friend {
  position: absolute;
  right: 24px;
  bottom: 112px;
  font-size: 46px;
  transform: rotate(-12deg);
}

.captain-friend span {
  position: absolute;
  right: -14px;
  top: -14px;
  color: #fff4d0;
  font-size: 24px;
}

.voyage-map {
  position: relative;
  min-height: 610px;
  overflow: hidden;
  border: 4px solid #17255f;
  border-radius: 70px 34px 34px 34px;
  color: #fff;
  background:
    radial-gradient(circle at 14% 20%, rgba(255,255,255,.8) 0 2px, transparent 3px),
    radial-gradient(circle at 73% 21%, rgba(255,217,90,.9) 0 3px, transparent 4px),
    radial-gradient(circle at 90% 80%, rgba(255,255,255,.65) 0 2px, transparent 3px),
    #2948c7;
  background-size: 82px 82px, 124px 124px, 96px 96px, auto;
  box-shadow: 10px 12px 0 #17255f;
}

.map-title {
  position: absolute;
  z-index: 3;
  left: 34px;
  top: 27px;
  display: grid;
}

.map-title span {
  font-size: 24px;
  font-weight: 900;
}

.map-title small {
  margin-top: 2px;
  color: #cdd7ff;
  font-size: 13px;
}

.voyage-route {
  position: absolute;
  inset: 85px 12px 18px;
  width: calc(100% - 24px);
  height: calc(100% - 103px);
}

.voyage-route path {
  fill: none;
  stroke: #ffd95a;
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 3 18;
}

.map-comet {
  position: absolute;
  right: 42px;
  top: 34px;
  color: #ffd95a;
  font-size: 46px;
  transform: rotate(-18deg);
}

.voyage-node {
  position: absolute;
  z-index: 2;
  display: grid;
  width: 116px;
  justify-items: center;
  transform: translate(-50%, -50%);
}

.voyage-node.node-1 { left: 10%; top: 76%; }
.voyage-node.node-2 { left: 31%; top: 49%; }
.voyage-node.node-3 { left: 49%; top: 75%; }
.voyage-node.node-4 { left: 65%; top: 36%; }
.voyage-node.node-5 { left: 79%; top: 66%; }
.voyage-node.node-6 { left: 90%; top: 25%; }

.voyage-node-bubble {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border: 4px solid #17255f;
  border-radius: 50%;
  background: #fff4d0;
  box-shadow: 6px 6px 0 #17255f;
  font-size: 34px;
}

.voyage-node strong {
  margin-top: 8px;
  color: #fff;
  font-size: 16px;
  text-align: center;
  text-shadow: 0 2px 0 #17255f;
  white-space: nowrap;
}

.voyage-node.current .voyage-node-bubble {
  background: #ffd95a;
  animation: voyage-bob 2.2s ease-in-out infinite;
}

.voyage-node.complete .voyage-node-bubble {
  background: #61d7b0;
}

.voyage-node.locked {
  opacity: 0.48;
  filter: grayscale(0.55);
}

.voyage-levels {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 7px;
}

.voyage-levels > span:not(.route-dash) {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 2px solid #17255f;
  border-radius: 50%;
  color: #17255f;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
}

.voyage-levels > span.done:not(.route-dash) {
  color: #fff;
  background: #31a987;
}

.voyage-levels .route-dash {
  width: 10px;
  height: 2px;
  background: #fff;
}

.hero-panel,
.panel,
.quiz-card,
.study-card,
.write-card,
.done-card {
  border: 3px solid #17255f;
  border-radius: 26px;
  box-shadow: 7px 8px 0 rgba(23, 37, 95, 0.16);
}

.compact-hero {
  color: #fff;
  background: #2948c7;
}

.compact-hero::before {
  width: 10px;
  background: #ffd95a;
}

.compact-hero .hero-title {
  color: #fff;
}

.compact-hero .hero-subtitle {
  color: #cdd7ff;
}

.focus-card {
  background: #fffaf0;
}

.primary-button {
  border-radius: 16px;
  background: #2948c7;
  box-shadow: 0 5px 0 #17255f;
}

.word-dot.active {
  border-color: #17255f;
  background: #ffd95a;
  box-shadow: 0 0 0 4px rgba(255, 217, 90, 0.34);
}

.word-dot.done {
  background: #61d7b0;
}

@keyframes voyage-bob {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50% { transform: translateY(-7px) rotate(2deg); }
}

@media (max-width: 980px) {
  .voyage-home {
    grid-template-columns: minmax(250px, 0.65fr) minmax(500px, 1.35fr);
  }
  .captain-card { padding: 22px; }
  .voyage-node-bubble { width: 68px; height: 68px; }
  .voyage-node { width: 104px; }
}

@media (max-width: 780px) {
  .voyage-home { grid-template-columns: 1fr; }
  .captain-card { min-height: 460px; }
  .voyage-map { min-height: 560px; }
  .voyage-stat span { display: none; }
}

/* v1.2 学习舱：侧边航程轨道 + 单屏任务舞台 */
.app.lesson-mode {
  width: min(1280px, calc(100vw - 28px));
  min-height: 100vh;
  padding: 14px 0;
}

.lesson-mode > .voyage-topbar,
.lesson-mode > .app-version {
  display: none;
}

.lesson-mode .child-view {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
  min-height: calc(100vh - 28px);
}

.lesson-rail {
  position: relative;
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  overflow: hidden;
  padding: 22px 18px;
  border: 4px solid #17255f;
  border-radius: 34px 18px 70px 34px;
  color: #17255f;
  background: #ffd95a;
  box-shadow: 8px 9px 0 #17255f;
}

.lesson-rail::after {
  content: "";
  position: absolute;
  right: -48px;
  bottom: 70px;
  width: 125px;
  height: 125px;
  border: 4px solid rgba(23, 37, 95, 0.14);
  border-radius: 50%;
}

.rail-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-bottom: 17px;
  border-bottom: 3px solid #17255f;
  font-size: 19px;
}

.rail-brand span {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid #17255f;
  border-radius: 50%;
  background: #fff4d0;
}

.rail-location {
  display: grid;
  gap: 3px;
  padding: 22px 0 18px;
}

.rail-location small {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .12em;
}

.rail-location strong {
  font-size: 27px;
  line-height: 1.1;
}

.rail-location span {
  color: #5b4771;
  font-weight: 800;
}

.rail-steps {
  position: relative;
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 8px 0;
}

.rail-steps::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 28px;
  bottom: 28px;
  width: 3px;
  background: rgba(23, 37, 95, 0.24);
}

.lesson-mode .step-pill {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 38px 1fr;
  min-height: 44px;
  align-items: center;
  color: rgba(23, 37, 95, 0.55);
  font-size: 14px;
}

.lesson-mode .step-index {
  width: 38px;
  height: 38px;
  border: 3px solid #17255f;
  color: #17255f;
  background: #fff4d0;
  box-shadow: none;
}

.lesson-mode .step-pill.active {
  color: #17255f;
  font-size: 16px;
}

.lesson-mode .step-pill.active .step-index {
  color: #fff;
  background: #ff735c;
  box-shadow: 3px 3px 0 #17255f;
}

.lesson-mode .step-pill.done .step-index {
  color: #fff;
  background: #31a987;
  box-shadow: none;
}

.rail-progress {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 3px solid #17255f;
  border-radius: 18px;
  background: #fff4d0;
}

.rail-progress > strong {
  font-size: 14px;
}

.rail-progress .word-progress {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 0;
}

.rail-progress .word-dot {
  width: 100%;
  height: 7px;
  border: 0;
  background: #d9cfa9;
}

.rail-progress .word-dot.active {
  background: #ff735c;
  box-shadow: none;
}

.rail-progress .word-dot.done {
  background: #31a987;
}

.rail-message {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: #5b4771;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.lesson-mode .lesson-stage,
.lesson-mode .review-write-card {
  position: relative;
  min-height: calc(100vh - 28px);
  overflow: hidden;
  border: 4px solid #17255f;
  border-radius: 24px 60px 24px 24px;
  background: #fffaf0;
  box-shadow: 9px 10px 0 rgba(23, 37, 95, 0.22);
}

.lesson-mode .lesson-stage::before {
  display: none;
}

.stage-sticker {
  position: absolute;
  left: 28px;
  top: 25px;
  z-index: 2;
  padding: 8px 13px;
  border: 2px solid #17255f;
  border-radius: 999px;
  background: #e1ddff;
  font-family: var(--word-font);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
}

.lesson-mode .study-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  padding: 0;
}

.lesson-mode .study-main {
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: center;
  justify-items: start;
  gap: 8px;
  padding: 70px clamp(55px, 9vw, 130px) 120px;
  text-align: left;
}

.lesson-mode .study-word {
  color: #17255f;
  font-size: clamp(82px, 14vw, 168px);
  line-height: .94;
  text-align: left;
  text-shadow: 7px 7px 0 #e1ddff;
}

.lesson-mode .study-cn {
  margin-top: 15px;
  color: #dc554b;
  font-size: clamp(34px, 5vw, 58px);
  text-align: left;
}

.study-listen-row {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-top: 26px;
}

.lesson-mode .round-sound-button,
.lesson-mode .prompt-sound-button {
  min-width: 0;
  min-height: 54px;
  border: 3px solid #17255f;
  border-radius: 999px;
  padding: 0 22px;
  color: #17255f;
  background: #61d7b0;
  box-shadow: 4px 4px 0 #17255f;
  font-size: 17px;
}

.lesson-mode .study-example {
  max-width: 420px;
  margin: 0;
  color: #66709a;
  font-size: 18px;
}

.lesson-dock {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  min-height: 92px;
  padding: 18px 24px;
  border-top: 4px solid #17255f;
  background: #e8edff;
}

.dock-tip {
  color: #66709a;
  font-size: 14px;
  font-weight: 800;
}

.lesson-mode .study-nav-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 10px;
  min-height: 0;
}

.lesson-mode .study-nav-button {
  min-width: 130px;
  min-height: 52px;
}

.lesson-mode .study-next-button {
  min-width: 180px;
}

.lesson-mode .split-stage {
  display: grid;
  grid-template-columns: minmax(270px, .72fr) minmax(430px, 1.45fr);
  grid-template-rows: 1fr;
  gap: 0;
  padding: 0;
}

.stage-prompt {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 54px 36px;
  border-right: 4px solid #17255f;
  color: #17255f;
  background: #ff735c;
  text-align: left;
}

.meaning-stage .stage-prompt {
  background: #ffd95a;
}

.writing-stage .stage-prompt {
  padding-bottom: 135px;
  background: #61d7b0;
}

.prompt-number {
  display: grid;
  width: 62px;
  height: 62px;
  margin-bottom: 28px;
  place-items: center;
  border: 3px solid #17255f;
  border-radius: 50%;
  background: #fff4d0;
  box-shadow: 5px 5px 0 #17255f;
  font-size: 28px;
  font-weight: 900;
}

.stage-prompt p {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 900;
}

.stage-prompt h2 {
  margin: 0 0 20px;
  font-size: clamp(38px, 5vw, 64px);
  line-height: 1.08;
  text-align: left;
}

.stage-prompt small {
  color: #51446d;
  font-size: 14px;
  font-weight: 800;
}

.stage-play {
  display: grid;
  align-content: center;
  gap: 22px;
  min-width: 0;
  padding: 46px;
  background:
    radial-gradient(circle at 90% 12%, rgba(255, 217, 90, .5) 0 8px, transparent 9px),
    radial-gradient(circle at 12% 88%, rgba(97, 215, 176, .38) 0 10px, transparent 11px),
    #fffaf0;
}

.lesson-mode .word-choices,
.lesson-mode .chunk-choices {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 18px;
}

.lesson-mode .chunk-choices {
  grid-template-columns: repeat(3, minmax(110px, 1fr));
}

.lesson-mode .choice-button {
  position: relative;
  min-height: 132px;
  border: 3px solid #17255f;
  border-radius: 22px;
  color: #17255f;
  background: #e8edff;
  box-shadow: 6px 7px 0 #17255f;
}

.lesson-mode .choice-button.choice-2 { background: #ffe7df; }
.lesson-mode .choice-button.choice-3 { background: #e3f8f0; }
.lesson-mode .choice-button.choice-4 { background: #fff0b8; }

.lesson-mode .choice-button small {
  position: absolute;
  left: 12px;
  top: 10px;
  display: grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border: 2px solid #17255f;
  border-radius: 50%;
  background: #fff;
  font-size: 12px;
}

.lesson-mode .meaning-answer {
  display: grid;
  gap: 25px;
}

.lesson-mode .meaning-answer strong {
  font-size: clamp(72px, 11vw, 132px);
  text-shadow: 6px 6px 0 #e1ddff;
}

.lesson-mode .masked-word {
  padding: 30px 18px;
  border-bottom: 4px solid #17255f;
  color: #17255f;
  font-size: clamp(62px, 9vw, 108px);
  text-align: left;
}

.lesson-mode .spelling-play {
  align-content: center;
}

.lesson-mode .feedback {
  min-height: 30px;
  text-align: left;
}

.lesson-mode .remember-button {
  min-height: 56px;
  justify-self: start;
}

.lesson-mode .writing-stage {
  grid-template-columns: minmax(250px, .58fr) minmax(480px, 1.5fr);
  grid-template-rows: 1fr auto;
}

.stage-paper {
  padding: 28px;
  background: #fffaf0;
}

.lesson-mode .single-canvas {
  height: 100%;
  min-height: 430px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(220, 85, 75, .28) 2px, transparent 2px) 64px 0 / 100% 100% no-repeat,
    repeating-linear-gradient(0deg, transparent 0 45px, rgba(41, 72, 199, .16) 46px 48px),
    #fffdf6;
  box-shadow: inset 0 0 0 3px #17255f, 7px 8px 0 rgba(23, 37, 95, .14);
}

.writing-dock {
  grid-column: 1 / -1;
}

.lesson-mode .writing-dock .write-actions {
  justify-content: flex-end;
}

.lesson-mode .review-write-card {
  padding: 24px;
}

@media (max-width: 900px) {
  .lesson-mode .child-view { grid-template-columns: 185px minmax(0, 1fr); }
  .lesson-rail { padding: 18px 14px; }
  .lesson-mode .split-stage { grid-template-columns: minmax(220px, .62fr) minmax(380px, 1.38fr); }
  .stage-prompt { padding: 38px 25px; }
  .stage-play { padding: 30px; }
}
