/* =========================================================
   字字岛 · 4–5岁汉字启蒙 H5
   视觉：奶油纸张 + 糖果色 + 手绘粗描边
   ========================================================= */

:root {
  --ink: #4a3428;
  --ink-soft: #7c6352;
  --ink-faint: rgba(74, 52, 40, 0.14);
  --cream: #fff8e9;
  --paper: #fffdf7;
  --coral: #ff8b79;
  --coral-deep: #d95f4f;
  --sun: #ffd45a;
  --sun-deep: #d9a62b;
  --leaf: #7bc96f;
  --leaf-deep: #4f9e5a;
  --sky: #aee9ff;
  --lilac: #b8a6f2;
  --blue: #5dbbef;
  --stroke: 3px solid var(--ink);
  --shadow-soft: 0 5px 0 rgba(74, 52, 40, 0.16);
  --font-round: "YouYuan", "幼圆", "Yuanti SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-char: "Kaiti SC", "STKaiti", "KaiTi", "Microsoft YaHei", serif;
  --sky-top: #a9e9ff;
  --sky-mid: #d9f5f6;
  --sky-bottom: #fff0c9;
  --hill-back: #a9dc8c;
  --hill-mid: #7bc96f;
  --hill-front: #5cb661;
  --ground: #55ab59;
  --path: #f4ddae;
  --scene-floor: #5cb661;
  --scene-bottom: #5cb661;
  --scene-opacity: 1;
}

/* 水塘主题只换环境色，不换 UI 结构 */
#app[data-theme="pond"] {
  --sky-top: #c5d8ff;
  --sky-mid: #f4e4f8;
  --sky-bottom: #ffe3c7;
  --hill-back: #9bd9c1;
  --hill-mid: #65c3a8;
  --hill-front: #45a98f;
  --ground: #3f9e86;
  --path: #e7d1ac;
  --scene-floor: #8ad9e8;
  --scene-bottom: #86d7e2;
}

#app[data-theme="garden"] {
  --sky-top: #ffdce9;
  --sky-mid: #fff4e2;
  --sky-bottom: #ffefd8;
  --hill-back: #c8e7a2;
  --hill-mid: #9bd88a;
  --hill-front: #7ac878;
  --ground: #6fbd70;
  --path: #f2ddb2;
  --scene-floor: #7ac878;
  --scene-bottom: #7ac878;
}

#app[data-theme="farm"] {
  --sky-top: #ffe0a8;
  --sky-mid: #fdf3d3;
  --sky-bottom: #ffefc7;
  --hill-back: #d8da8b;
  --hill-mid: #bbcf78;
  --hill-front: #99bd64;
  --ground: #8aae58;
  --path: #ecd49a;
  --scene-floor: #99bd64;
  --scene-bottom: #99bd64;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background:
    radial-gradient(circle at 16% 10%, rgba(255, 255, 255, 0.8) 0 3px, transparent 4px) 0 0 / 34px 34px,
    linear-gradient(135deg, #dff3e4, #f8ecd2 55%, #d6eeeb);
  color: var(--ink);
  font-family: var(--font-round);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible {
  outline: 4px solid #2f83ff;
  outline-offset: 3px;
}

button:active {
  -webkit-tap-highlight-color: transparent;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.is-hidden {
  display: none !important;
}

/* ---------------------------------------------------------
   外壳与场景
   --------------------------------------------------------- */

#app {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  max-width: 480px;
  margin: 0 auto;
  overflow: hidden;
  background:
    radial-gradient(circle at 82% 9%, rgba(255, 255, 255, 0.34) 0 4%, transparent 4.5%),
    linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 56%, var(--sky-bottom) 100%);
  transition: background 0.6s ease;
  user-select: none;
  -webkit-user-select: none;
}

@media (min-width: 640px) {
  body {
    display: grid;
    place-items: center;
  }

  #app {
    height: min(900px, calc(100svh - 32px));
    border-radius: 42px;
    box-shadow:
      0 30px 80px rgba(43, 95, 76, 0.26),
      0 0 0 8px rgba(255, 255, 255, 0.52),
      0 0 0 9px rgba(74, 52, 40, 0.08);
  }
}

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

#app::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 20;
  height: 14px;
  background: var(--scene-bottom);
  pointer-events: none;
}

.sun {
  position: absolute;
  top: 94px;
  right: 36px;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 28%, #fff7b8 0 10%, #ffe176 48%, #ffc93f 100%);
  box-shadow:
    0 0 0 13px rgba(255, 230, 128, 0.27),
    0 0 0 27px rgba(255, 231, 127, 0.1),
    0 8px 30px rgba(224, 163, 36, 0.25);
  animation: sunPulse 7s ease-in-out infinite;
}

.sun::after {
  content: "";
  position: absolute;
  inset: 17px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, rgba(255, 255, 255, 0.7), transparent 48%);
}

.cloud {
  position: absolute;
  width: 104px;
  height: 28px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  filter: drop-shadow(0 4px 0 rgba(255, 255, 255, 0.16));
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: 5px;
  border-radius: 50%;
  background: inherit;
}

.cloud::before {
  left: 16px;
  width: 46px;
  height: 46px;
}

.cloud::after {
  right: 14px;
  width: 34px;
  height: 34px;
}

.cloud.c1 {
  top: 152px;
  left: -42px;
  animation: cloudDrift 18s ease-in-out infinite alternate;
}

.cloud.c2 {
  top: 238px;
  right: -39px;
  opacity: 0.68;
  transform: scale(0.82);
  animation: cloudDrift 23s ease-in-out -6s infinite alternate-reverse;
}

.cloud.c3 {
  top: 78px;
  left: 39%;
  opacity: 0.5;
  transform: scale(0.56);
  animation: cloudDrift 27s ease-in-out -9s infinite alternate;
}

.scene-spark {
  position: absolute;
  z-index: 1;
  color: rgba(255, 255, 255, 0.8);
  font-size: 17px;
  line-height: 1;
  animation: twinkle 4.5s ease-in-out infinite;
}

.sp1 {
  top: 205px;
  left: 13%;
}

.sp2 {
  top: 132px;
  right: 23%;
  font-size: 11px;
  animation-delay: -1.8s;
}

.sp3 {
  top: 318px;
  right: 8%;
  font-size: 13px;
  animation-delay: -3s;
}

.landscape {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 57%;
  min-height: 330px;
  overflow: visible;
}

.scene-base {
  fill: var(--scene-floor);
  transition: fill 0.5s ease;
}

.hill-back {
  fill: var(--hill-back);
  transition: fill 0.5s ease;
}

.hill-mid {
  fill: var(--hill-mid);
  transition: fill 0.5s ease;
}

.hill-front {
  fill: var(--hill-front);
  transition: fill 0.5s ease;
}

.hill-path {
  fill: var(--path);
  opacity: 0.64;
}

.tree rect {
  fill: #8b5a3c;
}

.tree path {
  fill: #4f9e5a;
}

.tree path.tree-light {
  fill: #71bd68;
  opacity: 0.92;
}

.flower-stem {
  fill: none;
  stroke: #438f50;
  stroke-width: 3;
  stroke-linecap: round;
}

.flower-petal {
  fill: #fff4b1;
  stroke: rgba(74, 52, 40, 0.14);
  stroke-width: 1.5;
}

.flower-petal.pink {
  fill: #ffc1c9;
}

.flower-center {
  fill: #f4b942;
}

.mushroom rect {
  fill: #f6e5c6;
  stroke: rgba(74, 52, 40, 0.22);
  stroke-width: 1.4;
}

.mushroom .cap {
  fill: #ff9a86;
  stroke: rgba(74, 52, 40, 0.22);
  stroke-width: 1.4;
}

.mushroom-dot {
  fill: #fff3d8;
}

.pond-scene,
.garden-scene,
.farm-scene {
  display: none;
}

#app[data-theme="pond"] .forest-scene,
#app[data-theme="pond"] .garden-scene,
#app[data-theme="pond"] .farm-scene,
#app[data-theme="garden"] .forest-scene,
#app[data-theme="garden"] .pond-scene,
#app[data-theme="garden"] .farm-scene,
#app[data-theme="farm"] .forest-scene,
#app[data-theme="farm"] .pond-scene,
#app[data-theme="farm"] .garden-scene {
  display: none;
}

#app[data-theme="pond"] .pond-scene,
#app[data-theme="garden"] .garden-scene,
#app[data-theme="farm"] .farm-scene {
  display: block;
}

.garden-butterflies {
  transform-box: fill-box;
  transform-origin: center;
  animation: butterflyFloat 5s ease-in-out infinite;
}

.farm-field {
  fill: #d7b96b;
  opacity: 0.9;
}

.farm-field.light {
  fill: #e4c97b;
  opacity: 0.82;
}

.farm-rows {
  stroke: #a57b3d;
}

.barn {
  transform-box: fill-box;
  transform-origin: center;
}

.farm-fence path,
.garden-fence path {
  opacity: 0.92;
}

.pond-water {
  fill: #8ad9e8;
  opacity: 0.9;
}

.pond-ripple {
  fill: none;
  stroke: rgba(255, 255, 255, 0.6);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.lily-pad {
  fill: #5fbf7a;
  stroke: #3d955d;
  stroke-width: 1.5;
}

.lily-flower {
  fill: #ffb3c3;
}

.lily-center {
  fill: #ffe27a;
}

.reeds path {
  fill: none;
  stroke: #468d67;
  stroke-width: 4;
  stroke-linecap: round;
}

.reeds ellipse {
  fill: #8b6a44;
}

#app[data-screen="learn"] .sun,
#app[data-screen="quiz"] .sun {
  transform: scale(1.35);
  opacity: 0.55;
}

#app[data-screen="done"] .cloud {
  opacity: 0.36;
}

/* ---------------------------------------------------------
   顶部 HUD
   --------------------------------------------------------- */

.hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(13px + env(safe-area-inset-top)) 17px 0;
  pointer-events: none;
}

.hud > *,
.hud-right > * {
  pointer-events: auto;
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2.5px solid var(--ink);
  border-radius: 15px;
  background: rgba(255, 252, 243, 0.88);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.2);
  color: var(--ink);
  backdrop-filter: blur(5px);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.icon-btn:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.2);
}

.icon-btn.is-muted {
  color: var(--ink-soft);
  background: rgba(255, 252, 243, 0.65);
}

.hud-title {
  flex: 1 1 auto;
  overflow: hidden;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.hud-title.is-visible {
  opacity: 1;
  transform: none;
  background: rgba(255, 252, 243, 0.54);
  backdrop-filter: blur(5px);
}

/* ---------------------------------------------------------
   通用屏幕与按钮
   --------------------------------------------------------- */

.screens {
  position: absolute;
  inset: 0;
  z-index: 10;
}

.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  padding: calc(66px + env(safe-area-inset-top)) 20px calc(17px + env(safe-area-inset-bottom));
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(15px) scale(0.992);
  transition:
    opacity 0.32s ease,
    transform 0.36s cubic-bezier(0.22, 0.85, 0.34, 1),
    visibility 0.36s;
}

.screen.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
}

.screen-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.8);
  box-shadow: 0 2px 0 rgba(74, 52, 40, 0.08);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  backdrop-filter: blur(5px);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 54px;
  padding: 13px 22px;
  border: 3px solid var(--ink);
  border-radius: 19px;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0.03em;
  transition: transform 0.14s ease, box-shadow 0.14s ease, filter 0.14s ease;
}

.btn .icon {
  width: 22px;
  height: 22px;
}

.btn-primary {
  background: linear-gradient(180deg, #ffe27f, #ffd052);
  box-shadow:
    0 6px 0 #d4a127,
    0 10px 18px rgba(157, 112, 25, 0.2),
    inset 0 2px 0 rgba(255, 255, 255, 0.62);
  color: var(--ink);
}

.btn-primary:active {
  transform: translateY(5px);
  box-shadow:
    0 1px 0 #d4a127,
    0 3px 8px rgba(157, 112, 25, 0.2);
}

.btn-ghost {
  min-height: 44px;
  padding: 9px 18px;
  border-width: 2.5px;
  background: rgba(255, 252, 243, 0.75);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.13);
  color: var(--ink-soft);
  font-size: 14px;
}

.btn-ghost:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.13);
}

/* ---------------------------------------------------------
   首页
   --------------------------------------------------------- */

.screen-home {
  padding-top: calc(61px + env(safe-area-inset-top));
}

.home-brand {
  position: relative;
  z-index: 3;
  flex: 0 0 auto;
  text-align: center;
}

.brand-blocks {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  filter: drop-shadow(0 9px 0 rgba(74, 52, 40, 0.13));
}

.brand-char {
  display: grid;
  place-items: center;
  width: clamp(54px, 15.4vw, 68px);
  height: clamp(54px, 15.4vw, 68px);
  border: 3px solid var(--ink);
  border-radius: 19px;
  color: #fffdf7;
  font-size: clamp(34px, 9.7vw, 43px);
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 3px 0 rgba(74, 52, 40, 0.18);
  box-shadow:
    inset 0 -5px 0 rgba(74, 52, 40, 0.12),
    inset 0 3px 0 rgba(255, 255, 255, 0.28);
  animation: blockBob 3.6s ease-in-out infinite;
}

.brand-char.b1 {
  background: linear-gradient(160deg, #ff9c8b, #f47767);
  transform: rotate(-5deg);
}

.brand-char.b2 {
  background: linear-gradient(160deg, #ffe384, #ffcc48);
  color: #5d4126;
  text-shadow: 0 3px 0 rgba(255, 255, 255, 0.28);
  transform: rotate(3deg) translateY(-5px);
  animation-delay: -1.2s;
}

.brand-char.b3 {
  background: linear-gradient(160deg, #8ed980, #64b95d);
  transform: rotate(-2deg);
  animation-delay: -2.4s;
}

.brand-tag {
  display: inline-block;
  margin: 12px auto 0;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.64);
  color: #5f6d4e;
  font-size: clamp(11.5px, 3.2vw, 13px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.45;
  backdrop-filter: blur(5px);
}

.hero-stage {
  position: relative;
  flex: 1 1 280px;
  min-height: 190px;
  max-height: 335px;
  margin-top: 2px;
  z-index: 2;
}

.mascot {
  pointer-events: none;
}

.mascot-home {
  position: absolute;
  left: 50%;
  bottom: -2px;
  width: clamp(194px, 57vw, 248px);
  transform: translateX(-50%);
  z-index: 3;
}

.bunny-svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  filter: drop-shadow(0 13px 10px rgba(74, 52, 40, 0.12));
}

.mascot-home .bunny-svg {
  animation: bunnyIdle 4.8s ease-in-out infinite;
}

.bunny-svg .ear-left {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: earWiggleLeft 7.5s ease-in-out infinite;
}

.bunny-svg .ear-right {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: earWiggleRight 8.2s ease-in-out -1.1s infinite;
}

.bunny-svg .eyes {
  transform-box: fill-box;
  transform-origin: center;
  animation: bunnyBlink 5.8s ease-in-out infinite;
}

.bunny-svg .arm-wave {
  transform-box: fill-box;
  transform-origin: 18% 84%;
  animation: armWave 4.4s ease-in-out infinite;
}

.mascot.is-cheer {
  animation: bunnyCheer 0.72s cubic-bezier(0.26, 1.3, 0.4, 1);
}

.mascot.is-cheer .bunny-svg {
  animation: none;
}

.mascot-quiz.is-cheer {
  animation: none;
}

.mascot-quiz.is-cheer .bunny-svg {
  animation: bunnyCheerMini 0.68s cubic-bezier(0.26, 1.3, 0.4, 1);
}

.hero-mound {
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 230px;
  height: 20px;
  border-radius: 50%;
  background: rgba(74, 52, 40, 0.12);
  filter: blur(3px);
  transform: translateX(-50%);
  z-index: 1;
}

.float-char {
  position: absolute;
  z-index: 4;
  display: grid;
  place-items: center;
  width: clamp(47px, 13.5vw, 58px);
  height: clamp(47px, 13.5vw, 58px);
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: #fffaf0;
  box-shadow:
    0 5px 0 rgba(74, 52, 40, 0.15),
    inset 0 -4px 0 rgba(74, 52, 40, 0.05);
  color: var(--ink);
  font-family: var(--font-char);
  font-size: clamp(25px, 7.4vw, 32px);
  font-weight: 700;
  line-height: 1;
  animation: floatBubble 4.5s ease-in-out infinite;
}

.float-char.fc1 {
  top: 14%;
  left: 5%;
  background: #ffefb9;
  transform: rotate(-9deg);
}

.float-char.fc2 {
  top: 9%;
  right: 5%;
  background: #e4dcff;
  transform: rotate(8deg);
  animation-delay: -1.2s;
}

.float-char.fc3 {
  top: 45%;
  left: 1.5%;
  background: #d9f2c9;
  transform: rotate(5deg) scale(0.86);
  animation-delay: -2.4s;
}

.float-char.fc4 {
  top: 48%;
  right: 1.5%;
  background: #d4f0ff;
  transform: rotate(-6deg) scale(0.86);
  animation-delay: -3.3s;
}

.hero-spark {
  position: absolute;
  z-index: 1;
  color: #fff9dc;
  font-size: 19px;
  line-height: 1;
  text-shadow: 0 2px 0 rgba(74, 52, 40, 0.08);
  animation: twinkle 3.9s ease-in-out infinite;
}

.hs1 {
  left: 27%;
  top: 9%;
  font-size: 13px;
}

.hs2 {
  right: 29%;
  top: 35%;
  font-size: 17px;
  animation-delay: -1.7s;
}

.hs3 {
  left: 20%;
  bottom: 20%;
  font-size: 11px;
  animation-delay: -2.6s;
}

.home-bottom {
  position: relative;
  z-index: 4;
  flex: 0 0 auto;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.album-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  width: fit-content;
  margin: 0 2px 9px auto;
  padding: 7px 12px 7px 11px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.88);
  box-shadow: 0 4px 0 rgba(74, 52, 40, 0.16);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 800;
  backdrop-filter: blur(5px);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.album-pill .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}

.album-pill b {
  margin-left: 1px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #f0e4d0;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 900;
}

.album-pill:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(74, 52, 40, 0.16);
}

.level-row {
  display: flex;
  gap: 10px;
  width: 100%;
}

.level-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 141px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px 11px;
  border: 3px solid var(--ink);
  border-radius: 23px;
  background:
    radial-gradient(circle at 90% 7%, rgba(255, 255, 255, 0.78) 0 16px, transparent 17px),
    linear-gradient(155deg, #fffdf7, var(--card-bg, #fff3d6));
  box-shadow:
    0 6px 0 rgba(74, 52, 40, 0.2),
    0 10px 16px rgba(74, 52, 40, 0.09),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  text-align: left;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.2s ease;
}

.level-card::after {
  content: "";
  position: absolute;
  right: -19px;
  bottom: -28px;
  width: 93px;
  height: 93px;
  border-radius: 50%;
  background: var(--card-tint, rgba(123, 201, 111, 0.26));
  z-index: 0;
}

.level-card:not(.is-locked):active {
  transform: translateY(4px) scale(0.99);
  box-shadow:
    0 2px 0 rgba(74, 52, 40, 0.2),
    0 4px 8px rgba(74, 52, 40, 0.08);
}

.level-card.is-locked {
  filter: saturate(0.5);
  opacity: 0.82;
  cursor: default;
}

.level-card.is-primary {
  border-color: #3f6f43;
  background:
    radial-gradient(circle at 90% 7%, rgba(255, 255, 255, 0.8) 0 16px, transparent 17px),
    linear-gradient(155deg, #fffdf7, var(--card-bg, #fff3d6));
  box-shadow:
    0 6px 0 #b6a079,
    0 12px 18px rgba(74, 52, 40, 0.12),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
}

.level-card.map-card {
  background:
    radial-gradient(circle at 90% 7%, rgba(255, 255, 255, 0.8) 0 16px, transparent 17px),
    linear-gradient(155deg, #fffdf7, #e9f5f0);
}

.level-card.map-card .level-cta {
  color: #2f8e84;
}

.level-card.map-card::after {
  background: rgba(93, 187, 239, 0.16);
}

.level-card-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  z-index: 2;
  padding: 3px 7px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  color: var(--ink);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
  transform: rotate(3deg);
}

.level-card.map-card .level-art {
  background: rgba(224, 244, 239, 0.86);
}

.level-card.is-review-card {
  background:
    radial-gradient(circle at 90% 7%, rgba(255, 255, 255, 0.82) 0 16px, transparent 17px),
    linear-gradient(155deg, #fffdf7, #fff0d4);
}

.level-art .icon {
  width: 28px;
  height: 28px;
  stroke-width: 2;
}

.level-art {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 45px;
  height: 45px;
  margin-bottom: 3px;
  padding: 3px;
  border-radius: 15px;
  background: rgba(255, 253, 247, 0.68);
  box-shadow: inset 0 0 0 2px rgba(74, 52, 40, 0.08);
  font-size: 27px;
  line-height: 1;
}

.level-art-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.level-done-stamp {
  position: absolute;
  top: -6px;
  right: -9px;
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--leaf);
  color: #fff;
}

.level-done-stamp .icon {
  width: 12px;
  height: 12px;
  stroke-width: 3;
}

.level-name {
  position: relative;
  z-index: 1;
  color: var(--ink);
  font-size: clamp(16px, 4.5vw, 18px);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.3;
}

.level-words {
  position: relative;
  z-index: 1;
  margin-top: 1px;
  color: var(--ink-soft);
  font-family: var(--font-char);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.4;
}

.level-cta {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: auto;
  padding-top: 5px;
  color: var(--level-accent, var(--leaf-deep));
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.02em;
}

.level-cta .icon {
  width: 14px;
  height: 14px;
  stroke-width: 2.8;
}

.level-cta .lock-mini {
  width: 12px;
  height: 12px;
}

.home-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 9px 0 0;
  color: rgba(74, 52, 40, 0.61);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.note-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--leaf-deep);
}

/* ---------------------------------------------------------
   认字卡
   --------------------------------------------------------- */

.screen-learn {
  align-items: center;
  padding-top: calc(64px + env(safe-area-inset-top));
}

.learn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 360px;
  gap: 10px;
  flex: 0 0 auto;
}

.dots {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.6);
  backdrop-filter: blur(5px);
}

.dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(74, 52, 40, 0.17);
  transition: width 0.25s ease, background 0.25s ease;
}

.dot.is-active {
  width: 22px;
  background: var(--coral);
}

.dot.is-done {
  background: var(--leaf-deep);
}

.word-card-shell {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
  padding: 9px 0 11px;
}

.word-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: min(100%, 338px);
  height: 100%;
  max-height: 442px;
  min-height: 315px;
  overflow: hidden;
  padding: 20px 20px 17px;
  border: 3.5px solid var(--ink);
  border-radius: 32px;
  background:
    radial-gradient(circle at 18% 10%, rgba(255, 255, 255, 0.75) 0 3px, transparent 4px) 0 0 / 26px 26px,
    linear-gradient(175deg, #fffdf6 0%, #fff7e6 100%);
  box-shadow:
    0 10px 0 #e7d4b5,
    0 20px 30px rgba(74, 52, 40, 0.11),
    inset 0 2px 0 rgba(255, 255, 255, 0.85);
  color: var(--ink);
  text-align: center;
  transition: transform 0.17s ease, box-shadow 0.17s ease;
}

.word-card::before {
  content: "";
  position: absolute;
  top: -118px;
  left: -44px;
  right: -44px;
  height: 270px;
  border-radius: 50%;
  background: var(--word-color, #ffd45a);
  opacity: 0.23;
  z-index: 0;
}

.word-card:active {
  transform: translateY(3px) scale(0.995);
  box-shadow:
    0 6px 0 #e7d4b5,
    0 12px 20px rgba(74, 52, 40, 0.1);
}

.word-card.is-popping {
  animation: cardPop 0.46s cubic-bezier(0.22, 1.3, 0.36, 1);
}

.word-card > * {
  position: relative;
  z-index: 1;
}

.card-corner {
  position: absolute;
  content: "";
  top: 15px;
  left: 15px;
  width: 35px;
  height: 35px;
  border-top: 3px solid rgba(74, 52, 40, 0.14);
  border-left: 3px solid rgba(74, 52, 40, 0.14);
  border-radius: 12px 0 0 0;
  z-index: 0;
}

.card-spark {
  position: absolute;
  z-index: 0;
  color: var(--word-color, var(--sun));
  font-size: 19px;
  opacity: 0.8;
}

.card-spark.cs1 {
  top: 34px;
  right: 38px;
  animation: twinkle 3.7s ease-in-out infinite;
}

.card-spark.cs2 {
  bottom: 65px;
  left: 34px;
  font-size: 12px;
  animation: twinkle 4.9s ease-in-out -1.4s infinite;
}

.word-pic {
  display: grid;
  place-items: center;
  width: 98px;
  height: 98px;
  margin-bottom: 1px;
  padding: 10px;
  border: 2.5px solid rgba(74, 52, 40, 0.13);
  border-radius: 50%;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 255, 255, 0.98) 0 20%, transparent 21%),
    linear-gradient(rgba(255, 252, 243, 0.7), rgba(255, 252, 243, 0.7)),
    var(--word-color, #ffd45a);
  box-shadow:
    inset 0 -6px 0 rgba(74, 52, 40, 0.05),
    0 4px 0 rgba(74, 52, 40, 0.06);
  font-size: 58px;
  line-height: 1;
  animation: picFloat 3.8s ease-in-out infinite;
}

.art-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.word-pinyin {
  margin-top: 8px;
  color: var(--ink-soft);
  font-family: "Trebuchet MS", var(--font-round);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.14em;
  line-height: 1.2;
}

.word-char {
  margin: -2px 0 0;
  color: var(--ink);
  font-family: var(--font-char);
  font-size: clamp(104px, 18.5vh, 152px);
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.05;
  text-shadow: 0 5px 0 rgba(74, 52, 40, 0.055);
}

.word-word {
  margin-top: 1px;
  color: var(--ink);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0.12em;
  line-height: 1.3;
}

.word-phrase {
  margin-top: 8px;
  padding: 5px 13px;
  border-radius: 999px;
  background: rgba(74, 52, 40, 0.07);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.word-listen {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 9px;
  color: rgba(74, 52, 40, 0.46);
  font-size: 10.5px;
  font-weight: 700;
}

.word-listen .icon {
  width: 13px;
  height: 13px;
  stroke-width: 2.5;
}

.learn-actions {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  width: min(100%, 338px);
  gap: 5px;
}

.learn-actions .btn-primary {
  width: 100%;
  max-width: 300px;
  min-height: 56px;
  font-size: 19px;
}

.learn-tip {
  margin: 2px 0 0;
  color: rgba(74, 52, 40, 0.46);
  font-size: 10.5px;
  font-weight: 700;
}

/* ---------------------------------------------------------
   闯关
   --------------------------------------------------------- */

.screen-quiz {
  padding-top: calc(62px + env(safe-area-inset-top));
}

.quiz-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  flex: 0 0 auto;
  width: fit-content;
  margin: 0 auto;
  padding: 6px 11px;
  border: 2px solid rgba(74, 52, 40, 0.11);
  border-radius: 999px;
  background: rgba(255, 252, 243, 0.78);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.08);
  backdrop-filter: blur(5px);
}

.stars {
  display: flex;
  align-items: center;
  gap: 2px;
}

.progress-star {
  width: 25px;
  height: 25px;
  color: rgba(74, 52, 40, 0.15);
  transition: color 0.25s ease, transform 0.25s ease;
}

.progress-star svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: currentColor;
  stroke: rgba(74, 52, 40, 0.24);
  stroke-width: 1.2;
  stroke-linejoin: round;
}

.progress-star.is-filled {
  color: var(--sun);
  animation: starPop 0.58s cubic-bezier(0.2, 1.6, 0.3, 1);
}

.progress-star.is-filled svg {
  stroke: var(--ink);
  stroke-width: 1.5;
  filter: drop-shadow(0 2px 0 rgba(157, 112, 25, 0.25));
}

.quiz-count {
  margin-left: 2px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.03em;
}

.quiz-prompt-zone {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  flex: 0 0 auto;
  width: 100%;
  min-height: 147px;
  margin: 9px auto 0;
}

.mascot-quiz {
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  width: 112px;
  margin-right: -12px;
  margin-bottom: 1px;
}

.mascot-quiz .bunny-svg {
  animation: bunnyIdle 5.4s ease-in-out -1.8s infinite;
}

.prompt-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 11px;
  max-width: 258px;
  min-height: 102px;
  margin-bottom: 25px;
  padding: 12px 13px;
  border: 3px solid var(--ink);
  border-radius: 23px;
  background: var(--paper);
  box-shadow:
    0 5px 0 rgba(74, 52, 40, 0.17),
    inset 0 2px 0 rgba(255, 255, 255, 0.7);
  color: var(--ink);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease;
}

.prompt-card::before {
  content: "";
  position: absolute;
  left: -11px;
  bottom: 18px;
  width: 20px;
  height: 20px;
  border-bottom: 3px solid var(--ink);
  border-left: 3px solid var(--ink);
  border-radius: 0 0 0 5px;
  background: var(--paper);
  transform: rotate(45deg);
}

.prompt-card:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 rgba(74, 52, 40, 0.17);
}

.prompt-card.is-bonus {
  background: #fff7d8;
}

.prompt-card.is-bonus::before {
  background: #fff7d8;
}

.prompt-pic {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 61px;
  height: 61px;
  padding: 6px;
  border-radius: 50%;
  background: #fff1c9;
  box-shadow: inset 0 0 0 2px rgba(74, 52, 40, 0.09);
  font-size: 36px;
  line-height: 1;
}

.prompt-pic .art-svg {
  width: 100%;
  height: 100%;
}

.prompt-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
}

.prompt-kicker {
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.prompt-word {
  margin-top: 1px;
  color: var(--ink);
  font-size: clamp(21px, 5.8vw, 25px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.35;
  white-space: nowrap;
}

.prompt-replay {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
  color: var(--coral-deep);
  font-size: 10px;
  font-weight: 900;
}

.prompt-replay .icon {
  width: 12px;
  height: 12px;
  stroke-width: 2.6;
}

.prompt-wave {
  position: absolute;
  right: 11px;
  bottom: 11px;
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 14px;
  opacity: 0;
}

.prompt-wave.is-active {
  opacity: 1;
}

.prompt-wave i {
  display: block;
  width: 2.5px;
  border-radius: 999px;
  background: var(--coral);
  animation: waveBar 0.7s ease-in-out infinite alternate;
}

.prompt-wave i:nth-child(1) {
  height: 7px;
}

.prompt-wave i:nth-child(2) {
  height: 13px;
  animation-delay: -0.25s;
}

.prompt-wave i:nth-child(3) {
  height: 9px;
  animation-delay: -0.45s;
}

.quiz-options-wrap {
  width: 100%;
  max-width: 424px;
  margin: auto auto 0;
  padding-top: 8px;
}

.options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  width: 100%;
}

.option-card {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 0.79;
  min-height: 103px;
  overflow: hidden;
  border: 3px solid var(--ink);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent 40%),
    linear-gradient(160deg, #fffdf7, #fff2d7);
  box-shadow:
    0 6px 0 #dcc7a4,
    0 10px 16px rgba(74, 52, 40, 0.1),
    inset 0 2px 0 rgba(255, 255, 255, 0.8);
  color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
  animation: optionIn 0.42s cubic-bezier(0.22, 1.1, 0.34, 1) backwards;
  animation-delay: calc(var(--i, 0) * 65ms);
}

.option-card::before {
  content: "";
  position: absolute;
  top: -20px;
  left: 15%;
  width: 70%;
  height: 43px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.74);
  transform: rotate(-3deg);
}

.option-card::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 2px dashed rgba(74, 52, 40, 0.11);
  border-radius: 14px;
  pointer-events: none;
}

.option-card:active:not(:disabled) {
  transform: translateY(4px) scale(0.985);
  box-shadow:
    0 2px 0 #dcc7a4,
    0 4px 8px rgba(74, 52, 40, 0.08);
}

.option-glyph {
  position: relative;
  z-index: 1;
  padding-bottom: 2px;
  font-family: var(--font-char);
  font-size: clamp(58px, 16vw, 82px);
  font-weight: 700;
  line-height: 1;
}

.option-card.is-correct {
  background: linear-gradient(160deg, #fff9c9, #ffe173);
  border-color: #3b713f;
  box-shadow:
    0 6px 0 #c39c25,
    0 0 0 6px rgba(255, 212, 90, 0.3),
    0 12px 22px rgba(157, 112, 25, 0.16);
  animation: correctPop 0.58s cubic-bezier(0.2, 1.4, 0.4, 1);
}

.option-card.is-correct .option-glyph {
  color: #365f31;
}

.option-card.is-wrong {
  animation: optionShake 0.4s ease;
  background: #f1ebe2;
}

.option-card.is-dim {
  opacity: 0.42;
  filter: grayscale(0.45);
}

.option-card.is-hint {
  background: linear-gradient(160deg, #fffdf2, #fff0b5);
  box-shadow:
    0 6px 0 #dcc7a4,
    0 0 0 5px rgba(255, 210, 80, 0.36),
    0 10px 20px rgba(157, 112, 25, 0.1);
  animation: hintPulse 1.1s ease-in-out infinite;
}

.quiz-hint {
  min-height: 17px;
  margin: 8px 0 0;
  color: rgba(74, 52, 40, 0.54);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-align: center;
}

/* ---------------------------------------------------------
   完成页
   --------------------------------------------------------- */

.screen-done {
  align-items: center;
  justify-content: center;
  padding-top: calc(67px + env(safe-area-inset-top));
  padding-bottom: calc(15px + env(safe-area-inset-bottom));
  overflow-y: auto;
}

.done-shell {
  position: relative;
  display: flex;
  flex: 0 1 auto;
  flex-direction: column;
  align-items: center;
  width: min(100%, 356px);
  max-height: 100%;
  padding: 20px 18px 15px;
  border: 3px solid var(--ink);
  border-radius: 31px;
  background:
    radial-gradient(circle at 14% 20%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px) 0 0 / 28px 28px,
    linear-gradient(170deg, #fffdf5, #fff4dc);
  box-shadow:
    0 10px 0 rgba(74, 52, 40, 0.16),
    0 22px 38px rgba(74, 52, 40, 0.15),
    inset 0 2px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
  animation: doneIn 0.55s cubic-bezier(0.2, 1.1, 0.32, 1) both;
}

.done-shell::before {
  content: "";
  position: absolute;
  top: -12px;
  left: 50%;
  width: 86px;
  height: 24px;
  border: 2px solid rgba(74, 52, 40, 0.12);
  border-radius: 4px;
  background: rgba(255, 239, 177, 0.86);
  transform: translateX(-50%) rotate(-2deg);
  box-shadow: 0 2px 4px rgba(74, 52, 40, 0.06);
}

.done-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
}

#done-title {
  margin: 0;
  color: var(--ink);
  font-size: clamp(25px, 7vw, 31px);
  font-weight: 900;
  letter-spacing: 0.02em;
  line-height: 1.25;
}

.sticker-medal {
  position: relative;
  display: grid;
  place-items: center;
  width: 168px;
  height: 168px;
  margin: 15px auto 43px;
  flex: 0 0 auto;
}

.medal-rays {
  position: absolute;
  inset: -25px;
  border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 208, 82, 0.72) 0deg 9deg, transparent 9deg 24deg);
  -webkit-mask: radial-gradient(circle, transparent 47%, #000 48%);
  mask: radial-gradient(circle, transparent 47%, #000 48%);
  opacity: 0.85;
  animation: slowSpin 26s linear infinite;
}

.medal-ring {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 148px;
  height: 148px;
  border: 4px solid var(--ink);
  border-radius: 50%;
  background: linear-gradient(145deg, #fff8cc, #ffd659);
  box-shadow:
    0 8px 0 #d2a025,
    0 13px 22px rgba(157, 112, 25, 0.18),
    inset 0 7px 0 rgba(255, 255, 255, 0.62);
  animation: medalPop 0.85s cubic-bezier(0.18, 1.3, 0.34, 1) both;
}

#done-sticker {
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  padding: 5px;
  border: 3px solid rgba(74, 52, 40, 0.14);
  border-radius: 50%;
  background: #fff8e7;
  box-shadow: inset 0 -4px 0 rgba(74, 52, 40, 0.05);
  font-size: 75px;
  line-height: 1;
  filter: drop-shadow(0 5px 2px rgba(74, 52, 40, 0.1));
}

#done-sticker .sticker-art {
  display: block;
  width: 100%;
  height: 100%;
}

.medal-ribbon {
  position: absolute;
  bottom: -8px;
  left: 50%;
  z-index: 2;
  padding: 6px 15px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 4px 0 #c65b4c;
  color: #fffdf7;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.2;
  white-space: nowrap;
  transform: translateX(-50%) rotate(-2deg);
}

.done-stars {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  margin: 5px 0 2px;
  color: var(--sun);
}

.done-stars svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: currentColor;
  stroke: var(--ink);
  stroke-width: 1.2;
  stroke-linejoin: round;
  filter: drop-shadow(0 2px 0 #d2a025);
  animation: starPop 0.5s cubic-bezier(0.2, 1.5, 0.3, 1) backwards;
}

.done-copy {
  margin: 4px 0 7px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}

.done-copy strong {
  display: inline-block;
  margin: 0 2px;
  color: var(--coral-deep);
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  vertical-align: -1px;
}

.done-chars {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 0 11px;
}

.done-char {
  display: grid;
  place-items: center;
  width: 56px;
  height: 62px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: var(--paper);
  box-shadow: 0 4px 0 rgba(74, 52, 40, 0.15);
  color: var(--ink);
  font-family: var(--font-char);
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.done-char:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(74, 52, 40, 0.15);
}

.done-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: min(100%, 292px);
  gap: 7px;
  margin-top: auto;
}

.done-actions .btn-primary {
  width: 100%;
  min-height: 51px;
  font-size: 17px;
}

/* ---------------------------------------------------------
   字卡册弹窗
   --------------------------------------------------------- */

.modal {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 13px;
}

.modal[hidden] {
  display: none;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(49, 37, 29, 0.44);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.25s ease;
}

.album-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 425px;
  max-height: calc(100% - 8px);
  overflow-y: auto;
  padding: 17px 17px calc(12px + env(safe-area-inset-bottom));
  border: 3px solid var(--ink);
  border-radius: 29px 29px 22px 22px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px) 0 0 / 27px 27px,
    linear-gradient(175deg, #fffdf6, #fff4df);
  box-shadow:
    0 -8px 0 rgba(74, 52, 40, 0.14),
    0 22px 50px rgba(38, 27, 20, 0.24);
  animation: sheetUp 0.36s cubic-bezier(0.22, 1.05, 0.34, 1);
  overscroll-behavior: contain;
}

.album-panel::-webkit-scrollbar {
  width: 0;
}

.album-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.album-head h2 {
  margin: 4px 0 0;
  color: var(--ink);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.2;
}

.album-head .icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 13px;
}

.album-tip {
  margin: 2px 0 12px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
}

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

.album-char {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 77px;
  padding: 6px 4px 5px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(160deg, #fffdf7, #fff1d6);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.13);
  color: var(--ink);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.album-char:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.13);
}

.album-char .album-glyph {
  font-family: var(--font-char);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

.album-char .album-word {
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 800;
  line-height: 1.2;
}

.album-char.is-locked {
  border-style: dashed;
  border-color: rgba(74, 52, 40, 0.25);
  background: rgba(255, 252, 244, 0.45);
  box-shadow: none;
  color: rgba(74, 52, 40, 0.2);
}

.album-char.is-locked .album-word {
  color: rgba(74, 52, 40, 0.25);
}

.album-char.just-learned::after {
  content: "NEW";
  position: absolute;
  top: -6px;
  right: -4px;
  padding: 1px 4px;
  border: 1.5px solid var(--ink);
  border-radius: 6px;
  background: var(--coral);
  color: #fff;
  font-family: var(--font-round);
  font-size: 7px;
  font-weight: 900;
  letter-spacing: 0.03em;
  transform: rotate(6deg);
}

.album-sticker-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 15px 1px 7px;
}

.album-sticker-head h3 {
  margin: 0;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.album-sticker-head span {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 800;
}

.sticker-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sticker-slot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 7px 9px;
  border: 2.5px dashed rgba(74, 52, 40, 0.22);
  border-radius: 16px;
  background: rgba(255, 252, 244, 0.48);
  color: rgba(74, 52, 40, 0.32);
  font-size: 10px;
  font-weight: 800;
  text-align: left;
}

.sticker-slot.is-collected {
  border-style: solid;
  border-color: var(--ink);
  background: linear-gradient(150deg, #fffbea, #fff0c4);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.12);
  color: var(--ink-soft);
}

.sticker-slot .slot-emoji {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(74, 52, 40, 0.07);
  color: rgba(74, 52, 40, 0.35);
  font-size: 25px;
  filter: grayscale(1);
  opacity: 0.45;
}

.sticker-slot .slot-emoji .icon {
  width: 16px;
  height: 16px;
}

.sticker-slot .slot-emoji .sticker-art {
  display: block;
  width: 34px;
  height: 34px;
}

.sticker-slot.is-collected .slot-emoji {
  background: #ffe49a;
  filter: none;
  opacity: 1;
}

.sticker-slot .slot-name {
  display: block;
  font-size: 11.5px;
  font-weight: 900;
  line-height: 1.3;
}

.sticker-slot .slot-state {
  display: block;
  margin-top: 1px;
  font-size: 8.5px;
  font-weight: 700;
  opacity: 0.65;
}

.album-note {
  margin: 9px 0 0;
  color: rgba(74, 52, 40, 0.4);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
}

.album-reset {
  display: block;
  margin: 7px auto 0;
  padding: 4px 8px;
  color: rgba(74, 52, 40, 0.34);
  font-size: 9px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ---------------------------------------------------------
   小岛地图
   --------------------------------------------------------- */

.map-panel,
.parent-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  max-height: calc(100% - 6px);
  overflow-y: auto;
  padding: 17px 16px calc(14px + env(safe-area-inset-bottom));
  border: 3px solid var(--ink);
  border-radius: 29px 29px 22px 22px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px) 0 0 / 27px 27px,
    linear-gradient(175deg, #fffdf6, #fff4df);
  box-shadow:
    0 -8px 0 rgba(74, 52, 40, 0.14),
    0 22px 50px rgba(38, 27, 20, 0.24);
  animation: sheetUp 0.36s cubic-bezier(0.22, 1.05, 0.34, 1);
  overscroll-behavior: contain;
}

.map-panel::-webkit-scrollbar,
.parent-panel::-webkit-scrollbar,
.gate-panel::-webkit-scrollbar {
  width: 0;
}

.map-tip {
  margin: 4px 1px 12px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.5;
}

.map-tip strong {
  color: var(--coral-deep);
  font-size: 15px;
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.map-level {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  min-height: 108px;
  padding: 9px 10px 8px;
  border: 2.5px solid var(--ink);
  border-radius: 17px;
  background:
    radial-gradient(circle at 95% 4%, rgba(255, 255, 255, 0.82) 0 14px, transparent 15px),
    linear-gradient(155deg, #fffdf7, var(--tint, #fff1d4));
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.14);
  color: var(--ink);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.2s ease;
}

.map-level:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.14);
}

.map-level.is-locked {
  opacity: 0.58;
  filter: saturate(0.5);
}

.map-level.is-current {
  box-shadow:
    0 0 0 3px var(--sun),
    0 4px 0 rgba(74, 52, 40, 0.16);
}

.map-level-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 5px;
}

.map-icon {
  display: grid;
  place-items: center;
  width: 35px;
  height: 35px;
  flex: 0 0 auto;
  padding: 2px;
  border-radius: 11px;
  background: rgba(255, 253, 247, 0.7);
  box-shadow: inset 0 0 0 1.5px rgba(74, 52, 40, 0.08);
}

.map-icon svg {
  display: block;
  width: 100%;
  height: 100%;
}

.map-status {
  padding: 3px 6px;
  border-radius: 999px;
  background: rgba(74, 52, 40, 0.08);
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 900;
  white-space: nowrap;
}

.map-level.is-current .map-status {
  background: var(--sun);
  color: var(--ink);
}

.map-level.is-complete .map-status {
  background: #d8efc7;
  color: #3f6f43;
}

.map-level.is-locked .map-status {
  background: rgba(74, 52, 40, 0.09);
}

.map-name {
  display: block;
  width: 100%;
  margin-top: 5px;
  overflow: hidden;
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 900;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-words {
  display: block;
  width: 100%;
  margin-top: 1px;
  overflow: hidden;
  color: var(--ink-soft);
  font-family: var(--font-char);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-meta {
  display: block;
  width: 100%;
  margin-top: auto;
  padding-top: 4px;
  color: var(--level-accent, var(--leaf-deep));
  font-size: 8.5px;
  font-weight: 900;
}

.review-start {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 9px;
  margin-top: 11px;
  padding: 9px 11px;
  border: 2.5px dashed rgba(74, 52, 40, 0.3);
  border-radius: 17px;
  background: rgba(255, 252, 244, 0.6);
  color: rgba(74, 52, 40, 0.42);
  text-align: left;
}

.review-start.is-ready {
  border-style: solid;
  border-color: var(--ink);
  background: linear-gradient(150deg, #fffbea, #fff0c7);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.13);
  color: var(--ink);
}

.review-start.is-ready:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.13);
}

.review-icon {
  display: grid;
  place-items: center;
  width: 39px;
  height: 39px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 50%;
  background: rgba(74, 52, 40, 0.06);
}

.review-icon svg {
  display: block;
  width: 32px;
  height: 32px;
}

.review-copy {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.review-copy b {
  font-size: 13px;
  font-weight: 900;
}

.review-copy small {
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.review-start > .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.map-home {
  width: 100%;
  margin-top: 9px;
}

/* ---------------------------------------------------------
   家长验证 / 家长中心
   --------------------------------------------------------- */

.gate-modal {
  align-items: center;
}

.gate-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 345px);
  max-height: calc(100% - 20px);
  overflow-y: auto;
  padding: 18px 17px calc(15px + env(safe-area-inset-bottom));
  border: 3px solid var(--ink);
  border-radius: 27px;
  background:
    radial-gradient(circle at 90% 8%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px) 0 0 / 27px 27px,
    linear-gradient(175deg, #fffdf6, #fff4df);
  box-shadow:
    0 0 0 8px rgba(74, 52, 40, 0.09),
    0 22px 50px rgba(38, 27, 20, 0.24);
  animation: gateIn 0.3s cubic-bezier(0.2, 1.15, 0.32, 1);
}

.gate-explain {
  margin: 3px 0 14px;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.55;
}

.gate-question {
  margin: 4px 0 14px;
  padding: 13px 10px;
  border: 2.5px solid var(--ink);
  border-radius: 19px;
  background: #fff3c7;
  box-shadow: inset 0 -4px 0 rgba(74, 52, 40, 0.06);
  color: var(--ink);
  font-family: "Trebuchet MS", var(--font-round);
  font-size: 31px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-align: center;
}

.gate-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.gate-option {
  min-height: 50px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fffdf7;
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.13);
  color: var(--ink);
  font-family: "Trebuchet MS", var(--font-round);
  font-size: 22px;
  font-weight: 900;
}

.gate-option:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.13);
}

.gate-option.is-wrong {
  background: #f1ebe2;
  animation: optionShake 0.4s ease;
}

.gate-hint {
  margin: 12px 0 0;
  color: rgba(74, 52, 40, 0.42);
  font-size: 9.5px;
  font-weight: 700;
  text-align: center;
}

.parent-panel {
  font-size: 12px;
}

.parent-panel .album-head {
  margin-bottom: 2px;
}

.parent-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 11px;
}

.parent-stat {
  padding: 10px;
  border: 2.5px solid var(--ink);
  border-radius: 16px;
  background: linear-gradient(155deg, #fffdf7, #fff0d2);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.11);
}

.parent-stat span {
  display: block;
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 800;
}

.parent-stat strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  line-height: 1.1;
}

.parent-section {
  margin-top: 16px;
}

.parent-section h3 {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.parent-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.parent-section-head h3 {
  margin-bottom: 7px;
}

.parent-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.parent-kpis div {
  padding: 8px 9px;
  border: 2px solid rgba(74, 52, 40, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.7);
}

.parent-kpis span {
  display: block;
  color: var(--ink-soft);
  font-size: 9px;
  font-weight: 700;
}

.parent-kpis b {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.mastery-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  color: var(--ink-soft);
  font-size: 8px;
  font-weight: 700;
}

.mastery-legend i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 2px;
  border-radius: 50%;
}

.mastery-legend i.new {
  background: #d7d0c7;
}

.mastery-legend i.learning {
  background: #ffd45a;
}

.mastery-legend i.mastered {
  background: #7bc96f;
}

.parent-note {
  margin: 3px 0 8px;
  color: rgba(74, 52, 40, 0.55);
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.5;
}

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

.mastery-char {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 43px;
  padding: 3px;
  border: 2px solid rgba(74, 52, 40, 0.16);
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.55);
  color: rgba(74, 52, 40, 0.24);
  font-family: var(--font-char);
  font-size: 21px;
  font-weight: 700;
  line-height: 1;
}

.mastery-char.is-learning {
  border-color: rgba(157, 112, 25, 0.25);
  background: #fff4c7;
  color: var(--ink);
}

.mastery-char.is-mastered {
  border-color: rgba(63, 111, 67, 0.28);
  background: #ddf2d2;
  color: #355f35;
}

.mastery-char:active:not(:disabled) {
  transform: scale(0.94);
}

.mastery-char:disabled {
  cursor: default;
}

.mastery-char::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #d7d0c7;
}

.mastery-char.is-learning::after {
  background: var(--sun);
}

.mastery-char.is-mastered::after {
  background: var(--leaf-deep);
}

.parent-levels {
  overflow: hidden;
  border: 2px solid rgba(74, 52, 40, 0.12);
  border-radius: 13px;
  background: rgba(255, 253, 247, 0.65);
}

.parent-level-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) auto auto;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border-bottom: 1px solid rgba(74, 52, 40, 0.08);
}

.parent-level-row:last-child {
  border-bottom: 0;
}

.parent-level-row .pl-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parent-level-row .pl-status {
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 700;
  white-space: nowrap;
}

.parent-level-row .pl-score {
  color: var(--coral-deep);
  font-size: 8.5px;
  font-weight: 900;
  white-space: nowrap;
}

.parent-level-row.is-current .pl-name {
  color: var(--coral-deep);
}

.parent-level-row.is-current .pl-status {
  color: var(--coral-deep);
}

.parent-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 15px;
}

.parent-actions .btn {
  flex: 1 1 140px;
  min-height: 43px;
  font-size: 11px;
}

.parent-actions .btn .icon {
  width: 16px;
  height: 16px;
}

.btn.is-danger {
  border-color: rgba(161, 73, 61, 0.55);
  color: #a1493d;
}

.privacy-details {
  margin-top: 12px;
  padding: 9px 10px;
  border: 2px solid rgba(74, 52, 40, 0.12);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.5);
  color: var(--ink-soft);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.6;
}

.privacy-details summary {
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 900;
  cursor: pointer;
}

.privacy-details p {
  margin: 7px 0 0;
}

.parent-version {
  margin: 10px 0 0;
  color: rgba(74, 52, 40, 0.34);
  font-size: 8.5px;
  font-weight: 700;
  text-align: center;
}

.album-parent {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 9px;
  margin-top: 9px;
  padding: 9px 11px;
  border: 2.5px solid var(--ink);
  border-radius: 15px;
  background: rgba(255, 253, 247, 0.72);
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.1);
  color: var(--ink);
  text-align: left;
}

.album-parent .icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
}

.album-parent span {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
}

.album-parent b {
  font-size: 11.5px;
  font-weight: 900;
}

.album-parent small {
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 700;
}

.album-parent .arrow {
  width: 15px;
  height: 15px;
}

.album-parent:active {
  transform: translateY(3px);
  box-shadow: 0 0 0 rgba(74, 52, 40, 0.1);
}

/* ---------------------------------------------------------
   反馈、飘星、粒子
   --------------------------------------------------------- */

.feedback {
  position: absolute;
  top: 45%;
  left: 50%;
  z-index: 55;
  padding: 10px 20px;
  border: 3px solid var(--ink);
  border-radius: 999px;
  background: #fff3b9;
  box-shadow:
    0 5px 0 rgba(74, 52, 40, 0.17),
    0 9px 19px rgba(74, 52, 40, 0.1);
  color: var(--ink);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.25;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(0.68);
}

.feedback.is-show {
  animation: feedbackPop 1.35s cubic-bezier(0.2, 1.2, 0.35, 1) forwards;
}

.feedback.is-gentle {
  background: #fffdf5;
  color: var(--ink-soft);
  font-size: 15px;
}

.toast {
  position: absolute;
  bottom: calc(24px + env(safe-area-inset-bottom));
  left: 50%;
  z-index: 80;
  max-width: 82%;
  padding: 9px 15px;
  border-radius: 999px;
  background: rgba(74, 52, 40, 0.93);
  box-shadow: 0 6px 18px rgba(38, 27, 20, 0.18);
  color: #fffdf6;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity 0.25s ease, transform 0.3s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translate(-50%, 0);
}

#fx {
  position: absolute;
  inset: 0;
  z-index: 50;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.fly-star {
  position: absolute;
  z-index: 60;
  color: var(--sun);
  font-size: 27px;
  font-weight: 900;
  line-height: 1;
  text-shadow:
    0 0 0 var(--ink),
    0 2px 0 rgba(74, 52, 40, 0.2);
  pointer-events: none;
  will-change: transform, opacity;
}

/* ---------------------------------------------------------
   动画
   --------------------------------------------------------- */

@keyframes sunPulse {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 13px rgba(255, 230, 128, 0.27),
      0 0 0 27px rgba(255, 231, 127, 0.1),
      0 8px 30px rgba(224, 163, 36, 0.25);
  }
  50% {
    transform: scale(1.045);
    box-shadow:
      0 0 0 17px rgba(255, 230, 128, 0.25),
      0 0 0 34px rgba(255, 231, 127, 0.08),
      0 10px 34px rgba(224, 163, 36, 0.3);
  }
}

@keyframes cloudDrift {
  from {
    translate: -8px 0;
  }
  to {
    translate: 21px 7px;
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.82) rotate(0deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.14) rotate(12deg);
  }
}

@keyframes blockBob {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -5px;
  }
}

@keyframes floatBubble {
  0%,
  100% {
    translate: 0 0;
  }
  50% {
    translate: 0 -8px;
  }
}

@keyframes bunnyIdle {
  0%,
  100% {
    transform: translateY(0) rotate(-0.5deg);
  }
  50% {
    transform: translateY(-5px) rotate(0.8deg);
  }
}

@keyframes bunnyBlink {
  0%,
  44%,
  48%,
  100% {
    transform: scaleY(1);
  }
  46% {
    transform: scaleY(0.08);
  }
}

@keyframes earWiggleLeft {
  0%,
  86%,
  100% {
    transform: rotate(0deg);
  }
  90% {
    transform: rotate(-4deg);
  }
  94% {
    transform: rotate(2deg);
  }
}

@keyframes earWiggleRight {
  0%,
  84%,
  100% {
    transform: rotate(0deg);
  }
  88% {
    transform: rotate(4deg);
  }
  92% {
    transform: rotate(-2deg);
  }
}

@keyframes armWave {
  0%,
  72%,
  100% {
    transform: rotate(0deg);
  }
  78% {
    transform: rotate(-5deg);
  }
  84% {
    transform: rotate(2deg);
  }
}

@keyframes bunnyCheer {
  0% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
  35% {
    transform: translateX(-50%) translateY(-18px) scale(1.035) rotate(-2deg);
  }
  62% {
    transform: translateX(-50%) translateY(2px) scale(0.985);
  }
  82% {
    transform: translateX(-50%) translateY(-6px) scale(1.012);
  }
  100% {
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

@keyframes bunnyCheerMini {
  0% {
    transform: translateY(0) scale(1) rotate(0);
  }
  35% {
    transform: translateY(-9px) scale(1.04) rotate(-2deg);
  }
  62% {
    transform: translateY(2px) scale(0.985) rotate(1deg);
  }
  82% {
    transform: translateY(-3px) scale(1.01) rotate(0);
  }
  100% {
    transform: translateY(0) scale(1) rotate(0);
  }
}

@keyframes picFloat {
  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }
  50% {
    transform: translateY(-4px) rotate(1.5deg);
  }
}

@keyframes cardPop {
  0% {
    opacity: 0.35;
    transform: translateY(10px) scale(0.95) rotate(-1.2deg);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px) scale(1.012) rotate(0.3deg);
  }
  100% {
    opacity: 1;
    transform: none;
  }
}

@keyframes optionIn {
  from {
    opacity: 0;
    transform: translateY(13px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes correctPop {
  0% {
    transform: scale(1);
  }
  38% {
    transform: scale(1.075) rotate(1deg);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes optionShake {
  0%,
  100% {
    transform: translateX(0);
  }
  20% {
    transform: translateX(-6px) rotate(-1deg);
  }
  40% {
    transform: translateX(5px) rotate(1deg);
  }
  60% {
    transform: translateX(-4px);
  }
  80% {
    transform: translateX(2px);
  }
}

@keyframes hintPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.035);
  }
}

@keyframes starPop {
  0% {
    opacity: 0.3;
    transform: scale(0.4) rotate(-18deg);
  }
  70% {
    opacity: 1;
    transform: scale(1.18) rotate(5deg);
  }
  100% {
    transform: scale(1) rotate(0);
  }
}

@keyframes feedbackPop {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.64) rotate(-3deg);
  }
  16% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.06) rotate(1.5deg);
  }
  30% {
    transform: translate(-50%, -50%) scale(1) rotate(0);
  }
  75% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -58%) scale(0.96);
  }
}

@keyframes sheetUp {
  from {
    opacity: 0.5;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes doneIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes medalPop {
  0% {
    opacity: 0;
    transform: scale(0.45) rotate(-16deg);
  }
  65% {
    opacity: 1;
    transform: scale(1.06) rotate(3deg);
  }
  100% {
    opacity: 1;
    transform: scale(1) rotate(0);
  }
}

@keyframes slowSpin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes waveBar {
  from {
    transform: scaleY(0.4);
  }
  to {
    transform: scaleY(1);
  }
}

@keyframes butterflyFloat {
  0%,
  100% {
    transform: translate(0, 0) rotate(-2deg);
  }
  50% {
    transform: translate(7px, -9px) rotate(4deg);
  }
}

@keyframes gateIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.94);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------------------------------------------------------
   小屏适配
   --------------------------------------------------------- */

@media (max-height: 730px) {
  .screen-home {
    padding-top: calc(56px + env(safe-area-inset-top));
  }

  .brand-tag {
    margin-top: 8px;
    padding: 5px 11px;
  }

  .hero-stage {
    flex-basis: 230px;
    min-height: 165px;
  }

  .mascot-home {
    width: clamp(172px, 49vw, 208px);
  }

  .level-card {
    min-height: 127px;
    padding: 8px 10px 9px;
  }

  .level-art {
    width: 39px;
    height: 39px;
    font-size: 23px;
  }

  .level-name {
    font-size: 16px;
  }

  .level-words {
    font-size: 11px;
    letter-spacing: 0.04em;
    white-space: nowrap;
  }

  .album-pill {
    margin-bottom: 7px;
    padding-top: 6px;
    padding-bottom: 6px;
  }

  .home-note {
    margin-top: 7px;
  }

  .word-card {
    min-height: 290px;
    padding-top: 14px;
    padding-bottom: 13px;
  }

  .word-pic {
    width: 81px;
    height: 81px;
    font-size: 47px;
  }

  .word-pinyin {
    margin-top: 5px;
    font-size: 17px;
  }

  .word-char {
    font-size: clamp(92px, 17vh, 124px);
  }

  .word-listen {
    margin-top: 5px;
  }

  .learn-tip {
    display: none;
  }

  .learn-actions .btn-primary {
    min-height: 51px;
  }

  .screen-quiz {
    padding-top: calc(57px + env(safe-area-inset-top));
  }

  .quiz-prompt-zone {
    min-height: 129px;
  }

  .mascot-quiz {
    width: 95px;
  }

  .prompt-card {
    min-height: 92px;
    margin-bottom: 21px;
    padding: 10px 12px;
  }

  .prompt-pic {
    width: 53px;
    height: 53px;
    font-size: 31px;
  }

  .option-card {
    min-height: 93px;
  }

  .done-shell {
    padding-top: 16px;
  }

  .sticker-medal {
    width: 145px;
    height: 145px;
    margin-top: 12px;
    margin-bottom: 54px;
  }

  .medal-ring {
    width: 128px;
    height: 128px;
  }

  #done-sticker {
    width: 94px;
    height: 94px;
    font-size: 63px;
  }

  .done-char {
    width: 50px;
    height: 55px;
    font-size: 28px;
  }

  .done-copy {
    margin-bottom: 5px;
  }
}

@media (max-height: 620px) {
  .screen {
    padding-top: calc(52px + env(safe-area-inset-top));
    padding-bottom: calc(22px + env(safe-area-inset-bottom));
  }

  .screen-home {
    padding-top: calc(50px + env(safe-area-inset-top));
  }

  .hud {
    padding-top: calc(8px + env(safe-area-inset-top));
  }

  .icon-btn {
    width: 39px;
    height: 39px;
    border-radius: 13px;
  }

  .brand-tag {
    display: none;
  }

  .brand-char {
    width: 49px;
    height: 49px;
    border-radius: 16px;
    font-size: 31px;
  }

  .hero-stage {
    flex-basis: 180px;
    min-height: 135px;
  }

  .mascot-home {
    width: clamp(142px, 42vw, 172px);
  }

  .float-char {
    width: 41px;
    height: 41px;
    font-size: 21px;
  }

  .float-char.fc3,
  .float-char.fc4 {
    top: 39%;
  }

  .home-bottom {
    max-width: 390px;
  }

  .album-pill {
    font-size: 11px;
    padding: 5px 10px;
  }

  .level-card {
    min-height: 112px;
    border-radius: 19px;
  }

  .level-art {
    width: 33px;
    height: 33px;
    font-size: 20px;
    border-radius: 11px;
  }

  .level-name {
    font-size: 15px;
  }

  .level-words {
    font-size: 10.5px;
  }

  .level-cta {
    font-size: 10px;
  }

  .home-note {
    display: none;
  }

  .learn-head {
    max-width: 340px;
  }

  .footnote,
  .learn-tip {
    display: none;
  }

  .word-card {
    max-height: 335px;
    min-height: 260px;
  }

  .word-pic {
    width: 66px;
    height: 66px;
    font-size: 39px;
    margin-bottom: 0;
  }

  .word-pinyin {
    margin-top: 4px;
    font-size: 15px;
  }

  .word-char {
    font-size: clamp(82px, 15.5vh, 106px);
  }

  .word-word {
    font-size: 18px;
  }

  .word-phrase {
    margin-top: 5px;
    padding: 3px 10px;
    font-size: 10.5px;
  }

  .word-listen {
    display: none;
  }

  .learn-actions .btn-primary {
    min-height: 47px;
    font-size: 17px;
  }

  .quiz-prompt-zone {
    min-height: 104px;
    margin-top: 4px;
  }

  .mascot-quiz {
    width: 78px;
    margin-right: -9px;
  }

  .prompt-card {
    min-height: 81px;
    margin-bottom: 17px;
    padding: 8px 10px;
    gap: 8px;
    border-radius: 19px;
  }

  .prompt-pic {
    width: 46px;
    height: 46px;
    font-size: 28px;
  }

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

  .prompt-word {
    font-size: 19px;
  }

  .prompt-replay {
    font-size: 9px;
  }

  .quiz-options-wrap {
    padding-top: 2px;
  }

  .option-card {
    min-height: 77px;
    aspect-ratio: 0.95;
    border-radius: 17px;
  }

  .option-glyph {
    font-size: clamp(48px, 13vw, 65px);
  }

  .quiz-hint {
    margin-top: 5px;
    font-size: 9px;
  }

  .progress-star {
    width: 21px;
    height: 21px;
  }

  .quiz-progress {
    padding: 4px 9px;
  }

  .screen-done {
    justify-content: flex-start;
  }

  .done-shell {
    padding: 12px 12px 10px;
    border-radius: 24px;
  }

  .done-head .screen-kicker {
    display: none;
  }

  .sticker-medal {
    width: 114px;
    height: 114px;
    margin: 9px auto 44px;
  }

  .medal-ring {
    width: 102px;
    height: 102px;
    border-width: 3px;
  }

  #done-sticker {
    width: 81px;
    height: 81px;
    padding: 3px;
    border-width: 2px;
    font-size: 50px;
  }

  .medal-ribbon {
    padding: 4px 11px;
    font-size: 10px;
  }

  .done-stars svg {
    width: 22px;
    height: 22px;
  }

  .done-char {
    width: 44px;
    height: 48px;
    font-size: 25px;
    border-radius: 11px;
  }

  .done-copy {
    font-size: 11px;
  }

  .done-copy strong {
    font-size: 18px;
  }

  .done-actions .btn-primary {
    min-height: 45px;
    font-size: 15px;
  }

  .done-actions .btn-ghost {
    min-height: 37px;
    font-size: 12px;
  }
}

@media (max-height: 530px) {
  .brand-blocks {
    display: none;
  }

  .hero-stage {
    min-height: 115px;
  }

  .mascot-home {
    width: 130px;
  }

  .level-card {
    min-height: 98px;
  }

  .level-art {
    display: none;
  }

  .home-note {
    display: none;
  }

  .word-card {
    min-height: 238px;
  }

  .word-pic {
    display: none;
  }

  .word-pinyin {
    margin-top: 0;
  }

  .sticker-medal {
    margin-bottom: 38px;
  }
}

@media (max-height: 620px) {
  .map-level {
    min-height: 98px;
    padding-top: 7px;
    padding-bottom: 6px;
  }

  .map-icon {
    width: 31px;
    height: 31px;
  }

  .map-name {
    font-size: 12.5px;
  }

  .map-words {
    font-size: 9px;
  }

  .map-meta {
    padding-top: 2px;
  }

  .parent-summary {
    gap: 6px;
  }

  .parent-stat {
    padding: 8px;
  }

  .parent-stat strong {
    font-size: 19px;
  }

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

  .mastery-char {
    min-height: 39px;
    font-size: 19px;
  }

  .parent-actions .btn {
    min-height: 39px;
  }
}

@media (max-width: 359px) {
  .screen {
    padding-left: 14px;
    padding-right: 14px;
  }

  .map-panel,
  .parent-panel,
  .gate-panel {
    padding-left: 13px;
    padding-right: 13px;
  }

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

  .mastery-char {
    min-height: 38px;
    font-size: 18px;
  }

  .hud {
    padding-left: 13px;
    padding-right: 13px;
  }

  .brand-blocks {
    gap: 6px;
  }

  .float-char {
    width: 44px;
    height: 44px;
    font-size: 24px;
  }

  .level-row {
    gap: 8px;
  }

  .level-card {
    padding-left: 9px;
    padding-right: 9px;
  }

  .level-name {
    font-size: 15px;
  }

  .level-words {
    font-size: 10.5px;
    letter-spacing: 0.05em;
  }

  .prompt-card {
    padding-left: 9px;
    padding-right: 9px;
  }

  .prompt-pic {
    width: 50px;
    height: 50px;
    font-size: 31px;
  }

  .mascot-quiz {
    width: 92px;
  }

  .options {
    gap: 7px;
  }

  .option-glyph {
    font-size: 58px;
  }

  .done-shell {
    padding-left: 12px;
    padding-right: 12px;
  }

  .done-char {
    width: 49px;
    height: 56px;
  }
}

@media (min-width: 640px) {
  .screen {
    padding-left: 24px;
    padding-right: 24px;
  }

  .hud {
    padding-left: 21px;
    padding-right: 21px;
  }
}

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

/* ===== v0.4 · 500 字课程 / 25 岛 ===== */
.char-art {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  color: var(--ink);
  font-family: var(--font-char);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}
.level-art .char-art {
  font-size: 25px;
}
.learn-glyph {
  display: block;
}
.listen-art {
  display: block;
  width: 100%;
  height: 100%;
}
.word-pic .listen-art,
.prompt-pic .listen-art {
  width: 100%;
  height: 100%;
}
.word-card.is-advanced .word-pic {
  width: 86px;
  height: 86px;
  padding: 7px;
}
.word-card.is-advanced .word-char {
  font-size: clamp(112px, 20vh, 166px);
}
.word-card.is-advanced .word-word {
  margin-top: 3px;
}
.prompt-card.is-audio-only .prompt-pic {
  background: #fff1c9;
}
.prompt-card.is-audio-only .prompt-word {
  font-size: 19px;
}

.map-grid {
  display: block;
}
.map-unit {
  margin: 0 0 11px;
  padding: 8px 8px 9px;
  border: 2px solid rgba(74, 52, 40, 0.13);
  border-radius: 18px;
  background:
    radial-gradient(circle at 95% 5%, rgba(255, 255, 255, 0.72) 0 18px, transparent 19px),
    linear-gradient(155deg, #fffdf7, var(--unit-tint, #fff5df));
  box-shadow: 0 3px 0 rgba(74, 52, 40, 0.08);
}
.map-unit.is-complete {
  border-color: var(--unit-accent, var(--leaf));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.6), 0 4px 0 rgba(74, 52, 40, 0.10);
}
.map-unit.is-locked {
  opacity: 0.62;
  filter: saturate(0.55);
}
.map-unit-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  padding: 1px 2px 7px;
}
.map-unit-index {
  flex: 0 0 auto;
  color: var(--unit-accent, var(--coral-deep));
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.02em;
}
.map-unit-name {
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-unit-progress {
  margin-left: auto;
  flex: 0 0 auto;
  color: var(--ink-soft);
  font-size: 8.5px;
  font-weight: 800;
  white-space: nowrap;
}
.map-unit-lessons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
}
.map-level.is-compact {
  align-items: center;
  justify-content: center;
  min-height: 64px;
  padding: 5px 3px 4px;
  border-width: 2px;
  border-radius: 12px;
  text-align: center;
}
.map-chip-num {
  display: block;
  width: 100%;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 7.5px;
  font-weight: 900;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-chip-chars {
  display: block;
  width: 100%;
  margin: 3px 0 2px;
  overflow: hidden;
  color: var(--ink);
  font-family: var(--font-char);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}
.map-chip-state {
  display: grid;
  place-items: center;
  width: 100%;
  height: 13px;
  color: var(--leaf-deep, #3f6f43);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}
.map-chip-state .icon {
  width: 11px;
  height: 11px;
}
.map-level.is-locked .map-chip-state {
  color: rgba(74, 52, 40, 0.32);
}
.map-level.is-current .map-chip-state {
  color: var(--coral-deep);
}
.map-level.is-complete .map-chip-state {
  color: var(--leaf-deep, #3f6f43);
}

#done-sticker .unit-medal,
#done-sticker .lesson-badge {
  display: block;
  width: 100%;
  height: 100%;
}
.sticker-slot .slot-emoji .unit-medal {
  display: block;
  width: 34px;
  height: 34px;
}
.album-parent {
  margin-top: 12px;
}
.album-note {
  margin-bottom: 10px;
}

@media (max-height: 620px) {
  .map-level.is-compact {
    min-height: 58px;
  }
}
@media (max-width: 350px) {
  .map-unit {
    padding-left: 6px;
    padding-right: 6px;
  }
  .map-unit-name {
    font-size: 12px;
  }
  .map-unit-lessons {
    gap: 4px;
  }
  .map-level.is-compact {
    min-height: 59px;
    padding-left: 2px;
    padding-right: 2px;
  }
  .map-chip-chars {
    font-size: 14.5px;
  }
}

/* 452 字进阶图标：Twemoji SVG，放在原有奶油圆框里 */
.art-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  -webkit-user-drag: none;
  user-select: none;
}
.word-pic .art-img {
  width: 88%;
  height: 88%;
}
.prompt-pic .art-img {
  width: 100%;
  height: 100%;
}
.level-art .art-img {
  width: 92%;
  height: 92%;
}

/* 首页家长入口 */
.home-quick-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 2px 9px;
}
.home-quick-row .album-pill {
  margin: 0;
  flex: 0 1 auto;
}
.parent-pill {
  background: linear-gradient(150deg, rgba(255, 252, 243, 0.94), rgba(255, 240, 210, 0.9));
}
.parent-pill .icon {
  width: 17px;
  height: 17px;
  stroke-width: 2.2;
}
.parent-pill span {
  white-space: nowrap;
}
@media (max-width: 350px) {
  .home-quick-row {
    gap: 6px;
  }
  .home-quick-row .album-pill {
    padding-left: 9px;
    padding-right: 9px;
    font-size: 11.5px;
  }
  .home-quick-row .album-pill b {
    padding-left: 5px;
    padding-right: 5px;
    font-size: 9.5px;
  }
}
