/* ===== 幼儿启蒙乐园 · 公共样式 ===== */
:root {
  --orange: #ff8f5a;
  --orange-d: #f2703a;
  --green: #4cc38a;
  --green-d: #2fa877;
  --blue: #55a8f5;
  --blue-d: #2f8ce0;
  --purple: #a97bf0;
  --purple-d: #8b5ce0;
  --pink: #ff7b9c;
  --yellow: #ffc743;
  --red: #ff5a5a;
  --ink: #3c3a4e;
  --ink-2: #7a7691;
  --line: #ece9f5;
  --card: #ffffff;
  --bg: #fff7ef;
  --radius: 22px;
  --shadow: 0 8px 22px rgba(120, 100, 180, .13);
  --shadow-l: 0 14px 34px rgba(120, 100, 180, .18);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  font-family: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1000px 500px at 12% -10%, #ffe6d0 0%, transparent 60%),
    radial-gradient(900px 480px at 105% 5%, #dff1ff 0%, transparent 55%),
    radial-gradient(700px 500px at 50% 120%, #e9e3ff 0%, transparent 60%),
    var(--bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  padding-bottom: 40px;
}

button { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 4px 16px rgba(120, 100, 180, .08);
}
.topbar h1 {
  font-size: 20px;
  margin: 0;
  flex: 1;
  text-align: center;
  font-weight: 800;
  letter-spacing: 1px;
}
.icon-btn {
  width: 42px; height: 42px;
  border: none;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 20px;
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink);
  text-decoration: none;
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.9); }

/* ---------- 容器 ---------- */
.wrap { max-width: 780px; margin: 0 auto; padding: 18px 16px 40px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}
.card-title {
  font-size: 17px;
  font-weight: 800;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 首页 ---------- */
.hero { text-align: center; padding: 26px 10px 10px; }
.hero .logo { font-size: 46px; }
.hero h2 { margin: 6px 0 4px; font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.hero p { margin: 0; color: var(--ink-2); font-size: 14px; }

.home-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 22px; }
.home-card {
  border-radius: 26px;
  padding: 22px 16px;
  text-align: center;
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-l);
  transition: transform .16s;
  display: block;
}
.home-card:active { transform: scale(.96); }
.home-card .big { font-size: 44px; line-height: 1.1; }
.home-card .t { font-size: 19px; font-weight: 900; margin-top: 8px; letter-spacing: 2px; }
.home-card .d { font-size: 12px; opacity: .92; margin-top: 4px; }
.c-math { background: linear-gradient(140deg, #ffab6b, #f2703a); }
.c-cn { background: linear-gradient(140deg, #7ad3a5, #2fa877); }
.c-en { background: linear-gradient(140deg, #7bbcff, #2f8ce0); }
.c-py { background: linear-gradient(140deg, #7fe0dc, #22a7a0); }
.c-poem { background: linear-gradient(140deg, #ffb199, #e14b4b); }
.c-print { background: linear-gradient(140deg, #ffd98a, #f2a93b); }
.c-science { background: linear-gradient(140deg, #7fd3f0, #2f7fb8); }
.c-review { background: linear-gradient(140deg, #9ad7f5, #3b8fd0); }
.c-logic { background: linear-gradient(140deg, #f6a8d8, #d357a7); }
.c-story { background: linear-gradient(140deg, #c3b1ec, #8b6cc9); }
.c-admin { background: linear-gradient(140deg, #c39bf5, #8b5ce0); }
.c-hero { background: linear-gradient(140deg, #ffb05a, #e0433a); }
.home-grid > :last-child:nth-child(odd) { grid-column: 1 / -1; }
.stat-grid.four { grid-template-columns: repeat(4, 1fr); }
.stat-grid.five { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 460px) {
  .stat-grid.four { grid-template-columns: repeat(2, 1fr); }
  .stat-grid.five { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 按钮 ---------- */
.btn {
  border: none;
  border-radius: 16px;
  padding: 13px 22px;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(140deg, #ffab6b, #f2703a);
  box-shadow: 0 6px 14px rgba(242, 112, 58, .32);
  cursor: pointer;
  transition: transform .12s;
  letter-spacing: 1px;
}
.btn:active { transform: translateY(2px); }
.btn.green { background: linear-gradient(140deg, #7ad3a5, #2fa877); box-shadow: 0 6px 14px rgba(47, 168, 119, .32); }
.btn.blue { background: linear-gradient(140deg, #7bbcff, #2f8ce0); box-shadow: 0 6px 14px rgba(47, 140, 224, .32); }
.btn.purple { background: linear-gradient(140deg, #c39bf5, #8b5ce0); box-shadow: 0 6px 14px rgba(139, 92, 224, .32); }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 10px rgba(120, 100, 180, .14); }
.btn.sm { padding: 9px 16px; font-size: 14px; border-radius: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }

/* ---------- 选项芯片 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 10px; }
.chip {
  border: 2px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 16px;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.chip.on {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(140deg, #ffab6b, #f2703a);
  box-shadow: 0 4px 12px rgba(242, 112, 58, .3);
}
.chip.on.green { background: linear-gradient(140deg, #7ad3a5, #2fa877); box-shadow: 0 4px 12px rgba(47, 168, 119, .3); }
.chip.on.blue { background: linear-gradient(140deg, #7bbcff, #2f8ce0); box-shadow: 0 4px 12px rgba(47, 140, 224, .3); }
.chip.on.purple { background: linear-gradient(140deg, #c39bf5, #8b5ce0); box-shadow: 0 4px 12px rgba(139, 92, 224, .3); }

/* ---------- 进度条 ---------- */
.progress {
  height: 14px;
  background: #f1eefb;
  border-radius: 999px;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffc743, #ff8f5a);
  transition: width .35s ease;
}
.meta-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--ink-2); font-weight: 700; margin-bottom: 6px;
}

/* ---------- 题目区 ---------- */
.question {
  text-align: center;
  padding: 8px 0 4px;
}
.q-text { font-size: 30px; font-weight: 900; letter-spacing: 2px; line-height: 1.5; }
.q-word { font-size: 21px; font-weight: 800; line-height: 1.7; color: #4a4667; }
.q-illus {
  margin: 12px 0 4px;
  font-size: 26px;
  line-height: 1.6;
  word-break: break-all;
  min-height: 34px;
}
.dot-row { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0; }
.dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: linear-gradient(140deg, #ffc743, #ff8f5a);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .08);
}
.dot.blue { background: linear-gradient(140deg, #7bbcff, #2f8ce0); }

/* ---------- 答案按钮 ---------- */
.options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 18px; }
.opt {
  border: 3px solid var(--line);
  background: #fff;
  border-radius: 20px;
  padding: 20px 10px;
  font-size: 26px;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  transition: transform .12s, border-color .15s, background .15s;
}
.opt:active { transform: scale(.96); }
.opt.right { border-color: var(--green); background: #e9fbf2; color: #1f8f61; }
.opt.wrong { border-color: var(--red); background: #ffeeee; color: #d63c3c; }
.opt.dim { opacity: .5; }
.opt.word-opt { font-size: 19px; padding: 16px 10px; }

/* ---------- 数字键盘 ---------- */
.answer-screen {
  border: 3px dashed #ffd7b8;
  background: #fff9f4;
  border-radius: 20px;
  padding: 14px;
  font-size: 34px;
  font-weight: 900;
  text-align: center;
  min-height: 68px;
  margin-top: 14px;
  color: var(--orange-d);
}
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.key {
  border: none;
  background: #fff;
  border-radius: 16px;
  padding: 14px 0;
  font-size: 22px;
  font-weight: 900;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.key:active { transform: scale(.94); }
.key.act { background: linear-gradient(140deg, #ffab6b, #f2703a); color: #fff; }

/* ---------- 结果页 ---------- */
.score-num { font-size: 60px; font-weight: 900; text-align: center; color: var(--orange-d); line-height: 1.1; }
.stars { text-align: center; font-size: 34px; margin: 6px 0 10px; letter-spacing: 4px; }
.wrong-item {
  display: flex; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border-radius: 14px; background: #fff5f5; margin-bottom: 8px;
  font-size: 15px; font-weight: 600;
}
.wrong-item .r { color: var(--green-d); font-weight: 800; }
.wrong-item .w { color: var(--red); font-weight: 800; }
.wrong-row { gap: 8px; flex-wrap: wrap; }
.wrong-row .info { min-width: 0; flex: 1 1 60%; }
.wrong-row .mini-btn { flex: 0 0 auto; }

/* ---------- 识字卡片 ---------- */
.flip-card { perspective: 1200px; height: 300px; cursor: pointer; }
.flip-inner {
  position: relative; width: 100%; height: 100%;
  transition: transform .55s cubic-bezier(.4, .2, .2, 1);
  transform-style: preserve-3d;
}
.flip-card.flipped .flip-inner { transform: rotateY(180deg); }
.face {
  position: absolute; inset: 0;
  backface-visibility: hidden;
  border-radius: 26px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  box-shadow: var(--shadow-l);
  padding: 20px;
}
.face.front { background: linear-gradient(150deg, #ffffff, #f4fbf7); border: 4px solid #d6f2e4; }
.face.back { background: linear-gradient(150deg, #7ad3a5, #2fa877); color: #fff; transform: rotateY(180deg); }
.big-char { font-size: 132px; font-weight: 900; line-height: 1; color: var(--ink); }
.big-pinyin { font-size: 34px; font-weight: 800; margin-bottom: 4px; }
.big-word { font-size: 24px; font-weight: 700; opacity: .95; }
.face .hint { position: absolute; bottom: 14px; font-size: 13px; color: var(--ink-2); }
.face.back .hint { color: rgba(255, 255, 255, .85); }

/* ---------- 通用网格 ---------- */
.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
.tile {
  background: #fff; border-radius: 18px; box-shadow: var(--shadow);
  padding: 14px 8px; text-align: center; cursor: pointer;
  border: 3px solid transparent; transition: transform .12s;
}
.tile:active { transform: scale(.95); }
.tile.sel { border-color: var(--green); background: #eefbf5; }
.tile .em { font-size: 32px; }
.tile .en { font-weight: 800; font-size: 15px; margin-top: 4px; }
.tile .zh { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.input, .textarea, .select {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 11px 14px;
  font-size: 16px;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  outline: none;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--orange); }
.textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.form-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }

/* ---------- 列表 ---------- */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 16px; background: #fbfaff; margin-bottom: 8px;
}
.list-item .ch { font-size: 26px; font-weight: 900; width: 44px; text-align: center; }
.list-item .info { flex: 1; min-width: 0; }
.list-item .info b { font-size: 15px; }
.list-item .info span { display: block; font-size: 12px; color: var(--ink-2); }
.mini-btn {
  border: none; background: #fff; border-radius: 10px; padding: 7px 11px;
  font-size: 13px; font-weight: 700; cursor: pointer; box-shadow: 0 2px 6px rgba(120, 100, 180, .14);
}
.mini-btn.danger { color: var(--red); }

/* ---------- 提示 / 空态 ---------- */
.empty { text-align: center; padding: 30px 10px; color: var(--ink-2); }
.empty .e { font-size: 44px; }
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(20px);
  background: rgba(60, 58, 78, .94); color: #fff; padding: 11px 20px; border-radius: 999px;
  font-size: 14px; font-weight: 700; opacity: 0; pointer-events: none; transition: .28s; z-index: 90;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 奖励遮罩 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80;
  display: none; align-items: center; justify-content: center;
  background: rgba(50, 40, 80, .35); backdrop-filter: blur(3px);
}
.overlay.show { display: flex; }
.reward-box {
  background: #fff; border-radius: 28px; padding: 26px 26px 20px; text-align: center;
  width: min(340px, 86vw); box-shadow: var(--shadow-l); animation: pop .38s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes pop { from { transform: scale(.6); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.reward-box .em { font-size: 62px; }
.reward-box .tt { font-size: 22px; font-weight: 900; margin: 4px 0 2px; }
.reward-box .ss { color: var(--ink-2); font-size: 14px; margin-bottom: 14px; }
.reward-box .stars { font-size: 30px; letter-spacing: 3px; margin: 4px 0 12px; }

.confetti-piece {
  position: fixed; top: -14px; z-index: 95; pointer-events: none;
  width: 10px; height: 14px; border-radius: 3px;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(720deg); opacity: .15; }
}

/* ---------- 每日任务 / 贴纸墙 ---------- */
.daily-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 16px; background: #fbfaff;
  margin-bottom: 10px; text-decoration: none; color: var(--ink);
}
.daily-row:active { transform: scale(.985); }
.daily-row .ic { font-size: 22px; width: 30px; text-align: center; }
.daily-row .nm { font-size: 15px; font-weight: 800; min-width: 64px; }
.daily-row .nm i { display: block; font-style: normal; font-size: 12px; color: var(--ink-2); font-weight: 600; }
.daily-row .st { font-size: 13px; font-weight: 800; color: var(--orange-d); white-space: nowrap; }
.sticker-wall { font-size: 30px; line-height: 1.7; letter-spacing: 4px; word-break: break-all; }
.stk {
  display: inline-block; animation: stkpop .4s cubic-bezier(.2, 1.4, .4, 1);
}
@keyframes stkpop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.overlay.daily-ov { z-index: 85; }
.overlay.daily-ov .reward-box .em { font-size: 72px; }

/* ---------- 老师讲解 ---------- */
.explain-box {
  margin-top: 16px;
  border-radius: 18px;
  padding: 14px 14px 12px;
  background: linear-gradient(160deg, #fff8ec, #fdf1e0);
  border: 2px solid #ffe0bd;
  animation: expop .3s cubic-bezier(.2, 1.3, .4, 1);
}
@keyframes expop { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }
.ex-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ex-head .em { font-size: 30px; }
.ex-head b { display: block; font-size: 16px; }
.ex-head i { font-style: normal; font-size: 12px; color: var(--orange-d); font-weight: 700; }
.ex-steps { display: flex; flex-direction: column; gap: 10px; }
.ex-step { display: flex; gap: 10px; align-items: flex-start; }
.ex-step .no {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: linear-gradient(140deg, #ffab6b, #f2703a); color: #fff;
  font-size: 12px; font-weight: 900; display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
}
.ex-step .tx { flex: 1; font-size: 15px; line-height: 1.75; font-weight: 600; }
.ex-tip {
  margin-top: 12px; padding: 9px 12px; border-radius: 12px;
  background: #fff; font-size: 13px; line-height: 1.7; color: var(--ink-2); font-weight: 600;
}
.dot-gone { opacity: .22; filter: grayscale(1); }
.overlay.explain-ov { z-index: 86; }
.overlay.explain-ov .reward-box { padding: 20px; }

/* ---------- 统计小格 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat {
  background: #fbfaff; border-radius: 18px; padding: 14px 8px; text-align: center;
}
.stat b { display: block; font-size: 24px; color: var(--orange-d); }
.stat span { font-size: 12px; color: var(--ink-2); }

input[type=range] { width: 100%; accent-color: var(--orange); height: 26px; }
.muted { color: var(--ink-2); font-size: 13px; line-height: 1.7; }
.center { text-align: center; }
.mt { margin-top: 16px; }
.hide { display: none !important; }

@media (max-width: 420px) {
  .big-char { font-size: 104px; }
  .q-text { font-size: 26px; }
  .options { gap: 10px; }
  .opt { font-size: 22px; padding: 16px 8px; }
  .g4 { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 拼音模块 ===== */
.py-tile {
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 12px 6px; text-align: center; cursor: pointer; transition: transform .12s;
  border: 3px solid transparent;
}
.py-tile:active { transform: scale(.94); }
.py-tile.sel { border-color: var(--purple); background: #f6f1ff; }
.py-tile .py { font-size: 27px; font-weight: 900; line-height: 1.2; }
.py-tile .eg { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.tone-opts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.tone-opt {
  border: 3px solid var(--line); background: #fff; border-radius: 20px;
  padding: 14px 4px; cursor: pointer; text-align: center; transition: .12s;
}
.tone-opt:active { transform: scale(.95); }
.tone-opt .sym { font-size: 34px; font-weight: 900; line-height: 1; }
.tone-opt .nm { font-size: 13px; color: var(--ink-2); margin-top: 4px; }
.tone-opt.right { border-color: var(--green); background: #e9fbf2; }
.tone-opt.wrong { border-color: var(--red); background: #ffeeee; }
.tone-opt.dim { opacity: .45; }
.py-big { font-size: 82px; font-weight: 900; line-height: 1.1; letter-spacing: 2px; }
.py-blend { font-size: 60px; font-weight: 900; letter-spacing: 4px; }
.py-blend .s { color: var(--purple-d); }
.py-blend .y { color: var(--orange-d); }

/* ===== 打印中心 ===== */
.print-area { background: #fff; }
.hz-grid { display: grid; gap: 10px; }
.hz-card {
  border: 1px dashed #b9b9c8; border-radius: 10px; padding: 8px 6px 10px;
  text-align: center; background: #fff; break-inside: avoid; page-break-inside: avoid;
}
.hz-card .tian { width: 100%; max-width: 150px; }
.hz-card .pin { font-size: 20px; font-weight: 800; color: #444; margin-top: 6px; }
.hz-card .wd { font-size: 14px; color: #666; margin-top: 2px; }
.hz-card .em { font-size: 26px; margin-top: 2px; }
/* 田字格 */
.tian {
  position: relative; width: 100%; aspect-ratio: 1 / 1; margin: 0 auto;
  border: 2px solid #7b7b8c; border-radius: 4px; background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.tian b {
  font-size: clamp(46px, 11vw, 104px); font-weight: 900; line-height: 1;
  position: relative; z-index: 1; font-family: "KaiTi", "STKaiti", "PingFang SC", serif;
}
.tian::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed #c6c6d4; }
.tian::after { content: ''; position: absolute; top: 0; bottom: 0; left: 50%; border-left: 1px dashed #c6c6d4; }
.tian.small b { font-size: clamp(34px, 7vw, 62px); }

/* 口算题纸 */
.sheet { background: #fff; color: #222; }
.sheet-head {
  display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between;
  border-bottom: 2px solid #333; padding-bottom: 6px; margin-bottom: 12px; font-size: 14px;
}
.sheet-title { text-align: center; font-size: 20px; font-weight: 900; letter-spacing: 2px; margin-bottom: 8px; }
.sheet-grid { display: grid; gap: 14px 18px; }
.mcell { display: flex; align-items: baseline; gap: 6px; font-size: 19px; font-weight: 700; line-height: 35px; }
.mcell .bl { flex: 1; border-bottom: 1px solid #555; height: 1.05em; min-width: 35px; }
.mcell.word { display: block; font-size: 15px; font-weight: 600; line-height: 1.7; }
.mcell .no { color: #888; font-weight: 700; margin-right: 2px; display:none; }
.ans-box { margin-top: 16px; border-top: 1px dashed #999; padding-top: 10px; font-size: 13px; line-height: 2; }
.ans-box span { display: inline-block; min-width: 62px; }
.print-bar {
  position: sticky; bottom: 0; z-index: 20; display: flex; gap: 12px; justify-content: center;
  padding: 12px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px);
  border-top: 1px solid var(--line);
}
.paper {
  background: #fff; border-radius: 8px; box-shadow: 0 6px 22px rgba(80, 70, 130, .16);
  padding: 18mm 14mm; margin: 0 auto; max-width: 210mm; min-height: 297mm;
}

/* ===== 唐诗点读 ===== */
.poem-head { text-align: center; margin-bottom: 6px; }
.poem-head h2 { margin: 0 0 2px; font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.poem-box {
  background: linear-gradient(160deg, #fffdf7, #fdf6e9);
  border: 1px solid #f0e6cf; border-radius: 20px; padding: 16px 8px; margin-top: 10px;
}
.poem-line {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 2px;
  padding: 5px 6px; border-radius: 12px; cursor: pointer; transition: background .15s;
}
.poem-line:hover { background: rgba(255, 255, 255, .75); }
.poem-line.reading { background: #fff2df; box-shadow: inset 0 0 0 2px #ffd7b8; }
.pz {
  display: inline-flex; flex-direction: column; align-items: center;
  min-width: 2.1em; padding: 2px 0; border-radius: 8px;
}
.pz i { font-style: normal; font-size: clamp(11px, 2.6vw, 14px); color: #8b5ce0; line-height: 1.6; }
.pz b {
  font-size: clamp(20px, 5.6vw, 32px); font-weight: 700; line-height: 1.45;
  font-family: "KaiTi", "STKaiti", "楷体", "PingFang SC", serif;
}
.hide-py .pz i { visibility: hidden; }
.hide-zi .pz b { visibility: hidden; }
.pz.mask i, .pz.mask b { visibility: hidden; }
.pz.mask { background: #e7e3f2; box-shadow: inset 0 0 0 2px #d6d0e8; }
.pz-plain { display: block; text-align: center; margin: 4px 0; }
.pz-plain i { display: block; font-style: normal; font-size: 13px; color: #8b5ce0; }
.pz-plain b { font-size: 26px; font-weight: 700; }
.poem-item { cursor: pointer; }

/* ===== 逻辑训练 ===== */
.seq-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; }
.seq-tile {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 38px; min-width: 52px; height: 52px; padding: 0 8px;
  border-radius: 14px; background: #fbfaff; box-shadow: 0 2px 8px rgba(120, 100, 180, .12);
  border: 2px solid #ece9f5;
}
.seq-tile:last-child { background: #fff2df; border-color: #ffd7b8; color: #f2703a; }

.cmp-row { display: flex; gap: 10px; justify-content: center; align-items: flex-end; flex-wrap: wrap; }
.cmp-col { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: 70px; }
.cmp-emo { font-size: 24px; line-height: 1.1; letter-spacing: 2px; min-height: 26px; word-break: break-all; }
.cmp-lbl { font-size: 14px; font-weight: 800; color: var(--ink); }
.cmp-lbl i { font-style: normal; color: var(--ink-2); font-weight: 600; font-size: 12px; }

.mt-grid { display: grid; gap: 8px; max-width: 320px; margin: 4px auto 0; }
.mt-cell {
  font-size: 36px; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center;
  background: #fbfaff; border-radius: 12px; box-shadow: inset 0 0 0 2px #ece9f5;
}
.mt-hole { color: #f2703a; font-weight: 900; background: #fff2df; box-shadow: inset 0 0 0 2px #ffd7b8; }

.memory-grid { display: grid; gap: 10px; }
.mem-card {
  aspect-ratio: 1 / 1; cursor: pointer; perspective: 800px;
}
.mem-inner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform .5s cubic-bezier(.4, .2, .2, 1);
}
.mem-card.flipped .mem-inner { transform: rotateY(180deg); }
.mem-back, .mem-front {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  border-radius: 16px; backface-visibility: hidden; font-size: 36px;
  box-shadow: 0 4px 12px rgba(120, 100, 180, .14);
}
.mem-back { background: linear-gradient(140deg, #c39bf5, #8b5ce0); color: #fff; font-weight: 900; }
.mem-front { background: linear-gradient(160deg, #fff7ec, #fdf1e0); transform: rotateY(180deg); }
.mem-card.matched .mem-back { background: linear-gradient(140deg, #7ad3a5, #2fa877); }
.mem-card.matched .mem-front { background: linear-gradient(160deg, #e9fbf2, #d3f1e0); }
.mem-card:active { transform: scale(.96); }

/* ===== 山海经故事 ===== */
.story-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.story-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: 18px; background: linear-gradient(160deg, #fff7ec, #fdf1e0);
  box-shadow: 0 4px 12px rgba(120, 100, 180, .12);
  cursor: pointer; transition: transform .12s;
}
.story-item:active { transform: scale(.97); }
.story-item .cover {
  position: relative; flex: 0 0 64px; height: 64px; border-radius: 14px;
  background: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: inset 0 0 0 2px #f5e6c8;
  font-size: 28px; gap: 2px;
}
.story-item .cover .ribbon {
  position: absolute; right: -6px; top: -6px;
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(140deg, #ffab6b, #f2703a);
  color: #fff; font-size: 14px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(242, 112, 58, .4);
}
.story-item .info { flex: 1; min-width: 0; }
.story-item .info b { display: block; font-size: 16px; }
.story-item .info span { display: block; font-size: 12px; color: var(--ink-2); margin: 2px 0 4px; }
.story-item .tag-row { display: flex; align-items: center; gap: 6px; }
.chip-tag {
  display: inline-block; background: #fff; color: #f2703a; font-size: 11px;
  padding: 2px 8px; border-radius: 999px; font-weight: 700;
  box-shadow: inset 0 0 0 1.5px #ffd7b8;
}

.story-head { text-align: center; margin-bottom: 10px; }
.story-head .cover {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 96px; height: 96px; border-radius: 22px; background: #fff;
  box-shadow: inset 0 0 0 2px #f5e6c8;
  font-size: 36px; gap: 4px; margin-bottom: 6px;
}
.story-head .cover .ribbon {
  position: absolute; right: -8px; top: -8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(140deg, #ffab6b, #f2703a); color: #fff;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(242, 112, 58, .4);
}
.story-head h2 { margin: 0 0 4px; font-size: 24px; font-weight: 900; letter-spacing: 2px; }
.story-meta { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink-2); font-weight: 700; margin: 12px 0 6px; }
.story-page {
  margin: 12px 0; padding: 18px 14px; border-radius: 18px;
  background: linear-gradient(160deg, #fffdf7, #fdf6e9); border: 1px solid #f0e6cf;
  min-height: 160px;
}
.story-illus { text-align: center; margin-bottom: 10px; }
.story-text {
  font-size: 18px; line-height: 2.0; font-weight: 600; color: #3c3a4e;
  text-align: justify; text-indent: 2em; margin: 0;
  font-family: "KaiTi", "STKaiti", "PingFang SC", serif;
}
.story-moral {
  font-size: 16px; line-height: 1.9; color: #1f8f61; font-weight: 700;
  background: #e9fbf2; padding: 14px 16px; border-radius: 14px; border-left: 4px solid var(--green);
  margin: 0;
}
.story-ask {
  font-size: 15px; line-height: 1.9; color: #4a4667; font-weight: 600;
  background: #fff7ec; padding: 14px 16px; border-radius: 14px; border-left: 4px solid #ffab6b;
  margin: 0;
}

/* ===== 两弹一星元勋 ===== */
.hero-bio {
  font-size: 18px; line-height: 2.0; font-weight: 600; color: #3c3a4e;
  text-align: justify; text-indent: 2em; margin: 0 0 12px;
  font-family: "KaiTi", "STKaiti", "PingFang SC", serif;
  border-radius: 14px; padding: 8px 12px; cursor: pointer;
  transition: background .15s, box-shadow .15s, transform .1s;
}
.hero-bio:active { transform: scale(.995); }
.hero-bio.on {
  background: #fff3e6; box-shadow: inset 0 0 0 2px #ffd7b8;
}
.hero-deeds {
  margin: 0; padding-left: 22px;
}
.hero-deeds li {
  font-size: 15px; line-height: 1.9; font-weight: 700; color: #4a4667;
  margin-bottom: 6px;
}
.hero-quote {
  margin: 14px 0 0; padding: 14px 16px; border-radius: 14px;
  background: linear-gradient(160deg, #fff7ec, #fdeede);
  border-left: 4px solid var(--red);
  font-size: 16px; font-weight: 800; color: #c0392b; line-height: 1.8;
  text-align: center; font-family: "KaiTi", "STKaiti", "PingFang SC", serif;
}

/* ===== 故事互动：复述支架 / 录音 / 分层提问 ===== */
.inter-lead {
  font-size: 17px; font-weight: 800; color: #3c3a4e; margin: 0 0 4px;
}
.chip-tag.talk { background: #fdeaf3; color: #c2418a; }

/* 复述支架 */
.scaffold { display: flex; flex-direction: column; gap: 10px; margin: 12px 0 14px; }
.sc-row {
  display: flex; align-items: flex-start; gap: 10px;
  background: #f8f9ff; border-radius: 14px; padding: 10px 12px;
}
.sc-lab {
  flex: none; font-size: 13px; font-weight: 800; color: #5b5bd6;
  background: #eceefd; padding: 4px 9px; border-radius: 9px; white-space: nowrap;
}
.sc-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.sc-card {
  font-size: 14px; font-weight: 700; color: #3c3a4e;
  background: #fff; border: 2px solid #dfe3f5; border-radius: 11px;
  padding: 5px 11px; cursor: pointer; user-select: none;
  transition: transform .12s, border-color .12s, background .12s;
}
.sc-card:active { transform: scale(.94); background: #eceefd; border-color: #5b5bd6; }

/* 录音条 */
.rec-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  background: #f8f9ff; border-radius: 14px; padding: 10px 12px; margin: 10px 0;
}
.rec-tip { font-size: 12px; color: #6c6a8a; font-weight: 600; flex: 1; min-width: 140px; }
.rec-tip.rec { color: #d63b56; font-weight: 800; }
.rec-tip.rec::before {
  content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: #d63b56; margin-right: 6px; vertical-align: middle;
  animation: recBlink 1s infinite;
}
@keyframes recBlink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }

/* 提问卡 */
.quiz-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.quiz-head .chip { font-size: 13px; font-weight: 800; }
.quiz-head .muted { font-size: 13px; font-weight: 700; }
.quiz-q {
  font-size: 18px; line-height: 1.8; font-weight: 800; color: #3c3a4e;
  background: #fff7ec; border-left: 4px solid #ffab6b;
  padding: 14px 16px; border-radius: 14px; margin: 0 0 12px;
}
.quiz-box {
  font-size: 14px; line-height: 1.8; font-weight: 600; color: #4a4667;
  background: #f2f6ff; border-radius: 12px; padding: 11px 14px; margin-top: 8px;
  border-left: 4px solid #7d9bf5;
}
.quiz-box.ans { background: #eefaf3; border-left-color: var(--green); }
.quiz-box b { display: block; margin-bottom: 3px; }

/* 家长引导 */
.parent-tip {
  font-size: 13px; line-height: 1.8; color: #6c6a8a; font-weight: 600;
  background: #f5f5fb; padding: 11px 14px; border-radius: 12px;
  margin: 10px 0 0; border-left: 4px solid #b9b6d6;
}

@media (max-width: 460px) {
  .story-grid { grid-template-columns: 1fr; }
  .sc-row { flex-direction: column; gap: 7px; }
  .quiz-q { font-size: 16px; }
}

/* ===== 科学原理实验室 ===== */
.sci-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.sci-item {
  display: flex; align-items: center; gap: 12px;
  background: #f8f9ff; border: 2px solid #e6e9f7; border-radius: 16px;
  padding: 12px; cursor: pointer; transition: transform .12s, border-color .12s;
}
.sci-item:active { transform: scale(.97); border-color: #5b5bd6; }
.sci-item .sci-ic { font-size: 34px; flex: none; }
.sci-item .info { flex: 1; min-width: 0; }
.sci-item .info b { display: block; font-size: 15px; color: #3c3a4e; }
.sci-item .info span { display: block; font-size: 12px; color: #6c6a8a; margin: 2px 0 4px; }
.sci-item .tag-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

.sci-head { text-align: center; margin-bottom: 12px; }
.sci-emoji { font-size: 54px; line-height: 1; }
.sci-head h2 { margin: 6px 0 2px; font-size: 20px; color: #3c3a4e; }
.sci-meta { display: flex; justify-content: space-between; font-size: 12px; color: #6c6a8a; font-weight: 700; }
.sci-step {
  font-size: 17px; line-height: 1.9; font-weight: 700; color: #3c3a4e;
  background: #fff7ec; border-left: 4px solid #ffab6b;
  padding: 14px 16px; border-radius: 14px; margin: 12px 0 8px;
}
.sci-step-sub { font-size: 14px; color: #6c6a8a; font-weight: 600; min-height: 22px; padding: 0 4px; }
.sci-tip {
  font-size: 15px; line-height: 1.9; color: #1f8f61; font-weight: 700;
  background: #e9fbf2; padding: 14px 16px; border-radius: 14px;
  border-left: 4px solid var(--green); margin: 0;
}
.sci-ask {
  font-size: 15px; line-height: 1.9; color: #4a4667; font-weight: 600;
  background: #fff7ec; padding: 14px 16px; border-radius: 14px;
  border-left: 4px solid #ffab6b; margin: 0;
}

/* 装配台 */
.build-board {
  position: relative; width: 100%; height: 300px;
  background: linear-gradient(180deg, #eef1ff 0%, #f7f8ff 100%);
  border: 2px dashed #c9cfee; border-radius: 18px; margin-bottom: 14px;
  overflow: hidden;
}
.build-board .slot {
  position: absolute; transform: translate(-50%, -50%);
  width: 62px; height: 56px; margin: 0;
  border: 2px dashed #a8b0e0; border-radius: 14px; background: rgba(255, 255, 255, .6);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .15s, background .15s, transform .15s;
}
.build-board .slot .slot-nm {
  font-size: 10px; color: #8a90bd; font-weight: 800; text-align: center; padding: 0 2px;
}
.build-board .slot.hot { border-color: var(--green); background: #e9fbf2; transform: translate(-50%, -50%) scale(1.08); }
.build-board .slot.filled {
  border-style: solid; border-color: var(--green); background: #e9fbf2;
  animation: slotPop .3s ease;
}
.build-board .slot .pe { font-size: 30px; display: flex; align-items: center; justify-content: center; }
/* 工程图零件（SVG）在零件盘与槽位里的尺寸 */
.part .pe svg { display: block; width: 46px; height: 40px; }
.build-board .slot .pe svg { display: block; width: 52px; height: 45px; }
@keyframes slotPop { 0% { transform: translate(-50%, -50%) scale(.6); } 60% { transform: translate(-50%, -50%) scale(1.15); } 100% { transform: translate(-50%, -50%) scale(1); } }

/* 零件盘 */
.part-tray {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center;
  background: #f8f9ff; border-radius: 14px; padding: 12px; min-height: 62px;
}
.part {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 62px; padding: 7px 4px;
  background: #fff; border: 2px solid #dfe3f5; border-radius: 14px;
  cursor: grab; user-select: none; touch-action: none;
  transition: transform .12s, border-color .12s, opacity .12s;
}
.part:active { cursor: grabbing; }
.part .pe { font-size: 26px; line-height: 1.1; display: flex; align-items: center; justify-content: center; }
.part .pn { font-size: 10px; font-weight: 800; color: #5b5bd6; }
.part.is-dragging { opacity: .25; }
.part.used { opacity: .3; border-style: dashed; cursor: default; filter: grayscale(1); }
.part-ghost {
  box-shadow: 0 8px 22px rgba(60, 58, 78, .22); border-color: #5b5bd6;
  transform: scale(1.1) rotate(-3deg); background: #fff;
}
.build-hint {
  font-size: 14px; line-height: 1.8; font-weight: 600; color: #4a4667;
  background: #f2f6ff; border-left: 4px solid #7d9bf5;
  border-radius: 12px; padding: 10px 14px; margin-top: 10px;
}

/* ---- 完成后的成品动画 ---- */
.build-board.done { border-style: solid; border-color: var(--green); background: linear-gradient(180deg, #eafaf3 0%, #f7f8ff 100%); }
/* 火箭发射 */
.build-board.anim-launch { animation: sciLaunch 2s cubic-bezier(.5, 0, .8, .3) forwards; }
@keyframes sciLaunch { 0% { transform: translateY(0); } 25% { transform: translateY(6px); } 100% { transform: translateY(-320px); opacity: .15; } }
/* 活塞上下 */
.build-board.anim-piston [data-slot="e3"] { animation: sciPiston .9s ease-in-out infinite; }
@keyframes sciPiston { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -130%); } }
.build-board.anim-piston [data-slot="e5"] { animation: sciSpin 1.8s linear infinite; }
/* 灯泡亮 */
.build-board.anim-light [data-slot="c4"] { animation: sciBulb 1s ease-in-out infinite; }
@keyframes sciBulb { 0%, 100% { filter: brightness(1); transform: translate(-50%, -50%) scale(1); } 50% { filter: brightness(1.7) drop-shadow(0 0 12px #ffd83d); transform: translate(-50%, -50%) scale(1.16); } }
/* 杠杆撬动 */
.build-board.anim-lever [data-slot="l2"] { animation: sciLever 1.4s ease-in-out infinite; transform-origin: 80% 50%; }
@keyframes sciLever { 0%, 100% { transform: translate(-50%, -50%) rotate(-13deg); } 50% { transform: translate(-50%, -50%) rotate(6deg); } }
.build-board.anim-lever [data-slot="l3"] { animation: sciRock 1.4s ease-in-out infinite; }
@keyframes sciRock { 0%, 100% { transform: translate(-50%, -50%); } 50% { transform: translate(-50%, -78%); } }
/* 齿轮转动 */
@keyframes sciSpin { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes sciSpinRev { from { transform: translate(-50%, -50%) rotate(0deg); } to { transform: translate(-50%, -50%) rotate(-360deg); } }
.build-board.anim-gear [data-slot="g1"] { animation: sciSpin 3s linear infinite; }
.build-board.anim-gear [data-slot="g2"] { animation: sciSpinRev 1.5s linear infinite; }

/* ---- 原理动画舞台 ---- */
.sci-stage { position: relative; margin: 12px 0 4px; background: #f4f6ff; border-radius: 16px; padding: 8px 4px; }
.sci-stage svg { width: 100%; max-width: 430px; display: block; margin: 0 auto; }
.sci-panel {
  position: absolute; right: 10px; bottom: 10px;
  background: #1f2440; color: #d7e3ff; border-radius: 10px;
  padding: 7px 10px; font-size: 11px; font-weight: 700; line-height: 1.8;
  box-shadow: 0 4px 12px rgba(31, 36, 64, .28); min-width: 138px; pointer-events: none;
}
.sci-panel div { white-space: nowrap; }

/* 管路流动 */
.pipe-flow { stroke-dasharray: 4 10; animation: pipeFlow .7s linear infinite; }
.pipe-fuel { stroke: #e2543a; }
.pipe-ox { stroke: #3b8fd0; }
@keyframes pipeFlow { to { stroke-dashoffset: -14; } }

/* 场景显隐（注意：闪烁类动画只加在子元素上，避免覆盖这里的组级 opacity） */
.sci-stage .g-flame, .sci-stage .g-sonic, .sci-stage .g-parts,
.sci-stage .g-plume, .sci-stage .g-arrows { opacity: 0; transition: opacity .6s; }
.sci-stage.scene-2 .g-flame, .sci-stage.scene-3 .g-flame,
.sci-stage.scene-2 .g-sonic, .sci-stage.scene-3 .g-sonic,
.sci-stage.scene-2 .g-parts, .sci-stage.scene-3 .g-parts { opacity: 1; }
.sci-stage.scene-3 .g-plume, .sci-stage.scene-3 .g-arrows { opacity: 1; }

/* 火焰闪烁（子元素级） */
.sci-stage .g-flame ellipse {
  transform-box: fill-box; transform-origin: center;
  animation: flameFlick .5s ease-in-out infinite alternate;
}
@keyframes flameFlick { from { transform: scale(1); opacity: .85; } to { transform: scale(1.12, .92); opacity: 1; } }

/* 音速线闪烁（子元素级） */
.sci-stage .g-sonic line { animation: sonicBlink 1.1s ease-in-out infinite; }
@keyframes sonicBlink { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }

/* 马赫环脉动（子元素级，逐个错开） */
.sci-stage .g-plume .diamond {
  transform-box: fill-box; transform-origin: center;
  animation: diaPulse .7s ease-in-out infinite alternate;
}
.sci-stage .g-plume .d2 { animation-delay: .2s; }
.sci-stage .g-plume .d3 { animation-delay: .35s; }
@keyframes diaPulse { from { transform: scale(.72); opacity: .55; } to { transform: scale(1.12); opacity: 1; } }

/* 场景3：整箭缓缓上浮 = 飞起来啦 */
.sci-stage.scene-3 svg { animation: rocketBob 1s ease-in-out infinite alternate; }
@keyframes rocketBob { from { transform: translateY(0); } to { transform: translateY(-9px); } }

@media (max-width: 460px) { .sci-panel { font-size: 10px; min-width: 120px; } }

/* ---- 发动机：四冲程 ---- */
.sci-stage .g-piston { transform: translateY(0); transition: transform .55s cubic-bezier(.4, 0, .3, 1); }
.sci-stage.scene-2 .g-piston { transform: translateY(30px); }   /* 吸气：下行 */
.sci-stage.scene-3 .g-piston { transform: translateY(-10px); }  /* 压缩：上行 */
.sci-stage.scene-4 .g-piston { transform: translateY(34px); }   /* 做功：被猛推下 */
.sci-stage.scene-5 .g-piston { transform: translateY(-10px); }  /* 排气：上行 */
.sci-stage .g-valve { transform: translateY(0); transition: transform .35s; }
.sci-stage.scene-2 .valve-in { transform: translateY(8px); }
.sci-stage.scene-5 .valve-out { transform: translateY(8px); }
.sci-stage .gas { fill: #c9d6ea; opacity: 0; transform-box: fill-box; transform-origin: center; transition: fill .45s, opacity .45s, transform .45s; }
.sci-stage.scene-1 .gas { opacity: .35; }
.sci-stage.scene-2 .gas { fill: #7ec4f0; opacity: .6; transform: scale(1.04, 1.3); }
.sci-stage.scene-3 .gas { fill: #e8935a; opacity: .85; transform: scale(.88, .5); }
.sci-stage.scene-4 .gas { fill: #ff7a3d; opacity: .95; transform: scale(1.06, 1.15); }
.sci-stage.scene-5 .gas { fill: #aab3c4; opacity: .5; transform: scale(1, .8); }
.sci-stage .g-spark { opacity: 0; transition: opacity .3s; }
.sci-stage.scene-4 .g-spark { opacity: 1; }
.sci-stage .g-spark path { transform-box: fill-box; transform-origin: center; animation: sparkFlash .35s steps(2) infinite; }
@keyframes sparkFlash { from { transform: scale(.72); opacity: .55; } to { transform: scale(1.18); opacity: 1; } }
.sci-stage .g-crank { transform-origin: 180px 238px; }
.sci-stage.scene-4 .g-crank, .sci-stage.scene-5 .g-crank { animation: crankSpin 1.2s linear infinite; }
@keyframes crankSpin { to { transform: rotate(360deg); } }

/* ---- 电路 ---- */
.sci-stage .current { opacity: 0; stroke-dasharray: 9 15; transition: opacity .4s; }
.sci-stage.scene-2 .current, .sci-stage.scene-3 .current { opacity: 1; animation: curFlow .9s linear infinite; }
@keyframes curFlow { to { stroke-dashoffset: -24; } }
.sci-stage .sw-blade { transform-origin: 160px 55px; transform: rotate(-34deg); transition: transform .35s; }
.sci-stage.scene-2 .sw-blade, .sci-stage.scene-3 .sw-blade { transform: rotate(0deg); }
.sci-stage .bulb-glow { opacity: 0; transform-box: fill-box; transform-origin: center; transition: opacity .4s; }
.sci-stage.scene-3 .bulb-glow { opacity: .5; animation: bulbBreathe 1.1s ease-in-out infinite alternate; }
@keyframes bulbBreathe { from { transform: scale(.85); } to { transform: scale(1.12); } }
.sci-stage .bulb-glass { transition: fill .4s; }
.sci-stage.scene-3 .bulb-glass { fill: #ffe27a; }

/* ---- 杠杆 ---- */
.sci-stage .g-bar { transform-origin: 170px 183px; transform: rotate(0deg); transition: transform .6s cubic-bezier(.4, 0, .3, 1); }
.sci-stage.scene-2 .g-bar { transform: rotate(-9deg); }
.sci-stage.scene-3 .g-bar { transform: rotate(-18deg); }
.sci-stage .g-rock { transform: translateY(0); transition: transform .6s cubic-bezier(.4, 0, .3, 1); }
.sci-stage.scene-3 .g-rock { transform: translateY(-30px); }
.sci-stage .g-force { opacity: 0; transition: opacity .4s; }
.sci-stage.scene-2 .g-force, .sci-stage.scene-3 .g-force { opacity: 1; }

/* ---- 齿轮 ---- */
.sci-stage .gear-a { transform-origin: 135px 130px; }
.sci-stage .gear-b { transform-origin: 221px 130px; }
.sci-stage.scene-2 .gear-a, .sci-stage.scene-3 .gear-a { animation: spinCW 4s linear infinite; }
.sci-stage.scene-2 .gear-b, .sci-stage.scene-3 .gear-b { animation: spinCCW 2s linear infinite; }
@keyframes spinCW { to { transform: rotate(360deg); } }
@keyframes spinCCW { to { transform: rotate(-360deg); } }
.sci-stage .g-dir { opacity: 0; transition: opacity .4s; }
.sci-stage.scene-3 .g-dir { opacity: 1; }

@media (max-width: 460px) {
  .sci-grid { grid-template-columns: 1fr; }
  .build-board { height: 260px; }
  .build-board .slot { width: 54px; height: 50px; }
  .part { width: 54px; }
}

/* ===== 打印样式 ===== */
@page { size: A4 portrait; margin: 10mm; }
@media print {
  html, body { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  .topbar, .print-bar, .no-print, .toast, .overlay { display: none !important; }
  .wrap { max-width: none; padding: 0 !important; margin: 0 !important; }
  .card { box-shadow: none !important; background: #fff !important; padding: 0 !important; margin: 0 !important; border: none !important; }
  .paper { box-shadow: none !important; padding: 0 !important; margin: 0 !important; max-width: none; min-height: 0; }
  .hz-card { border-color: #999; }
  .tian { border-color: #000; }
  .tian::before, .tian::after { border-color: #999; }
  .mcell, .sheet-head, .sheet-title { color: #000; }
  .hz-grid, .sheet-grid { gap: 8mm 10mm; }
  .ans-box { page-break-before: auto; }
}

/* ===== 简笔画画廊 ===== */
.c-draw { background: linear-gradient(140deg, #c39bf5, #8b5ce0); }

.draw-stage {
  position: relative;
  margin: 4px auto 14px;
  max-width: 500px;
  background: #fff;
  border-radius: 18px;
  box-shadow: inset 0 0 0 3px #f3eddf, var(--shadow);
  overflow: hidden;
}
.draw-stage canvas {
  display: block;
  width: 100%;
  height: auto;
  cursor: crosshair;
  touch-action: none;
}

.toolbar {
  display: flex; flex-direction: column; gap: 8px;
  background: #f8f9ff; border-radius: 14px; padding: 10px 12px;
  margin-bottom: 10px;
}
.tool-row {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.tool-row + .tool-row { padding-top: 8px; border-top: 1px dashed #dfe3f5; }

.color-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot {
  width: 30px; height: 30px; border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px #dfe3f5;
  cursor: pointer; padding: 0;
  transition: transform .12s, box-shadow .12s;
}
.color-dot:active { transform: scale(.9); }
.color-dot.on { box-shadow: 0 0 0 2px #5b5bd6, 0 0 0 5px #eceefd; transform: scale(1.1); }

.size-row { display: flex; align-items: center; gap: 6px; }
.size-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: #7a7691; border: 3px solid #fff;
  box-shadow: 0 0 0 2px #dfe3f5;
  cursor: pointer; padding: 0;
  transition: transform .12s, box-shadow .12s;
}
.size-dot[data-size="9"] { width: 26px; height: 26px; }
.size-dot[data-size="16"] { width: 32px; height: 32px; }
.size-dot.on { box-shadow: 0 0 0 2px #5b5bd6, 0 0 0 5px #eceefd; }
.size-btn {
  border: 2px solid #dfe3f5; background: #fff;
  border-radius: 12px; padding: 6px 12px;
  font-size: 14px; font-weight: 800; color: #5b5bd6;
  cursor: pointer;
}
.size-btn.on { background: #5b5bd6; color: #fff; border-color: #5b5bd6; }

.tool-btn {
  flex: 1 1 30%;
  border: 2px solid #dfe3f5; background: #fff;
  border-radius: 12px; padding: 9px 10px;
  font-size: 14px; font-weight: 800; color: #4a4667;
  cursor: pointer; transition: .12s;
}
.tool-btn:active { transform: scale(.96); background: #eceefd; }

.save-row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.save-row .btn { flex: 1 1 40%; max-width: 200px; }

#aiState { transition: opacity .3s; }

/* 画廊 */
.gallery {
  display: grid; gap: 12px;
  grid-template-columns: repeat(2, 1fr);
}
@media (min-width: 540px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.g-card {
  background: #fff; border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.g-img {
  position: relative; width: 100%; aspect-ratio: 1 / 1;
  background: linear-gradient(160deg, #fffdf7, #fdf6e9);
  overflow: hidden;
}
.g-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.g-info {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 8px 10px 4px; font-size: 13px; font-weight: 800;
  color: #3c3a4e;
}
.g-ic { font-size: 18px; }
.g-act {
  display: flex; gap: 6px; padding: 6px 10px 10px;
}
.g-act .mini-btn { flex: 1; font-size: 12px; padding: 6px 4px; }

.badge {
  display: inline-block; font-size: 11px; font-weight: 800;
  padding: 2px 7px; border-radius: 999px;
  background: #eceefd; color: #5b5bd6;
  margin-left: auto;
}
.badge.green { background: #e9fbf2; color: #1f8f61; }
.badge.purple { background: #f6f1ff; color: #8b5ce0; }
.badge.red { background: #ffeeee; color: #d63c3c; }

@media (max-width: 460px) {
  .tool-btn { flex: 1 1 28%; }
  .gallery { grid-template-columns: 1fr 1fr; }
}

/* ===== 英语音标 ===== */
.c-phon { background: linear-gradient(140deg, #7bbcff, #2f8ce0); }

.tag-line { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; flex-wrap: wrap; }
.ph-card {
  position: relative;
  background: #fff; border-radius: 16px; box-shadow: var(--shadow);
  padding: 12px 12px 12px; margin-bottom: 10px;
  cursor: pointer; transition: transform .12s, box-shadow .12s, border-color .15s;
  border: 3px solid transparent;
}
.ph-card:active { transform: scale(.97); }
.ph-card.v { border-color: #cfe6ff; }
.ph-card.vl { border-color: #cfe0ff; }
.ph-card.vd { border-color: #cdf3e2; }
.ph-card.sel { border-color: var(--orange); box-shadow: 0 6px 16px rgba(242, 112, 58, .25); }
.ph-card.locked { cursor: default; }
.ph-card.correct { border-color: var(--green); background: #eefbf4; }
.ph-card.wrong { border-color: var(--red); background: #fff0f0; }
.ph-ipa { font-size: 26px; font-weight: 900; color: #2f8ce0; letter-spacing: 1px; }
.ph-card.v .ph-ipa { color: #2f8ce0; }
.ph-card.vl .ph-ipa { color: #3b6fd0; }
.ph-card.vd .ph-ipa { color: #1f8f61; }
.ph-name { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-left: 6px; }
.ph-eg { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ph-em { font-size: 26px; }
.ph-word { font-size: 17px; font-weight: 800; color: #3c3a4e; }
.ph-zh { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.ph-voice { display: inline-block; font-size: 11px; font-weight: 800; margin-top: 6px; padding: 1px 8px; border-radius: 999px; }
.ph-card.vl .ph-voice { background: #e9f1ff; color: #2f8ce0; }
.ph-card.vd .ph-voice { background: #eafaf2; color: #1f8f61; }
.ph-tip { font-size: 12.5px; line-height: 1.7; color: #6c6a8a; font-weight: 600; margin-top: 6px; }
.ph-play {
  position: absolute; top: 10px; right: 10px;
  border: none; background: #eef4ff; border-radius: 12px;
  width: 36px; height: 36px; font-size: 16px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ph-play:active { transform: scale(.9); }

/* 清浊配对 */
.pair-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pair-col-title { font-size: 14px; font-weight: 800; text-align: center; margin-bottom: 8px; color: #3c3a4e; }
.pair-grid .ph-card { margin-bottom: 10px; }
.pair-progress { text-align: center; font-size: 15px; font-weight: 800; color: var(--orange-d); margin-top: 10px; }
.pair-tip { background: #fff7ec; border-left: 4px solid #ffab6b; border-radius: 10px; padding: 9px 12px; font-size: 13px; font-weight: 700; color: #4a4667; margin: 0 0 12px; line-height: 1.7; }
#pairResult { font-size: 15px; font-weight: 800; color: #1f8f61; }

@media (max-width: 460px) {
  .pair-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .ph-ipa { font-size: 22px; }
}

