:root {
  --bg: #FFF6E9;
  --card: #FFFFFF;
  --ink: #3B332A;
  --ink-2: #7A6E60;
  --ink-3: #A79B8B;
  --line: #F0E4D2;
  --chinese: #F5893B;
  --chinese-soft: #FFF0E2;
  --math: #3D8BF5;
  --math-soft: #E6F0FF;
  --biology: #1FA97F;
  --biology-soft: #E5F6F0;
  --geography: #B5713A;
  --geography-soft: #FAF0E5;
  --history: #A63A46;
  --history-soft: #FBEEEF;
  --green: #34B37E;
  --green-soft: #E4F7EF;
  --red: #EF5B5B;
  --red-soft: #FDEBEB;
  --amber: #F5B21E;
  --purple: #8B6FE8;
  --r-lg: 24px;
  --r-md: 18px;
  --r-sm: 12px;
  --shadow: 0 6px 0 rgba(59, 51, 42, .07);
}

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

/* 关键：保证带 hidden 属性的元素（遮罩/底栏/返回键/提示）始终隐藏，
   避免作者样式里的 display:flex 等覆盖了浏览器默认的 [hidden]{display:none} */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: contain;
}

body {
  min-height: 100vh;
  /* 静态柔和渐变：顶部暖白、底部浅橙，替代原先飘动的云朵装饰 */
  background:
    radial-gradient(120% 70% at 50% 0%, #FFFCF5 0%, rgba(255, 252, 245, 0) 60%),
    linear-gradient(180deg, #FFF6E9 0%, #FFF1DE 55%, #FFEAD2 100%);
  background-attachment: fixed;
}
body.has-tab { padding-bottom: 84px; }

button { font-family: inherit; font-size: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: rgba(255, 246, 233, .92);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.topbar-title { flex: 1; text-align: center; font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.back-btn {
  padding: 7px 15px; border-radius: 999px;
  background: #fff; border: 2px solid var(--line);
  font-size: 15px; font-weight: 600; color: var(--ink-2);
  box-shadow: 0 2px 0 var(--line);
}
.back-btn:active { transform: translateY(2px); box-shadow: none; }
.icon-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 999px;
  background: #fff; border: 2px solid var(--line);
  font-size: 15px; font-weight: 700; color: var(--amber);
  box-shadow: 0 2px 0 var(--line);
}
.star-ico { font-size: 16px; }

/* ---------- 主区 ---------- */
#app { position: relative; z-index: 1; max-width: 880px; margin: 0 auto; padding: 18px 16px 20px; }

.page-head { margin: 6px 0 20px; }
.page-head h1 { font-size: 26px; margin: 0 0 6px; font-weight: 800; letter-spacing: .5px; }
.page-head p { margin: 0; color: var(--ink-2); font-size: 15px; }

/* ---------- 卡片网格 ---------- */
.grid { display: grid; gap: 14px; }
.grid.g2 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.grid.g3 { grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); }
.grid.g4 { grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); }

.card {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 18px 16px;
  box-shadow: var(--shadow);
  text-align: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card.tap:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(59,51,42,.07); }
.card.locked { opacity: .5; }
.card.locked .card-title { color: var(--ink-3); }

.card-emoji { font-size: 40px; line-height: 1; display: block; margin-bottom: 8px; }
.card-title { font-size: 19px; font-weight: 700; margin: 0 0 4px; }
.card-sub { font-size: 13px; color: var(--ink-2); margin: 0; }
.card-tag {
  display: inline-block; margin-top: 9px; padding: 3px 11px;
  border-radius: 999px; font-size: 12px; font-weight: 700;
  background: var(--line); color: var(--ink-2);
}
.card-tag.soon { background: #EFEADD; color: var(--ink-3); }

.subject-card.chinese { border-color: #FBD9B8; background: linear-gradient(#FFFBF5, #FFF3E6); }
.subject-card.math { border-color: #C7DEFB; background: linear-gradient(#F8FBFF, #EAF3FF); }
.subject-card.biology { border-color: #BFE6D8; background: linear-gradient(#F6FCF9, #E9F7F1); }
.subject-card.geography { border-color: #E7C9A6; background: linear-gradient(#FCF6EF, #FAF0E5); }
.subject-card.history { border-color: #EBBCC3; background: linear-gradient(#FDF4F5, #FBEEEF); }
.subject-card .card-emoji { font-size: 46px; }

/* ---------- 单元列表 ---------- */
.unit {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 15px 16px; margin-bottom: 12px;
  box-shadow: var(--shadow); text-align: left; width: 100%;
}
.unit:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(59,51,42,.07); }
.unit.locked { opacity: .55; }
.unit-idx {
  flex: none; width: 46px; height: 46px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; color: #fff;
}
.unit-idx.chinese { background: var(--chinese); }
.unit-idx.math { background: var(--math); }
.unit-idx.biology { background: var(--biology); }
.unit-idx.geography { background: var(--geography); }
.unit-idx.history { background: var(--history); }
.unit-idx.lock { background: var(--ink-3); }
.unit-body { flex: 1; min-width: 0; }
.chapter-title {
  margin: 18px 0 10px; padding-left: 12px; font-size: 15px; font-weight: 800;
  color: var(--biology); border-left: 4px solid var(--biology); line-height: 1.3;
}
.lesson-list { display: flex; flex-direction: column; gap: 10px; }
.unit-name { font-size: 17px; font-weight: 700; margin: 0 0 2px; }
.unit-desc { font-size: 13px; color: var(--ink-2); margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.unit-right { flex: none; text-align: right; font-size: 12px; color: var(--ink-3); font-weight: 700; }

/* 进度环 */
.ring { flex: none; width: 46px; height: 46px; }
.ring circle { fill: none; stroke-width: 5; }
.ring .bg { stroke: var(--line); }
.ring .fg { stroke: var(--green); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; }
.ring-txt { font-size: 11px; font-weight: 800; fill: var(--green); }

/* ---------- 学习卡 ---------- */
.lesson-nav { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 999px;
  border: 2px solid var(--line); background: #fff;
  font-size: 14px; font-weight: 700; color: var(--ink-2);
}
.chip.on { background: var(--ink); color: #fff; border-color: var(--ink); }

/* 我的成长·学习进度 多级折叠（手风琴：年级 → 科目 → 单元） */
.acc-g { margin-bottom: 10px; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; overflow: hidden; }
.acc-h, .acc-h2 { width: 100%; display: flex; align-items: center; gap: 8px; padding: 12px 14px;
  border: none; background: transparent; color: var(--ink); cursor: pointer; text-align: left; font-family: inherit; }
.acc-h { background: #FBF3E6; font-size: 16px; }
.acc-h2 { padding-left: 32px; font-size: 15px; }
.acc-h:hover, .acc-h2:hover { background: #F7ECDC; }
.acc-ar { font-size: 12px; color: var(--ink-3); width: 14px; text-align: center; }
.acc-em { font-size: 18px; }
.acc-meta { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--ink-3);
  background: #F1E7D6; padding: 2px 9px; border-radius: 999px; }
.acc-b { border-top: 1px solid var(--line); }
.acc-b2 { padding: 4px 14px 10px 32px; border-top: 1px dashed var(--line); }
.acc-row { display: flex; align-items: center; gap: 12px; margin: 10px 0; }
.acc-row-l { flex: 1; }
.acc-row-n { font-size: 14px; font-weight: 700; color: var(--ink); }
.acc-row-r { font-size: 13px; font-weight: 700; color: var(--ink-2); min-width: 56px; text-align: right; }

/* 课文页头 + 封面插画（贴近教材排版：课题居中、插图铺满） */
.lesson-head { text-align: center; margin: 4px 0 20px; }
.lesson-unit { font-size: 12px; color: var(--ink-3); letter-spacing: 1px; }
.lesson-title { font-size: 28px; font-weight: 700; margin: 6px 0 0; color: var(--ink); font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif; letter-spacing: 2px; }
.lesson-cover { margin: 0 0 18px; border-radius: var(--r-md); overflow: hidden; background: #fff; box-shadow: var(--shadow); }
.lesson-cover img { width: 100%; height: auto; display: block; }
.lesson-cover.emoji { display: flex; align-items: center; justify-content: center; min-height: 120px; font-size: 64px; background: linear-gradient(135deg, #FFF3E6, #FFE7D1); }
/* 语文正文：楷体、行距舒展 */
.reading-text { font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif; font-size: 19px; line-height: 2; color: #2A2118; }
/* 教材风格课文卡片 */
.textbook-note { background: #fff; border: none; border-radius: 0; box-shadow: none; padding: 22px 18px 18px; margin-bottom: 18px; position: relative; }
.textbook-note::before { content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 56px; height: 3px; background: var(--chinese); border-radius: 0 0 2px 2px; }
.textbook-note h3 { text-align: center; font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif; font-size: 20px; font-weight: 700; color: var(--ink); margin: 0 0 16px; }
.textbook-note h3 .tb-emoji { font-size: .8em; margin-right: 6px; opacity: .7; }
.textbook-note .reading-text { font-size: 20px; line-height: 2.4; text-align: center; text-indent: 0; letter-spacing: 1px; white-space: pre-line; }
.textbook-note ul { margin-top: 16px; padding-left: 22px; font-size: 16px; color: var(--ink-2); }
.textbook-note li { margin-bottom: 8px; }
.textbook-note .example { background: #FFF9F2; border-left: 4px solid var(--chinese); border-radius: 0 10px 10px 0; color: #8B4A1A; margin-top: 18px; }

.char-card {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 18px;
  box-shadow: var(--shadow); text-align: center; margin-bottom: 14px;
}
.hz {
  font-size: 108px; line-height: 1; font-weight: 700; margin: 6px 0 4px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif;
}
.hz-py { font-size: 22px; color: var(--chinese); font-weight: 700; letter-spacing: 1px; }
.hz-meta { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 12px 0 4px; }
.pill {
  padding: 4px 12px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--chinese-soft); color: #B85C15;
}
.pill.blue { background: var(--math-soft); color: #1B5FBF; }
.pill.green { background: var(--green-soft); color: #1B7A55; }
.hz-words { font-size: 16px; margin: 10px 0 2px; }
.hz-sent { font-size: 15px; color: var(--ink-2); background: #FBF6EE; border-radius: var(--r-sm); padding: 10px 12px; margin-top: 10px; }

.tianzi {
  position: relative; width: 200px; height: 200px; margin: 4px auto 0;
  border: 2px solid #E9B7B7; border-radius: 10px; background: #FFFDFC;
  display: flex; align-items: center; justify-content: center;
}
.tianzi::before, .tianzi::after { content: ""; position: absolute; background: #E9B7B7; }
.tianzi::before { left: 50%; top: 0; bottom: 0; width: 1px; border-left: 1px dashed #EFC9C9; background: none; }
.tianzi::after { top: 50%; left: 0; right: 0; height: 1px; border-top: 1px dashed #EFC9C9; background: none; }
.tianzi .diag { position: absolute; inset: 0; }
.tianzi svg { width: 100%; height: 100%; }

.pinyin-card {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 22px 18px;
  box-shadow: var(--shadow); text-align: center; margin-bottom: 14px;
}
.py-big { font-size: 88px; line-height: 1.1; font-weight: 700; color: var(--chinese); letter-spacing: 4px; }
.py-tones { display: flex; justify-content: center; gap: 12px; margin: 12px 0 6px; }
.py-tone { font-size: 40px; font-weight: 700; color: var(--ink); }
.py-tip { font-size: 15px; color: var(--ink-2); background: #FBF6EE; border-radius: var(--r-sm); padding: 10px 12px; margin-top: 8px; }

.concept-card {
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--r-lg); padding: 20px 18px;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.concept-card h3 { margin: 0 0 10px; font-size: 20px; font-weight: 800; color: var(--math); }
/* 生物科目主题：概念卡标题与强调用绿色 */
[data-sub="biology"] .concept-card h3 { color: var(--biology); }
[data-sub="biology"] .concept-card .example { background: var(--biology-soft); color: #0E6B4E; border-left: 4px solid var(--biology); border-radius: 0 10px 10px 0; }
[data-sub="biology"] .concept-card .visual .vitem.hl { background: var(--biology-soft); border-color: #BFE6D8; }
.concept-card p { margin: 0 0 10px; font-size: 16px; }
.concept-card ul { margin: 0; padding-left: 20px; font-size: 16px; }
.concept-card li { margin-bottom: 6px; }
/* 学习卡内联几何/示意图：居中、浅色底、自适应宽度 */
.card-fig { margin: 14px 0 4px; padding: 14px; background: #F7FAFF; border: 1px solid #D6E4FB; border-radius: 14px; display: flex; justify-content: center; }
.card-fig svg { max-width: 100%; height: auto; }
.example {
  background: var(--math-soft); border-radius: var(--r-sm);
  padding: 12px 14px; margin-top: 12px; font-size: 15px; color: #1B5FBF;
}
/* 例题卡：分步演示 */
.ex-card { border-color: #BFD6FF; background: #F5F9FF; }
.ex-q { font-size: 26px; font-weight: 800; color: var(--math); text-align: center; margin: 6px 0 14px; }
.ex-step { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px dashed #D7E4F8; }
.ex-step:first-of-type { border-top: none; }
.ex-n { flex: 0 0 28px; height: 28px; line-height: 28px; text-align: center; border-radius: 50%;
  background: var(--math); color: #fff; font-weight: 800; font-size: 15px; margin-top: 2px; }
.ex-body { flex: 1; }
.ex-body p { margin: 0; font-size: 16px; color: var(--ink); }
.ex-exp { margin-top: 6px; font-size: 17px; font-weight: 800; color: var(--math); background: #EAF2FF;
  border-radius: 10px; padding: 6px 12px; display: inline-block; }
.ex-ans { font-size: 20px; color: #2A8B57; }
.ex-ans b { font-size: 26px; }
.visual { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 4px; }
.vitem {
  min-width: 56px; padding: 12px 14px; border-radius: 14px;
  background: #FFF7E8; border: 2px solid #F3DFB8; text-align: center;
}
.vitem b { display: block; font-size: 22px; }
.vitem span { font-size: 12px; color: var(--ink-2); }
.vitem.hl { background: var(--math-soft); border-color: #BBD6FA; }

/* ---------- 按钮 ---------- */
.actions { display: flex; gap: 12px; margin-top: 18px; }
.btn {
  flex: 1; padding: 15px 18px; border-radius: var(--r-md);
  font-size: 17px; font-weight: 800; text-align: center;
  border: 2px solid transparent; box-shadow: 0 4px 0 rgba(0,0,0,.12);
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn:active { transform: translateY(4px); box-shadow: 0 0 0 rgba(0,0,0,.12); }
.btn.primary { background: var(--green); color: #fff; }
.btn.warn { background: var(--amber); color: #fff; }
.btn.blue { background: var(--math); color: #fff; }
.btn.orange { background: var(--chinese); color: #fff; }
.btn.ghost { background: #fff; color: var(--ink-2); border-color: var(--line); box-shadow: 0 4px 0 var(--line); }
.btn.sm { flex: none; padding: 10px 18px; font-size: 15px; border-radius: 999px; }

/* ---------- 答题 ---------- */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 30px; }
.bar { flex: 1; height: 14px; border-radius: 999px; background: #F1E7D6; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width .3s ease; }
.quiz-num { font-size: 15px; font-weight: 800; color: var(--ink-2); flex: none; }
.timer {
  flex: none; font-size: 19px; font-weight: 900; color: #fff;
  background: var(--green); padding: 4px 12px; border-radius: 999px;
  box-shadow: 0 3px 0 rgba(52,179,126,.35); letter-spacing: .5px;
  min-width: 80px; text-align: center;
}
.timer.low { background: var(--red); box-shadow: 0 3px 0 rgba(239,91,91,.35); animation: tpulse .6s ease-in-out infinite; }
@keyframes tpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
/* 限时闯关顶部消耗进度条，比小计时器更显眼 */
.time-bar { height: 8px; background: #F1E7D6; border-radius: 999px; overflow: hidden; margin-bottom: 18px; }
.time-bar i { display: block; height: 100%; background: var(--green); border-radius: 999px; transition: width 1s linear, background .3s; }
.time-bar i.low { background: var(--red); }

.q-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 22px 18px; box-shadow: var(--shadow); margin-bottom: 14px;
}
.q-index { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 12px; font-weight: 800; }
.q-index .q-no {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  background: linear-gradient(135deg, var(--accent, #ff7a59), #ff9f7e);
  color: #fff; border-radius: 999px;
  font-size: 17px; font-weight: 800; line-height: 1;
  box-shadow: 0 3px 0 rgba(255, 122, 89, .22);
}
.q-index .q-no.alt { background: linear-gradient(135deg, var(--math, #3D8BF5), #6aa6ff); box-shadow: 0 3px 0 rgba(61, 139, 245, .22); }
.q-index .q-label { font-size: 14px; color: var(--ink-2); font-weight: 700; }
.num-big {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "PingFang SC", serif;
  font-size: 96px; font-weight: 800; line-height: 1; text-align: center;
  color: var(--math, #3D8BF5); margin: 6px 0 10px;
  text-shadow: 0 4px 0 rgba(61, 139, 245, .12);
}
.num-m { text-align: center; font-size: 16px; color: var(--ink-2); margin: 0 0 4px; }
.q-text { font-size: 22px; font-weight: 700; margin: 0 0 4px; line-height: 1.5; }
.q-text .big { font-size: 40px; color: var(--ink); font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.q-hint { font-size: 14px; color: var(--ink-3); margin: 0 0 14px; }

.opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; }
.opt {
  padding: 18px 12px; border-radius: var(--r-md);
  border: 2px solid var(--line); background: #fff;
  font-size: 26px; font-weight: 700; text-align: center;
  box-shadow: 0 4px 0 var(--line); transition: transform .1s;
}
.opt .small { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-top: 2px; }
.opt:active { transform: translateY(4px); box-shadow: none; }
.opt.right { background: var(--green-soft); border-color: var(--green); box-shadow: 0 4px 0 var(--green); }
.opt.wrong { background: var(--red-soft); border-color: var(--red); box-shadow: 0 4px 0 var(--red); }
.opt:disabled { cursor: default; }
.opt-emoji { font-size: 88px; line-height: 1; display: block; }
.opts.emoji-opts { grid-template-columns: 1fr 1fr; gap: 16px; }
.emoji-opts .opt { padding: 22px 10px; }
.q-figure { font-size: 130px; line-height: 1.05; text-align: center; margin: 0 0 18px; letter-spacing: 6px; }
/* 精确立体图形插画（替代会误导人的 emoji） */
.opt-fig { width: 88px; height: 88px; object-fit: contain; display: block; margin: 0 auto; }
.q-figure img { width: 150px; height: 150px; object-fit: contain; display: inline-block; vertical-align: middle; }
.v-fig { width: 48px; height: 48px; object-fit: contain; vertical-align: middle; }
.ex-fig { width: 42px; height: 42px; object-fit: contain; vertical-align: middle; margin-top: 4px; }

.fill-row { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; }
.fill-input {
  width: 130px; padding: 12px; text-align: center;
  font-size: 30px; font-weight: 800; border: 2px solid var(--line);
  border-radius: var(--r-sm); background: #FFFDF8; color: var(--ink);
  outline: none;
}
.fill-input:focus { border-color: var(--math); }
.fill-word { font-size: 26px; font-weight: 700; color: var(--ink); font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
/* 凑十法竖式：拆数 → 凑十 → 求和（按教材格式） */
/* 教材练习册格式：屋顶拆分 + 连线 + 4 个空（正常流，互不覆盖） */
.ch-form {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; margin: 12px 0 8px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; user-select: none;
}
.ch-row { display: flex; align-items: center; justify-content: center; gap: 10px; }
.ch-eq { font-size: 32px; font-weight: 800; color: var(--ink); }
.ch-t { font-size: 30px; font-weight: 800; color: var(--ink); }
.ch-roof { font-size: 26px; line-height: 1; color: var(--math); font-weight: 700; }
.ch-rl { margin-right: 46px; }
.ch-link { font-size: 22px; line-height: 1; color: var(--math); }
.ch-lv { margin-right: 96px; }
.ch-lh { letter-spacing: 2px; }
.ch-and { font-size: 18px; color: var(--ink-3); margin: 0 2px; }
.ch-hint { font-size: 16px; color: var(--ink-3); margin-left: 4px; }
/* 凑十法（加法）：整体居中；屋顶 ╱╲ 两斜线正对下方两拆分框；连线由 JS 绘制在“和”框正上方 */
.ch-form.ch-add { align-items: center; position: relative; }
.ch-add .ch-a, .ch-add .ch-b { color: var(--math); }
.ch-add .ch-op { margin: 0 6px; }
.ch-add .ch-eqsign { margin: 0 8px; }
.ch-add .ch-roof, .ch-add .ch-parts { align-self: center; }
.ch-add .ch-roof { gap: 10px; }
.ch-add .ch-slash { width: 44px; display: inline-flex; justify-content: center; align-items: center; }
.ch-add .ch-link { min-height: 42px; align-self: stretch; }
.ch-add .ch-sum { align-self: center; margin-top: 2px; }
.ch-split { display: flex; flex-direction: column; align-items: center; }
.ch-link-svg { display: block; }
.choushi-input {
  width: 44px; height: 44px; padding: 0; text-align: center;
  font-size: 24px; font-weight: 800; border: 2px solid var(--math);
  border-radius: 10px; background: #FFFDF8; color: var(--math); outline: none;
  -webkit-appearance: none; appearance: none;
}
.choushi-input:focus { box-shadow: 0 0 0 3px rgba(45, 111, 214, .18); }
.choushi-input:disabled { color: var(--ink); border-color: var(--ink-3); }
.num-pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 14px; }
.num-key {
  padding: 14px 0; border-radius: var(--r-sm); background: #fff;
  border: 2px solid var(--line); font-size: 20px; font-weight: 800;
  box-shadow: 0 3px 0 var(--line);
}
.num-key:active { transform: translateY(3px); box-shadow: none; }
.num-key.del { background: var(--red-soft); color: var(--red); font-size: 16px; }
.num-key.ok { background: var(--green); color: #fff; border-color: var(--green); font-size: 16px; }
/* 出答案后禁用：数字键盘、删除、确定 全部置灰，不可再点 */
.num-key:disabled {
  background: var(--fill-disabled, #EEF0F3); color: #B7BDC6;
  border-color: var(--line); box-shadow: none; cursor: not-allowed;
  transform: none;
}

.feedback {
  border-radius: var(--r-md); padding: 14px 16px; margin-top: 14px;
  font-size: 16px; font-weight: 600;
}
.feedback.good { background: var(--green-soft); color: #1B7A55; }
.feedback.bad { background: var(--red-soft); color: #B02A2A; }
.feedback b { font-weight: 800; }

/* 答对/答错后展示的“知识点”卡片：无论对错都给出对应考点 */
.kp-card {
  margin-top: 10px; padding: 14px 16px;
  border-radius: var(--r-md);
  background: #EAF6EE; border: 1px solid #BFE3CB;
  color: #1F3D2B; font-size: 15px; line-height: 1.7;
}
.kp-card b { color: #1B7A55; font-weight: 800; }

/* ---------- 结算 ---------- */
.result {
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-lg);
  padding: 30px 20px; text-align: center; box-shadow: var(--shadow);
}
.result-emoji { font-size: 64px; line-height: 1; }
.result-score { font-size: 46px; font-weight: 800; margin: 6px 0; color: var(--green); }
.result-score.mid { color: var(--amber); }
.result-score.low { color: var(--red); }
.result-sub { color: var(--ink-2); font-size: 15px; margin: 0 0 16px; }
.stars { font-size: 34px; letter-spacing: 6px; color: var(--amber); margin: 4px 0 12px; }
.stars .off { color: #E7DCC9; }

/* 成绩页：本题回顾列表（逐题显示对错 / 你的答案 / 正确答案） */
.review-list { display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; padding: 4px 2px; margin: 4px 0 8px; }
.review-item { background: #fff; border-radius: 14px; padding: 12px 14px; border: 2px solid var(--line); text-align: left; }
.review-item.ok { border-color: rgba(52, 179, 126, .55); }
.review-item.bad { border-color: rgba(229, 90, 80, .55); }
.rv-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.rv-no { width: 22px; height: 22px; border-radius: 50%; background: var(--ink-1); color: #fff; font-size: 13px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.rv-mark { font-size: 18px; font-weight: 900; }
.review-item.ok .rv-mark { color: var(--green); }
.review-item.bad .rv-mark { color: var(--red); }
.rv-q { font-size: 15px; font-weight: 700; color: var(--ink-1); margin-bottom: 6px; line-height: 1.4; }
.rv-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.rv-opt { font-size: 14px; padding: 3px 10px; border-radius: 999px; background: #F2F4F8; color: var(--ink-2); }
.rv-opt.corr { background: rgba(52, 179, 126, .15); color: var(--green); font-weight: 800; border: 1px solid rgba(52, 179, 126, .5); }
.rv-ans { font-size: 14px; color: var(--ink-2); }
.rv-ans .okc { color: var(--green); }
.rv-ans .errc { color: var(--red); }
.rv-why { font-size: 13px; color: var(--ink-3); margin-top: 4px; }

/* ---------- 看板 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md);
  padding: 14px 10px; text-align: center; box-shadow: var(--shadow);
}
.stat b { display: block; font-size: 26px; font-weight: 800; line-height: 1.2; }
.stat span { font-size: 13px; color: var(--ink-2); }

.section-title { font-size: 18px; font-weight: 800; margin: 22px 0 12px; }

.badges { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 12px; }
.badge {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md);
  padding: 14px 8px; text-align: center; box-shadow: var(--shadow); opacity: .4;
}
.badge.on { opacity: 1; border-color: var(--amber); background: #FFFBF0; }
.badge-em { font-size: 30px; line-height: 1.2; }
.badge-nm { font-size: 12px; font-weight: 700; margin-top: 4px; }
.badge-ds { font-size: 11px; color: var(--ink-3); }

/* ================= 趣味小游戏 ================= */
.game-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 14px; }
.game-card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--r-md);
  padding: 18px 10px; text-align: center; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.game-card:active { transform: scale(.96); }
.game-card.math { border-color: var(--math); }
.game-em { font-size: 40px; line-height: 1.2; }
.game-name { font-size: 15px; font-weight: 800; margin-top: 6px; }
.game-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.game-wrap { max-width: 560px; margin: 0 auto; }
.game-head { text-align: center; margin-bottom: 6px; }
.game-tip { font-size: 15px; color: var(--ink-2); }
.game-tip b { color: var(--math); }

/* 💣 数字炸弹 */
.bomb-range { font-size: 16px; margin-top: 4px; }
.bomb-range b { color: var(--math); font-size: 20px; }
.bomb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 8px; max-width: 440px; margin: 16px auto; }
.bomb-num {
  aspect-ratio: 1; font-size: 22px; font-weight: 800; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.bomb-num:active { transform: scale(.94); }
.bomb-num.out { opacity: .35; background: #f1f1f1; cursor: default; }
.bomb-num.safe { background: #E8F8EF; border-color: #7ED9A8; color: #2E9E63; }
.bomb-num.boom { background: #FF6B6B; border-color: #FF6B6B; color: #fff; animation: boom .45s ease; }
@keyframes boom { 0% { transform: scale(1); } 40% { transform: scale(1.35); } 100% { transform: scale(1); } }
.bomb-score { text-align: center; color: var(--ink-3); font-size: 13px; }

/* 数字炸弹·按单次排除数量弹出三档特效 */
#gameMount { position: relative; }
.bomb-fx {
  position: absolute; left: 50%; top: 46%; z-index: 20; pointer-events: none;
  display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center;
  transform: translate(-50%, -50%) scale(.6); animation: bombFx 1.05s ease forwards;
}
.bomb-fx-em { font-size: 40px; line-height: 1; }
.bomb-fx-tx { font-size: 15px; font-weight: 800; white-space: nowrap; }
.bomb-fx.big .bomb-fx-em { font-size: 58px; }
.bomb-fx.big .bomb-fx-tx { color: #F5A623; font-size: 18px; }
.bomb-fx.mid .bomb-fx-em { font-size: 44px; }
.bomb-fx.mid .bomb-fx-tx { color: var(--math); }
.bomb-fx.small .bomb-fx-em { font-size: 32px; opacity: .85; }
.bomb-fx.small .bomb-fx-tx { color: var(--ink-3); font-size: 13px; }
@keyframes bombFx {
  0% { opacity: 0; transform: translate(-50%, -40%) scale(.5); }
  18% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  32% { transform: translate(-50%, -50%) scale(1); }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -64%) scale(1); }
}

/* 语文游戏卡片配色 */
.game-card.chinese { border-color: var(--chinese); }
.game-card.chinese .game-name { color: var(--chinese); }
.game-card.biology { border-color: var(--biology); }
.game-card.biology .game-name { color: var(--biology); }
.game-card.geography { border-color: var(--geography); }
.game-card.geography .game-name { color: var(--geography); }
.game-card.history { border-color: var(--history); }
.game-card.history .game-name { color: var(--history); }
/* 历史·时间排序：更宽的两列卡片，序号和朝代名看得清 */
.hist-chips { max-width: 430px; }
.hist-chip { font-size: 15px; letter-spacing: .4px; }
.hist-chip.right { font-weight: 800; }

/* 🌍 地理游戏·词卡（大洲大洋 / 天气气候 判断） */
.geo-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 116px; margin: 14px auto; padding: 18px 16px; max-width: 460px;
  background: var(--geography-soft); border: 2px solid #E4CDB4; border-radius: var(--r-md);
}
.geo-em { font-size: 42px; line-height: 1; }
.geo-term { font-size: 40px; font-weight: 800; color: var(--geography); letter-spacing: 3px; }
.geo-sent { font-size: 20px; font-weight: 700; color: var(--ink-1); line-height: 1.5; text-align: center; }

/* ☀️ 节气与地球运动（地理配色连连看，2 列便于放长句） */
.zs-card.geo-a { color: var(--geography); border-color: #E4CDB4; font-family: inherit; }
.zs-card.geo-b { color: var(--ink-1); border-color: #CFE3F3; font-family: inherit; }
.zs-card.geo-a.pick, .zs-card.geo-b.pick { background: var(--geography); color: #fff; border-color: var(--geography); transform: scale(1.06); box-shadow: 0 4px 12px rgba(181,113,58,.4); }
.zs-grid.geo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; max-width: 440px; }
.geo-grid .zs-card { aspect-ratio: auto; min-height: 58px; padding: 10px 8px; font-size: 15px; line-height: 1.3; word-break: break-word; }
.geo-grid .zs-card.geo-a, .geo-grid .zs-card.geo-b { font-family: inherit; }

/* 🚩 国旗猜国家 / 🏆 世界地理之最（地理四选一） */
.flag-face { text-align: center; font-size: 92px; line-height: 1.1; margin: 18px 0 6px; }
.geo-ask { font-size: 19px; font-weight: 800; color: var(--ink-1); line-height: 1.5; text-align: center; }
.geo-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 360px; margin: 14px auto 8px; }
.geo-opt {
  padding: 14px 10px; font-size: 17px; font-weight: 800; border-radius: 14px;
  border: 2px solid #E4CDB4; background: #fff; color: var(--geography);
  cursor: pointer; font-family: inherit; line-height: 1.3;
}
.geo-opt:active { transform: scale(.96); }
.geo-opt.right { background: #E8F8EF; border-color: #7ED9A8; color: #2E9E63; }
.geo-opt.wrong { background: #FFE3E3; border-color: #FF6B6B; color: #D64545; animation: tm-shake .4s; }

/* 🍜 风物配城市 / ⛅ 天气符号（地理紧凑连连看） */
.zs-grid.geo-tight { grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 400px; }
.geo-tight .zs-card { aspect-ratio: auto; min-height: 54px; padding: 8px 6px; font-size: 16px; line-height: 1.25; word-break: break-word; font-family: inherit; }
.geo-tight .zs-card.geo-ico { font-size: 32px; }

/* ⛰️ B 组·自绘示意图（等高线地形图 / 气温降水图 / 图例符号） */
.geo-fig { display: block; width: 100%; max-width: 330px; height: auto; margin: 10px auto 2px; }
.map-fig { text-align: center; font-size: 42px; line-height: 1.35; margin: 6px 0 0; color: var(--geography); letter-spacing: 3px; }

/* 🌍 地理答题反馈（对齐单元练习：点完直接亮答案 + 手动「下一题」） */
.geo-fb { max-width: 440px; margin: 4px auto 0; }
.geo-fb-line { text-align: center; font-size: 15px; font-weight: 800; padding: 9px 12px; border-radius: 12px; line-height: 1.5; }
.geo-fb-line.ok { color: #2E9E63; background: #E8F8EF; }
.geo-fb-line.bad { color: #D64545; background: #FFE9E9; }
.geo-fb-line b { font-weight: 800; }
.geo-actions { display: flex; justify-content: center; margin: 10px 0 2px; }
.geo-next-btn {
  padding: 11px 36px; font-size: 16px; font-weight: 800; border: none; border-radius: 13px;
  background: var(--geography); color: #fff; cursor: pointer; font-family: inherit; letter-spacing: 1px;
  box-shadow: 0 4px 12px rgba(181,113,58,.30);
}
.geo-next-btn:active { transform: scale(.96); }

/* 📚 答题知识点解析（正解 + 逐条讲解每个干扰项） */
.geo-explain { max-width: 460px; margin: 10px auto 0; text-align: left; }
.geo-ex-line { font-size: 13.5px; line-height: 1.6; margin: 5px 0; padding: 8px 12px; border-radius: 10px; }
.geo-ex-line.ok { background: #E8F8EF; color: #226B45; }
.geo-ex-line.x { background: #F4EFE7; color: #6B5A44; }
.geo-ex-line b { font-weight: 800; }

/* 🔤 拼音找朋友 */
.py-pic { position: relative; text-align: center; font-size: 92px; line-height: 1.1; margin: 14px 0 8px; }
.py-speak { position: absolute; right: 6px; bottom: 2px; font-size: 24px; line-height: 1; border: none; background: var(--chinese-soft); border-radius: 50%; width: 46px; height: 46px; cursor: pointer; }
.py-speak:active { transform: scale(.92); }
.py-opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; max-width: 320px; margin: 8px auto; }
.py-opt { padding: 14px 0; font-size: 26px; font-weight: 800; border-radius: 14px; border: 2px solid var(--line); background: #fff; color: var(--chinese); cursor: pointer; font-family: inherit; }
.py-opt:active { transform: scale(.95); }
.py-opt.right { background: #E8F8EF; border-color: #7ED9A8; color: #2E9E63; }
.py-opt.wrong { background: #FFE3E3; border-color: #FF6B6B; color: #D64545; animation: tm-shake .4s; }
.py-tip { text-align: center; color: var(--ink-3); font-size: 13px; }

/* 🀄 识字连连看 */
.zs-left { text-align: center; font-size: 14px; color: var(--ink-3); }
.zs-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 360px; margin: 16px auto; }
.zs-card {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; cursor: pointer; font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
}
.zs-card.zs-char { color: var(--chinese); border-color: #F6C9A6; }
.zs-card.zs-pic { font-size: 34px; }
.zs-card:active { transform: scale(.94); }
.zs-card.pick { background: var(--chinese); color: #fff; border-color: var(--chinese); transform: scale(1.06); box-shadow: 0 4px 12px rgba(245, 137, 59, .4); }
.zs-card.match { background: #FFF3D6; border-color: #F5C842; }
.zs-card.wrong { background: #FFE3E3; border-color: #FF6B6B; color: #D64545; animation: tm-shake .4s; }
.zs-card.gone { visibility: hidden; }
.zs-card.bio-a { color: var(--biology); border-color: #BFE6D8; font-family: inherit; }
.zs-card.bio-b { color: var(--ink-1); border-color: #CFE3F3; font-family: inherit; }
.zs-card.bio-a.pick, .zs-card.bio-b.pick { background: var(--biology); color: #fff; border-color: var(--biology); transform: scale(1.06); box-shadow: 0 4px 12px rgba(46,158,99,.4); }
/* 细胞结构连连看：紧凑自适应布局，覆盖通用 zs-grid 的方形大卡（bios 卡是长中文短语，方卡会被撑歪） */
.zs-grid.bio-grid { grid-template-columns: repeat(4, 1fr); gap: 8px; max-width: 360px; }
.bio-grid .zs-card { aspect-ratio: auto; min-height: 54px; padding: 7px 6px; font-size: 15px; line-height: 1.2; word-break: break-word; }
.bio-grid .zs-card.bio-a, .bio-grid .zs-card.bio-b { font-family: inherit; }
.bio-nm { font-size: 16px; font-weight: 700; color: var(--ink-2); margin-top: 2px; }

/* ✍️ 笔画笔顺 —— 田字格复用生字渲染（.tianzi / .hz-box），此处只管按钮与写一遍布局 */
.bh-prog { text-align: center; font-size: 15px; color: var(--ink-3); font-weight: 700; }
.bh-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; max-width: 480px; margin: 14px auto; }
.bh-btn { position: relative; box-sizing: border-box; min-width: 124px; padding: 16px 22px; font-size: 22px; font-weight: 800; border-radius: 14px; border: 2px solid var(--line);
  background: #fff; color: var(--chinese); cursor: pointer; font-family: inherit; }
.bh-btn:active { transform: scale(.95); }
.bh-btn.used { background: #F2F3F5; border-color: var(--line); color: #B6BCC4; cursor: default; opacity: .55; }
.bh-btn.used .bh-order { opacity: 1; }
.bh-btn.ok { background: #E8F8EF; border-color: #7ED9A8; color: #2E9E63; }
.bh-btn.wrong { background: #FFE3E3; border-color: #FF6B6B; color: #D64545; animation: tm-shake .4s; }
.bh-order { position: absolute; top: -9px; right: -9px; min-width: 22px; height: 22px; padding: 0 5px; line-height: 22px; box-sizing: border-box; border-radius: 11px; background: var(--math); color: #fff; font-size: 12px; font-weight: 800; box-shadow: 0 2px 6px rgba(74, 144, 226, .4); }
.bh-tip { text-align: center; color: var(--ink-3); font-size: 13px; }
.bh-extra { text-align: center; margin: 14px 0 4px; }
.bh-write-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 22px; font-size: 16px; font-weight: 800; border-radius: 12px; border: 2px solid var(--math); background: var(--math); color: #fff; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.bh-write-btn:active { transform: scale(.95); }
.bh-write { text-align: center; padding: 18px 12px; }
.bh-write .bh-replay-title { font-size: 18px; font-weight: 800; color: var(--math); margin: 0 0 12px; }
.bh-tz-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 10px 0 6px; }
.bh-tz-item { text-align: center; }
.bh-tz-item .tianzi { width: 104px; height: 104px; margin: 0 auto; }
.bh-tz-cap { font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif; font-size: 20px; color: var(--ink-2); margin-top: 4px; }
.bh-replay-done { font-size: 18px; font-weight: 800; color: var(--chinese); margin: 18px 0 4px; }

/* 🐯 象形字配对 / ⚖️ 反义词对碰（共用连连看样式） */
.xxz-left, .fy-left { text-align: center; font-size: 14px; color: var(--ink-3); }
.xxz-grid, .fy-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; max-width: 360px; margin: 16px auto; }
.xxz-card, .fy-card { aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; border-radius: 14px; border: 2px solid var(--line); background: #fff;
  color: var(--ink); cursor: pointer; font-family: inherit; }
.xxz-card:active, .fy-card:active { transform: scale(.94); }
.xxz-card.xxz-pic, .fy-card.fy-opp { font-size: 34px; }
.xxz-card.xxz-char, .fy-card.fy-word { color: var(--chinese); border-color: #F6C9A6; }
.xxz-card.pick, .fy-card.pick { background: var(--chinese); color: #fff; border-color: var(--chinese); transform: scale(1.06); box-shadow: 0 4px 12px rgba(245,137,59,.4); }
.xxz-card.match, .fy-card.match { background: #FFF3D6; border-color: #F5C842; }
.xxz-card.wrong, .fy-card.wrong { background: #FFE3E3; border-color: #FF6B6B; color: #D64545; animation: tm-shake .4s; }
.xxz-card.gone, .fy-card.gone { visibility: hidden; }

/* 🔟 凑十消消乐 */
.tm-left { text-align: center; font-size: 14px; color: var(--ink-3); }
.tm-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; max-width: 420px; margin: 16px auto; }
/* 难度选择 */
.tm-select { text-align: center; padding: 28px 12px; }
.tm-select-tip { font-size: 16px; color: var(--ink-2); margin-bottom: 22px; }
.tm-levels { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.tm-level {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 132px; padding: 18px 14px; cursor: pointer;
  border-radius: 16px; border: 2px solid var(--line); background: #fff; color: var(--math);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tm-level:active { transform: scale(.95); }
.tm-level:hover { border-color: var(--math); box-shadow: 0 4px 14px rgba(74, 144, 226, .25); }
.tm-lv-num { font-size: 32px; line-height: 1; font-weight: 900; }
.tm-level span { font-size: 15px; font-weight: 700; }
.tm-level small { font-size: 12px; color: var(--ink-3); font-weight: 600; }
.tm-num {
  aspect-ratio: 1; font-size: 26px; font-weight: 800; border-radius: 14px;
  border: 2px solid var(--line); background: #fff; color: var(--math); cursor: pointer;
  transition: transform .15s ease, background .15s ease, color .15s ease,
    border-color .15s ease, opacity .3s ease, box-shadow .15s ease;
}
.tm-num:active { transform: scale(.94); }
/* 选中：放大 + 蓝色高亮 + 弹跳 */
.tm-num.pick {
  background: var(--math); color: #fff; border-color: var(--math);
  transform: scale(1.08); box-shadow: 0 4px 12px rgba(74, 144, 226, .35);
  animation: tm-pop .3s ease;
}
@keyframes tm-pop { 0% { transform: scale(1); } 50% { transform: scale(1.16); } 100% { transform: scale(1.08); } }
/* 取消选中：轻微回缩反馈 */
.tm-num.unpick { transform: scale(.96); }
/* 配对成功：金光闪一下 */
.tm-num.match { background: #FFD66B; border-color: #FFB300; color: #6b4b00; }
/* 配对失败：红色抖动 */
.tm-num.wrong { background: #FF6B6B; border-color: #FF6B6B; color: #fff; animation: tm-shake .42s ease; }
@keyframes tm-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(6px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}
/* 消除：缩小 + 淡出 */
.tm-num.gone { transform: scale(0); opacity: 0; pointer-events: none; }

/* ⚡ 口算小达人 */
.arith-bar { display: flex; justify-content: space-between; align-items: center; max-width: 320px; margin: 6px auto 0; font-size: 15px; font-weight: 700; }
.arith-time { color: var(--ink-3); }
.arith-combo { color: var(--ink-3); }
.arith-combo.hot { color: #FF7043; }
.arith-right { color: #2E9E63; }
.arith-q { font-size: 34px; font-weight: 800; text-align: center; margin: 14px 0; letter-spacing: 1px; }
.arith-ans { color: var(--math); min-width: 44px; display: inline-block; border-bottom: 3px solid var(--math); }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 264px; margin: 18px auto 0; }
.pad-key {
  height: 56px; font-size: 24px; font-weight: 800; border-radius: 12px;
  border: 2px solid var(--line); background: #fff; color: var(--ink); cursor: pointer;
}
.pad-key:active { transform: scale(.94); }
.pad-key.ok { background: var(--amber); border-color: var(--amber); color: #5a3b00; }
.pad-key.del { background: #FFF0F0; color: #D05B5B; }

/* 游戏结算页 */
.game-over { text-align: center; padding: 26px 16px; }
.go-em { font-size: 56px; }
.game-over h2 { margin: 6px 0 4px; }
.go-detail { color: var(--ink-2); font-size: 15px; }
.go-stars { color: var(--amber); font-weight: 800; font-size: 18px; margin: 8px 0 4px; }
.go-stars.dim { color: var(--ink-3); font-weight: 400; font-size: 14px; }

.wrong-item {
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-md);
  padding: 14px 16px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.wrong-q { font-size: 17px; font-weight: 700; margin: 0 0 6px; }
.wrong-a { font-size: 14px; color: var(--ink-2); margin: 0; }
.wrong-a b { color: var(--green); }
.wrong-src { font-size: 12px; color: var(--ink-3); margin: 6px 0 0; }
.link-btn { font-size: 13px; font-weight: 700; color: var(--math); margin-top: 8px; }

.empty { text-align: center; padding: 50px 20px; color: var(--ink-3); }
.empty-em { font-size: 54px; display: block; margin-bottom: 10px; }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; background: rgba(255,255,255,.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; font-size: 11px; color: var(--ink-3); font-weight: 700; }
.tab-ico { font-size: 21px; line-height: 1.2; }
.tab.on { color: var(--chinese); }

/* ---------- 反馈层 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%);
  z-index: 60; padding: 12px 22px; border-radius: 999px;
  background: rgba(59,51,42,.94); color: #fff; font-size: 15px; font-weight: 700;
  box-shadow: 0 8px 24px rgba(0,0,0,.2);
  animation: pop .25s ease;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 12px); } }

.modal {
  position: fixed; inset: 0; z-index: 70;
  background: rgba(59,51,42,.45);
  display: grid; place-items: center;
  padding: 24px 16px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal-card {
  background: #fff; border-radius: var(--r-lg); padding: 24px 20px;
  max-width: 560px; width: 100%; text-align: center;
  animation: pop .25s ease; max-height: calc(100vh - 48px); overflow-y: auto;
  overscroll-behavior: contain;
}
.modal-card h3 { margin: 0 0 8px; font-size: 20px; }
.modal-card p { margin: 0 0 16px; font-size: 15px; color: var(--ink-2); }

/* ===== 星球弹窗（点击八大行星图中的星球） ===== */
.planet-modal { text-align: left; }
.planet-modal h3 { text-align: center; }
.planet-en { font-size: 13px; color: #8A94A6; font-weight: 400; }
.planet-photo { position: relative; margin: 4px 0 14px; border-radius: 14px; overflow: hidden; background: #0B1226; min-height: 160px; padding: 14px; display: flex; align-items: center; justify-content: center; }
.planet-img { display: block; max-width: 100%; max-height: 260px; object-fit: contain; margin: 0 auto; }
.planet-ph { display: none; flex-direction: column; gap: 6px; align-items: center; padding: 34px 0; color: #9FB4D8; }
.planet-ph b { font-size: 42px; }
.planet-ph span { font-size: 12px; }
.planet-desc { text-align: left; line-height: 1.7; margin-bottom: 12px !important; }
.planet-facts { margin: 0 0 12px; padding-left: 20px; font-size: 14px; color: var(--ink-2); line-height: 1.9; text-align: left; }
.planet-credit { font-size: 12px; color: #8A94A6; margin-bottom: 14px !important; text-align: center; }

.bounce { animation: bounce .4s ease; }
@keyframes bounce { 0%,100% { transform: scale(1); } 40% { transform: scale(1.12); } }

.opt .kai { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.tianzi svg { display: block; }

/* ===================== 田字格 · 本课生字 ===================== */
/* 有笔画数据时格子由 SVG 绘制，屏蔽掉 CSS 画的格子，避免双重线条 */
.tianzi.hz-box { border-color: transparent; background: none; display: block; }
.tianzi.hz-box::before, .tianzi.hz-box::after { display: none; }
.tianzi.mini { width: 78px; height: 78px; margin: 0 auto; }
.tianzi.big { width: 230px; height: 230px; margin: 6px auto 10px; }
.hz-fallback {
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  font-size: 76px; line-height: 1; color: var(--ink);
}
.tianzi.mini .hz-fallback { font-size: 52px; }
.tianzi.big .hz-fallback { font-size: 170px; }

/* SVG 里的田字格：外框 + 虚线十字 + 对角线 + 描红底字 */
.hz-svg .hz-grid rect { stroke: #E3AEAE; }
.hz-svg .hz-dash { stroke: #EFC9C9; stroke-width: 5; stroke-dasharray: 26 18; }
.hz-svg .hz-diag { stroke: #F7E1E1; stroke-width: 5; stroke-dasharray: 16 20; }
.hz-svg .hz-ghost path { fill: #F0E8DB; }
.hz-svg .hz-char path { fill: #3B332A; }

/* —— 本课生字区 —— */
.hz-sec { margin: 24px 0 6px; }
.hz-sec-t {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  font-size: 17px; font-weight: 800; color: var(--ink); padding: 0 2px 10px;
}
.hz-sec-n { font-size: 12px; font-weight: 700; color: var(--ink-3); }
.hz-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 14px;
}
.hz-card {
  background: linear-gradient(180deg, #FFFDF9, #FFF6EA);
  border: 2px solid #F0D9BC; border-radius: var(--r-md);
  padding: 13px 8px 12px; text-align: center; box-shadow: var(--shadow);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hz-card:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(180,130,60,.18); }
.hz-card .hz-py { font-size: 19px; margin-bottom: 8px; line-height: 1.2; }
.hz-card .tianzi.mini { width: 94px; height: 94px; }
.hz-info { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 10px 0 9px; }
.pill.xs { padding: 3px 10px; font-size: 11px; }
.hz-card-btns { display: flex; gap: 6px; justify-content: center; }
.btn.xs { padding: 6px 11px; font-size: 12px; border-radius: 10px; }

/* —— 生字详情弹窗 —— */
.hz-dlgt {
  display: flex; align-items: baseline; justify-content: center; gap: 12px;
  font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
  font-size: 40px; margin: 0 0 4px; color: var(--ink);
}
.hz-dlgt span { font-size: 21px; font-weight: 700; color: var(--chinese); font-family: inherit; }
.hz-bx { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 14px 0 2px; }
.hz-bx-i {
  padding: 4px 10px; border-radius: 9px; background: var(--chinese-soft);
  color: #B85C15; font-size: 13px; font-weight: 700; cursor: pointer;
}
.hz-bx-i:hover { background: #FFE0C2; }
.hz-meta2 { display: flex; justify-content: center; gap: 6px; flex-wrap: wrap; margin: 12px 0 2px; }
.hz-w2 { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin: 12px 0 2px; }
.hz-w2 b { font-size: 13px; color: var(--ink-3); margin-right: 2px; font-weight: 700; }
.hz-w2 span {
  padding: 4px 11px; background: #FBF6EE; border-radius: 9px; font-size: 16px;
  color: var(--ink); font-family: "Kaiti SC", "STKaiti", "KaiTi", "楷体", serif;
}
.hz-tip2 {
  margin-top: 13px; padding: 10px 12px; background: #FBF6EE; border-radius: var(--r-sm);
  font-size: 14px; color: var(--ink-2); line-height: 1.75; text-align: left;
}

/* —— 每课一读（PDF 原页 1:1 展示） —— */
.reader-wrap {
  background: #f4f7f3; border-radius: var(--r-md); padding: 16px; margin: 12px 0;
}
.reader-page {
  display: block; width: 100%; max-width: 640px; margin: 0 auto;
  border-radius: var(--r-sm); box-shadow: 0 4px 16px rgba(0,0,0,.08); background: #fff;
}
.reader-nav {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 640px; margin: 14px auto 0; gap: 12px;
}
.reader-pg {
  font-size: 15px; font-weight: 800; color: var(--ink-2);
  background: #fff; padding: 6px 14px; border-radius: 20px; box-shadow: 0 1px 3px rgba(0,0,0,.06);
}

@media (max-width: 400px) {
  .hz { font-size: 92px; }
  .py-big { font-size: 68px; }
  .q-text { font-size: 20px; }
  .tianzi.big { width: 200px; height: 200px; }
  .hz-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
}

/* ---------- 数数卡（一排大图，点一下算数一个） ---------- */
.count-card { border-color: #C7DEFB; background: linear-gradient(180deg, #F8FBFF, #EAF3FF); }
.count-row { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin: 14px 0 6px; }
.count-group { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; align-items: center; padding: 12px 16px; background: #F2F7FF; border: 2px dashed #9DBDF0; border-radius: 16px; }
.count-plus { font-size: 36px; font-weight: 800; color: #F08A24; line-height: 1; padding: 30px 2px; }
.count-item {
  position: relative; width: 66px; height: 66px; border-radius: 16px;
  background: #fff; border: 3px solid #D7E4F8;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; line-height: 1; cursor: pointer; user-select: none;
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  box-shadow: 0 3px 0 #D7E4F8;
}
.count-item:active { transform: translateY(3px); box-shadow: none; }
.count-item.done { background: #DCF3E8; border-color: var(--green); box-shadow: 0 3px 0 var(--green); }
.count-item.mark { border-color: var(--amber); box-shadow: 0 3px 0 var(--amber); }
.count-item .cimg { pointer-events: none; }
.cmark {
  position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 800; color: #B5841A; background: #FFF7E3;
  border: 1px solid var(--amber); border-radius: 8px; padding: 0 6px; white-space: nowrap;
}
.cmark.remove { color: #fff; background: #E74C3C; border-color: #C0392B; }
.count-item.pos { border-color: var(--amber); box-shadow: 0 3px 0 var(--amber); }
.ten-card { text-align: left; }
.ten-pics { display: flex; gap: 20px; justify-content: center; align-items: flex-start; flex-wrap: wrap; margin: 14px 0 6px; }
.ten-pile { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.pile-n { font-weight: 800; font-size: 16px; color: var(--math); }
.pile-img { display: flex; flex-wrap: wrap; gap: 3px; max-width: 240px; font-size: 24px; line-height: 1.25; justify-content: center; }
.ten-pile .pick { display: inline-block; border: 2px solid var(--amber); border-radius: 50%; padding: 0 2px; box-shadow: 0 0 0 2px #FFF3E6; }
.ten-steps { margin-top: 10px; }
.ten-step { padding: 7px 12px; border-radius: 10px; font-size: 15px; margin: 6px 0; background: #F7F9FC; color: var(--ink-2); }
.ten-step b { color: var(--math); }
.ten-step.hl { background: #E6F0FF; color: #2B6FD6; font-weight: 700; }
.ten-result { margin-top: 10px; font-size: 18px; font-weight: 800; color: var(--math); text-align: center; }
.count-bar { text-align: center; font-size: 16px; color: var(--ink-2); margin: 16px 0 6px; }
.count-bar b { color: var(--math); font-size: 22px; }
.count-bar #countDone { color: var(--green); font-weight: 800; }

/* 首页：未设置名字时先填写昵称 */
.name-gate { display: flex; align-items: center; justify-content: center; min-height: 58vh; padding: 20px; }
.name-card { width: 100%; max-width: 360px; background: #fff; border: 2px solid var(--line); border-radius: 22px; padding: 28px 24px; text-align: center; box-shadow: 0 10px 30px rgba(0,0,0,.06); }
.name-emoji { font-size: 44px; line-height: 1; margin-bottom: 8px; }
.name-card h2 { margin: 6px 0 4px; font-size: 22px; font-weight: 800; color: var(--ink-1); }
.name-card p { margin: 0 0 18px; font-size: 14px; color: var(--ink-3); }
.name-input { width: 100%; box-sizing: border-box; padding: 12px 14px; font-size: 16px; border: 2px solid var(--line); border-radius: 12px; outline: none; transition: border-color .15s; font-family: inherit; }
.name-input:focus { border-color: var(--biology); }
.name-input.err { border-color: #FF6B6B; animation: tm-shake .4s; }
.name-card .btn.primary { width: 100%; margin-top: 16px; }

/* ============ 🪑 小人坐椅子（数学游戏 · 作业内嵌） ============ */
.game-task .game-mount { margin-top: 14px; }
.seat-wrap { display: flex; gap: 14px; align-items: stretch; }
.seat-palette { display: flex; flex-direction: column; gap: 12px; justify-content: center; font-size: 14px; color: #55657A; min-width: 64px; }
.seat-src { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 700; padding: 8px 6px; background: #fff; border: 2px dashed #B9D2F2; border-radius: 12px; cursor: grab; user-select: none; touch-action: none; transition: background .15s, border-color .15s; }
.seat-src:active { background: #EAF2FF; border-color: #6FA8E8; }
.seat-leg-ico { font-size: 30px; line-height: 1; }
.seat-pal-tip { margin: 2px 0 0; font-size: 11px; color: #9AA9BE; text-align: center; }
.seat-row-label { font-size: 13px; color: #55657A; font-weight: 700; margin: 4px 0 6px; }
.seat-empty { font-size: 13px; color: #A9B6C8; }
.seat-board { flex: 1; background: #F4F8FF; border: 2px dashed #B9D2F2; border-radius: 14px; padding: 16px; }
.seat-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; align-items: center; min-height: 60px; }
.seat-row-chairs { margin-bottom: 16px; }
.seat-chair { position: relative; width: 48px; height: 56px; display: flex; align-items: flex-end; justify-content: center; font-size: 30px; border-radius: 10px; background: #fff; border: 2px solid #D8E6FB; cursor: pointer; transition: background .15s, border-color .15s; }
.seat-chair .seat-ico { line-height: 1; }
.seat-chair.taken { background: #E9F7EC; border-color: #9DD8A8; }
.seat-chair .seat-sit { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: 26px; }
.seat-person { width: 48px; height: 56px; display: flex; align-items: center; justify-content: center; font-size: 32px; cursor: grab; user-select: none; touch-action: none; transition: opacity .1s; }
.seat-person.dragging { opacity: .3; }
.seat-ghost { font-size: 32px; z-index: 9999; pointer-events: none; opacity: .9; }
.seat-all-seated { font-size: 15px; font-weight: 700; color: var(--green); }
.seat-tip { text-align: center; color: #55657A; font-size: 13px; margin: 12px 0 0; }
@media (max-width: 480px) {
  .seat-chair, .seat-person { width: 40px; height: 48px; font-size: 26px; }
  .seat-chair .seat-sit { top: -19px; font-size: 22px; }
}
/* ===== 照片优先：有照片显示照片，无照片自动回退自绘线图 ===== */
.hp-wrap { position: relative; margin: 4px 0 2px; }
.hp-wrap .hp-svg { display: block; }
.hp-wrap .hp-img { display: none; width: 100%; border-radius: 10px; border: 1px solid #E6E1D8; background: #fff; }
.hp-wrap.hasimg .hp-svg { display: none; }
.hp-wrap.hasimg .hp-img { display: block; }
.hp-credit { display: none; margin: 6px 2px 0; font-size: 11px; line-height: 1.5; color: #8A8577; text-align: center; }
.hp-wrap.hasimg .hp-credit { display: block; }
.card-photo { margin: 10px 0 2px; text-align: center; }
.card-photo img { max-width: 100%; border-radius: 10px; border: 1px solid #E6E1D8; background: #fff; }
.photo-cap { margin: 6px 2px 0; font-size: 11.5px; line-height: 1.5; color: #8A8577; }
.photo-credit { margin: 3px 2px 0; font-size: 10.5px; line-height: 1.4; color: #A8A296; }
/* 时间排序：答案逐行显示（名称 + 年份） */
.ord-seq { margin: 8px 0 2px; text-align: left; }
.ord-row { display: flex; align-items: baseline; gap: 8px; padding: 5px 9px; margin-bottom: 5px; border-radius: 8px; background: #FBF7F0; }
.ord-no { flex: none; width: 18px; height: 18px; border-radius: 50%; background: var(--history); color: #fff; font-size: 11px; font-weight: 700; text-align: center; line-height: 18px; }
.ord-row b { font-size: 14px; color: #3A3228; }
.ord-yr { margin-left: auto; font-size: 11.5px; color: #8A8577; text-align: right; }
@media (max-width: 480px) {
  .ord-row { flex-wrap: wrap; }
  .ord-yr { margin-left: 26px; text-align: left; }
}
