:root {
  --bg1: #e6f2ff; --bg2: #fff3df;
  --ink: #24324a; --muted: #6b7a90;
  --card: #ffffff; --line: #e3e9f3;
  --pri: #4f7cff; --pri-d: #3559d6;
  --ok: #17a874; --ok-bg: #e2f7ee;
  --bad: #e94f4f; --bad-bg: #fdeaea;
  --warm: #ffb547;
  --shadow: 0 6px 18px rgba(40, 70, 120, .12);
  --r: 18px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background: linear-gradient(160deg, var(--bg1), var(--bg2)) fixed;
  background-color: var(--bg1);
  min-height: 100vh;
  font-size: 18px;
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: default; }
#app { max-width: 860px; margin: 0 auto; padding: 0 16px 48px; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 15px; }
b { color: #1d3d8f; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border-radius: var(--r); box-shadow: var(--shadow); padding: 20px; }
.btn { padding: 12px 22px; border-radius: 14px; font-weight: 700; font-size: 18px; transition: transform .1s, opacity .2s; }
.btn:active:not(:disabled) { transform: translateY(2px); }
.btn.primary { background: var(--pri); color: #fff; box-shadow: 0 4px 0 var(--pri-d); }
.btn.ghost { background: #fff; color: var(--pri); border: 2px solid var(--line); }
.btn.small { padding: 6px 14px; font-size: 15px; }
.btn:disabled { opacity: .4; }
button:focus { outline: none; }
button:focus-visible { outline: 3px solid #ffc861; outline-offset: 2px; }
.link { color: var(--muted); text-decoration: underline; margin-top: 12px; font-size: 15px; }
.row { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 18px; }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 12px 0; background: linear-gradient(var(--bg1) 75%, rgba(230, 242, 255, 0)); }
.topbar h1 { font-size: 20px; margin: 0; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo { font-size: 28px; }
.stats { display: flex; gap: 8px; align-items: center; }
.pill { background: #fff; border-radius: 999px; padding: 6px 12px; font-weight: 700; box-shadow: var(--shadow); font-size: 16px; white-space: nowrap; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; background: #fff; box-shadow: var(--shadow); font-size: 20px; display: grid; place-items: center; flex: none; }
.icon-btn .badge { position: absolute; top: -6px; right: -6px; background: var(--bad); color: #fff; font-style: normal; font-size: 12px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px; line-height: 18px; }

.bubble { position: relative; background: #f3f7ff; border-radius: 16px; padding: 12px 16px; font-size: 17px; }
.bubble.small { font-size: 16px; padding: 8px 14px; }

/* ---------- 吉祥物 ---------- */
.mascot { display: block; }
.mascot .bub { animation: bub 2.4s infinite ease-in; }
.mascot .b2 { animation-delay: .8s; }
.mascot .b3 { animation-delay: 1.6s; }
@keyframes bub { 0% { transform: translateY(0); opacity: .9; } 100% { transform: translateY(-22px); opacity: 0; } }
.hero-m .mascot, .result-card .mascot { animation: float 3s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-6px); } }

/* ---------- 地图 ---------- */
.hero { display: flex; gap: 16px; align-items: center; margin-top: 4px; border-top: 6px solid var(--c, var(--pri)); }
.hero-txt { flex: 1; min-width: 0; }
.rank { margin-top: 10px; font-size: 16px; }
.xpbar { height: 10px; background: #edf1f7; border-radius: 5px; overflow: hidden; margin-top: 6px; }
.xpbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--warm), #ff7a59); border-radius: 5px; transition: width .6s; }
.sec-title { font-size: 20px; margin: 26px 0 12px; }
.islands { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.island { text-align: left; border-top: 6px solid var(--c); transition: transform .15s; display: flex; flex-direction: column; gap: 4px; }
.island.open:hover { transform: translateY(-3px); }
.island.locked { opacity: .55; filter: grayscale(.6); }
.island.done { background: linear-gradient(160deg, #fff, #fff8e5); }
.isl-top { display: flex; justify-content: space-between; align-items: center; }
.isl-no { font-size: 14px; color: var(--c); font-weight: 700; }
.isl-emoji { font-size: 32px; }
.isl-title { font-size: 20px; font-weight: 800; }
.isl-sub { font-size: 14px; color: var(--muted); flex: 1; }
.tag { align-self: flex-start; margin-top: 8px; font-size: 14px; background: #f1f4fa; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.tag.soon, .tag.lock { font-weight: 400; color: var(--muted); }
.foot { text-align: center; color: var(--muted); font-size: 14px; margin-top: 24px; }

/* ---------- 单元关卡 ---------- */
.badge-card { margin-top: 14px; text-align: center; background: #fff8e5; }
.badge-card.new { margin: 14px 0; padding: 12px; border-radius: 14px; animation: glow 1.4s ease-in-out infinite alternate; }
@keyframes glow { to { box-shadow: 0 0 0 6px rgba(255, 181, 71, .35); } }
.path { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.lv { display: flex; align-items: center; gap: 14px; text-align: left; border-left: 6px solid var(--c); transition: transform .15s; }
.lv:not(.locked):hover { transform: translateX(4px); }
.lv.locked { opacity: .5; }
.lv.boss { background: linear-gradient(120deg, #fff, #fff1d6); }
.lv-no { font-size: 32px; width: 48px; text-align: center; flex: none; }
.lv-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.lv-txt small { color: var(--muted); font-size: 14px; }
.lv-stars i { font-style: normal; color: #d8dee9; font-size: 22px; }
.lv-stars i.on { color: var(--warm); }

/* ---------- 关卡页 ---------- */
.play-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; padding: 12px 0 6px; background: linear-gradient(var(--bg1) 80%, rgba(230, 242, 255, 0)); }
.progress { flex: 1; height: 14px; background: #fff; border-radius: 7px; overflow: hidden; box-shadow: inset 0 1px 3px rgba(0, 0, 0, .08); }
.progress i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #5ad1a0, var(--ok)); border-radius: 7px; transition: width .5s; }
.combo { font-weight: 800; color: #ff7a3d; font-size: 15px; min-width: 0; white-space: nowrap; }
.combo.hot { animation: pulse .8s infinite; }
@keyframes pulse { 50% { transform: scale(1.12); } }
.mini-m { flex: none; }
.mini-m.bounce { animation: bounce .5s; }
@keyframes bounce { 30% { transform: translateY(-8px) scale(1.08); } 60% { transform: translateY(0); } }
.lv-name { font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.say { display: flex; gap: 8px; align-items: center; margin-bottom: 12px; }
.say .mascot { flex: none; }

.g-title { margin: 4px 0 6px; font-size: 20px; text-align: center; }
.counter { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.hint-line { text-align: center; color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.tiny-hint { text-align: center; color: var(--muted); font-size: 14px; margin-top: 8px; }

.pic { display: inline-grid; place-items: center; }
.pic .ico { width: 100%; height: 100%; }
.pic.xl { width: 96px; height: 96px; font-size: 72px; }
.pic.lg { width: 76px; height: 76px; font-size: 56px; }
.pic.sm { width: 34px; height: 34px; font-size: 26px; flex: none; }
.pic.emo { line-height: 1; }

.feedback { margin-top: 14px; padding: 0 4px; text-align: center; min-height: 28px; }
.feedback.ok, .feedback.bad { padding: 12px 16px; border-radius: 14px; }
.feedback.ok { background: var(--ok-bg); color: #0b6b48; }
.feedback.bad { background: var(--bad-bg); color: #a42d2d; }
.explain { margin-top: 8px; text-align: left; color: var(--ink); font-size: 16px; }
.next-btn { margin-top: 12px; }

/* 学一学 */
.learn-card { text-align: center; }
.learn-card h2 { margin: 6px 0 10px; font-size: 24px; }
.learn-body { text-align: left; font-size: 18px; line-height: 1.85; }
.think { margin-top: 16px; padding: 14px; background: #fff8e8; border-radius: 14px; border: 2px dashed #ffd38a; text-align: left; }
.think-q { font-weight: 700; margin-bottom: 10px; }
.think .reveal { width: 100%; }
.think-a { animation: pop .35s; }
.dots { display: flex; justify-content: center; gap: 6px; margin-top: 14px; }
.dot { width: 10px; height: 10px; border-radius: 5px; background: #d8dee9; transition: all .3s; }
.dot.done { background: #a9c0ff; }
.dot.on { width: 26px; background: var(--pri); }

/* 分类 */
.item-card { text-align: center; padding: 26px 20px; }
.item-text { font-size: 24px; font-weight: 800; margin-top: 8px; }
.buckets { display: grid; gap: 12px; margin-top: 16px; grid-template-columns: repeat(2, 1fr); }
.buckets.n3 { grid-template-columns: repeat(3, 1fr); }
.bucket { background: #fff; border: 3px solid var(--line); border-radius: 16px; padding: 14px 8px; font-weight: 800; font-size: 18px; display: flex; flex-direction: column; align-items: center; gap: 4px; box-shadow: var(--shadow); transition: transform .1s, border-color .2s; }
.bucket:hover:not(:disabled) { border-color: var(--pri); transform: translateY(-2px); }
.be { font-size: 30px; }

/* 选择 */
.q-card { text-align: center; }
.q-text { font-size: 21px; font-weight: 700; margin-top: 4px; }
.options { display: grid; gap: 10px; margin-top: 16px; }
.opt { display: flex; align-items: center; gap: 12px; background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 12px 16px; text-align: left; font-size: 18px; box-shadow: var(--shadow); transition: border-color .2s, transform .1s; }
.opt:hover:not(:disabled) { border-color: var(--pri); }
.opt b { flex: none; width: 30px; height: 30px; border-radius: 50%; background: #eef2ff; color: var(--pri); display: grid; place-items: center; font-size: 16px; }

/* 对错状态（通用） */
.right { border-color: var(--ok) !important; background: var(--ok-bg) !important; opacity: 1 !important; animation: pop .35s; }
.wrong { border-color: var(--bad) !important; background: var(--bad-bg) !important; opacity: .75; }

/* 连连看 */
.cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 12px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.m-item { display: flex; align-items: center; gap: 8px; min-height: 58px; background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 8px 12px; text-align: left; font-size: 17px; box-shadow: var(--shadow); transition: all .2s; }
.col-l .m-item { font-weight: 800; }
.m-item.sel { border-color: var(--pri); background: #eef2ff; transform: scale(1.03); }
.m-item.done { border-color: var(--ok); background: var(--ok-bg); opacity: .55; transform: scale(.97); }

/* 排序 */
.slots { list-style: none; padding: 0; margin: 0 0 16px; display: flex; flex-direction: column; gap: 8px; }
.slot { display: flex; gap: 10px; align-items: center; background: rgba(255, 255, 255, .6); border: 2px dashed #c9d4e6; border-radius: 12px; padding: 8px 12px; min-height: 48px; font-size: 16px; color: var(--muted); }
.slot b { flex: none; width: 28px; height: 28px; border-radius: 50%; background: #dde5f3; color: #fff; display: grid; place-items: center; font-size: 15px; }
.slot.filled { border-style: solid; border-color: var(--ok); background: var(--ok-bg); color: var(--ink); }
.slot.filled b { background: var(--ok); }
.pool { display: flex; flex-direction: column; gap: 10px; }
.step { background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 12px 16px; text-align: left; font-size: 17px; box-shadow: var(--shadow); transition: border-color .2s; }
.step:hover { border-color: var(--pri); }
.step.gone { display: none; }

/* 文字表达式的箭头 */
.rx { display: inline-flex; flex-direction: column; align-items: stretch; vertical-align: middle; min-width: 2.6em; margin: 0 .3em; line-height: 1.05; }
.rx i { font-style: normal; font-size: .6em; color: #c0392b; text-align: center; min-height: .9em; padding: 0 .2em; white-space: nowrap; }
.rx .arr { display: block; height: 2px; background: currentColor; position: relative; margin: 2px 0; }
.rx .arr::after { content: ""; position: absolute; right: -2px; top: -4px; border: 5px solid transparent; border-left: 8px solid currentColor; border-right: 0; }

/* 空气成分条 */
.airbar { display: flex; height: 34px; border-radius: 10px; overflow: hidden; margin: 10px 0 4px; font-size: 13px; color: #fff; font-weight: 700; }
.airbar i { font-style: normal; display: grid; place-items: center; white-space: nowrap; overflow: hidden; }

/* 虚拟实验台 */
.lab-scene { padding: 10px; background: linear-gradient(#fbfdff, #f1f6fd); }
.scene { width: 100%; max-height: 280px; display: block; }
.lab-q { font-size: 19px; font-weight: 700; text-align: center; }
.lab .options { margin-top: 12px; }
.lab .act { width: 100%; padding: 16px; font-size: 20px; }
.observe { margin-top: 8px; text-align: left; background: #fff; border-radius: 10px; padding: 8px 12px; color: var(--ink); font-size: 16px; }
.scene .flk { animation: flk .22s infinite alternate; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes flk { to { transform: scale(.9, 1.1); } }
.scene .glow { animation: glowp .5s infinite alternate; }
@keyframes glowp { to { opacity: .6; } }
.scene .spk { animation: spk .5s infinite; }
@keyframes spk { 0%, 100% { opacity: 0; } 40% { opacity: 1; } }
.scene .smoke { animation: smk 2.4s infinite ease-in-out; }
@keyframes smk { 50% { transform: translateY(-6px); opacity: .7; } }
.scene .rise { animation: rise 2.6s ease-out both; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes rise { from { transform: scaleY(0); } }
.scene .drain { animation: drain 3s ease-in-out forwards; transform-box: fill-box; transform-origin: 50% 100%; }
@keyframes drain { to { transform: scaleY(.2); } }
.scene .bup { animation: bup 1.2s infinite ease-in; }
@keyframes bup { from { transform: translateY(0); opacity: .9; } to { transform: translateY(-34px); opacity: 0; } }

.scene .nh3 { animation: nh3 3s infinite ease-in-out; }
@keyframes nh3 { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 50% { transform: translate(-50px, -80px); } 90% { opacity: 1; } 100% { transform: translate(-100px, 10px); opacity: 0; } }
.scene .redden { animation: redden 3s ease-in both; }
@keyframes redden { from { fill: #f6f9ff; } }

/* ---------- 微观图示 ---------- */
.mol { display: inline-block; vertical-align: middle; margin: 0 2px; }
.mbox { display: inline-flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; max-width: 220px; padding: 8px 10px; border: 2px dashed #b9c6da; border-radius: 12px; background: #fbfcff; vertical-align: middle; margin: 4px; }
.mlegend { display: inline-flex; align-items: center; gap: 2px; font-size: 14px; color: var(--muted); }
.atom-sch { display: inline-block; vertical-align: middle; }
.micro-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; margin: 8px 0; }

/* 元素周期表的一格 */
.ecell { display: inline-grid; grid-template-columns: 1fr 1fr; grid-template-rows: auto 1fr auto; width: 66px; height: 74px; padding: 3px 5px; border: 2px solid #8fa3c0; border-radius: 8px; vertical-align: middle; line-height: 1.15; background: #fff; color: var(--ink); }
.ecell i { font-style: normal; }
.ecell .ez { font-size: 12px; font-weight: 700; }
.ecell .es { font-size: 15px; font-weight: 800; text-align: right; color: #1d3d8f; }
.ecell .en { grid-column: 1 / 3; font-size: 20px; font-weight: 800; text-align: center; align-self: center; }
.ecell .em { grid-column: 1 / 3; font-size: 11px; text-align: center; color: var(--muted); }
.ecell.metal { background: #fff0dc; border-color: #f0b46a; }
.ecell.nonmetal { background: #e2f0ff; border-color: #8fb8e8; }
.ecell.noble { background: #efe7ff; border-color: #b9a2f0; }
.ecell.big { width: 110px; height: 124px; padding: 6px 8px; border-width: 3px; }
.ecell.big .ez { font-size: 18px; } .ecell.big .es { font-size: 24px; } .ecell.big .en { font-size: 34px; } .ecell.big .em { font-size: 15px; }

/* 原子拼装 */
.atom-target { display: flex; align-items: center; gap: 14px; justify-content: center; text-align: left; }
.atom-board { display: flex; align-items: center; gap: 12px; margin-top: 12px; flex-wrap: wrap; justify-content: center; }
.bohr-wrap { width: 190px; max-width: 100%; }
.bohr { width: 100%; height: auto; display: block; }
.shell-ctrl { display: flex; flex-direction: column; gap: 8px; }
.sc { display: flex; align-items: center; gap: 8px; }
.sc span { width: 52px; font-size: 15px; color: var(--muted); }
.sc-btn { width: 40px; height: 40px; border-radius: 12px; background: #eef2ff; color: var(--pri); font-size: 22px; font-weight: 800; }
.sc-btn:active { transform: scale(.92); }
.sc-n { width: 26px; text-align: center; font-size: 20px; }
.atom-sum { font-size: 15px; color: var(--muted); margin-top: 4px; }

/* 化学式与化合价 */
sub { font-size: .7em; vertical-align: -.25em; line-height: 0; }
.val { display: inline-flex; flex-direction: column; align-items: center; vertical-align: bottom; line-height: 1.05; margin: 0 1px; }
.val i { font-style: normal; font-size: .62em; color: #c0392b; font-weight: 700; }
.scene .grow-down { animation: growDown 3s ease-out both; transform-box: fill-box; transform-origin: 50% 0; }
@keyframes growDown { from { transform: scaleY(0); } }

/* 化合价拼图 */
.f-target { text-align: center; font-size: 19px; }
.f-species { display: flex; justify-content: center; gap: 28px; margin-top: 10px; font-size: 30px; font-weight: 800; }
.f-species > span { display: flex; flex-direction: column; align-items: center; }
.f-species small { font-size: 14px; font-weight: 400; color: var(--muted); }
.f-board { margin-top: 12px; }
.f-row { display: flex; align-items: center; gap: 8px; min-height: 46px; }
.f-lab { flex: none; width: 36px; font-size: 14px; color: var(--muted); }
.f-track { flex: 1; display: flex; flex-wrap: nowrap; gap: 3px; min-width: 0; overflow: hidden; }
.f-sum { flex: none; width: 40px; text-align: right; font-size: 18px; }
.pill-v { height: 36px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; font-size: 13px; color: #fff; white-space: nowrap; animation: pop .25s; overflow: hidden; }
.pill-v sup { font-size: .7em; }
.pill-v.pos { background: linear-gradient(#ff8a7a, #ef5a5a); }
.pill-v.neg { background: linear-gradient(#7fb0ff, #4f7cff); }
.f-state { text-align: center; margin-top: 8px; font-size: 15px; color: var(--muted); }
.f-state.ok { color: var(--ok); font-weight: 700; }
.f-formula { text-align: center; font-size: 34px; font-weight: 800; color: #1d3d8f; margin-top: 4px; }
.f-big { font-size: 1.3em; }
.f-ctrl { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin-top: 12px; }
.f-name { width: auto !important; min-width: 40px; font-size: 18px !important; font-weight: 800; color: var(--ink) !important; text-align: right; }

/* 化学方程式：等号（双线）与未配平时的短线 */
.rx .arr2 { display: block; height: 6px; border-top: 2px solid currentColor; border-bottom: 2px solid currentColor; margin: 1px 0; }
.rx .dash { display: block; height: 2px; background: currentColor; margin: 4px 25% 3px; }
.eqn { white-space: normal; }
.eqt { white-space: nowrap; }
.scene .redden2 { animation: toGreen 3s ease-in both; }
.scene .toRed { animation: toRed 3s ease-in both; }
@keyframes toRed { from { fill: #333; } }
.scene .toRed2 { animation: toRed2 2.5s ease-in both; }
@keyframes toRed2 { from { fill: #a07cd9; } }
.scene .toPurple { animation: toPurple 2.5s ease-in both; }
@keyframes toPurple { from { fill: #ff5c7a; } }
.scene .fadeLate { animation: fadeLate 3.2s ease-in forwards; }
@keyframes fadeLate { 0%, 70% { opacity: 1; } 100% { opacity: 0; } }
.scene .smokeLate { animation: smokeIn 3.2s forwards, smk 2.4s 3.2s infinite ease-in-out; }
@keyframes smokeIn { 0%, 80% { opacity: 0; } 100% { opacity: .8; } }
@keyframes toGreen { from { fill: #7fb8ff; } }

/* 配平天平 */
.eq-card { text-align: center; padding: 14px 8px; }
.eq-terms { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 2px 4px; font-size: 22px; font-weight: 800; }
.term { display: inline-flex; flex-direction: column; align-items: center; }
.tf { display: inline-flex; align-items: baseline; white-space: nowrap; }
.coef { color: #e8590c; min-width: .7em; text-align: right; margin-right: 1px; transition: color .2s; }
.coef.one { color: #c9d2df; }
.cb { width: 38px; height: 26px; border-radius: 8px; background: #eef2ff; color: var(--pri); font-size: 13px; }
.cb:active { transform: scale(.92); }
.plus { color: var(--muted); padding: 0 2px; }
.eq-sign { display: inline-flex; font-size: 20px; }
.eq-hint { font-size: 14px; color: var(--muted); margin-top: 6px; }
.scale-card { margin-top: 12px; overflow: hidden; }
.scale { position: relative; height: 34px; }
.beam { position: absolute; left: 8%; right: 8%; top: 12px; height: 8px; border-radius: 4px; background: linear-gradient(#9aa8bb, #6f7f96); transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.pivot { position: absolute; left: 50%; top: 18px; transform: translateX(-50%); border: 12px solid transparent; border-bottom: 16px solid #6f7f96; border-top: 0; }
.pans { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 4px; }
.pan { min-height: 64px; display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: center; gap: 3px; padding: 8px; background: #f3f6fb; border: 2px solid #c9d4e6; border-top-width: 5px; border-radius: 0 0 40px 40px; transition: transform .5s cubic-bezier(.3, 1.4, .5, 1); }
.pan-labels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: center; font-size: 13px; color: var(--muted); margin-top: 18px; }
.ab { font-style: normal; width: 22px; height: 22px; border-radius: 50%; display: inline-grid; place-items: center; font-size: 9px; font-weight: 800; color: #24324a; border: 1.5px solid #24324a; flex: none; }
.ab.more { background: #fff; font-size: 9px; width: auto; padding: 0 4px; border-radius: 11px; }
.el-table { margin: 10px auto 0; border-collapse: collapse; font-size: 15px; }
.el-table th, .el-table td { padding: 3px 12px; text-align: center; }
.el-table th { color: var(--muted); font-weight: 400; font-size: 13px; }
.el-table tr.ok td:last-child { color: var(--ok); font-weight: 800; }
.el-table tr.no td:last-child { color: var(--bad); font-weight: 800; }
.el-table tr.no td:nth-child(2), .el-table tr.no td:nth-child(3) { color: var(--bad); font-weight: 700; }
.eq-final { font-size: 22px; font-weight: 800; margin: 8px 0; color: var(--ink); overflow-x: auto; }

/* 灭火救援队 */
.fire-scene { text-align: center; background: linear-gradient(#fff, #fff4ec); }
.fs-pic { position: relative; height: 96px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.fs-emoji { font-size: 64px; }
.fs-fire { font-size: 50px; display: inline-block; transition: transform .4s; animation: flk2 .5s infinite alternate; transform-origin: 50% 100%; }
.fs-fire.out { animation: puff 1s forwards; transform: none !important; }
@keyframes flk2 { to { filter: brightness(1.2); margin-top: -4px; } }
@keyframes puff { 0% { transform: scale(1.4); opacity: .3; } 100% { transform: scale(1); opacity: 1; } }
.fs-title { font-size: 20px; font-weight: 800; margin-top: 6px; }

/* 实验：变黑、变浅绿、生锈 */
.scene .toBlack { animation: toBlack 3s ease-in both; }
@keyframes toBlack { from { fill: #9a3b22; } }
.scene .toGreen2 { animation: toGreen2 4s ease-in both; }
@keyframes toGreen2 { from { fill: #eef6ff; } }
.scene .fadeIn { animation: fadeIn 2.5s ease-in both; }
@keyframes fadeIn { from { opacity: 0; } }

/* 活动性大比拼 */
.act-card { text-align: center; }
.act-pair { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; font-size: 28px; }
.act-pair b { font-size: 20px; margin-left: 4px; }
.act-plus { font-size: 15px; color: var(--muted); }
.act-q { margin-top: 8px; font-size: 18px; font-weight: 700; }
.ladder-card { margin-top: 12px; padding: 12px 8px; }
.ladder { display: grid; grid-template-columns: repeat(15, minmax(0, 1fr)); gap: 2px; }
.lad { display: flex; flex-direction: column; align-items: center; padding: 4px 0; border-radius: 6px; background: #f1f4fa; transition: all .3s; }
.lad b { font-size: clamp(10px, 2.8vw, 15px); color: #1d3d8f; }
.lad i { font-style: normal; font-size: clamp(9px, 2.4vw, 13px); color: var(--muted); }
.lad.me { background: var(--ok); transform: scale(1.12); } .lad.me b, .lad.me i { color: #fff; }
.lad.tgt { background: var(--warm); transform: scale(1.12); } .lad.tgt b, .lad.tgt i { color: #fff; }
.lad-arrow { text-align: center; font-size: 13px; color: var(--muted); margin-top: 6px; }

/* 溶解度曲线 */
.chart-card { padding: 8px; background: linear-gradient(#fbfdff, #f4f8fe); }
.chart { width: 100%; max-height: 300px; display: block; }
.curve .q-card { margin-top: 12px; }
.cpt { cursor: pointer; }
.cpt:hover .dot { fill: #ffe9a8; }
.cpt.hit .dot { fill: var(--ok); stroke: #0b6b48; }
.cpt.miss .dot { fill: var(--bad); stroke: #a42d2d; }
.buckets.n4 { grid-template-columns: repeat(4, 1fr); }
.pt-btn { font-size: 20px; }
.card .chart-card { margin: 8px 0; box-shadow: none; border: 1px solid var(--line); }

/* pH 调色盘 */
.ph-card { text-align: center; }
.ph-tube-box .ph-tube { width: 90px; height: 150px; }
.palette { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 14px; }
.pal { display: flex; flex-direction: column; align-items: center; gap: 4px; background: #fff; border: 3px solid var(--line); border-radius: 14px; padding: 10px 4px; font-weight: 700; box-shadow: var(--shadow); }
.pal i { width: 34px; height: 34px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .12); }
.pal:hover:not(:disabled) { border-color: var(--pri); }
.ph-strip { display: flex; justify-content: center; margin: 12px 0 6px; }
.ph-strip i { width: 46px; height: 70px; border-radius: 6px; border: 2px solid rgba(0, 0, 0, .15); box-shadow: var(--shadow); }
.ph-card-row { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin-top: 12px; }
.ph-card-row .pal { padding: 6px 2px; border-radius: 10px; font-size: 15px; }
.ph-card-row .pal i { width: 100%; height: 26px; border-radius: 6px; }
.ph-bar-card { margin-top: 12px; padding: 14px 10px; }
.ph-bar-wrap { position: relative; padding-top: 18px; margin: 8px 0; }
.ph-bar { display: grid; grid-template-columns: repeat(15, 1fr); border-radius: 8px; overflow: hidden; }
.ph-bar i { font-style: normal; text-align: center; font-size: 12px; font-weight: 700; color: #fff; padding: 5px 0; text-shadow: 0 1px 2px rgba(0, 0, 0, .4); }
.ph-ptr { position: absolute; top: 0; transform: translateX(-50%); color: var(--ink); font-size: 16px; transition: left .5s; }
.ph-scale { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ph-target { text-align: center; font-weight: 700; color: #c77700; margin-top: 4px; }
.ph-beaker { width: 160px; height: 140px; display: block; margin: 8px auto 0; }

/* 离子消消乐 */
.ion-mix { display: flex; align-items: center; justify-content: center; gap: 12px; font-size: 22px; font-weight: 800; flex-wrap: wrap; }
.ion-mix span { display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border-radius: 12px; }
.ion-mix .plus { font-style: normal; color: var(--muted); }
.ion-mix small { font-size: 13px; font-weight: 400; color: var(--muted); }
.ion-mix .src0 { background: #eef4ff; } .ion-mix .src1 { background: #fff3e6; }
.ion-board { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.ion-row { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.ion { min-width: 76px; height: 64px; border-radius: 50%; font-size: 21px; font-weight: 800; background: #fff; border: 3px solid var(--line); box-shadow: var(--shadow); transition: transform .15s, opacity .4s; }
.ion.src0 { border-color: #9db7ff; } .ion.src1 { border-color: #ffc58a; }
.ion.pos { color: #c0392b; } .ion.neg { color: #1d5fbf; }
.ion.sel { transform: scale(1.12); background: #fff8d6; border-color: var(--warm); }
.ion.gone { opacity: .12; transform: scale(.7); }
.ion-made { margin-top: 12px; text-align: center; font-size: 15px; color: var(--muted); min-height: 20px; }
.made { display: inline-flex; flex-direction: column; align-items: center; margin: 4px 6px; padding: 4px 10px; border-radius: 10px; background: #f4f7fc; color: var(--ink); font-weight: 700; font-size: 17px; }
.made small { font-size: 12px; font-weight: 400; color: var(--muted); }
.made.沉淀 { background: #f1ecff; } .made.气体 { background: #e6f6ff; } .made.水 { background: #e2f7ee; }
.ion-done { display: block; width: 100%; margin-top: 12px; padding: 12px; font-size: 18px; }

/* 营养搭配 */
.meal-card { text-align: center; }
.plate { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 12px auto; padding: 14px; max-width: 360px; border-radius: 50%/38%; background: radial-gradient(#fff 55%, #eef2f8 56%, #fff 70%, #e3e9f3 71%); }
.dish { display: flex; flex-direction: column; align-items: center; font-size: 14px; font-weight: 700; }
.dish i { font-style: normal; font-size: 34px; }
.dish.new { animation: pop .5s; color: var(--ok); }
.nutri { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.nutri span { display: flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; font-size: 18px; transition: all .4s; }
.nutri span b { font-size: 14px; }
.nutri .on { background: #fff4c2; box-shadow: 0 0 10px rgba(255, 190, 40, .7); }
.nutri .off { background: #eef1f5; filter: grayscale(1); opacity: .55; }

/* 总复习岛毕业证 */
.badge-card.grad { background: linear-gradient(135deg, #fff3c4, #ffd9b0); border: 2px solid #ffb547; font-size: 17px; line-height: 1.6; }

/* 间隔复习 */
.review-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; flex-wrap: wrap; border-left: 6px solid var(--warm); }
.review-card.calm { border-left-color: var(--ok); color: var(--muted); }
.review-card small { display: block; font-size: 14px; }
.w-due { float: right; color: #c77700; font-weight: 700; }
.w-due.done { color: var(--ok); }
.fc { text-align: center; }
.fc-tag { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.fc-back { margin-top: 14px; text-align: left; }
.fc-ans { background: var(--ok-bg); color: #0b6b48; border-radius: 10px; padding: 8px 12px; font-weight: 700; margin-bottom: 8px; }
.fc-btns { margin-top: 14px; justify-content: center; }

/* 每日小目标 */
.daily { margin-top: 14px; border-left: 6px solid var(--warm); }
.daily.all { border-left-color: var(--ok); background: linear-gradient(135deg, #fff, #effbf5); }
.daily-head { display: flex; justify-content: space-between; align-items: center; font-size: 18px; margin-bottom: 8px; }
.streak { font-size: 15px; font-weight: 800; color: #ff7a3d; }
.goal { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-top: 1px dashed var(--line); }
.g-ic { font-size: 20px; width: 26px; text-align: center; }
.g-name { flex: 1; font-size: 16px; }
.g-name small { display: block; font-size: 13px; color: var(--muted); }
.goal.ok .g-name { color: var(--muted); text-decoration: line-through; }
.g-bar { width: 70px; height: 8px; border-radius: 4px; background: #e8edf5; overflow: hidden; flex: none; }
.g-bar i { display: block; height: 100%; background: linear-gradient(90deg, #5ad1a0, var(--ok)); }
.daily-foot { margin-top: 6px; font-size: 14px; color: var(--muted); text-align: center; }

/* 家长查看页 */
.parent .card { margin-bottom: 14px; }
.parent h3 { margin: 0 0 10px; font-size: 18px; }
.parent .small { font-size: 14px; }
.ptiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ptiles.two { grid-template-columns: repeat(2, 1fr); }
.ptile { background: #f4f7fc; border-radius: 12px; padding: 10px; display: flex; flex-direction: column; gap: 2px; }
.ptile span { font-size: 13px; color: var(--muted); }
.ptile b { font-size: 20px; color: var(--ink); }
.ptile small { font-size: 12px; color: var(--muted); }
.pchart { width: 100%; display: block; margin: 4px 0; }
.pbar:hover path { fill: var(--pri-d); }
.ptable-wrap { overflow-x: auto; }
.ptab { width: 100%; border-collapse: collapse; font-size: 14px; margin-top: 8px; }
.ptab th, .ptab td { padding: 6px 4px; text-align: center; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ptab th { color: var(--muted); font-weight: 600; }
.ptab td:first-child, .ptab th:first-child { text-align: left; }
.ptab tr.hl td { background: #fff4e0; }
.pweak { margin-bottom: 8px; }
.ptag { display: inline-block; margin: 4px 6px 0 0; padding: 4px 10px; border-radius: 999px; background: #fff4e0; color: #8a5200; font-weight: 700; font-size: 14px; }
.ptips p { margin: 4px 0; font-size: 15px; }
@media (max-width: 560px) { .ptiles { grid-template-columns: repeat(2, 1fr); } .ptiles.three { grid-template-columns: repeat(3, 1fr); } }

/* 进度备份 */
.pbackup .row { flex-wrap: wrap; justify-content: flex-start; gap: 10px; }
.pbackup .warn { color: #c77700; font-weight: 700; }
.pb-msg:empty { display: none; }

/* 课本对照 */
.isl-book { font-size: 13px; color: var(--muted); background: #f4f7fc; border-radius: 8px; padding: 2px 8px; align-self: flex-start; }
.unit-book { margin: 10px 4px 0; }
.ed-row { justify-content: flex-start; margin-top: 8px; }

/* ---------- 元素卡收集册 ---------- */
.ptable { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 4px; }
.ptable .ecell { min-width: 0; padding: 2px 3px; border-radius: 6px; }
.ptable .ecell .ez { font-size: 10px; } .ptable .ecell .es { font-size: 11px; } .ptable .ecell .en { font-size: clamp(13px, 3.6vw, 20px); } .ptable .ecell .em { font-size: 9px; }
.pextra { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
.ptable .ecell, .pextra .ecell { width: 100%; height: auto; aspect-ratio: 66 / 74; cursor: pointer; transition: transform .15s; }
.ptable .ecell:hover, .pextra .ecell:hover { transform: scale(1.06); }
.ecell.lock { background: #eef1f6; border: 2px dashed #c9d2df; color: #b5bfcc; }
.ecell.lock .es, .ecell.lock .em { color: #b5bfcc; }
.ecell.lock .en { font-size: 22px; }
.legend-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; font-size: 14px; color: var(--muted); margin: 10px 0; }
.legend-row span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; background: var(--c); }
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(20, 30, 50, .45); display: grid; place-items: center; padding: 16px; }
.modal .card { width: min(420px, 100%); max-height: 90vh; overflow: auto; text-align: center; animation: flipIn .45s; }
@keyframes flipIn { from { transform: perspective(600px) rotateY(90deg); opacity: 0; } }
.ecard-name { font-size: 26px; font-weight: 800; margin-top: 8px; }
.ecard-py { color: var(--muted); font-size: 16px; }
.ecard-info { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0; font-size: 15px; }
.ecard-info div { background: #f4f7fc; border-radius: 10px; padding: 6px; }
.ecard-fact { text-align: left; background: #fff8e8; border-radius: 12px; padding: 10px 12px; font-size: 16px; }
.new-cards { margin: 12px 0; padding: 12px; border-radius: 14px; background: #f3f0ff; }
.new-cards .ecell { margin: 4px; animation: pop .5s both; }

/* ---------- 结算 ---------- */
.result { padding-top: 30px; }
.result-card { text-align: center; display: flex; flex-direction: column; align-items: center; }
.result-card h2 { margin: 10px 0 4px; font-size: 26px; }
.big-stars { display: flex; gap: 10px; margin: 8px 0; }
.big-stars .star { font-size: 56px; color: #dfe4ec; }
.big-stars .star.on { color: var(--warm); animation: starIn .5s both; text-shadow: 0 3px 10px rgba(255, 170, 40, .5); }
@keyframes starIn { 0% { transform: scale(0) rotate(-90deg); } 70% { transform: scale(1.3); } 100% { transform: scale(1); } }
.result-card p { margin: 4px 0; }
.gain { font-weight: 800; color: #ff7a3d; font-size: 20px; }

/* ---------- 错题本 ---------- */
.wrongs .empty { text-align: center; display: flex; flex-direction: column; align-items: center; }
.wrong-item { margin-bottom: 12px; }
.w-where { font-size: 13px; color: var(--muted); }
.w-q { font-weight: 700; margin: 4px 0; }
.w-ex { font-size: 16px; background: #f6f8fc; border-radius: 10px; padding: 8px 12px; margin: 6px 0 10px; }

/* ---------- 动效 ---------- */
.pop { animation: pop .35s; }
@keyframes pop { 0% { transform: scale(.85); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }

.toast { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); background: #24324a; color: #fff; padding: 10px 20px; border-radius: 999px; font-weight: 700; z-index: 50; animation: toast 1.5s forwards; white-space: nowrap; }
.toast.hot { background: linear-gradient(90deg, #ff7a3d, #ffb547); }
@keyframes toast { 0% { opacity: 0; transform: translate(-50%, -10px); } 15%, 80% { opacity: 1; transform: translate(-50%, 0); } 100% { opacity: 0; } }

.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 40; overflow: hidden; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { top: 105vh; transform: rotate(720deg); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ---------- 手机 ---------- */
@media (max-width: 560px) {
  body { font-size: 17px; }
  .hero { flex-direction: column; text-align: center; }
  .buckets.n3 { grid-template-columns: 1fr; }
  .buckets.n4 { grid-template-columns: repeat(2, 1fr); }
  .bucket { flex-direction: row; justify-content: center; }
  .cols { grid-template-columns: 1fr 1.2fr; gap: 8px; }
  .m-item { font-size: 15px; padding: 6px 8px; }
  .pic.sm { width: 26px; height: 26px; }
  .item-text { font-size: 21px; }
  .pill { padding: 4px 8px; font-size: 14px; }
  .topbar { gap: 6px; }
  .topbar h1 { font-size: 17px; }
  .stats { gap: 5px; }
  .icon-btn { width: 36px; height: 36px; font-size: 17px; border-radius: 10px; }
}

/* 坐标图像题 */
.graph-opts { grid-template-columns: 1fr 1fr; }
.gopt { flex-direction: column; align-items: stretch; gap: 2px; padding: 6px 8px 4px; position: relative; }
.gopt b { position: absolute; left: 6px; top: 6px; width: 24px; height: 24px; font-size: 14px; }
.gopt .gsvg { width: 100%; height: auto; display: block; }

/* 知识手册 */
.bk-search { display: flex; align-items: center; gap: 10px; margin: 18px 0 12px; flex-wrap: wrap; }
.bk-search input { flex: 1; min-width: 0; font-size: 17px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: #fff; }
.bk-unit { margin-bottom: 12px; padding: 12px 16px; }
.bk-unit > summary { cursor: pointer; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 18px; list-style: none; }
.bk-unit > summary::-webkit-details-marker { display: none; }
.bk-unit > summary::after { content: '▸'; margin-left: auto; color: var(--pri); transition: transform .2s; }
.bk-unit[open] > summary::after { transform: rotate(90deg); }
.bk-ue { font-size: 24px; }
.bk-lt { font-size: 17px; margin: 18px 0 8px; }
.bk-card { margin: 8px 0; padding: 12px 14px; box-shadow: none; border: 2px solid var(--line); }
.bk-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 17px; }
.bk-card .think > summary { cursor: pointer; }
.bk-lock { color: #8a94a3; margin: 10px 0; }

/* 表格计算题的数据表 */
.dtab { margin: 10px auto 2px; border-collapse: collapse; font-size: 15px; background: #fff; }
.dtab th, .dtab td { border: 1.5px solid #b9c6d8; padding: 4px 9px; text-align: center; font-weight: 400; }
.dtab th { background: #eef4ff; color: var(--ink, #2b4c7e); white-space: nowrap; font-size: 14px; }

/* 常见标志 */
.signs { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 8px 0; }
.opt .sign { width: 74px; height: auto; flex: none; }

/* 很窄的手机：顶栏 4 个按钮 + 星星时，给标题留点地方 */
@media (max-width: 400px) {
  .stats { gap: 4px; }
  .icon-btn { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
  .stats .pill { padding: 3px 6px; font-size: 13px; }
}

/* 选择题题干里的曲线图（看图答题） */
.q-text .gsvg, .learn-body .gsvg { display: block; width: 100%; max-width: 340px; margin: 10px auto 4px; background: #fbfdff; border: 1px solid var(--line); border-radius: 10px; }

/* 方程式默写：选生成物 */
.pk-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0; }
.pk { min-width: 76px; padding: 10px 14px; font-size: 20px; background: #fff; border: 3px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }
.pk.on { border-color: var(--pri); background: #eef2ff; }
.pk-slot { color: var(--pri); font-weight: 700; }

/* 单元知识结构图 */
.bk-map { background: #f7fbff; border: 2px dashed #b9cdea; border-radius: 12px; padding: 4px 12px 10px; margin: 10px 0 4px; }
.kmap, .kmap ul { list-style: none; margin: 0; padding-left: 16px; }
.kmap { padding-left: 0; font-size: 15px; line-height: 1.6; }
.kmap li { position: relative; padding-left: 14px; margin: 3px 0; }
.kmap li::before { content: ''; position: absolute; left: 0; top: .75em; width: 9px; border-top: 2px solid #9db8e0; }
.kmap ul { border-left: 2px solid #c9d8ee; margin-left: 4px; }
.kmap > li { padding-left: 0; } .kmap > li::before { display: none; }
.kmap b { color: #1f5fa8; }
.bk-maplock { color: #8a94a3; margin: 8px 0; font-size: 15px; }
