/* ============================================================
   乐呵学堂 Rex Academy · 全新设计系统 v2
   ------------------------------------------------------------
   设计语言：暖奶油底色 + 学科主题色 + 白色浮起卡片
   自适应：全流式（clamp 尺寸 + auto-fill 网格），
           卡片随窗口大小自动增减列数与缩放，无固定断点死排
   规则：卡片 hover 不位移（阴影/提亮/图标动效），避免裁切
   ============================================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  /* 画布 */
  --bg: #fdf6ec;
  --bg-soft: #fffdf9;
  --ink: #33294a;
  --ink-soft: #756b8f;
  --muted: #a89dc0;
  --line: #f3e8d8;
  --card: #ffffff;

  /* 功能色 */
  --ok: #35b97b;
  --bad: #ef7a7a;
  --sun: #ffc93c;

  /* 学科主题（默认橙 · 数学） */
  --theme: #ff8a3c;
  --theme-deep: #d97517;
  --theme-soft: #fff0de;
  --theme-grad: linear-gradient(140deg, #ffbd58, #ff8a3c);
  --theme-shadow: #e2791f;

  /* 流式半径与间距 */
  --r-lg: clamp(20px, 2.6vw, 30px);
  --r-md: clamp(16px, 2vw, 22px);
  --r-sm: clamp(12px, 1.4vw, 16px);
  --gap: clamp(10px, 1.8vw, 20px);
  --pad: clamp(14px, 2.4vw, 28px);

  /* 字体 */
  --font: "Nunito", "Baloo 2", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* 卡片流式列宽：窗口越大每列越宽、列数自动增多 */
  --card-min: clamp(168px, 24vw, 264px);
}

html {
  -webkit-text-size-adjust: 100%;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden; /* 一屏骨架；内容区内部滚动 */
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-weight: 700;
  color: var(--ink);
  background:
    radial-gradient(90rem 50rem at 110% -10%, #ffe9d2 0%, transparent 60%),
    radial-gradient(70rem 44rem at -20% 110%, #dff5f0 0%, transparent 55%),
    var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

body.no-scroll {
  overflow: hidden;
}

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

ul {
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
}

button {
  font-family: inherit;
}

/* 触屏体验：禁双击缩放延迟、禁文字选区与长按菜单（输入框除外） */
* {
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input,
textarea {
  -webkit-user-select: text;
  user-select: text;
  -webkit-touch-callout: default;
}

:focus-visible {
  outline: 3px solid #7bb8ff;
  outline-offset: 3px;
}

/* ============ 背景浮球 ============ */

.bg-blobs {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.bg-blobs span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.5;
}

.bg-blobs span:nth-child(1) {
  width: 44vmax;
  height: 44vmax;
  top: -18vmax;
  left: -12vmax;
  background: #ffe3c2;
}

.bg-blobs span:nth-child(2) {
  width: 38vmax;
  height: 38vmax;
  right: -12vmax;
  bottom: -16vmax;
  background: #d2f2ec;
}

.bg-blobs span:nth-child(3) {
  width: 24vmax;
  height: 24vmax;
  top: 36%;
  right: 8%;
  background: #ffe1ee;
  opacity: 0.4;
}

/* ============ 顶栏 ============ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(8px, 1.4vw, 14px) clamp(14px, 4vw, 44px);
  background: rgba(253, 246, 236, 0.84);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(243, 232, 216, 0.7);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}

.brand-mark {
  width: clamp(38px, 4.4vw, 46px);
  height: clamp(38px, 4.4vw, 46px);
  flex: 0 0 auto;
  border-radius: clamp(12px, 1.4vw, 15px);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: clamp(19px, 2.2vw, 23px);
  line-height: 1;
  background: linear-gradient(140deg, #ffd257, #ff9a3c);
  box-shadow: 0 4px 0 #e58a2c, 0 8px 18px rgba(229, 138, 44, 0.25);
}

.topbar > .brand-text {
  margin-right: auto;
}

.brand-text b {
  display: block;
  font-size: clamp(15px, 1.8vw, 17px);
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.brand-text small {
  display: block;
  margin-top: 2px;
  font-size: clamp(10px, 1.2vw, 11px);
  font-weight: 800;
  letter-spacing: 0.16em;
  color: #b58755;
}

.gear-btn {
  display: grid;
  place-items: center;
  width: clamp(34px, 4vw, 40px);
  height: clamp(34px, 4vw, 40px);
  margin-right: 4px;
  border: 0;
  border-radius: clamp(11px, 1.3vw, 14px);
  background: #fff;
  font-size: clamp(15px, 1.8vw, 18px);
  cursor: pointer;
  box-shadow: 0 3px 0 #f1e6d5;
  transition: transform 0.15s ease;
}

.gear-btn:hover {
  transform: rotate(22deg);
}

.round-btn {
  flex: 0 0 auto;
  width: clamp(38px, 4.4vw, 44px);
  height: clamp(38px, 4.4vw, 44px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink);
  font-size: clamp(16px, 2vw, 19px);
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 0 rgba(242, 230, 213, 0.9);
  transition: box-shadow 0.12s ease;
}

.round-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 rgba(242, 230, 213, 0.9);
}

/* ============ 内容骨架：全部竖向可滚，一屏放得下就正好一屏 ============ */

.wrap {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: clamp(8px, 1.4vw, 18px) clamp(14px, 3vw, 36px) clamp(12px, 2vw, 22px);
}

.foot {
  flex: 0 0 auto;
  padding: 6px 16px calc(10px + env(safe-area-inset-bottom));
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  color: #a89dc0;
}

/* ============ 首页 ============ */

.home-hero {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: clamp(10px, 2.4vw, 28px);
  padding: clamp(6px, 1.4vw, 16px) 0 clamp(8px, 1.6vw, 18px);
  text-align: center;
}

.hero-mascot {
  position: static;
}

.mascot {
  width: clamp(62px, 8vw, 96px);
  filter: drop-shadow(0 8px 0 rgba(226, 121, 31, 0.1));
  animation: bob 3.4s ease-in-out infinite;
}

.mascot .m-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: blink 4.8s infinite;
}

.home-hero .eyebrow,
.home-hero h1 {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-block;
  padding: 6px 15px;
  border-radius: 999px;
  background: #fff0d8;
  color: #b57331;
  font-size: clamp(10.5px, 1.3vw, 12.5px);
  font-weight: 900;
  letter-spacing: 0.14em;
}

.home-hero h1 {
  width: 100%;
  margin: 0;
  font-size: clamp(23px, 3.8vw, 40px);
  letter-spacing: 0.01em;
}

/* 首页学科卡：auto-fit 网格，窗口大小决定列数与卡宽 */
.subjects {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(clamp(160px, 44vw, 250px), 100%), 1fr));
  gap: var(--gap);
  align-content: start;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 4px;
}

.subject {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.2vw, 12px);
  min-height: fit-content;
  padding: clamp(16px, 2.2vw, 26px);
  border-radius: var(--r-lg);
  color: #fff;
  text-decoration: none;
  background-image: linear-gradient(155deg, #ffc063, #ff8a3c);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.13), 0 22px 40px rgba(226, 121, 31, 0.2);
  transition: box-shadow 0.18s ease, filter 0.18s ease;
}

.subject.en {
  background-image: linear-gradient(155deg, #5addc9, #1fa596);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.13), 0 22px 40px rgba(31, 165, 150, 0.2);
}

.subject.zh {
  background-image: linear-gradient(155deg, #c3a5fa, #8b5cf6);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.13), 0 22px 40px rgba(109, 71, 217, 0.2);
}

.subject.ai {
  background-image: linear-gradient(155deg, #8ab6fa, #3b82f6);
  box-shadow: 0 8px 0 rgba(0, 0, 0, 0.13), 0 22px 40px rgba(59, 130, 246, 0.2);
}

.subject:hover {
  filter: brightness(1.045);
}

.subject:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.13), 0 8px 16px rgba(0, 0, 0, 0.12);
}

.subject::before {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(150px, 18vw, 250px);
  height: clamp(150px, 18vw, 250px);
  right: clamp(-80px, -6vw, -40px);
  top: clamp(-100px, -8vw, -50px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.subject::after {
  content: "";
  position: absolute;
  z-index: -1;
  width: clamp(110px, 13vw, 170px);
  height: clamp(110px, 13vw, 170px);
  left: clamp(-60px, -5vw, -30px);
  bottom: clamp(-80px, -6vw, -40px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}

.subject-no {
  position: absolute;
  top: clamp(10px, 1.6vw, 20px);
  right: clamp(14px, 2vw, 26px);
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.04em;
  opacity: 0.22;
}

.subject-head {
  display: flex;
  align-items: center;
  gap: clamp(9px, 1.2vw, 14px);
}

.subject-icon {
  display: grid;
  place-items: center;
  width: clamp(42px, 4.6vw, 56px);
  height: clamp(42px, 4.6vw, 56px);
  border-radius: clamp(14px, 1.6vw, 20px);
  background: rgba(255, 255, 255, 0.24);
  box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.4);
  font-size: clamp(21px, 2.4vw, 28px);
  transition: transform 0.18s ease;
}

.subject:hover .subject-icon {
  transform: rotate(-8deg) scale(1.1);
}

.subject-title h2 {
  margin: 0;
  font-size: clamp(19px, 2.4vw, 30px);
  letter-spacing: 0.02em;
}

.subject-sub {
  margin-top: 2px;
  font-size: clamp(10.5px, 1.2vw, 12.5px);
  font-weight: 800;
  letter-spacing: 0.1em;
  opacity: 0.9;
}

.subject-chips {
  display: grid;
  gap: 6px;
  margin-top: 2px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.chip-row span {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: clamp(10px, 1.1vw, 11.5px);
  font-weight: 800;
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  white-space: nowrap;
}

.chip-row .chip-tag {
  display: grid;
  place-items: center;
  width: clamp(20px, 2.2vw, 24px);
  height: clamp(20px, 2.2vw, 24px);
  padding: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.32);
  border: 0;
  font-size: 11px;
}

.chip-row.play span:not(.chip-tag) {
  background: transparent;
  border-style: dashed;
}

.subject-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
}

.subject-progress {
  flex: 1;
  height: clamp(6px, 0.8vw, 8px);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
  overflow: hidden;
}

.subject-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: #fff;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.subject-score {
  font-size: clamp(10px, 1.15vw, 11.5px);
  font-weight: 900;
  white-space: nowrap;
}

.subject-cta {
  align-self: flex-start;
  margin-top: 2px;
  padding: clamp(8px, 1vw, 11px) clamp(16px, 2vw, 22px);
  border-radius: 999px;
  background: #fff;
  color: var(--theme-deep);
  font-size: clamp(12.5px, 1.4vw, 14.5px);
  font-weight: 900;
  box-shadow: 0 4px 0 rgba(0, 0, 0, 0.12);
}

.subject.en .subject-cta { color: #14867a; }
.subject.zh .subject-cta { color: #5b3ac9; }
.subject.ai .subject-cta { color: #1d4ed8; }

/* 窄屏：学科卡紧凑化（隐藏清单/编号/按钮，保留图标+标题+进度） */
@media (max-width: 560px) {
  .subject-chips,
  .subject-sub,
  .subject-cta,
  .subject-no {
    display: none;
  }

  .subject {
    padding: clamp(12px, 3.4vw, 16px);
    gap: 6px;
  }

  .subject-icon {
    width: clamp(36px, 9.4vw, 42px);
    height: clamp(36px, 9.4vw, 42px);
    font-size: clamp(18px, 4.6vw, 21px);
  }

  .subject-title h2 {
    font-size: clamp(17px, 4.4vw, 20px);
  }

  .subject-foot {
    margin-top: auto;
  }
}

.home-note {
  flex: 0 0 auto;
  margin: clamp(10px, 1.6vw, 16px) 0 0;
  text-align: center;
  font-size: clamp(10.5px, 1.2vw, 12px);
  font-weight: 800;
  color: #a89dc0;
}

/* 首页装饰：云与星 */
.doodle-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.d-cloud {
  position: absolute;
  opacity: 0.9;
  animation: drift 18s ease-in-out infinite;
}

.d-cloud.c1 {
  top: -4px;
  left: 3%;
  width: clamp(70px, 9vw, 110px);
}

.d-cloud.c2 {
  top: 26px;
  right: 20%;
  width: clamp(50px, 6.4vw, 78px);
  opacity: 0.65;
  animation-delay: -7s;
}

.d-spark {
  position: absolute;
  width: clamp(13px, 1.6vw, 20px);
  fill: #ffd257;
  animation: twinkle 2.8s ease-in-out infinite;
}

.d-spark.s1 { bottom: 4px; left: 10%; }
.d-spark.s2 { top: 6px; right: 34%; animation-delay: -1s; }
.d-spark.s3 { bottom: 2px; right: 8%; width: clamp(11px, 1.3vw, 15px); animation-delay: -2s; }

/* ============ 学科页头部 ============ */

.area-wrap {
  padding-top: clamp(6px, 1vw, 14px);
}

.area-top {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(10px, 2vw, 24px);
  padding: clamp(4px, 1vw, 12px) 0 clamp(4px, 1vw, 10px);
}

.area-top h1 {
  margin: clamp(5px, 0.8vw, 8px) 0 clamp(3px, 0.6vw, 6px);
  font-size: clamp(23px, 3.4vw, 38px);
  letter-spacing: 0.01em;
}

.area-sub {
  font-size: clamp(12px, 1.6vw, 15px);
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-soft);
}

.area-meta {
  margin-top: clamp(5px, 0.8vw, 8px);
  font-size: clamp(10.5px, 1.2vw, 11.5px);
  font-weight: 800;
  color: #a89dc0;
}

.area-mascot {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.area-mascot .mascot {
  width: clamp(52px, 6.4vw, 78px);
  animation-duration: 3.8s;
}

.bubble {
  position: relative;
  padding: 7px 11px;
  border-radius: 14px;
  background: #fff;
  color: var(--theme-deep);
  font-size: clamp(10.5px, 1.2vw, 11.5px);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 3px 0 var(--theme-soft);
}

.bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  border-radius: 2px;
  background: #fff;
  transform: rotate(45deg);
}

/* 进度环 */
.ring {
  --p: 0;
  position: relative;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: clamp(76px, 9vw, 118px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--theme) calc(var(--p) * 1%), #f0e5d6 0);
  transition: background 0.6s ease;
}

.ring::before {
  content: "";
  position: absolute;
  inset: clamp(7px, 0.9vw, 10px);
  border-radius: 50%;
  background: var(--bg);
}

.ring-inner {
  position: relative;
  text-align: center;
  line-height: 1.15;
}

.ring-inner b {
  display: block;
  font-size: clamp(17px, 2.2vw, 27px);
  font-weight: 900;
  color: var(--theme-deep);
}

.ring-inner em {
  display: block;
  font-size: clamp(9.5px, 1.1vw, 11px);
  font-style: normal;
  font-weight: 800;
  color: #a89dc0;
}

.ring-inner small {
  display: block;
  margin-top: 1px;
  font-size: clamp(9px, 1vw, 10.5px);
  font-weight: 800;
  color: #c3b8d0;
}

/* ============ 分区标题 ============ */

.sec-title {
  flex: 0 0 auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: clamp(12px, 2vw, 22px) 0 clamp(8px, 1.2vw, 12px);
  font-size: clamp(16px, 2vw, 21px);
}

.sec-hint {
  font-size: clamp(10px, 1.15vw, 11.5px);
  font-weight: 800;
  color: #a89dc0;
}

/* ============ 模块卡片：auto-fill 流式网格 ============ */

.tile-grid {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(var(--card-min), 100%), 1fr));
  gap: var(--gap);
  align-content: start;
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(5px, 0.8vw, 8px);
  min-height: clamp(150px, 20vw, 190px);
  padding: 0 clamp(12px, 1.4vw, 16px) clamp(10px, 1.3vw, 14px);
  border: 2px solid #f6ecdd;
  border-radius: var(--r-md);
  background: var(--card);
  color: inherit;
  text-decoration: none;
  box-shadow: 0 7px 0 #f1e5d3, 0 16px 30px rgba(120, 90, 60, 0.08);
  cursor: pointer;
  overflow: hidden;
  transition: box-shadow 0.16s ease, filter 0.16s ease;
}

.tile:hover {
  box-shadow: 0 10px 0 #f1e5d3, 0 22px 40px rgba(120, 90, 60, 0.14);
  filter: brightness(1.015);
}

.tile:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #f1e5d3;
}

/* 封面（孩子先看图再看字） */
.tile-cover {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 1vw, 10px);
  height: clamp(58px, 7.4vw, 92px);
  margin: 0 calc(-1 * clamp(12px, 1.4vw, 16px));
  position: relative;
  overflow: hidden;
}

.tile-cover::after {
  content: "";
  position: absolute;
  right: -22px;
  top: -26px;
  width: clamp(54px, 6.4vw, 84px);
  height: clamp(54px, 6.4vw, 84px);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
}

.tile-cover .cv-chip {
  display: grid;
  place-items: center;
  min-width: clamp(32px, 4vw, 50px);
  height: clamp(36px, 4.4vw, 54px);
  padding: 0 8px;
  border-radius: clamp(10px, 1.2vw, 14px);
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 900;
  color: var(--ink);
}

.tile-cover .cv-emoji {
  font-size: clamp(22px, 2.8vw, 36px);
  line-height: 1;
  letter-spacing: 2px;
  filter: drop-shadow(0 3px 2px rgba(0, 0, 0, 0.12));
}

.tile-cover .cv-word {
  padding: clamp(3px, 0.5vw, 6px) clamp(9px, 1.2vw, 16px);
  border-radius: clamp(10px, 1.2vw, 14px);
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
  font-size: clamp(14px, 1.7vw, 20px);
  font-weight: 900;
  color: var(--ink);
}

.tile-cover .cv-op {
  font-size: clamp(16px, 2vw, 26px);
  font-weight: 900;
  color: #fff;
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}

.tile-cover .cv-bubble {
  padding: clamp(5px, 0.7vw, 8px) clamp(9px, 1.2vw, 14px);
  border-radius: 14px 14px 14px 4px;
  background: #fff;
  font-size: clamp(10.5px, 1.3vw, 13.5px);
  font-weight: 900;
  color: var(--ink);
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
}

.tile-cover .cv-bubble.b2 {
  border-radius: 14px 14px 4px 14px;
  background: rgba(255, 255, 255, 0.75);
}

.tile-cover .cv-hanzi {
  display: grid;
  place-items: center;
  width: clamp(36px, 4.4vw, 52px);
  height: clamp(40px, 4.8vw, 58px);
  border-radius: clamp(10px, 1.2vw, 12px);
  background: #fff;
  box-shadow: 0 3px 0 rgba(0, 0, 0, 0.08);
  font-size: clamp(19px, 2.3vw, 27px);
  font-weight: 900;
  color: var(--ink);
}

.tile-cover .cv-mini {
  font-size: clamp(11px, 1.3vw, 14px);
  font-weight: 900;
  color: #fff;
  opacity: 0.95;
}

/* 每个模块自己的封面底色 */
.cv-numbers { background: linear-gradient(135deg, #FFE29A, #FFB25E); }
.cv-counting { background: linear-gradient(135deg, #FFD9C8, #FF9A6B); }
.cv-addsub { background: linear-gradient(135deg, #FFE3B8, #FFC069); }
.cv-bonds { background: linear-gradient(135deg, #D8E7FF, #9DBDF5); }
.cv-ipa { background: linear-gradient(135deg, #DCEBFF, #9CC3F9); }
.cv-ipa .ipa-chip { color: #2563eb; }
.cv-words { background: linear-gradient(135deg, #CFE3FF, #8FB8F9); }
.cv-phonics { background: linear-gradient(135deg, #E4D9FF, #B79CF2); }
.cv-talk { background: linear-gradient(135deg, #D2F3EA, #79D0BE); }
.cv-split { background: linear-gradient(135deg, #FFE8D6, #FFC9A8); }
.cv-line { background: linear-gradient(135deg, #D6F2FF, #9BDBF5); }
.cv-match-m { background: linear-gradient(135deg, #FFF1C9, #FFD980); }
.cv-match-e { background: linear-gradient(135deg, #D9F7E8, #8FE3C0); }

.tile.has-cover {
  padding-top: 0;
}

.tile.has-cover .tile-icon,
.tile-play.has-cover .tile-icon {
  display: none;
}

.tile-icon {
  display: grid;
  place-items: center;
  width: clamp(40px, 4.6vw, 48px);
  height: clamp(40px, 4.6vw, 48px);
  margin-top: clamp(10px, 1.3vw, 14px);
  border-radius: clamp(13px, 1.5vw, 16px);
  background: var(--theme-soft);
  font-size: clamp(20px, 2.4vw, 25px);
  transition: transform 0.18s ease;
}

.tile:hover .tile-icon {
  transform: rotate(-8deg) scale(1.12);
}

.tile h3 {
  height: 25px;
  line-height: 25px;
  margin-top: clamp(6px, 1vw, 10px);
  font-size: clamp(15px, 1.8vw, 17.5px);
  letter-spacing: 0.01em;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tile p {
  font-size: clamp(11px, 1.25vw, 12.5px);
  font-weight: 700;
  line-height: 1.45;
  color: var(--ink-soft);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tile-bar {
  height: clamp(8px, 1vw, 10px);
  margin-top: clamp(3px, 0.5vw, 6px);
  border-radius: 999px;
  background: #f4eee4;
  overflow: hidden;
}

.tile-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme), #ffc93c);
  transition: width 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.tile-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: clamp(24px, 2.6vw, 28px);
  margin-top: clamp(3px, 0.5vw, 6px);
  font-size: clamp(10.5px, 1.2vw, 11.5px);
  font-weight: 800;
  color: var(--ink-soft);
}

.tile-meta b {
  font-size: clamp(11.5px, 1.3vw, 13px);
  color: var(--ink);
}

.tile-go {
  flex: 0 0 auto;
  padding: clamp(4px, 0.6vw, 6px) clamp(10px, 1.3vw, 14px);
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
  font-size: clamp(10.5px, 1.2vw, 12px);
  font-weight: 900;
  box-shadow: 0 3px 0 var(--theme-deep);
  white-space: nowrap;
}

.tile-play .tile-go {
  background: #fff;
  color: var(--theme-deep);
  box-shadow: 0 3px 0 var(--theme-soft), inset 0 0 0 2px var(--theme-soft);
}

.tile-play {
  background-image: linear-gradient(180deg, #fff 40%, var(--theme-soft));
  border: 2px dashed rgba(0, 0, 0, 0.07);
}

.tile-play::after {
  content: "玩";
  position: absolute;
  top: clamp(8px, 1vw, 12px);
  right: clamp(8px, 1vw, 12px);
  padding: 3px 9px;
  border-radius: 999px;
  background: #fff;
  color: var(--theme-deep);
  font-size: 10.5px;
  font-weight: 900;
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.06);
}

.tile-play .tile-meta {
  margin-top: auto;
}

.tile.played .tile-icon {
  box-shadow: inset 0 0 0 2px var(--theme);
}

/* 学科主题色（data-area） */
body[data-area="en"] {
  --theme: #1fa596;
  --theme-deep: #14867a;
  --theme-soft: #e2f8f4;
  --theme-grad: linear-gradient(150deg, #4bd3c0, #1fa596);
  --theme-shadow: #17877c;
}

body[data-area="zh"] {
  --theme: #8b5cf6;
  --theme-deep: #6d47d9;
  --theme-soft: #f1eafe;
  --theme-grad: linear-gradient(150deg, #b18cf5, #8b5cf6);
  --theme-shadow: #6d47d9;
}

body[data-area="ai"] {
  --theme: #3b82f6;
  --theme-deep: #2563eb;
  --theme-soft: #e3edff;
  --theme-grad: linear-gradient(150deg, #7cb0fa, #3b82f6);
  --theme-shadow: #1d4ed8;
}

body[data-area="play"] {
  --theme: #8b7be8;
  --theme-deep: #6a5ad0;
  --theme-soft: #efebff;
  --theme-grad: linear-gradient(150deg, #a99bf5, #7c6ce0);
  --theme-shadow: #6a5ad0;
}

/* ============ 徽章 ============ */

.area-badges {
  flex: 0 0 auto;
  margin-top: clamp(14px, 2.4vw, 26px);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1vw, 12px);
}

.badge {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 clamp(130px, 16vw, 190px);
  padding: clamp(8px, 1vw, 11px) clamp(10px, 1.4vw, 14px);
  border-radius: var(--r-sm);
  border: 2px dashed #ecdfcd;
  background: #fff;
  text-align: left;
}

.badge.on {
  border: 2px solid #ffd48a;
  background: linear-gradient(180deg, #fffdf7, #fff3dc);
  box-shadow: 0 5px 0 #ffe8c4;
}

.badge-ico {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: clamp(28px, 3.2vw, 36px);
  height: clamp(28px, 3.2vw, 36px);
  font-size: clamp(16px, 1.9vw, 20px);
  filter: grayscale(1) contrast(1.06);
  opacity: 0.44;          /* 未获得者：灰但仍能看清是谁 */
}

.badge.on .badge-ico {
  filter: none;
  opacity: 1;
}

.badge-name {
  display: block;
  font-size: clamp(11.5px, 1.3vw, 13px);
  font-weight: 900;
  line-height: 1.2;
}

.badge-need {
  display: block;
  margin-top: 2px;
  font-size: clamp(9.5px, 1.05vw, 10.5px);
  font-weight: 700;
  color: #a79db8;
  line-height: 1.3;
}

/* 学科页底部工具 / 声音入口 */

.area-tools,
.voice-open {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: clamp(12px, 2vw, 20px);
}

.area-tools button,
.voice-open button {
  padding: 4px 8px;
  border: 0;
  background: none;
  color: #a89dc0;
  font-size: clamp(11px, 1.2vw, 12px);
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.hz-store-note {
  font-size: clamp(11px, 1.25vw, 12.5px);
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink-soft);
}

/* ============ 动画 ============ */

@keyframes fade {
  from { opacity: 0; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.94) translateY(10px); }
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  45% { transform: scale(1.08); }
}

@keyframes shake {
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

@keyframes glow {
  50% { background: #fff3cf; }
}

@keyframes burst {
  0% { opacity: 1; transform: translate(0, 0) rotate(0deg); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)); }
}

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(16px); }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.3; transform: scale(0.8) rotate(0deg); }
  50% { opacity: 1; transform: scale(1.2) rotate(20deg); }
}

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

@keyframes blink {
  0%, 93%, 100% { transform: scaleY(1); }
  96% { transform: scaleY(0.12); }
}

@keyframes toastIn {
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 6px 0 var(--theme-shadow), 0 0 0 0 rgba(31, 165, 150, 0.35); }
  50% { box-shadow: 0 6px 0 var(--theme-shadow), 0 0 0 12px rgba(31, 165, 150, 0); }
}

@keyframes bunnyHop {
  50% { transform: translateX(-50%) translateY(-14px) scale(1.1); }
}

@keyframes mergeFly {
  0% { transform: translate(var(--dx, 0px), var(--dy, 0px)) scale(1); }
  55% { transform: translate(calc(var(--dx, 0px) * 0.4), calc(var(--dy, 0px) - 34px)) scale(1.18); }
  100% { transform: translate(0, 0) scale(1); }
}

@keyframes applePop {
  from { opacity: 0; transform: translateY(-14px) scale(0.6); }
}

@keyframes bondFly {
  to { transform: translateY(-26px) scale(1.25); opacity: 0.35; }
}

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

/* ============================================================
   练习弹层（Practice 引擎共用）
   ============================================================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(8px, 1.6vw, 20px);
  background: rgba(51, 41, 74, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}

.overlay[hidden] {
  display: none;
}

.game {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vw, 14px);
  width: min(880px, 100%);
  height: 100%;
  max-height: 100%;
  padding: clamp(12px, 2vw, 24px);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: 0 30px 70px rgba(51, 41, 74, 0.3);
  animation: pop 0.24s cubic-bezier(0.22, 1.2, 0.36, 1);
  overflow: hidden;
}

.game.theme-en {
  --theme: #1fa596;
  --theme-deep: #14867a;
  --theme-soft: #e2f8f4;
}

.game.theme-zh {
  --theme: #8b5cf6;
  --theme-deep: #6d47d9;
  --theme-soft: #f1eafe;
}

.game.theme-play {
  --theme: #8b7be8;
  --theme-deep: #6a5ad0;
  --theme-soft: #efebff;
}

.game-top {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
}

.game-title h2 {
  font-size: clamp(15px, 2vw, 18px);
  letter-spacing: 0.02em;
}

.game-title p {
  margin-top: 2px;
  font-size: clamp(11px, 1.3vw, 12.5px);
  font-weight: 800;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.star-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  font-size: clamp(13px, 1.5vw, 15px);
  font-weight: 900;
  transition: transform 0.15s ease;
}

.star-pill.pop {
  transform: scale(1.16);
}

.bar {
  flex: 0 0 auto;
  height: clamp(8px, 1vw, 10px);
  border-radius: 999px;
  background: #efe5d6;
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--theme), var(--sun));
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(8px, 1.4vw, 14px);
  overflow-y: auto;
  padding-bottom: 4px;
}

.prompt {
  flex: 0 0 auto;
  padding: clamp(12px, 2vw, 24px);
  border-radius: var(--r-md);
  background: #fff;
  text-align: center;
  box-shadow: inset 0 0 0 2px #f7eddf;
}

.big-numeral {
  font-size: clamp(56px, 13vw, 110px);
  line-height: 0.95;
  font-weight: 900;
  color: var(--theme);
  letter-spacing: -0.02em;
}

.prompt-q {
  margin-top: clamp(8px, 1.2vw, 12px);
  font-size: clamp(14px, 1.9vw, 18px);
  font-weight: 800;
  color: var(--ink-soft);
  line-height: 1.5;
}

.prompt-emoji {
  display: inline-grid;
  place-items: center;
  width: clamp(84px, 11vw, 124px);
  aspect-ratio: 1;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--theme-soft);
  font-size: clamp(42px, 5.6vw, 62px);
  line-height: 1;
}

.prompt-emoji.emoji-row {
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 2px;
  width: auto;
  max-width: clamp(220px, 30vw, 280px);
  aspect-ratio: auto;
  margin: 0 auto;
  border-radius: 0;
  background: none;
  font-size: clamp(22px, 3vw, 32px);
}

.big-word {
  font-size: clamp(36px, 7.4vw, 58px);
  font-weight: 900;
  letter-spacing: 0.03em;
  line-height: 1.1;
  word-break: break-word;
}

.phonics-word {
  font-size: clamp(32px, 6.4vw, 50px);
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1.2;
}

.phonics-word .blank {
  display: inline-grid;
  place-items: center;
  min-width: 0.92em;
  margin: 0 0.06em;
  color: var(--theme);
  border-bottom: 5px dashed #f0c68d;
}

.big-hanzi {
  font-size: clamp(52px, 12vw, 96px);
  line-height: 1.05;
  font-weight: 900;
  color: var(--theme);
}

.big-hanzi.pinyin-card {
  color: var(--ink);
}

.dots {
  display: grid;
  grid-template-columns: repeat(5, clamp(10px, 1.3vw, 16px));
  gap: clamp(6px, 0.9vw, 9px);
  justify-content: center;
  justify-items: center;
}

.dots i {
  display: block;
  width: clamp(10px, 1.3vw, 16px);
  height: clamp(10px, 1.3vw, 16px);
  border-radius: 50%;
  background: var(--theme);
  opacity: 0.88;
}

.dots-wrap {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.say-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: clamp(8px, 1.2vw, 14px);
  padding: clamp(8px, 1.1vw, 11px) clamp(16px, 2vw, 22px);
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--theme-deep);
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--theme-soft), inset 0 0 0 2px var(--theme-soft);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.say-btn.big {
  font-size: clamp(15px, 2vw, 18px);
  padding: clamp(10px, 1.4vw, 14px) clamp(20px, 2.6vw, 28px);
}

.say-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--theme-soft), inset 0 0 0 2px var(--theme-soft);
}

/* 选项网格：流式，窗口大小决定每行个数 */
.options {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(clamp(96px, 14vw, 150px), 100%), 1fr));
  gap: clamp(8px, 1.3vw, 14px);
}

.option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(66px, 10vw, 100px);
  padding: clamp(8px, 1.2vw, 12px);
  border: 3px solid #f1e6d6;
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 #efe3d3;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.15s ease, background 0.15s ease;
  word-break: break-word;
}

.option:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #efe3d3;
}

.option-word {
  font-size: clamp(15px, 2.4vw, 23px);
  letter-spacing: 0.01em;
}

.option-emoji {
  font-size: clamp(32px, 5.6vw, 48px);
  line-height: 1;
}

.option-dots {
  padding: 12px 10px;
}

.option-hanzi {
  font-size: clamp(22px, 4vw, 30px);
}

.option-side {
  font-size: clamp(15px, 2.4vw, 19px);
  gap: 4px;
}

.option-sentence {
  font-size: clamp(12px, 1.8vw, 16px);
  line-height: 1.3;
  padding: 8px;
}

.option.is-picked {
  border-color: var(--theme);
  background: var(--theme-soft);
  box-shadow: 0 6px 0 var(--theme-deep);
  animation: pop 0.16s ease;
}

.option.is-correct {
  border-color: var(--ok);
  background: #eafbf1;
  box-shadow: 0 6px 0 #a9e6c3;
  animation: bounce 0.4s ease;
}

.option.is-wrong {
  border-color: var(--bad);
  background: #fff1f1;
  color: #c5534f;
  animation: shake 0.4s ease;
}

.option.is-reveal {
  border-color: var(--sun);
  background: #fff8df;
  box-shadow: 0 6px 0 #ffe6a1;
  animation: glow 1.2s ease infinite;
}

.option:disabled {
  cursor: default;
}

/* 提交按钮 */
.submit-row {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  margin-top: clamp(6px, 1vw, 12px);
}

.submit-btn {
  min-width: 46%;
  padding: clamp(11px, 1.5vw, 15px) clamp(24px, 3vw, 34px);
  border-radius: var(--r-sm);
  font-size: clamp(15px, 2vw, 18px);
  letter-spacing: 0.2em;
}

.submit-btn:disabled {
  opacity: 0.35;
  box-shadow: none;
  cursor: not-allowed;
}

.hint {
  flex: 0 0 auto;
  min-height: 22px;
  text-align: center;
  font-size: clamp(12.5px, 1.7vw, 15px);
  font-weight: 800;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}

.hint.good {
  color: #2fa96b;
  animation: bounce 0.4s ease;
}

/* 数一数：点物件 */
.pool {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 12px);
  margin-top: 12px;
}

.pool-item {
  position: relative;
  display: grid;
  place-items: center;
  min-width: clamp(42px, 5.4vw, 52px);
  min-height: clamp(42px, 5.4vw, 52px);
  padding: 4px;
  border: 0;
  background: none;
  font-size: clamp(30px, 4.6vw, 46px);
  line-height: 1;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.2s ease;
}

.pool-item:active {
  transform: scale(0.88);
}

.pool-item.counted {
  opacity: 0.42;
  transform: scale(0.86);
}

.pool-item.counted::after {
  content: attr(data-order);
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--theme);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.pool-tip {
  margin-top: 8px;
  font-size: clamp(11.5px, 1.4vw, 13px);
  font-weight: 800;
  color: #a79db8;
}

/* 加减法图像 */
.visual-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.2vw, 12px);
  font-size: clamp(20px, 3.4vw, 32px);
  line-height: 1.4;
}

.visual-row .group {
  letter-spacing: 0.06em;
}

.visual-row .group[data-count] {
  cursor: pointer;
  border-radius: 12px;
}

.visual-row .group[data-count]:active {
  transform: scale(0.94);
}

.visual-row .op {
  font-size: 0.86em;
  font-weight: 900;
  color: var(--theme);
}

.visual-row .crossed {
  position: relative;
  opacity: 0.4;
}

.visual-row .crossed::after {
  content: "";
  position: absolute;
  left: -2px;
  right: -2px;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: var(--bad);
}

.equation {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
  font-size: clamp(22px, 4.2vw, 38px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.equation b {
  color: var(--theme);
  font-size: 1.06em;
}

.qmark {
  display: inline-grid;
  place-items: center;
  min-width: 1.5em;
  height: 1.5em;
  border-radius: 14px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: 0.76em;
}

.ph-chips {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.ph-chips span {
  display: grid;
  place-items: center;
  min-width: clamp(38px, 4.6vw, 46px);
  height: clamp(38px, 4.6vw, 46px);
  padding: 0 8px;
  border-radius: 14px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: clamp(17px, 2.2vw, 21px);
  font-weight: 900;
}

/* 音标拼读 */
.ipa-big {
  font-size: clamp(50px, 10vw, 92px);
  font-weight: 900;
  line-height: 1.1;
  color: var(--theme-deep);
  letter-spacing: 0.02em;
}

.ipa-blend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  margin: 4px 0;
}

.ipa-part {
  display: grid;
  place-items: center;
  min-width: clamp(48px, 7vw, 70px);
  height: clamp(54px, 8vw, 82px);
  padding: 0 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 0 #efe3d3;
  font-size: clamp(26px, 4vw, 42px);
  font-weight: 900;
  color: var(--ink);
}

.ipa-vowel {
  display: grid;
  place-items: center;
  min-width: clamp(66px, 10vw, 98px);
  height: clamp(54px, 8vw, 82px);
  padding: 0 12px;
  border-radius: 16px;
  background-image: var(--theme-grad);
  color: #fff;
  font-size: clamp(22px, 3.4vw, 36px);
  font-weight: 900;
  box-shadow: 0 4px 0 var(--theme-shadow);
}

/* 左右比较 */
.compare {
  display: flex;
  justify-content: center;
  gap: clamp(8px, 1.6vw, 16px);
  margin-bottom: 6px;
}

.compare-side {
  flex: 1;
  max-width: clamp(160px, 22vw, 220px);
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 12px 8px;
  border-radius: 18px;
  background: #fdf7ef;
}

.compare-side span {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  color: #a79db8;
}

.compare-side .dots {
  grid-template-columns: repeat(5, 10px);
  gap: 6px;
}

.compare-side .dots i {
  width: 10px;
  height: 10px;
}

/* 智慧课堂（数步题）支架 */
.scaffold {
  margin-top: 14px;
  padding: 10px 10px 12px;
  border-radius: 18px;
  background: #fffdf8;
  box-shadow: inset 0 0 0 2px #f4e8d8;
  animation: pop 0.22s ease;
}

.scaffold-title {
  margin-bottom: 2px;
  text-align: center;
  font-size: 12.5px;
  font-weight: 900;
  color: var(--theme-deep);
}

.mini-line {
  position: relative;
  height: 62px;
  margin: 0 16px;
}

.mini-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 40px;
  height: 3px;
  border-radius: 999px;
  background: #f0e4d2;
}

.mini-tick {
  position: absolute;
  top: 32px;
  padding: 1px 2px;
  background: #fffdf8;
  font-size: 10.5px;
  font-weight: 800;
  color: #b3a9c2;
  transform: translateX(-50%);
  transition: color 0.2s ease, transform 0.2s ease;
}

.mini-tick.is-passed {
  color: #7bbfa8;
}

.mini-tick.is-here {
  color: var(--theme-deep);
  transform: translateX(-50%) scale(1.3);
}

.mini-runner {
  position: absolute;
  top: 2px;
  font-size: 20px;
  line-height: 1;
  transform: translateX(-50%);
  transition: left 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

.scaffold-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 2px;
}

.scaffold-bar span {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-soft);
}

.scaffold-bar .btn {
  padding: 8px 16px;
  border-radius: 14px;
  font-size: 13px;
  box-shadow: 0 4px 0 #db731b;
}

/* 数的分解：分解树 + 拖拽盘 */
.bond-tree {
  display: grid;
  justify-items: center;
  margin-bottom: 6px;
}

.bond-node {
  display: grid;
  place-items: center;
  width: clamp(50px, 6.4vw, 60px);
  height: clamp(50px, 6.4vw, 60px);
  border: 3px solid #f0dcbe;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(23px, 3vw, 28px);
  font-weight: 900;
}

.bond-node.is-whole {
  border-color: var(--theme);
  color: var(--theme-deep);
  box-shadow: 0 3px 0 var(--theme-soft);
}

.bond-node.is-ask {
  border-style: dashed;
  border-color: #ecd7b8;
  background: #fffaf1;
  color: #c9a97c;
}

.bond-parts {
  display: flex;
  gap: clamp(16px, 2.4vw, 28px);
}

.bond-col {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
}

.bond-lines {
  position: relative;
  width: clamp(140px, 18vw, 180px);
  height: 32px;
  margin: 2px 0;
}

.bond-lines i {
  position: absolute;
  left: calc(50% - 1.5px);
  top: 0;
  width: 3px;
  height: 84px;
  border-radius: 2px;
  background: #e2c9a6;
  transform-origin: top center;
}

.bond-lines i:first-child {
  transform: rotate(68deg);
}

.bond-lines i:last-child {
  transform: rotate(-68deg);
}

.bond-lines.is-up {
  transform: scaleY(-1);
}

.bond-plate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: clamp(110px, 14vw, 132px);
  min-height: 50px;
  padding: 4px;
  border: 2px solid #f0dcbe;
  border-radius: 12px 12px 20px 20px;
  background: #fffaf1;
}

.bond-plate.is-ask {
  border-style: dashed;
  color: #c9a97c;
  font-size: 22px;
  font-weight: 900;
}

.bond-plate .bond-apple {
  animation: applePop 0.35s ease backwards;
}

.bond-apple {
  font-size: clamp(13px, 1.8vw, 17px);
  line-height: 1.1;
}

/* 分解拖拽盘 */
.bond-drop {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  align-content: center;
  gap: 2px;
  width: clamp(110px, 14vw, 132px);
  min-height: clamp(80px, 10vw, 96px);
  padding: 6px 6px 22px;
  border: 3px dashed #e2c9a6;
  border-radius: 14px 14px 24px 24px;
  background: #fffaf1;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bond-drop.is-ask {
  border-color: #ecd7b8;
}

.bond-drop.is-drop-hint {
  border-color: var(--theme);
  box-shadow: 0 0 0 3px var(--theme-soft);
}

.bond-drop-num {
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 13px;
  font-weight: 900;
  color: #a89dc0;
}

.bond-drop .bond-drag-apple {
  font-size: clamp(17px, 2.4vw, 21px);
  line-height: 1.1;
}

.bond-tray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: clamp(50px, 6.4vw, 62px);
  margin-top: 10px;
  padding: 9px 12px;
  border: 2px dashed #e9dcc9;
  border-radius: 20px;
  background: #f9f5ee;
}

.bond-drag-apple {
  font-size: clamp(22px, 3.4vw, 30px);
  line-height: 1.1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.bond-drag-apple.is-demo-fly {
  animation: bondFly 0.34s ease forwards;
}

.bond-drag-apple.is-drag-source {
  opacity: 0.25;
}

.bond-ghost {
  position: fixed;
  z-index: 300;
  transform: translate(-50%, -50%) scale(1.5);
  pointer-events: none;
  filter: drop-shadow(0 10px 12px rgba(120, 90, 60, 0.35));
  line-height: 1.1;
  font-size: clamp(22px, 3.4vw, 30px);
}

/* 分一分（独立页） */
.num-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}

.num-picker button {
  width: clamp(38px, 4.6vw, 44px);
  height: clamp(38px, 4.6vw, 44px);
  border: 2px solid #f1e6d6;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(15px, 1.8vw, 18px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 3px 0 #efe3d3;
  transition: transform 0.12s ease;
}

.num-picker button:active {
  transform: translateY(2px);
}

.num-picker button.is-on {
  border-color: transparent;
  background-image: var(--theme-grad);
  color: #fff;
  box-shadow: 0 3px 0 var(--theme-shadow);
}

.bond-stage {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 1.6vw, 18px) 0;
}

button.bond-apple {
  display: inline-block;
  padding: 0;
  border: 0;
  background: none;
  font-size: clamp(24px, 3.4vw, 32px);
  cursor: grab;
  touch-action: none;
  transition: transform 0.12s ease;
}

button.bond-apple:active {
  transform: scale(0.82);
}

.bond-apple.is-drag-source {
  opacity: 0.25;
}

[data-plate].is-drop-hint {
  border-color: var(--theme);
  box-shadow: 0 0 0 3px var(--theme-soft);
}

.found-box {
  flex: 0 0 auto;
  margin-top: clamp(10px, 1.6vw, 18px);
}

.found-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.found-chip {
  padding: 8px 14px;
  border: 2px dashed #ecd7b8;
  border-radius: 12px;
  background: #fff;
  font-size: clamp(12px, 1.4vw, 13.5px);
  font-weight: 900;
  color: #c9a97c;
}

.found-chip.is-on {
  border: 2px solid #a9e6c3;
  background: #eafbf1;
  color: #2aa06a;
}

/* 问答 / 高频词句式选项（兼容） */

/* ---------- 结算 ---------- */

.result {
  margin: auto 0;
  padding: clamp(12px, 2vw, 26px) 8px clamp(8px, 1.4vw, 16px);
  text-align: center;
}

.result-face {
  font-size: clamp(50px, 8vw, 74px);
  line-height: 1;
  animation: bounce 0.6s ease;
}

.result h2 {
  margin-top: 10px;
  font-size: clamp(20px, 3vw, 26px);
}

.result-score {
  margin-top: 6px;
  font-size: clamp(13.5px, 1.8vw, 17px);
  font-weight: 800;
  color: var(--ink-soft);
}

.result-score b {
  font-size: 1.7em;
  color: var(--theme);
  margin: 0 2px;
}

.result-stars {
  margin: 10px auto 0;
  max-width: 420px;
  font-size: clamp(16px, 2.6vw, 22px);
  line-height: 1.6;
  letter-spacing: 2px;
  word-break: break-all;
}

.result-stars .big-star {
  margin-right: 4px;
  font-size: 1.6em;
  color: var(--theme);
}

.result-sub {
  margin-top: 8px;
  font-size: clamp(12px, 1.5vw, 13.5px);
  font-weight: 800;
  color: var(--ink-soft);
}

.result-msg {
  margin-top: 6px;
  font-size: clamp(13.5px, 1.9vw, 16px);
  font-weight: 900;
  color: var(--theme-deep);
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: clamp(14px, 2.2vw, 24px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: clamp(12px, 1.6vw, 15px) clamp(20px, 2.6vw, 28px);
  border: 0;
  border-radius: var(--r-sm);
  font-size: clamp(14px, 1.8vw, 16.5px);
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.4;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-primary {
  background-image: linear-gradient(140deg, #ffbd58, #ff8a3c);
  color: #fff;
  box-shadow: 0 6px 0 #db731b;
}

.btn-primary:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #db731b;
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 6px 0 #efe3d3, inset 0 0 0 2px #f4ecdf;
}

.btn-ghost:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #efe3d3, inset 0 0 0 2px #f4ecdf;
}

.btn-danger {
  background: #e25c5c;
  color: #fff;
  box-shadow: 0 5px 0 #b84848;
}

.btn-danger:active {
  box-shadow: 0 2px 0 #b84848;
}

.save-note {
  margin-top: 14px;
  font-size: clamp(10.5px, 1.2vw, 11.5px);
  font-weight: 800;
  color: #a79db8;
}

/* ---------- 小节小结 ---------- */

.section-shot {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(253, 246, 236, 0.9);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  animation: fade 0.2s ease;
}

.section-card {
  width: min(420px, 100%);
  padding: 22px 20px 18px;
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 18px 40px rgba(51, 41, 74, 0.16);
  text-align: center;
}

.section-eyebrow {
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #a89dc0;
}

.section-card h2 {
  margin: 6px 0 2px;
  font-size: clamp(19px, 2.6vw, 24px);
}

.section-card h2 b {
  font-size: 1.25em;
  color: var(--theme);
}

.section-wrong {
  margin-top: 12px;
  text-align: left;
}

.section-wrong p {
  font-size: 12px;
  font-weight: 800;
  color: #a79db8;
}

.section-wrong ul {
  display: grid;
  gap: 6px;
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
}

.section-wrong li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 12px;
  border-radius: 12px;
  background: #fff8e8;
  font-size: clamp(12.5px, 1.5vw, 13.5px);
  font-weight: 900;
  color: var(--ink);
}

.section-wrong li em {
  font-style: normal;
  font-size: 14px;
  color: #2aa06a;
}

.section-perfect {
  margin-top: 10px;
  font-size: 14px;
  font-weight: 900;
  color: #2aa06a;
}

/* ---------- 轻提示 / 彩带 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 200;
  max-width: min(90vw, 420px);
  padding: 11px 20px;
  border-radius: 999px;
  background: rgba(51, 41, 74, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 12px);
  animation: toastIn 0.3s ease forwards;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}

.confetti {
  position: absolute;
  top: 42%;
  left: 50%;
  width: 9px;
  height: 14px;
  border-radius: 2px;
  pointer-events: none;
  z-index: 5;
  animation: burst 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}

/* ---------- 弹窗（声音设置 / 家长设置 / 确认） ---------- */

.voice-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 20px);
  background: rgba(51, 41, 74, 0.42);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.voice-modal[hidden] {
  display: none;
}

.voice-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(460px, 100%);
  max-height: 86vh;
  padding: clamp(16px, 2vw, 22px);
  border-radius: var(--r-md);
  background: var(--bg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.24);
  overflow-y: auto;
}

.voice-card h3 {
  font-size: clamp(16px, 2vw, 19px);
}

.confirm-card {
  text-align: center;
}

.confirm-ico {
  font-size: clamp(38px, 5vw, 46px);
  line-height: 1;
  margin-bottom: 4px;
}

.confirm-msg {
  margin: 8px 0 4px;
  font-size: clamp(12.5px, 1.5vw, 13.5px);
  font-weight: 700;
  line-height: 1.6;
  color: var(--ink-soft);
}

.confirm-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.voice-sub {
  font-size: clamp(12px, 1.4vw, 13px);
  font-weight: 800;
  color: var(--ink-soft);
}

.voice-list {
  display: grid;
  gap: 6px;
  max-height: 46vh;
  padding-right: 2px;
  overflow: auto;
}

.voice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  align-items: center;
  padding: 10px 12px;
  border: 2px solid #f1e6d6;
  border-radius: 14px;
  background: #fff;
  font-size: clamp(12.5px, 1.4vw, 13.5px);
  font-weight: 900;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.voice-row span {
  grid-column: 1;
  font-size: 10.5px;
  font-weight: 800;
  color: #a89dc0;
}

.voice-row i {
  grid-row: 1 / span 2;
  grid-column: 2;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  color: var(--theme-deep);
}

.voice-row.is-on {
  border-color: var(--theme);
  box-shadow: 0 0 0 2px var(--theme-soft);
}

.voice-speed {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.voice-speed button {
  padding: 6px 12px;
  border: 2px solid #f1e6d6;
  border-radius: 999px;
  background: #fff;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.voice-speed button.is-on {
  border-color: transparent;
  background: var(--theme);
  color: #fff;
}

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

.voice-auto {
  padding: 0;
  border: 0;
  background: none;
  color: #a89dc0;
  font-size: 11.5px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.voice-empty {
  font-size: 12px;
  font-weight: 800;
  color: #a89dc0;
  text-align: center;
}

.parent-rows {
  display: grid;
  gap: 8px;
}

.parent-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #f1e6d6;
  border-radius: 16px;
  background: #fff;
  font-size: 14px;
  font-weight: 900;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.parent-row .parent-info {
  display: grid;
  gap: 2px;
}

.parent-row b {
  font-size: 14px;
  font-weight: 900;
}

.parent-row span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
}

.parent-row .parent-go {
  font-size: 20px;
  font-weight: 900;
  color: #c9bfae;
  font-style: normal;
}

button.parent-row:hover {
  border-color: var(--theme-soft);
  background: #fffdf8;
}

.lock-switch {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: #e6e0ec;
  color: #8a8098;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  flex: 0 0 auto;
}

.lock-switch i {
  font-style: normal;
  font-size: 15px;
}

.lock-switch i.lock-dot {
  position: absolute;
  display: none;
}

.lock-switch[aria-checked="true"] {
  background: #2aa06a;
  color: #fff;
}

.lock-switch:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================================
   智慧课堂（teach.html）
   ============================================================ */

.teach-head {
  flex: 0 0 auto;
  padding: clamp(10px, 1.8vw, 20px) 0 clamp(4px, 0.8vw, 10px);
  text-align: center;
}

.teach-head h1 {
  margin: clamp(8px, 1.2vw, 14px) 0 clamp(5px, 0.9vw, 10px);
  font-size: clamp(21px, 3.2vw, 32px);
  line-height: 1.32;
}

.teach-sub {
  font-size: clamp(12.5px, 1.7vw, 15px);
  font-weight: 700;
  line-height: 1.75;
  color: var(--ink-soft);
}

.teach-level {
  margin-top: 8px;
  font-size: clamp(10.5px, 1.2vw, 11.5px);
  font-weight: 800;
  color: #a89dc0;
}

.tabs {
  display: inline-flex;
  gap: 6px;
  margin-top: clamp(10px, 1.4vw, 16px);
  padding: 5px;
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
}

.tab {
  padding: clamp(7px, 1vw, 10px) clamp(14px, 1.9vw, 20px);
  border: 0;
  border-radius: 999px;
  background: none;
  font-size: clamp(12.5px, 1.5vw, 14px);
  font-weight: 900;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.tab.is-on {
  background-image: var(--theme-grad);
  color: #fff;
  box-shadow: 0 3px 0 var(--theme-shadow);
}

.lesson {
  flex: 0 0 auto;
  margin-top: clamp(8px, 1.4vw, 14px);
  padding: clamp(12px, 2vw, 24px);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 8px 0 #f2e6d5;
}

.steps {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(6px, 1.4vw, 16px);
}

.step {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: clamp(10.5px, 1.25vw, 12px);
  font-weight: 900;
  color: #c3b8d0;
}

.step i {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #f4eee4;
  color: #b3a9c2;
  font-size: 10.5px;
  font-style: normal;
}

.step.is-on {
  color: var(--theme-deep);
}

.step.is-on i {
  background: var(--theme);
  color: #fff;
}

.step.is-done {
  color: #35b97b;
}

.step.is-done i {
  background: #d9f4e6;
  color: #2aa06a;
}

.lesson-q {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: clamp(10px, 1.6vw, 18px);
  font-size: clamp(24px, 4.4vw, 40px);
  font-weight: 900;
  letter-spacing: 0.04em;
}

.lesson-q b {
  color: var(--theme);
}

.lesson-q .sign {
  color: #a89dc0;
  font-size: 0.78em;
}

.lesson-q .ans {
  color: #2aa06a;
  animation: bounce 0.45s ease;
}

.lesson-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(120px, 16vw, 156px);
  margin: 6px 0 4px;
  padding: 10px 8px;
  border-radius: 22px;
  background: #fffdf8;
}

.lesson-groups {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(6px, 1.6vw, 16px);
}

.lgroup {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fdf7ef;
  transition: background-color 0.4s ease;
}

.lgroup span {
  font-size: 11.5px;
  font-weight: 900;
  color: #a89dc0;
}

.litems {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px;
  max-width: clamp(150px, 20vw, 200px);
  line-height: 1.2;
}

.lesson-emo {
  display: inline-block;
  padding: 4px;
  font-size: clamp(24px, 3.4vw, 36px);
  line-height: 1;
}

.lop {
  font-size: clamp(19px, 2.8vw, 26px);
  font-weight: 900;
  color: var(--theme);
}

/* 合起来动画 */
.lesson-stage.is-merging .lgroup {
  background: transparent;
}

.lesson-stage.is-merging .lgroup > span {
  opacity: 0;
  transition: opacity 0.24s ease;
}

.lesson-stage.is-merging .lop {
  opacity: 0;
  transform: scale(1.7);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.pool-item.is-flying {
  position: relative;
  z-index: 3;
  will-change: transform;
  animation: mergeFly 0.76s cubic-bezier(0.33, 0, 0.2, 1) var(--delay, 0ms) both;
}

.pool-item.is-landed {
  animation: bounce 0.36s ease;
}

.lesson-run {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(4px, 0.9vw, 9px);
}

.lesson-run .pool-item {
  font-size: clamp(24px, 3.4vw, 36px);
  cursor: pointer;
}

.lesson-run .pool-item.is-taken {
  opacity: 0.32;
  transform: scale(0.86);
}

.lesson-run .pool-item.is-taken::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  border-radius: 2px;
  background: var(--bad);
}

.lesson-tip {
  flex: 0 0 auto;
  min-height: clamp(36px, 4.6vw, 44px);
  margin-top: 8px;
  text-align: center;
  font-size: clamp(13px, 1.7vw, 15.5px);
  font-weight: 800;
  line-height: 1.65;
  color: var(--ink-soft);
}

.lesson-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.teach-note {
  flex: 0 0 auto;
  margin-top: clamp(14px, 2.2vw, 22px);
  padding: clamp(14px, 2vw, 22px);
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
}

.teach-note h2 {
  margin-bottom: 6px;
  font-size: 14.5px;
}

.teach-note p {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.85;
  color: var(--ink-soft);
}

/* ============================================================
   翻翻乐（game.html）
   ============================================================ */

.game-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(8px, 1.4vw, 14px);
  padding: clamp(8px, 1.4vw, 16px) 0 clamp(6px, 1vw, 10px);
  text-align: center;
}

.game-head h1 {
  margin: clamp(6px, 1vw, 10px) 0 clamp(4px, 0.7vw, 8px);
  font-size: clamp(21px, 3.2vw, 30px);
}

.game-head .teach-sub {
  margin: 2px 0 4px;
}

.game-head .tabs {
  margin: clamp(8px, 1.2vw, 14px) 0 2px;
}

.game-stats {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(6px, 1vw, 12px);
}

.game-stats span {
  padding: clamp(5px, 0.8vw, 8px) clamp(10px, 1.4vw, 15px);
  border-radius: 999px;
  background: #fff;
  border: 2px solid var(--line);
  font-size: clamp(11px, 1.3vw, 12.5px);
  font-weight: 800;
  color: var(--ink-soft);
}

.game-stats b {
  font-size: clamp(13px, 1.5vw, 14.5px);
  color: var(--ink);
}

.board {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(7px, 1.2vw, 14px);
  width: 100%;
  max-width: min(520px, 100%);
  margin: clamp(6px, 1.2vw, 14px) auto 0;
}

/* 横屏矮窗：6×2 自动铺排 */
@media (orientation: landscape) and (max-height: 560px) {
  .game-head {
    justify-content: space-between;
    padding: 2px 0 2px;
  }

  .board {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    max-width: 720px;
    margin-top: 4px;
  }

  .mcard {
    aspect-ratio: 1 / 0.82;
  }
}

.mcard {
  position: relative;
  aspect-ratio: 1 / 1.04;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  perspective: 900px;
}

.mcard-inner {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform 0.42s cubic-bezier(0.2, 0.8, 0.3, 1);
}

.mcard.is-flipped .mcard-inner {
  transform: rotateY(180deg);
}

.mcard-face {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 6px;
  border-radius: clamp(14px, 1.8vw, 20px);
  background: #fff;
  box-shadow: 0 5px 0 #efe3d3;
  text-align: center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.mcard-back {
  background-image: linear-gradient(140deg, #ffd257, #ff9a3c);
  box-shadow: 0 5px 0 #db8a2f;
}

.board[data-mode="en"] .mcard-back {
  background-image: linear-gradient(140deg, #4bd3c0, #1fa596);
  box-shadow: 0 5px 0 #17877c;
}

.mcard-back::after {
  content: "?";
  color: #fff;
  font-size: clamp(22px, 3.4vw, 38px);
  font-weight: 900;
  opacity: 0.92;
  transition: transform 0.18s ease;
}

.mcard:hover .mcard-back::after {
  transform: scale(1.25);
}

.mcard-front {
  color: var(--ink);
  font-weight: 900;
  transform: rotateY(180deg);
}

.mcard-front .num {
  font-size: clamp(24px, 4.4vw, 40px);
  color: var(--theme-deep);
}

.mcard-front .word {
  font-size: clamp(11px, 2vw, 18px);
  line-height: 1.2;
  word-break: break-word;
}

.mcard-front .emoji {
  font-size: clamp(24px, 4.4vw, 40px);
  line-height: 1;
}

.mcard-front .dots {
  grid-template-columns: repeat(3, 9px);
  gap: 5px;
}

.mcard-front .dots i {
  width: 9px;
  height: 9px;
}

.mcard.is-matched .mcard-front {
  background: #eafbf1;
  box-shadow: 0 5px 0 #a9e6c3;
}

.mcard.is-matched {
  animation: bounce 0.4s ease;
}

.game-tip {
  flex: 0 0 auto;
  margin-top: clamp(6px, 1vw, 12px);
  text-align: center;
  font-size: clamp(11.5px, 1.3vw, 13px);
  font-weight: 800;
  color: #a89dc0;
}

.result-card {
  width: min(520px, 100%);
  padding: clamp(16px, 2.4vw, 30px);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: 0 24px 60px rgba(51, 41, 74, 0.3);
  animation: pop 0.25s ease;
  max-height: 100%;
  overflow-y: auto;
}

/* ============================================================
   拖拽游戏（play.html）
   ============================================================ */

.play-head {
  position: relative;
  flex: 0 0 auto;
  padding: clamp(10px, 1.8vw, 20px) 0 clamp(4px, 0.8vw, 10px);
  text-align: center;
}

.play-head h1 {
  margin: clamp(8px, 1.2vw, 12px) 0 clamp(4px, 0.8vw, 8px);
  font-size: clamp(22px, 3.4vw, 34px);
}

.play-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(8px, 1.2vw, 12px);
  margin-top: clamp(10px, 1.6vw, 18px);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
}

.play-tab {
  display: grid;
  justify-items: center;
  gap: 2px;
  padding: clamp(10px, 1.6vw, 16px) 8px;
  border: 2px solid var(--line);
  border-radius: 22px;
  background: #fff;
  cursor: pointer;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.play-tab:active {
  transform: translateY(3px);
}

.play-tab.is-on {
  border-color: transparent;
  background-image: var(--theme-grad);
  color: #fff;
  box-shadow: 0 5px 0 var(--theme-shadow);
}

.play-tab-ico {
  font-size: clamp(21px, 2.8vw, 28px);
  line-height: 1.2;
}

.play-tab b {
  font-size: clamp(11.5px, 1.5vw, 14px);
  font-weight: 900;
}

.play-tab em {
  font-size: clamp(9.5px, 1.1vw, 11px);
  font-style: normal;
  font-weight: 800;
  color: #a89dc0;
}

.play-tab.is-on em {
  color: rgba(255, 255, 255, 0.86);
}

.play-panel {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: clamp(8px, 1.4vw, 16px);
  padding: clamp(12px, 1.8vw, 22px);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 8px 0 #f2e6d5;
}

.play-bar {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.play-bar h2 {
  font-size: clamp(15px, 2vw, 19px);
}

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

.play-reset {
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: #f7f2ea;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
}

.play-reset:active {
  transform: translateY(1px);
}

.play-progress {
  flex: 0 0 auto;
  height: 6px;
  margin-top: 10px;
  border-radius: 999px;
  background: #f4eee4;
  overflow: hidden;
}

.play-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background-image: var(--theme-grad);
  transition: width 0.4s ease;
}

.play-round {
  padding: 5px 12px;
  border-radius: 999px;
  background: #f7f2ea;
  font-size: 11.5px;
  font-weight: 900;
  color: var(--ink-soft);
  white-space: nowrap;
}

.play-stage {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  margin-top: 12px;
  min-height: clamp(300px, 42vh, 400px);
}

.play-tip {
  flex: 0 0 auto;
  min-height: 18px;
  margin-top: clamp(4px, 0.8vw, 10px);
  text-align: center;
  font-size: clamp(11.5px, 1.35vw, 13px);
  font-weight: 800;
  color: #a89dc0;
}

/* 喂小怪兽 */
.feed-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: clamp(10px, 2.4vw, 28px);
}

.monster {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.monster-face {
  font-size: clamp(42px, 6vw, 66px);
  line-height: 1;
}

.monster.is-happy .monster-face {
  animation: bounce 0.5s ease;
}

.monster-badge {
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: clamp(11.5px, 1.35vw, 13px);
  font-weight: 900;
}

.monster-badge b {
  font-size: 1.3em;
}

.bowl {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  width: clamp(140px, 20vw, 230px);
  min-height: clamp(110px, 14vw, 136px);
  padding: 10px;
  border: 3px dashed #ecdcc4;
  border-radius: 22px 22px 62px 62px;
  background: #fffaf1;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.bowl.is-over {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.bowl-items {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
}

.bowl-hint {
  align-self: center;
  font-size: 11.5px;
  font-weight: 800;
  color: #c3b8d0;
}

.bowl-tag {
  align-self: center;
  font-size: 11px;
  font-weight: 900;
  color: #b3a9c2;
}

.garden {
  margin-top: 2px;
  padding: 12px;
  border: 2px dashed #e9dcc9;
  border-radius: 22px;
  background: #f9f5ee;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.garden.is-over {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.garden-label {
  display: block;
  margin-bottom: 6px;
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #b3a9c2;
}

.garden-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(4px, 0.9vw, 10px);
  min-height: 50px;
}

.garden-empty {
  font-size: 12px;
  font-weight: 800;
  color: #c3b8d0;
}

.fruit {
  position: relative;
  padding: 4px;
  border: 0;
  background: none;
  font-size: clamp(26px, 3.8vw, 38px);
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.fruit.is-dragging {
  z-index: 60;
  cursor: grabbing;
  filter: drop-shadow(0 10px 14px rgba(120, 90, 60, 0.28));
}

/* 数字天平 */
.scale {
  position: relative;
  width: 100%;
  max-width: 540px;
  height: clamp(200px, 24vw, 258px);
  margin: 0 auto;
}

.scale::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 120px;
  height: 10px;
  border-radius: 999px;
  background: #f0dcc0;
  transform: translateX(-50%);
}

.scale-post {
  position: absolute;
  left: 50%;
  top: 38px;
  bottom: 80px;
  width: 8px;
  border-radius: 4px;
  background: #e6cba4;
  transform: translateX(-50%);
}

.scale-beam {
  position: absolute;
  left: 20%;
  right: 20%;
  top: 38px;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9c08a, #d9a25c);
  transform-origin: 50% 50%;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.scale-pivot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #d9a25c;
  border-radius: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}

.scale-stand {
  position: absolute;
  left: 50%;
  bottom: 8px;
  width: 0;
  height: 0;
  border-left: 30px solid transparent;
  border-right: 30px solid transparent;
  border-bottom: 72px solid #f0dcc0;
  transform: translateX(-50%);
}

.scale-pan {
  position: absolute;
  top: 56px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 4px;
  width: 40%;
  min-height: clamp(96px, 12vw, 118px);
  padding: 8px 8px 6px;
  border: 3px solid #f0dcbe;
  border-radius: 16px 16px 48px 48px;
  background: #fffaf1;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s ease, background 0.2s ease;
}

.scale-pan::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -20px;
  width: 3px;
  height: 20px;
  border-radius: 2px;
  background: #e0c49a;
  transform: translateX(-50%);
}

.scale-pan.left { left: 0; }
.scale-pan.right { right: 0; }

.scale-pan.is-over {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.pan-items {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-end;
  justify-content: center;
  gap: 3px;
  min-height: 56px;
}

.pan-hint {
  align-self: center;
  font-size: 10.5px;
  font-weight: 800;
  color: #c3b8d0;
}

.pan-sum {
  align-self: center;
  margin-top: 2px;
  padding: 2px 12px;
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  font-weight: 900;
  color: var(--theme-deep);
  box-shadow: 0 2px 0 #efe3d3;
}

.chip {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 1px;
  min-width: clamp(36px, 4.8vw, 48px);
  padding: 5px 6px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(160deg, #fff, #fdf3e4);
  box-shadow: 0 3px 0 #e9d7bd;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.chip b {
  font-size: clamp(14px, 1.9vw, 18px);
  font-weight: 900;
  line-height: 1;
  color: var(--theme-deep);
}

.chip-dots {
  font-size: 6px;
  line-height: 1;
  letter-spacing: 1px;
  color: #d8b98d;
}

.chip.is-dragging {
  z-index: 60;
  cursor: grabbing;
  box-shadow: 0 10px 18px rgba(120, 90, 60, 0.24);
}

.chip-tray {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 2px dashed #e9dcc9;
  border-radius: 20px;
  background: #f9f5ee;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.chip-tray.is-over {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.tray-label {
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.14em;
  color: #b3a9c2;
  white-space: nowrap;
}

.tray-items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tray-empty {
  font-size: clamp(10.5px, 1.2vw, 12px);
  font-weight: 800;
  color: #c3b8d0;
}

/* 小兔跳数轴 */
.line-q {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(22px, 3.6vw, 36px);
  font-weight: 900;
}

.line-q b {
  color: var(--theme);
}

.line-q .sign {
  color: #b3a9c2;
  font-size: 0.78em;
}

.line-area {
  position: relative;
  padding: clamp(44px, 5vw, 56px) clamp(6px, 1.4vw, 20px) clamp(26px, 3vw, 36px);
  margin-top: 4px;
}

.line-track {
  position: relative;
  height: 16px;
  margin: 0 clamp(12px, 2vw, 26px);
}

.line-track::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 6px;
  border-radius: 999px;
  background: #f0e4d2;
  transform: translateY(-50%);
}

.tick {
  position: absolute;
  top: 50%;
  transform: translateX(-50%);
  pointer-events: none;
}

.tick i {
  display: block;
  width: 3px;
  height: 12px;
  margin-top: -6px;
  border-radius: 2px;
  background: #e0cdb2;
}

.tick em {
  position: absolute;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(10.5px, 1.2vw, 12.5px);
  font-style: normal;
  font-weight: 900;
  color: #b3a9c2;
}

.rabbit {
  position: absolute;
  top: 50%;
  font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transform: translate(-50%, -100%);
  transition: left 0.12s ease;
  filter: drop-shadow(0 4px 6px rgba(120, 90, 60, 0.18));
}

.rabbit.is-dragging {
  cursor: grabbing;
  transition: none;
  transform: translate(-50%, -100%) scale(1.12);
}

.line-bubble {
  position: absolute;
  top: 4px;
  min-width: 34px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--theme);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  transform: translateX(-50%);
  transition: left 0.12s ease;
}

/* ============================================================
   接着数（counton.html）
   ============================================================ */

.count-stage {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(300px, 46vh, 420px);
}

.jump-eq {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: clamp(24px, 4.2vw, 38px);
  font-weight: 900;
  letter-spacing: 0.02em;
}

.jump-eq b {
  color: var(--theme);
}

.jump-eq span {
  font-size: 0.78em;
  color: #b3a9c2;
}

.jump-eq .qmark {
  border-radius: 12px;
  font-size: 0.72em;
}

.jump-eq .qmark.is-done {
  background: #e3f9ee;
  color: #2aa06a;
  animation: bounce 0.4s ease;
}

.phase-q {
  margin-top: 6px;
  text-align: center;
  font-size: clamp(13.5px, 1.9vw, 17px);
  font-weight: 800;
  color: var(--ink-soft);
}

.phase-hint {
  text-align: center;
  font-size: clamp(11px, 1.3vw, 12.5px);
  font-weight: 800;
  color: #a89dc0;
}

.num-choices {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  gap: clamp(10px, 2vw, 18px);
  margin: clamp(6px, 1vw, 12px) 0;
}

.num-choice {
  width: clamp(68px, 9vw, 98px);
  height: clamp(68px, 9vw, 98px);
  border: 3px solid #f1e6d6;
  border-radius: 26px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(30px, 4.4vw, 44px);
  font-weight: 900;
  box-shadow: 0 6px 0 #efe3d3;
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.15s ease;
}

.num-choice:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 #efe3d3;
}

.num-choice.is-picked {
  border-color: var(--theme);
  background: var(--theme-soft);
  box-shadow: 0 6px 0 var(--theme-deep);
}

.num-choice.is-wrong {
  border-color: var(--bad);
  background: #fff1f1;
  color: #c5534f;
  animation: shake 0.4s ease;
}

.num-choice.is-correct {
  border-color: var(--ok);
  background: #eafbf1;
  box-shadow: 0 6px 0 #a9e6c3;
  animation: bounce 0.4s ease;
}

.numline {
  padding: 6px clamp(8px, 1.6vw, 20px) 0;
}

.nl-track {
  position: relative;
  height: clamp(78px, 9vw, 96px);
}

.nl-rail {
  position: absolute;
  left: 0;
  right: 0;
  top: 58px;
  height: 4px;
  border-radius: 999px;
  background: #f0e4d2;
}

.nl-num {
  position: absolute;
  top: 48px;
  transform: translateX(-50%);
  padding: 1px 2px;
  background: #fff;
  font-size: clamp(10.5px, 1.4vw, 15px);
  font-weight: 800;
  color: #b3a9c2;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nl-num.is-passed {
  color: #7bbfa8;
}

.nl-num.is-here {
  color: var(--theme-deep);
  transform: translateX(-50%) scale(1.35);
}

.nl-runner {
  position: absolute;
  top: 10px;
  font-size: clamp(22px, 3.2vw, 30px);
  line-height: 1;
  transform: translateX(-50%);
  transition: left 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.nl-runner.is-hopping {
  animation: bunnyHop 0.32s ease;
}

.jump-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 10px;
}

.jump-left {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(12px, 1.4vw, 13.5px);
  font-weight: 800;
  color: var(--ink-soft);
}

.jump-left b {
  font-size: clamp(14px, 1.7vw, 16.5px);
  color: var(--theme-deep);
}

.paws {
  letter-spacing: 2px;
  font-size: clamp(13px, 1.5vw, 15px);
}

.paw {
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.paw.is-used {
  opacity: 0.22;
  transform: scale(0.8);
}

.next-q {
  text-align: center;
  font-size: clamp(13.5px, 1.9vw, 17px);
  font-weight: 800;
  color: var(--ink-soft);
}

.next-num {
  text-align: center;
  font-size: clamp(64px, 10vw, 104px);
  font-weight: 900;
  line-height: 1;
  color: var(--theme);
  margin: clamp(4px, 0.8vw, 8px) 0;
}

.seq-toggle {
  display: block;
  margin: 10px auto 0;
  padding: 2px 6px;
  border: 0;
  background: none;
  color: #a89dc0;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.seq-strip {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.seq-strip[hidden] {
  display: none;
}

.seq-strip span {
  display: grid;
  place-items: center;
  width: clamp(21px, 2.6vw, 30px);
  aspect-ratio: 1;
  border-radius: 8px;
  background: #fffaf1;
  font-size: clamp(10.5px, 1.3vw, 14px);
  font-weight: 800;
  color: #a89dc0;
}

.seq-strip span.is-here {
  background: var(--theme);
  color: #fff;
}

.seq-strip span.is-next {
  background: var(--theme-soft);
  color: var(--theme-deep);
  box-shadow: inset 0 0 0 2px var(--theme);
}

/* ============================================================
   句子小火车（speak.html）
   ============================================================ */

.speak-stage {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: clamp(300px, 46vh, 420px);
}

.build {
  display: grid;
  justify-items: center;
  gap: clamp(10px, 1.6vw, 16px);
  width: 100%;
}

.build-pic {
  display: grid;
  justify-items: center;
  gap: 4px;
}

.build-pic > span {
  display: grid;
  place-items: center;
  width: clamp(72px, 10vw, 104px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--theme-soft);
  font-size: clamp(40px, 5.4vw, 54px);
  line-height: 1;
}

.build-pic em {
  font-style: normal;
  font-size: clamp(11px, 1.3vw, 12.5px);
  font-weight: 800;
  color: var(--ink-soft);
}

.slots {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(5px, 1vw, 10px);
  width: 100%;
}

.slot {
  display: grid;
  place-items: center;
  min-width: clamp(56px, 8vw, 84px);
  height: clamp(46px, 6vw, 60px);
  padding: 0 6px;
  border: 3px dashed #ecdcc4;
  border-radius: 16px;
  background: #fffaf1;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.slot.is-over {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.slot.is-filled {
  padding: 0;
  border-color: transparent;
  background: transparent;
}

.slot-num {
  font-size: 12px;
  font-weight: 900;
  color: #cbbfae;
}

.wtray {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(5px, 1vw, 10px);
  width: 100%;
  min-height: 62px;
  padding: 10px 12px;
  border: 2px dashed #e9dcc9;
  border-radius: 20px;
  background: #f9f5ee;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.wtray.is-over {
  border-color: var(--theme);
  background: var(--theme-soft);
}

.wcard {
  position: relative;
  padding: clamp(8px, 1.1vw, 11px) clamp(12px, 1.6vw, 17px);
  border: 0;
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(15px, 2vw, 19px);
  font-weight: 900;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  box-shadow: 0 4px 0 #e9d7bd;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.wcard.is-dragging {
  z-index: 60;
  cursor: grabbing;
  box-shadow: 0 10px 18px rgba(120, 90, 60, 0.22);
  transition: none;
}

.say {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: 100%;
}

.say-pic {
  font-size: clamp(44px, 6vw, 66px);
  line-height: 1;
}

.say-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  font-size: clamp(21px, 3.4vw, 33px);
  font-weight: 900;
  letter-spacing: 0.01em;
  line-height: 1.4;
}

.sw {
  padding: 1px 5px;
  border-radius: 10px;
  transition: background 0.2s ease, color 0.2s ease;
}

.say-line .sw:last-child::after {
  content: ".";
}

.sw.is-ok {
  background: #e3f9ee;
  color: #2aa06a;
}

.sw-dot {
  font-size: 0.9em;
}

.say-zh {
  font-size: clamp(11.5px, 1.35vw, 13px);
  font-weight: 800;
  color: var(--ink-soft);
}

.say-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 4px;
}

.listen-btn {
  padding: clamp(10px, 1.4vw, 13px) clamp(14px, 1.9vw, 20px);
  border: 0;
  border-radius: 18px;
  background: #fff;
  color: var(--theme-deep);
  font-size: clamp(13px, 1.6vw, 15px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--theme-soft), inset 0 0 0 2px var(--theme-soft);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.listen-btn:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--theme-soft), inset 0 0 0 2px var(--theme-soft);
}

.mic-btn {
  display: grid;
  justify-items: center;
  gap: 2px;
  min-width: 104px;
  padding: 10px 22px 12px;
  border: 0;
  border-radius: 22px;
  background-image: var(--theme-grad);
  color: #fff;
  font-size: clamp(12.5px, 1.5vw, 14.5px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 6px 0 var(--theme-shadow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.mic-btn:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--theme-shadow);
}

.mic-ico {
  font-size: clamp(23px, 2.8vw, 27px);
  line-height: 1.2;
}

.mic-btn.is-listening {
  animation: micPulse 1.1s ease-in-out infinite;
}

.mic-hint {
  min-height: 20px;
  font-size: clamp(11.5px, 1.35vw, 13px);
  font-weight: 800;
  color: #a89dc0;
  text-align: center;
  line-height: 1.5;
}

.skip-btn {
  padding: 2px 6px;
  border: 0;
  background: none;
  color: #a89dc0;
  font-size: 12px;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

/* ============================================================
   AI 乐园（ai.html）
   ============================================================ */

.ai-lessons {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(clamp(148px, 40vw, 250px), 100%), 1fr));
  gap: clamp(10px, 1.4vw, 14px);
}

.ai-lesson {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(12px, 1.6vw, 17px);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 6px 0 #f1e6d5;
  cursor: pointer;
  transition: box-shadow 0.15s ease, filter 0.15s ease;
}

.ai-lesson:hover {
  box-shadow: 0 9px 0 #f1e6d5, 0 16px 30px rgba(120, 90, 60, 0.1);
  filter: brightness(1.015);
}

.lesson-no {
  position: absolute;
  top: 12px;
  right: 14px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #e3edff;
  color: var(--theme-deep);
  font-size: 10.5px;
  font-weight: 900;
}

.ai-lesson .lesson-emoji {
  font-size: clamp(26px, 3.2vw, 32px);
  line-height: 1;
}

.ai-lesson h3 {
  margin: 8px 0 4px;
  font-size: clamp(14.5px, 1.7vw, 16.5px);
}

.lesson-body {
  display: none;
  margin-top: 6px;
  font-size: clamp(12px, 1.4vw, 13.5px);
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink-soft);
}

.lesson-body p {
  margin: 0 0 6px;
}

.lesson-body b {
  color: var(--theme-deep);
}

.ai-lesson.is-open .lesson-body {
  display: block;
}

.lesson-speak {
  display: none;
  align-self: flex-start;
  margin-top: 8px;
  padding: 6px 12px;
  border: 0;
  border-radius: 999px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: 11.5px;
  font-weight: 900;
  cursor: pointer;
}

.ai-lesson.is-open .lesson-speak {
  display: inline-block;
}

.ai-lesson.is-done::after {
  content: "✓ 已读";
  position: absolute;
  top: 10px;
  right: 12px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #eafbf1;
  color: #2aa06a;
  font-size: 10.5px;
  font-weight: 900;
}

.ai-lesson.is-done .lesson-no {
  display: none;
}

.chat-panel {
  flex: 1 1 auto;
  min-height: clamp(300px, 44vh, 420px);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: clamp(10px, 1.6vw, 18px);
}

.chat-box {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 6px 2px;
}

.chat-msg {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: clamp(13.5px, 1.6vw, 15px);
  font-weight: 700;
  line-height: 1.65;
}

.chat-msg.ai {
  align-self: flex-start;
  background: #fff;
  box-shadow: 0 3px 0 #f1e6d5;
}

.chat-msg.user {
  align-self: flex-end;
  background-image: var(--theme-grad);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
}

.chat-msg.is-typing {
  opacity: 0.6;
  animation: blink 1.2s infinite;
}

.chat-chips {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.chat-chip {
  padding: 8px 14px;
  border: 2px solid var(--theme-soft);
  border-radius: 999px;
  background: #fff;
  color: var(--theme-deep);
  font-size: clamp(11.5px, 1.35vw, 13px);
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}

.chat-chip:hover {
  background: var(--theme-soft);
}

.chat-form {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.chat-form input {
  flex: 1;
  padding: clamp(10px, 1.3vw, 13px) 16px;
  border: 2px solid #f1e6d6;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  font-size: clamp(13.5px, 1.6vw, 15px);
  font-weight: 700;
  outline: none;
  transition: border-color 0.15s ease;
}

.chat-form input:focus {
  border-color: var(--theme);
}

.chat-form button {
  padding: clamp(10px, 1.3vw, 13px) clamp(16px, 2.2vw, 26px);
  border: 0;
  border-radius: 16px;
  background-image: var(--theme-grad);
  color: #fff;
  font-size: clamp(13px, 1.5vw, 14.5px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--theme-shadow);
}

.chat-form button:active {
  transform: translateY(2px);
}

.chat-form button:disabled {
  opacity: 0.6;
}

/* AI 互动课件播放器 */
.lesson-player {
  position: fixed;
  inset: 0;
  z-index: 115;
  display: grid;
  place-items: center;
  padding: clamp(12px, 2vw, 22px);
  background: var(--bg);
}

.lp-inner {
  width: min(620px, 100%);
  max-height: 100%;
  overflow-y: auto;
  text-align: center;
  position: relative;
}

.lp-close {
  position: absolute;
  top: -6px;
  right: 0;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 3px 0 #f1e6d5;
  font-size: 16px;
  cursor: pointer;
}

.lp-title {
  margin: 0 40px 8px 0;
  font-size: clamp(14px, 1.7vw, 16px);
  font-weight: 900;
  color: var(--theme-deep);
}

.lp-scene {
  min-height: clamp(220px, 30vw, 270px);
  display: grid;
  place-items: center;
  padding: 10px;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 0 #f1e6d5;
}

.sc-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
}

.sc-big {
  font-size: clamp(44px, 7vw, 72px);
  line-height: 1;
  animation: bob 2.8s ease-in-out infinite;
}

.sc-arrow {
  font-size: clamp(24px, 3.6vw, 36px);
  font-weight: 900;
  color: #c9bfae;
}

.sc-laptop {
  position: relative;
  font-size: clamp(64px, 10vw, 108px);
  line-height: 1;
  cursor: pointer;
  display: inline-block;
}

.sc-ai {
  position: absolute;
  top: 18%;
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(24px, 3.6vw, 36px);
}

.sc-tap {
  border: 0;
  background: none;
  cursor: pointer;
  transition: transform 0.15s ease;
  position: relative;
  display: inline-grid;
  place-items: center;
}

.sc-tap:active {
  transform: scale(0.9);
}

.sc-dev, .sc-sense, .sc-act {
  font-size: clamp(40px, 6.4vw, 64px);
  line-height: 1.1;
}

.sc-ask {
  padding: 12px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 0 #f1e6d5;
  font-size: clamp(13.5px, 1.7vw, 15.5px);
  font-weight: 900;
  color: var(--ink);
}

.sc-tap.is-done {
  opacity: 0.55;
}

.tap-mark {
  position: absolute;
  top: -8px;
  right: -10px;
  font-size: 22px;
  font-style: normal;
  animation: pop 0.25s ease;
}

.lp-say {
  margin: 14px 0 4px;
  font-size: clamp(14.5px, 2vw, 19px);
  font-weight: 900;
  line-height: 1.7;
  color: var(--ink);
}

.lp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.lp-progress {
  font-size: 12px;
  font-weight: 900;
  color: #a89dc0;
}

.lp-next {
  padding: clamp(10px, 1.4vw, 13px) clamp(20px, 2.6vw, 28px);
  border: 0;
  border-radius: 16px;
  background-image: var(--theme-grad);
  color: #fff;
  font-size: clamp(14px, 1.6vw, 15.5px);
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 4px 0 var(--theme-shadow);
}

.lp-next:active {
  transform: translateY(2px);
}

.lp-next.is-hidden {
  visibility: hidden;
}

/* ============================================================
   登录页（login.html 专属结构）
   ============================================================ */

.card {
  width: min(380px, 100%);
  padding: clamp(22px, 3vw, 32px) clamp(20px, 2.6vw, 28px) clamp(18px, 2.4vw, 26px);
  border-radius: var(--r-lg);
  background: #fff;
  box-shadow: 0 10px 0 #f2e6d5, 0 24px 50px rgba(120, 90, 60, 0.12);
  text-align: center;
}

.field {
  position: relative;
}

.field input {
  padding-right: 44px;
  letter-spacing: 0.12em;
  font-size: clamp(15px, 2vw, 17px);
}

.field input.long {
  letter-spacing: 0.04em;
  font-size: 15px;
  text-align: left;
}

#eye {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  font-size: 16px;
  cursor: pointer;
  box-shadow: none;
}

.sub-en {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.22em;
  color: #b3a9c2;
  text-transform: uppercase;
}

.sub {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: #8a8098;
}

.note {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.7;
  color: #b3a9c2;
}

/* 识字注音 */
.hz-stage {
  display: grid;
  place-items: center;
  min-height: clamp(120px, 15vw, 140px);
}

.hz-note {
  margin-top: 4px;
  font-size: clamp(12px, 1.4vw, 13px);
  font-weight: 800;
  color: var(--theme-deep);
}

.more {
  flex: 0 0 auto;
  margin-top: clamp(16px, 2.4vw, 28px);
}

.more-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(clamp(200px, 26vw, 280px), 100%), 1fr));
  gap: var(--gap);
}

.more-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: clamp(14px, 1.9vw, 20px);
  border-radius: var(--r-md);
  background: #fff;
  box-shadow: 0 8px 0 #f2e6d5;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.16s ease, filter 0.16s ease;
}

.more-card:hover {
  box-shadow: 0 11px 0 #f2e6d5, 0 18px 34px rgba(120, 90, 60, 0.1);
  filter: brightness(1.015);
}

.more-card:active {
  transform: translateY(4px);
  box-shadow: 0 3px 0 #f2e6d5;
}

.more-icon {
  display: grid;
  place-items: center;
  width: clamp(44px, 5.4vw, 54px);
  height: clamp(44px, 5.4vw, 54px);
  flex: 0 0 auto;
  border-radius: 18px;
  font-size: clamp(21px, 2.6vw, 27px);
  background: #f4edff;
}

.more-card.en .more-icon {
  background: #e2f8f4;
}

.more-card h3 {
  font-size: clamp(14.5px, 1.7vw, 17px);
  letter-spacing: 0.02em;
}

.more-card p {
  margin-top: 4px;
  font-size: clamp(11.5px, 1.3vw, 12.5px);
  font-weight: 700;
  line-height: 1.5;
  color: var(--ink-soft);
}

.more-go {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 900;
  color: #b3a9c2;
}

.star-total {
  display: none;
}

/* ============================================================
   全站隐藏滚动条（保留滚动能力，仅去掉视觉滚动条）
   ============================================================ */

* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* 旧 Edge */
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome / Safari / Edge */
}

/* ============================================================
   全站隐藏滚动条（保留滚动能力，仅去掉视觉滚动条）
   ============================================================ */

* {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* 旧 Edge */
}

*::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome / Safari / Edge */
}

/* 音标学习：口型提示 + 发音按钮排布 */
.ipa-zh {
  margin-top: 6px;
  font-size: clamp(14px, 1.8vw, 17px);
  font-weight: 900;
  color: var(--theme-deep);
}

.ipa-tip {
  margin-top: 6px;
  padding: 9px 16px;
  display: inline-block;
  border-radius: 14px;
  background: var(--theme-soft);
  color: var(--theme-deep);
  font-size: clamp(13px, 1.6vw, 15.5px);
  font-weight: 800;
}

.ipa-say-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: clamp(8px, 1.2vw, 14px);
}

.ipa-say-row .say-btn {
  margin-top: 0;
}

/* ============================================================
   马里奥角色皮肤（透明渲染图）
   图标位 = 白色圆角底板 + 透明角色图；图自带 6% 内边距，所以这里几乎不再加 padding
   ============================================================ */
.char-ico {
  display: block;
  box-sizing: border-box;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* 填满方框型图标位（图片画布已含留白）
   grid 容器里百分比高度会退化成 auto，所以用绝对定位钉死 */
.char-ico--plate {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 2%;
}

/* 按字号高的行内小图 */
.char-ico--glyph {
  height: 1.4em;
  width: auto;
  margin: 0 auto;
}

/* 正文里夹的小角色图（例如聊天欢迎语） */
.char-inline {
  height: 1.25em;
  width: auto;
  margin-left: 0.2em;
  vertical-align: -0.26em;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* 所有图标位统一白底，和角色图的白底无缝衔接 */
.brand-mark,
.subject-icon,
.tile-icon,
.badge-ico,
.more-icon,
.play-tab-ico,
.ai-lesson .lesson-emoji,
.monster-face {
  position: relative;
  overflow: hidden;
  background: #fff;
  box-shadow: inset 0 0 0 1.5px rgba(120, 92, 56, 0.1);
}

.brand-mark {
  background: #fff;
}

/* 拖拽游戏页签 */
.play-tab-ico {
  display: grid;
  place-items: center;
  width: clamp(34px, 3.9vw, 42px);
  height: clamp(34px, 3.9vw, 42px);
  border-radius: 12px;
  overflow: hidden;
}

/* AI 小课卡片图标 */
.ai-lesson .lesson-emoji {
  display: grid;
  place-items: center;
  width: clamp(42px, 4.8vw, 52px);
  height: clamp(42px, 4.8vw, 52px);
  border-radius: 14px;
  overflow: hidden;
}

/* 喂小怪兽：库巴的脸要看得清 */
.monster-face {
  display: grid;
  place-items: center;
  width: clamp(58px, 7vw, 86px);
  height: clamp(58px, 7vw, 86px);
  border-radius: 18px;
  overflow: hidden;
}

.badge-ico {
  border-radius: 10px;
  overflow: hidden;
}

.badge-ico .char-ico {
  padding: 2%;
}

/* 吉祥物：透明 PNG 直接叠在奶油底上 */
img.char-mascot {
  height: auto;
  object-fit: contain;
  animation: bob 3.4s ease-in-out infinite;
}

.home-hero .hero-mascot { order: 1; }
.home-hero h1 { order: 2; }
.home-hero .eyebrow { order: 3; }

.home-hero .hero-mascot { order: 1; }
.home-hero h1 { order: 2; }
.home-hero .eyebrow { order: 3; }

.home-hero img.char-mascot {
  height: clamp(96px, 13vw, 164px);
  width: auto;
}

.area-mascot img.char-mascot {
  height: clamp(76px, 9.4vw, 118px);
  width: auto;
  animation-duration: 3.8s;
}

/* 封面里换上去的角色小图 */
.tile-cover .char-ico--glyph {
  height: clamp(30px, 3.8vw, 46px);
}
