:root {
  --bg: #fff8ee;
  --bg2: #fff1dc;
  --card: #ffffff;
  --ink: #4a3b2c;
  --ink-soft: #8b7a68;
  --line: #f0e4d4;
  --primary: #ff9f43;
  --primary-d: #f08c2e;
  --green: #4caf72;
  --green-d: #3d945e;
  --blue: #4aa8d8;
  --purple: #9b7ede;
  --red: #ef6b6b;
  --gold: #ffc107;
  --shadow: 0 6px 20px rgba(180, 130, 70, .13);
  --shadow-lg: 0 12px 34px rgba(180, 130, 70, .2);
  --radius: 20px;
}

/* ---------- 开源卡通字体（ZCOOL KuaiLe，SIL OFL 1.1，已按项目用字子集化） ---------- */
@font-face {
  font-family: "ZCOOL KuaiLe";
  src: url("/fonts/zcool-kuaile-subset.woff2") format("woff2");
  font-display: swap;
  font-weight: 400;
  font-style: normal;
}
/* 只作用于标题/数字/按钮等固定 UI 文案；题目正文、选项、解析保持系统无衬线，保证长文本可读 */
.brand,
.login-title,
.section-title,
.ec-title,
.ec-qtitle,
.answer-feedback .fb-title,
h1, h2, h3,
.coin-pill,
.btn {
  font-family: "ZCOOL KuaiLe", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; cursor: pointer; border: none; }
input, select { font-family: inherit; }

/* ---------- 背景装饰 ---------- */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 12% 18%, #ffe0b2 0, transparent 22%),
    radial-gradient(circle at 88% 12%, #d9f0ff 0, transparent 24%),
    radial-gradient(circle at 80% 88%, #e5f7d9 0, transparent 26%),
    radial-gradient(circle at 15% 85%, #ffe9f0 0, transparent 22%);
}

/* ---------- 通用 ---------- */
.wrap { max-width: 960px; margin: 0 auto; padding: 18px 16px 90px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.muted { color: var(--ink-soft); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 14px; font-size: 16px; font-weight: 700;
  color: #fff; background: var(--primary);
  box-shadow: 0 4px 0 var(--primary-d);
  transition: transform .08s, box-shadow .08s, opacity .2s;
  user-select: none;
}
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-d); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.green { background: var(--green); box-shadow: 0 4px 0 var(--green-d); }
.btn.green:active { box-shadow: 0 1px 0 var(--green-d); }
.btn.blue { background: var(--blue); box-shadow: 0 4px 0 #368bb8; }
.btn.ghost { background: #fff; color: var(--ink); box-shadow: 0 3px 0 var(--line); border: 1px solid var(--line); }
.btn.sm { padding: 8px 14px; font-size: 14px; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.danger { background: var(--red); box-shadow: 0 4px 0 #cf5252; }

.card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px;
}

/* ---------- 登录页 ---------- */
.login-page { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; }
.login-logo { font-size: 68px; line-height: 1; margin-bottom: 6px; animation: bob 3s ease-in-out infinite; }
.login-title { font-size: 30px; font-weight: 900; letter-spacing: 1px; margin: 0 0 4px; }
.login-sub { color: var(--ink-soft); margin: 0 0 26px; font-size: 15px; }
.login-card { width: 100%; max-width: 380px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 14px; font-weight: 700; margin-bottom: 7px; color: var(--ink); }
.field input, .field select {
  width: 100%; padding: 13px 15px; border: 2px solid var(--line);
  border-radius: 13px; font-size: 16px; background: #fffefa; color: var(--ink);
  outline: none; transition: border-color .2s;
}
.field input:focus, .field select:focus { border-color: var(--primary); }
.field input[type=text].code-input { letter-spacing: 3px; font-weight: 800; text-transform: uppercase; }
.login-divider { display: flex; align-items: center; gap: 12px; color: var(--ink-soft); font-size: 13px; margin: 20px 0 14px; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.admin-link { color: var(--primary-d); font-weight: 700; background: none; font-size: 14px; }
.admin-link:hover { text-decoration: underline; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 248, 238, .92); backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
  padding: 12px 16px;
}
.topbar-inner { max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 900; font-size: 18px; }
.brand .logo { font-size: 26px; }
.coin-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #ffd452, #ffb52e);
  color: #6b4a00; font-weight: 900; font-size: 16px;
  padding: 7px 14px; border-radius: 999px; box-shadow: 0 3px 8px rgba(255,180,40,.4);
}
.coin-pill .coin-ico { font-size: 18px; }
/* 收蛋后金币变多：pill 弹跳 + 图标翻转 */
.coin-pill.coin-bump { animation: coinBump .72s cubic-bezier(.2,1.4,.4,1); }
@keyframes coinBump {
  0% { transform: scale(1); }
  30% { transform: scale(1.26) rotate(-4deg); box-shadow: 0 0 0 7px rgba(255,190,50,.4), 0 3px 16px rgba(255,180,40,.65); }
  60% { transform: scale(.96) rotate(2deg); }
  100% { transform: scale(1); }
}
.coin-pill.coin-bump .coin-ico { animation: coinSpin .72s ease; }
@keyframes coinSpin {
  0% { transform: rotateY(0) scale(1); }
  50% { transform: rotateY(180deg) scale(1.45); }
  100% { transform: rotateY(360deg) scale(1); }
}
/* 飘出的 +N 金币 */
.coin-fly {
  position: fixed; z-index: 9999; pointer-events: none; white-space: nowrap;
  font-weight: 900; font-size: 20px; color: #e07b00;
  text-shadow: 0 2px 0 #fff, 0 3px 9px rgba(224,123,0,.5);
  animation: coinFly 1.15s ease-out forwards;
}
@keyframes coinFly {
  0% { opacity: 0; transform: translate(-50%, 4px) scale(.6); }
  22% { opacity: 1; transform: translate(-50%, -12px) scale(1.18); }
  100% { opacity: 0; transform: translate(-50%, -74px) scale(1); }
}
/* 四散的金币粒子 */
.coin-spark {
  position: fixed; z-index: 9998; pointer-events: none; font-size: 15px;
  animation: coinSpark .9s ease-out forwards;
}
@keyframes coinSpark {
  0% { opacity: 1; transform: translate(-50%,-50%) scale(.5) rotate(0); }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.1) rotate(var(--rot)); }
}

/* ---------- 底部导航 ---------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
  border-top: 2px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 4px max(8px, env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 0; border-radius: 12px; color: var(--ink-soft); font-size: 12px; font-weight: 700;
  background: none; transition: color .2s, background .2s;
}
.nav-item .ico { font-size: 24px; line-height: 1; transition: transform .2s; }
.nav-item.active { color: var(--primary-d); background: #fff3e4; }
.nav-item.active .ico { transform: scale(1.15); }

/* ---------- 首页 / 科目选择 ---------- */
.hero {
  background: linear-gradient(135deg, #ffb765, #ff9f43);
  color: #fff; border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow-lg); margin-bottom: 20px; position: relative; overflow: hidden;
}
.hero h1 { margin: 0 0 6px; font-size: 24px; font-weight: 900; }
.hero p { margin: 0; opacity: .95; font-size: 15px; }
.hero .hen { position: absolute; right: 12px; bottom: -6px; font-size: 84px; opacity: .9; }
.section-title { font-size: 19px; font-weight: 900; margin: 22px 4px 12px; display: flex; align-items: center; gap: 8px; }

.subject-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.subject-card {
  border-radius: var(--radius); padding: 22px 18px; color: #fff; text-align: center;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .12s;
  position: relative; overflow: hidden;
}
.subject-card:active { transform: scale(.96); }
.subject-card .big-ico { font-size: 52px; line-height: 1; margin-bottom: 8px; }
.subject-card .name { font-size: 20px; font-weight: 900; }
.subject-card .desc { font-size: 12px; opacity: .9; margin-top: 4px; }
.subject-card .quota { font-size: 12px; margin-top: 10px; background: rgba(255,255,255,.22); border-radius: 999px; padding: 4px 10px; display: inline-block; }
.subject-card .quota b { font-size: 14px; }
.subject-card .quota.done { background: rgba(0,0,0,.2); }
.subject-card.is-done { filter: grayscale(.55); opacity: .75; }
.subject-math { background: linear-gradient(135deg, #5fb8e8, #3d93cf); }
.subject-chinese { background: linear-gradient(135deg, #f58a8a, #e05b6a); }
.subject-english { background: linear-gradient(135deg, #a78bec, #7d5fd0); }

.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.stat-box { background: var(--card); border-radius: 16px; padding: 16px 10px; text-align: center; box-shadow: var(--shadow); }
.stat-box .num { font-size: 26px; font-weight: 900; color: var(--primary-d); }
.stat-box .lab { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- 做题页 ---------- */
.quiz-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.q-progress { flex: 1; height: 12px; background: var(--line); border-radius: 999px; margin: 0 14px; overflow: hidden; }
.q-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--green), #7ed39e); border-radius: 999px; transition: width .3s; }
.q-card { margin-bottom: 16px; }
.q-topic { display: inline-block; background: #fff0dd; color: var(--primary-d); font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 999px; margin-bottom: 12px; }
.q-stem { font-size: 20px; font-weight: 800; line-height: 1.5; margin: 0 0 18px; }
.q-num { color: var(--primary-d); margin-right: 6px; }
.options { display: flex; flex-direction: column; gap: 10px; }
.option {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 13px 16px; border: 2px solid var(--line); border-radius: 14px;
  background: #fffefa; font-size: 16px; color: var(--ink); transition: all .15s; width: 100%;
}
.option:hover { border-color: var(--primary); background: #fff8ee; }
.option.selected { border-color: var(--primary); background: #fff0dd; font-weight: 700; }
.option .key {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--line);
  display: flex; align-items: center; justify-content: center; font-weight: 900; color: var(--ink-soft);
}
.option.selected .key { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--green); background: #eaf8ef; }
.option.correct .key { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: #fdecec; }
.option.wrong .key { background: var(--red); color: #fff; }
.option.dim { opacity: .5; }
.option:disabled { cursor: default; }
.option:disabled:hover { border-color: var(--line); background: #fffefa; }
.option.correct:disabled:hover { border-color: var(--green); background: #eaf8ef; }
.option.wrong:disabled:hover { border-color: var(--red); background: #fdecec; }

/* 作答即时反馈：对错 + 正确答案 + 解析 */
.answer-feedback { margin-top: 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px 15px; animation: pop .28s ease; }
.answer-feedback.ok { background: #eaf8ef; border-color: #bfe6cd; }
.answer-feedback.bad { background: #fdecec; border-color: #f3c9c9; }
.answer-feedback .fb-title { font-weight: 800; font-size: 15px; }
.answer-feedback.ok .fb-title { color: var(--green-d); }
.answer-feedback.bad .fb-title { color: var(--red); }
.answer-feedback .fb-exp { margin-top: 7px; font-size: 14px; line-height: 1.65; color: #5b5b52; }

/* ---------- 结算页 ---------- */
.result-emoji { font-size: 80px; line-height: 1; animation: pop .5s ease; }
.result-score { font-size: 42px; font-weight: 900; color: var(--primary-d); margin: 8px 0 2px; }
.result-reward { font-size: 18px; font-weight: 800; color: var(--green-d); margin-bottom: 18px; }
.review-item { text-align: left; border-bottom: 1px solid var(--line); padding: 12px 2px; }
.review-item:last-child { border-bottom: none; }
.review-head { display: flex; gap: 8px; align-items: flex-start; font-weight: 700; }
.review-mark { font-size: 18px; }
.review-explain { font-size: 13px; color: var(--ink-soft); margin: 6px 0 0 26px; line-height: 1.5; }

/* ---------- 农场 ---------- */
/* ---------- 农场：蚂蚁庄园风格场景 ---------- */
.farm-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.farm-tab { flex: 1; padding: 11px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-weight: 800; color: var(--ink-soft); }
.farm-tab.active { background: var(--green); color: #fff; border-color: var(--green-d); }

/* 庄园场景（配色全部走 CSS 变量，切换主题时由 JS 覆盖 .farm-scene 上的变量） */
.farm-scene {
  --sky1: #a9e4ff; --sky2: #d9f3ff; --grassTop: #e8f8d5; --grassBot: #b7e891;
  --ground1: #8ed168; --ground2: #86cc60; --groundEdge: #7cc658;
  --cloud: #ffffff; --sun1: #fff7bd; --sun2: #ffb703; --sign: #fff8e8;
  position: relative; height: 340px; border-radius: 20px; overflow: hidden;
  box-shadow: var(--shadow); margin-bottom: 14px;
  background: linear-gradient(180deg, var(--sky1) 0%, var(--sky2) 40%, var(--grassTop) 42%, var(--grassBot) 100%);
  transition: background .5s ease;
}
.farm-sun {
  position: absolute; top: 20px; right: 26px; width: 54px; height: 54px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--sun1), var(--sun2) 72%);
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--sun2) 18%, transparent), 0 0 34px color-mix(in srgb, var(--sun2) 45%, transparent);
  animation: sunPulse 4s ease-in-out infinite; transition: background .5s ease;
}
.farm-cloud { position: absolute; background: var(--cloud); border-radius: 50px; opacity: .9; box-shadow: 0 3px 8px rgba(120,170,200,.18); transition: background .5s ease; }
.farm-cloud::before, .farm-cloud::after { content: ''; position: absolute; background: var(--cloud); border-radius: 50%; }
.farm-c1 { width: 72px; height: 22px; top: 42px; left: 12%; animation: cloudDrift 20s linear infinite; }
.farm-c1::before { width: 34px; height: 34px; top: -15px; left: 12px; }
.farm-c1::after { width: 24px; height: 24px; top: -9px; left: 40px; }
.farm-c2 { width: 56px; height: 18px; top: 74px; left: 58%; animation: cloudDrift 27s linear infinite reverse; }
.farm-c2::before { width: 27px; height: 27px; top: -12px; left: 9px; }
.farm-c2::after { width: 18px; height: 18px; top: -7px; left: 31px; }
.farm-ground {
  position: absolute; left: 0; right: 0; bottom: 0; height: 58%;
  background: linear-gradient(180deg, rgba(255,255,255,.18), rgba(0,0,0,.04)), repeating-linear-gradient(90deg, var(--ground1) 0 26px, var(--ground2) 26px 52px);
  border-top: 5px solid var(--groundEdge);
  transition: background .5s ease, border-color .5s ease;
}
.farm-fence {
  position: absolute; left: 0; right: 0; bottom: 30%; height: 46px; z-index: 1;
  background:
    linear-gradient(180deg, transparent 12px, var(--fence1, #d9a066) 12px 20px, transparent 20px 26px, var(--fence1, #d9a066) 26px 34px, transparent 34px),
    repeating-linear-gradient(90deg, transparent 0 30px, var(--fence2, #c6894c) 30px 42px, transparent 42px 68px);
  filter: drop-shadow(0 3px 2px rgba(0,0,0,.12));
  transition: background .5s ease;
}
.farm-trough {
  position: absolute; left: 20px; bottom: 12%; z-index: 2; font-size: 34px;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.18));
}
.farm-sign {
  position: absolute; right: 16px; bottom: 14%; z-index: 2;
  background: var(--sign); border: 2px solid rgba(180,130,70,.5); border-radius: 10px;
  padding: 3px 10px; font-size: 11px; font-weight: 900; color: #a8702f;
  box-shadow: 0 3px 8px rgba(0,0,0,.12); transition: background .5s ease;
}

/* ===== 场景主题专属元素层（z-index 1：在地面之上、小鸡 z-index 3 之下）===== */
.sc-layer { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
/* 麦田：底部一排随风摇摆的麦穗 */
.sc-wheat-row { position: absolute; left: 0; right: 0; bottom: 5%; display: flex; justify-content: space-around; font-size: 26px; white-space: nowrap; animation: wheatSway 3.4s ease-in-out infinite; transform-origin: bottom center; }
/* 星空：闪烁的星星 + 月亮 */
.sc-stars i { position: absolute; background: #fff; border-radius: 50%; box-shadow: 0 0 6px 1px rgba(255,255,255,.8); animation: twinkle 2.4s ease-in-out infinite; }
.sc-moon { position: absolute; top: 22px; left: 34px; font-size: 40px; filter: drop-shadow(0 0 10px rgba(255,255,220,.7)); animation: moonFloat 5s ease-in-out infinite; }
/* 菜园：土垄 + 一排蔬菜 */
.sc-beds { position: absolute; left: 6%; right: 6%; bottom: 2%; height: 30%; border-radius: 8px; background: repeating-linear-gradient(180deg, #a4703f 0 14px, #8c5c31 14px 26px); box-shadow: inset 0 4px 0 rgba(0,0,0,.12); }
.sc-veg { position: absolute; left: 0; right: 0; bottom: 8%; text-align: center; font-size: 24px; letter-spacing: 5px; white-space: nowrap; animation: wheatSway 4.2s ease-in-out infinite; }
/* 糖果：漂浮的糖果 */
.sc-candy-items { position: absolute; left: 0; right: 0; bottom: 9%; text-align: center; font-size: 27px; letter-spacing: 9px; white-space: nowrap; filter: drop-shadow(0 3px 3px rgba(180,60,120,.25)); animation: candyBob 3s ease-in-out infinite; }
/* 小河：荡漾的水面 + 荷叶 + 小桥 */
.sc-water { position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(180deg, #7fd4ee, #3fa9d8); border-top: 3px solid rgba(255,255,255,.55); animation: waterWave 3s ease-in-out infinite; }
.sc-water::after { content: ''; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, transparent 0 26px, rgba(255,255,255,.25) 26px 48px, transparent 48px 74px); }
.sc-lily { position: absolute; left: 14%; bottom: 4%; font-size: 30px; }
.sc-lily2 { position: absolute; right: 20%; bottom: 6%; font-size: 22px; }
.sc-bridge { position: absolute; left: 50%; bottom: 12%; transform: translateX(-50%); font-size: 38px; }
/* 沙漠：起伏沙丘 + 仙人掌 */
.sc-dune { position: absolute; bottom: 4%; border-radius: 50% 50% 0 0; }
.sc-dune.d1 { left: -6%; width: 68%; height: 96px; background: linear-gradient(180deg, #f0cf8e, #dfb26a); }
.sc-dune.d2 { right: -8%; width: 66%; height: 74px; background: linear-gradient(180deg, #eec582, #d8a95c); }
.sc-cactus { position: absolute; font-size: 34px; filter: drop-shadow(0 3px 2px rgba(120,80,20,.25)); }
.sc-cactus.c1 { left: 18%; bottom: 12%; }
.sc-cactus.c2 { right: 16%; bottom: 9%; font-size: 26px; }
/* 雪原：飘落的雪花 + 雪人 */
.sc-flakes i { position: absolute; top: -6%; color: #fff; text-shadow: 0 0 5px rgba(150,190,220,.9); animation: snowFall linear infinite; }
.sc-snowman { position: absolute; right: 15%; bottom: 10%; font-size: 44px; }
@keyframes wheatSway { 0%,100% { transform: rotate(-2deg); } 50% { transform: rotate(2deg); } }
@keyframes twinkle { 0%,100% { opacity: .25; transform: scale(.7); } 50% { opacity: 1; transform: scale(1.25); } }
@keyframes moonFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes candyBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes waterWave { 0%,100% { transform: translateY(0) scaleY(1); } 50% { transform: translateY(3px) scaleY(1.06); } }
@keyframes snowFall { 0% { transform: translateY(0) rotate(0); opacity: 0; } 12% { opacity: .95; } 100% { transform: translateY(360px) rotate(180deg); opacity: .15; } }
/* 商城主题预览卡里的场景小标 */
.theme-card .tp-scene { position: absolute; right: 8px; bottom: 4px; font-size: 17px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }

/* 装饰摆件：绝对定位，可拖动 */
.farm-decor-layer { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.farm-decor-layer .farm-decor { pointer-events: auto; }
/* 整理模式下把装饰层提到小鸡之上，保证被小鸡遮挡的装饰也能点到删除按钮 */
.farm-scene.decor-editing .farm-decor-layer { z-index: 6; }
.farm-decor {
  position: absolute; z-index: 2; cursor: grab; user-select: none;
  transform: translate(-50%, -60%); -webkit-tap-highlight-color: transparent;
  filter: drop-shadow(0 4px 3px rgba(0,0,0,.22)); touch-action: none;
  transition: filter .15s;
}
.farm-decor:active { cursor: grabbing; }
.farm-decor .decor-emoji { font-size: 40px; line-height: 1; display: block; pointer-events: none; }
.farm-decor.decor-dragging { z-index: 30; filter: drop-shadow(0 10px 6px rgba(0,0,0,.3)) scale(1.12); }
.farm-decor .decor-remove {
  position: absolute; top: -8px; right: -10px; width: 20px; height: 20px; border-radius: 50%;
  background: #ff5b6e; color: #fff; font-size: 13px; font-weight: bold; line-height: 20px; text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,.25); opacity: 0; transition: opacity .15s; pointer-events: none;
}
.farm-decor:hover .decor-remove, .farm-decor.decor-edit .decor-remove { opacity: 1; pointer-events: auto; }
.decor-hint { font-size: 11px; color: var(--ink-soft); text-align: center; margin: -4px 0 12px; }

/* 主题商店卡片 */
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.theme-card { background: var(--card); border-radius: 18px; padding: 12px; text-align: center; box-shadow: var(--shadow); border: 3px solid transparent; position: relative; transition: border-color .2s, transform .15s; }
.theme-card.theme-current { border-color: var(--green); }
.theme-card.theme-owned { border-color: #ffd166; }
.theme-card .theme-preview {
  height: 74px; border-radius: 12px; margin-bottom: 8px; position: relative; overflow: hidden;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.5);
}
.theme-card .theme-preview .pv-sun { position: absolute; top: 8px; right: 10px; width: 20px; height: 20px; border-radius: 50%; }
.theme-card .theme-preview .pv-ground { position: absolute; left: 0; right: 0; bottom: 0; height: 38%; }
.theme-card .tp-emoji { font-size: 26px; position: absolute; left: 10px; top: 26px; filter: drop-shadow(0 2px 2px rgba(0,0,0,.2)); }
.theme-card .nm { font-weight: 900; font-size: 14px; }
.theme-card .ds { font-size: 11px; color: var(--ink-soft); min-height: 15px; margin: 2px 0 8px; }
.theme-card .theme-badge {
  position: absolute; top: 6px; left: 6px; font-size: 10px; font-weight: 900; padding: 2px 7px; border-radius: 8px;
  background: var(--green); color: #fff; z-index: 1;
}
.theme-card.theme-owned .theme-badge { background: #f0a500; }
.theme-card .btn { width: 100%; }

/* 实景主题：真实插画背景图 */
.farm-scene.photo-scene {
  background-color: #cdeaf6;
  background-size: cover;
  background-position: center bottom;
  background-repeat: no-repeat;
}
/* 实景图上给食槽/标牌加柔和底，保证在复杂背景上可读 */
.farm-scene.photo-scene .farm-trough,
.farm-scene.photo-scene .farm-sign {
  background-color: rgba(255,255,255,.78);
  backdrop-filter: blur(2px);
  border-radius: 12px;
}
.farm-scene.photo-scene .farm-sign { padding-left: 8px; padding-right: 8px; }
/* 商城实景预览：图片铺满 + 底部暗角让 emoji 更清楚 */
.theme-card.theme-photo .theme-preview .tp-emoji {
  background: rgba(255,255,255,.72); border-radius: 50%; width: 34px; height: 34px;
  line-height: 34px; text-align: center; top: 22px; left: 8px;
}
.theme-card.theme-photo .theme-preview::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 30%;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.12)); pointer-events: none;
}
.shop-sub-tabs { display: flex; gap: 8px; margin: 4px 0 14px; }
.shop-sub-tab { flex: 1; padding: 9px; border-radius: 11px; background: #fff; border: 2px solid var(--line); font-weight: 800; color: var(--ink-soft); font-size: 13px; }
.shop-sub-tab.active { background: var(--primary); color: #fff; border-color: var(--primary-d); }
.owned-tag { display: inline-block; font-size: 10px; font-weight: 800; color: var(--green-d); background: #e6f6ec; border-radius: 8px; padding: 1px 6px; margin-left: 4px; }

/* 小鸡群 */
.pet-yard {
  position: absolute; left: 0; right: 0; bottom: 6%; z-index: 3;
  display: flex; align-items: flex-end; justify-content: center; flex-wrap: wrap;
  gap: 2px 6px; padding: 0 46px;
}
.pet-chicken {
  position: relative; width: 74px; height: 92px; cursor: pointer; user-select: none;
  transform: translateY(var(--lift, 0px)) scale(var(--scale, 1));
  transform-origin: center bottom; -webkit-tap-highlight-color: transparent;
}
.pet-sprite { position: absolute; inset: 0; animation: hopIdle var(--dur, 2.8s) ease-in-out var(--delay, 0s) infinite; }
.pet-body {
  position: absolute; left: 9px; top: 16px; width: 56px; height: 58px; z-index: 2;
  background: radial-gradient(circle at 38% 28%, #fff 0%, var(--body) 52%, var(--body2) 100%);
  border-radius: 50% 50% 46% 46% / 55% 55% 45% 45%;
  box-shadow: inset -6px -8px 0 rgba(0,0,0,.05), 0 4px 8px rgba(0,0,0,.14);
}
.pet-comb {
  position: absolute; top: 5px; left: 29px; width: 15px; height: 17px; z-index: 3;
  background: var(--comb); border-radius: 50% 50% 40% 40%;
  box-shadow: -7px 5px 0 -1px var(--comb), 7px 5px 0 -1px var(--comb);
}
.pet-eye {
  position: absolute; top: 32px; width: 8px; height: 9px; z-index: 4;
  background: #3a2e28; border-radius: 50%; animation: blink 5s var(--delay, 0s) infinite;
}
.pet-eye.l { left: 23px; } .pet-eye.r { right: 23px; }
.pet-eye::after { content: ''; position: absolute; top: 1px; left: 2px; width: 3px; height: 3px; background: #fff; border-radius: 50%; }
.pet-beak {
  position: absolute; top: 42px; left: 50%; transform: translateX(-50%); width: 0; height: 0; z-index: 4;
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 9px solid var(--beak);
}
.pet-wing { position: absolute; top: 40px; width: 19px; height: 24px; z-index: 3; background: var(--body2); }
.pet-wing.l { left: 2px; border-radius: 50% 30% 50% 60%; transform-origin: right center; animation: wingFlap 2.4s ease-in-out var(--delay, 0s) infinite; }
.pet-wing.r { right: 2px; border-radius: 30% 50% 60% 50%; transform-origin: left center; animation: wingFlap 2.4s ease-in-out var(--delay, 0s) infinite reverse; }
.pet-tail { position: absolute; top: 24px; right: -3px; width: 20px; height: 22px; z-index: 1; background: var(--body2); border-radius: 50% 10% 50% 10%; }
.pet-legs { position: absolute; bottom: 5px; left: 50%; transform: translateX(-50%); display: flex; gap: 14px; z-index: 1; }
.pet-legs i { width: 4px; height: 14px; background: var(--beak); border-radius: 2px; }
.pet-shadow { position: absolute; bottom: 1px; left: 50%; transform: translateX(-50%); width: 50px; height: 9px; background: rgba(0,0,0,.16); border-radius: 50%; filter: blur(2px); transition: .2s; }
.pet-tag {
  position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  font-size: 10px; font-weight: 800; color: #46603a; background: rgba(255,255,255,.88);
  border-radius: 8px; padding: 1px 6px; z-index: 5; box-shadow: 0 2px 5px rgba(0,0,0,.1);
}
/* 产蛋进度条：名字标签下方的细条，实时走时，让孩子看清下一枚蛋的进度 */
.egg-progress {
  position: absolute; bottom: -1px; left: 50%; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: 3px; white-space: nowrap;
  background: rgba(255,255,255,.92); border-radius: 999px; padding: 2px 5px;
  box-shadow: 0 2px 5px rgba(0,0,0,.14); font-size: 9px; font-weight: 800; color: #7a4b00;
}
.egg-progress .ep-icon { font-size: 10px; line-height: 1; }
.egg-progress .ep-track {
  display: block; width: 30px; height: 6px; border-radius: 999px;
  background: #f0e2c4; overflow: hidden; box-shadow: inset 0 1px 2px rgba(0,0,0,.1);
}
.egg-progress .ep-fill {
  display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #ffd166, #ff9f1c); transition: width .9s linear;
}
.egg-progress .ep-time { font-variant-numeric: tabular-nums; min-width: 24px; text-align: right; }
.egg-progress.idle { color: #9a8460; background: rgba(255,255,255,.82); gap: 2px; padding: 2px 6px; }
.egg-progress.idle .ep-idle-label { font-size: 9px; }
.pet-bubble {
  position: absolute; top: -16px; left: 50%; transform: translateX(-50%) scale(.8);
  background: #fff; border: 2px solid #ffd166; border-radius: 14px; padding: 4px 10px;
  font-size: 12px; font-weight: 800; white-space: nowrap; opacity: 0; pointer-events: none;
  z-index: 10; transition: .2s; box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.pet-bubble::after {
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border-left: 7px solid transparent; border-right: 7px solid transparent; border-top: 8px solid #fff;
}
.pet-chicken.is-talking .pet-bubble { opacity: 1; transform: translateX(-50%) scale(1); }
.pet-chicken.is-petted .pet-sprite { animation: petJump .52s ease; }
.pet-chicken.is-eating .pet-sprite { animation: peck .34s ease-in-out 3; }
.pet-chicken.selected .pet-shadow { background: rgba(255,159,67,.55); box-shadow: 0 0 0 6px rgba(255,159,67,.16); }
.pet-fx { position: absolute; inset: 0; z-index: 11; pointer-events: none; }
.pet-fx .heart { position: absolute; left: 50%; top: 26px; font-size: 20px; animation: floatUp 1.1s ease-out forwards; }
.pet-fx .crumb { position: absolute; left: 50%; top: 54px; font-size: 12px; animation: floatUp .8s ease-out forwards; }

/* 待收的鸡蛋：白色蛋群顶在小鸡头上，点一下就能收走 */
.pet-eggs-anchor {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  z-index: 9; cursor: pointer; pointer-events: auto; padding: 3px 5px;
  -webkit-tap-highlight-color: transparent;
}
.pet-eggs {
  display: flex; align-items: center; white-space: nowrap;
  background: #fff; border: 1.5px solid #fff; border-radius: 999px;
  padding: 1px 7px 1px 5px; box-shadow: 0 3px 9px rgba(0,0,0,.22);
  animation: eggBob 2.3s ease-in-out infinite;
}
.pet-eggs-anchor:hover .pet-eggs { box-shadow: 0 0 0 3px rgba(255,255,255,.6), 0 3px 9px rgba(0,0,0,.22); }
.pet-eggs .egg {
  display: inline-block; width: 11px; height: 14px; margin-left: -2px;
  background: #fff; border: 1px solid #dcdcdc;
  border-radius: 50% 50% 48% 48% / 62% 62% 38% 38%;
  box-shadow: inset -1px -2px 0 rgba(0,0,0,.06);
}
.pet-eggs .egg:first-child { margin-left: 0; }
.pet-eggs b { margin-left: 4px; font-size: 12px; font-weight: 900; color: #7a4b00; }
/* 气泡上移，避免和头顶的鸡蛋重叠 */
.pet-bubble { top: -36px; }
/* 刚下蛋：小鸡蹲一下、气泡报喜、蛋从头顶弹出来 */
.pet-chicken.just-laid .pet-bubble { opacity: 1; transform: translateX(-50%) scale(1); border-color: #ffb703; }
.pet-chicken.just-laid .pet-body { animation: laySquash .8s ease; }
.pet-chicken.just-laid .pet-eggs .egg { animation: eggPopIn .6s ease both; }
.pet-fx .egg-pop {
  position: absolute; left: 50%; top: 12px; z-index: 12; white-space: nowrap;
  font-size: 19px; font-weight: 900; color: #fff; text-shadow: 0 2px 4px rgba(0,0,0,.35), 0 0 8px #ffb703;
  animation: floatUp 1.8s ease-out forwards;
}
@keyframes eggBob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes laySquash { 0%,100% { transform: scale(1); } 35% { transform: scale(1.12,.8) translateY(6px); } 65% { transform: scale(.94,1.06); } }
@keyframes eggPopIn { 0% { opacity: 0; transform: translateY(10px) scale(.4); } 60% { opacity: 1; transform: translateY(-6px) scale(1.3); } 100% { transform: translateY(0) scale(1); } }

/* 品种配色 */
.breed-chick  { --body:#fffdf7; --body2:#f0e6cc; --comb:#ff6b7a; --beak:#ffa726; }
.breed-fluffy { --body:#fff4b8; --body2:#ffd84d; --comb:#ff5b5b; --beak:#ff9800; }
.breed-red    { --body:#eda774; --body2:#cc7043; --comb:#e53935; --beak:#f57c00; }
.breed-black  { --body:#75757e; --body2:#45454e; --comb:#d32f2f; --beak:#8d6e63; }

@keyframes hopIdle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes blink { 0%,92%,100% { transform: scaleY(1); } 95% { transform: scaleY(.12); } }
@keyframes wingFlap { 0%,100% { transform: rotate(0); } 50% { transform: rotate(16deg); } }
@keyframes sunPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.07); } }
@keyframes cloudDrift { from { transform: translateX(-24px); } to { transform: translateX(36px); } }
@keyframes petJump { 0% { transform: translateY(0) scale(1); } 30% { transform: translateY(-20px) scale(1.08,.93); } 62% { transform: translateY(0) scale(.94,1.07); } 100% { transform: translateY(0) scale(1); } }
@keyframes peck { 0%,100% { transform: rotate(0) translateY(0); } 50% { transform: rotate(18deg) translateY(6px); } }
@keyframes floatUp { 0% { opacity: 0; transform: translate(-50%, 0) scale(.6); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(calc(-50% + var(--dx, 0px)), -62px) scale(1.25); } }

/* 选中小鸡操作面板 */
.pet-panel { margin-bottom: 14px; }
.pet-panel-top { display: flex; align-items: center; gap: 12px; }
.pet-panel-top .pp-emoji { font-size: 40px; line-height: 1; }
.pet-panel-top .pp-name { font-weight: 900; font-size: 16px; }
.pet-panel-top .pp-sub { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.pp-bars { flex: 1; min-width: 0; }
.pp-bar-row { display: flex; align-items: center; gap: 6px; margin-top: 5px; }
.pp-bar-row .lab { font-size: 11px; font-weight: 800; color: var(--ink-soft); white-space: nowrap; width: 30px; }
.pp-bar { flex: 1; height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.pp-bar > i { display: block; height: 100%; border-radius: 999px; transition: width .35s; }
.pp-bar.growth > i { background: linear-gradient(90deg, #ffd452, var(--primary)); }
.pp-bar.mood > i { background: linear-gradient(90deg, #ff9a9e, #ff5b6e); }
.pp-bar.satiety > i { background: linear-gradient(90deg, #b7e47b, #43a047); }
.pet-panel-actions { display: flex; gap: 8px; margin-top: 12px; }
.pet-panel-actions .btn { flex: 1; }

.feed-banner {
  background: linear-gradient(135deg, #7ed39e, #4caf72); color: #fff;
  border-radius: 16px; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  box-shadow: var(--shadow); margin-bottom: 14px;
}
.feed-banner .f-ico { font-size: 34px; }

/* 鸡蛋收集条 */
.egg-banner { border-left: 5px solid #f5c451; background: #fffdf5; }

.empty-state { text-align: center; padding: 30px 20px 20px; color: var(--ink-soft); }
.empty-state .big { font-size: 56px; margin-bottom: 10px; }

.shop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.shop-card { background: var(--card); border-radius: 18px; padding: 16px 12px; text-align: center; box-shadow: var(--shadow); }
.shop-card .big-ico { font-size: 48px; line-height: 1; }
.shop-card .nm { font-weight: 900; margin: 6px 0 2px; }
.shop-card .pr { color: var(--primary-d); font-weight: 800; font-size: 14px; margin-bottom: 10px; }

/* ---------- 后台管理 ---------- */
.admin-tabs { display: flex; gap: 8px; margin-bottom: 18px; flex-wrap: wrap; }
.admin-tab { padding: 9px 16px; border-radius: 12px; background: #fff; border: 2px solid var(--line); font-weight: 800; color: var(--ink-soft); }
.admin-tab.active { background: var(--purple); color: #fff; border-color: var(--purple); }
.code-table { width: 100%; border-collapse: collapse; }
.code-table th, .code-table td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line); font-size: 14px; }
.code-table th { color: var(--ink-soft); font-size: 12px; }
.code-badge { font-family: monospace; font-weight: 900; font-size: 15px; background: #fff0dd; color: var(--primary-d); padding: 3px 8px; border-radius: 8px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #eef4ff; color: #3a6ea8; }
.badge.on { background: #eaf8ef; color: var(--green-d); }
.badge.off { background: #f2f2f2; color: #999; }
.badge.term-a { background: #fff3e0; color: #b26a00; }
.badge.term-b { background: #e8f1fd; color: #2f66b3; }
.q-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; }
.q-item.is-del { opacity: .62; background: #fafaf8; border-style: dashed; }
.q-item .q-stem-mini { font-weight: 700; margin-bottom: 4px; }
.q-item .q-meta { font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
/* 后台题库浏览 */
.bank-cell { display: inline-block; padding: 6px 11px; border-radius: 10px; border: 1.5px solid var(--line); background: #fff; font-weight: 800; font-size: 12.5px; color: var(--primary-d); cursor: pointer; transition: all .15s; }
.bank-cell:hover { border-color: var(--primary); }
.bank-cell.gen { color: #6b7f9c; background: #f5f7fb; }
.bank-cell.active { border-color: var(--purple); background: #f4efff; color: var(--purple); }
.bank-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.bank-opt { font-size: 13px; padding: 4px 10px; border-radius: 8px; background: #f5f6f8; color: var(--ink-soft); }
.bank-opt.right { background: #eaf8ef; color: var(--green-d); font-weight: 800; }
.bank-topics { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.bank-topics span { font-size: 12px; padding: 4px 10px; border-radius: 999px; background: #eef4ff; color: #3d6bb3; font-weight: 700; }
.row-actions { white-space: nowrap; }
.row-actions .btn { margin-right: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.option-editor { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.option-editor input[type=text] { flex: 1; }
.option-editor .radio { width: 22px; height: 22px; accent-color: var(--green); }

/* ---------- Toast / Modal ---------- */
.toast {
  position: fixed; top: 76px; left: 50%; transform: translateX(-50%) translateY(-20px);
  background: var(--ink); color: #fff; padding: 12px 22px; border-radius: 12px;
  font-weight: 700; font-size: 15px; z-index: 100; opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; box-shadow: var(--shadow-lg); max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.ok { background: var(--green-d); }
.toast.err { background: #d9534f; }

.modal-mask {
  position: fixed; inset: 0; background: rgba(60,45,30,.45); z-index: 90;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box { background: #fff; border-radius: 22px; padding: 26px; width: 100%; max-width: 420px; box-shadow: var(--shadow-lg); }
.modal-box h3 { margin: 0 0 12px; font-size: 20px; }
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ---------- 交卷前护眼放松环节 ---------- */
.ec-mask { position: fixed; inset: 0; z-index: 120; background: rgba(30,24,18,.62); display: flex; align-items: center; justify-content: center; padding: 16px; }
.ec-wrap { width: 100%; max-width: 460px; background: #fff; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-lg); }
.ec-head { padding: 16px 18px 12px; text-align: center; }
.ec-title { font-size: 19px; font-weight: 900; color: var(--ink); }
.ec-guide { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.ec-scene { position: relative; height: 320px; overflow: hidden; background: #0d1a16; }
.ec-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* 呼吸引导：中心光晕缓缓明暗（SVG 内的 ec-lamp），外加一圈很淡的引导圈 */
.ec-lamp { animation: ecLamp 5s ease-in-out infinite; }
@keyframes ecLamp { 0%,100%{opacity:.55} 50%{opacity:1} }
.ec-breath { position: absolute; left: 50%; top: 50%; width: 150px; height: 150px; transform: translate(-50%,-50%); display: flex; align-items: center; justify-content: center; pointer-events: none; }
.ec-breath i { width: 100%; height: 100%; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.3); background: transparent; animation: ecBreath 5s ease-in-out infinite; }
@keyframes ecBreath { 0%,100%{transform:scale(.78);opacity:.2} 50%{transform:scale(1.02);opacity:.6} }
/* 小苹果：由近（左下、大）沿直线飞向隧道尽头（正中、小） */
.ec-flyer { position: absolute; left: 7%; top: 90%; width: 92px; height: 106px; transform: translate(-50%,-50%) scale(1.55) rotate(-8deg); transform-origin: center center; z-index: 3; }
.ec-flyer.flying { animation: ecFly var(--ec-fly) cubic-bezier(.3,.05,.3,.98) forwards; }
@keyframes ecFly {
  0%{left:7%;top:90%;transform:translate(-50%,-50%) scale(1.55) rotate(-8deg)}
  42%{left:25%;top:73%;transform:translate(-50%,-50%) scale(.95) rotate(1deg)}
  100%{left:50%;top:50%;transform:translate(-50%,-50%) scale(.36) rotate(5deg)}
}
.ec-apple { width: 100%; height: 100%; filter: drop-shadow(0 6px 5px rgba(0,0,0,.22)); }
.ec-apple-body { transition: fill .35s ease; }
.ec-blink { position: absolute; left: 50%; top: 12px; z-index: 4; transform: translateX(-50%) translateY(-12px); background: rgba(255,255,255,.96); color: #e65100; font-weight: 900; font-size: 14px; padding: 8px 16px; border-radius: 999px; opacity: 0; transition: all .4s; white-space: nowrap; box-shadow: var(--shadow); pointer-events: none; }
.ec-blink.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.ec-label { position: absolute; left: 12px; bottom: 10px; color: rgba(255,255,255,.9); background: rgba(0,0,0,.34); padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; letter-spacing: .5px; backdrop-filter: blur(2px); }
.ec-panel { padding: 16px 18px 20px; }
.ec-start { text-align: center; }
.ec-start-tip { font-size: 13px; color: var(--ink-soft); line-height: 1.7; margin-bottom: 12px; }
.ec-question { text-align: center; }
.ec-question.appear { animation: ecAppear .35s ease both; }
@keyframes ecAppear { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:none} }
.ec-qtitle { font-size: 16px; font-weight: 900; color: var(--ink); margin-bottom: 12px; }
.ec-options { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ec-opt { min-width: 70px; padding: 12px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; font-weight: 900; font-size: 15px; color: var(--ink); cursor: pointer; }
.ec-opt:active { transform: scale(.95); }
.ec-qhint { font-size: 12px; color: var(--ink-soft); margin-top: 12px; }

/* ---------- 错题本 ---------- */
.nav-badge { position: absolute; top: 4px; right: 18%; min-width: 16px; height: 16px; padding: 0 4px; background: #ff5b5b; color: #fff; border-radius: 999px; font-size: 10px; font-weight: 800; line-height: 16px; text-align: center; }
.nav-item { position: relative; }
.focus-banner { width: 100%; margin: 0 0 14px; padding: 12px 16px; border: none; border-radius: var(--radius); background: linear-gradient(135deg, #ffb26b, #ff8f5a); color: #fff; font-size: 14px; font-weight: 700; text-align: left; box-shadow: var(--shadow); cursor: pointer; }
.focus-banner b { font-size: 17px; }
.focus-banner:active { transform: scale(.98); }
.small-hero h1 { font-size: 22px; }
.focus-toast { margin: 12px 0; padding: 10px 12px; background: #fff8e8; border: 1px solid #ffe0a8; border-radius: 12px; font-size: 13px; line-height: 1.7; color: #8a5a00; }
.focus-item { margin-bottom: 12px; }
.focus-progress { margin-top: 10px; height: 8px; background: #f0f0f0; border-radius: 999px; overflow: hidden; }
.focus-progress i { display: block; height: 100%; background: linear-gradient(90deg, #7ed88f, #3fb96b); border-radius: 999px; transition: width .3s; }
/* 错题专项练习入口 */
.review-practice-card { margin-bottom: 14px; padding: 16px; border: 2px solid #ffd7a8; background: linear-gradient(135deg, #fffaf2, #fff4e6); }
.review-practice-title { font-size: 17px; font-weight: 900; color: #d9762b; }
.review-scope-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.review-scope-btn { min-height: 46px; font-size: 14px; font-weight: 800; }
.review-scope-btn:first-child { grid-column: 1 / -1; }
.review-scope-btn[disabled] { opacity: .45; filter: grayscale(.5); }
.review-scope-btn .scope-count { display: inline-block; min-width: 22px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: rgba(255,255,255,.55); font-size: 12px; line-height: 20px; }
.review-scope-btn.ghost .scope-count { background: #eef4ff; }

/* ---------- 儿童友好反馈：答错再想想 ---------- */
.answer-feedback.retry { background: #fff8e6; border-color: #f5d98a; }
.answer-feedback.retry .fb-title { color: #a9741a; }
.fb-retry-tip { margin-top: 6px; font-size: 12px; color: var(--muted); }
.guide-toggle { display: block; width: 100%; margin-top: 8px; padding: 6px; border: 0; background: transparent; color: var(--primary); font-size: 12px; font-weight: 800; cursor: pointer; text-decoration: underline; }

/* ---------- 成长体系：成就 / 进步 / 打卡 / 图鉴 ---------- */
.ach-pop { margin-top: 10px; padding: 10px 12px; border-radius: 14px; background: linear-gradient(135deg,#fff6d8,#ffe9a8); border: 1.5px solid #f3cf72; text-align: left; }
.ach-pop-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 800; color: #8a5a12; padding: 2px 0; }
.ach-emoji { font-size: 20px; }
.home-progress-card { margin-top: 14px; padding: 12px 14px; }
.hp-row { display: flex; gap: 16px; }
.hp-item { display: flex; align-items: center; gap: 8px; flex: 1; }
.hp-icon { font-size: 24px; }
.hp-num { font-size: 20px; font-weight: 800; color: var(--ink); line-height: 1; }
.hp-lab { font-size: 11px; color: var(--muted); margin-top: 2px; }
.hp-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.hp-badge { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #fff6d8; border: 1px solid #f3cf72; font-size: 17px; }
.hp-more { display: inline-flex; align-items: center; font-size: 12px; color: var(--muted); }
.ach-progress-num { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; }
.ach-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-top: 6px; }
.ach-card { border-radius: 16px; padding: 14px 10px; text-align: center; border: 1.5px solid var(--line); background: #fff; }
.ach-card.got { background: #fffaf0; border-color: #f3cf72; }
.ach-card.locked { opacity: .6; }
.ach-card-emoji { font-size: 30px; line-height: 1.2; }
.ach-card-name { font-size: 13px; font-weight: 800; color: var(--ink); margin-top: 4px; }
.ach-card-desc { font-size: 11px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
.footprint-card { padding: 6px 14px; }
.fp-row { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 13px; border-bottom: 0.5px solid var(--line); }
.fp-row:last-child { border-bottom: 0; }
.fp-row b { color: var(--primary); font-weight: 800; }

/* ---------- 动画 ---------- */
@keyframes bob { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }
@keyframes pop { 0%{transform:scale(.4);opacity:0} 70%{transform:scale(1.15)} 100%{transform:scale(1);opacity:1} }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: inline-block; width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--primary); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------- 响应式 ---------- */
@media (max-width: 600px) {
  .wrap { padding: 14px 12px 84px; }
  .hero h1 { font-size: 21px; }
  .login-title { font-size: 26px; }
  .form-grid { grid-template-columns: 1fr; }
  .stat-box .num { font-size: 22px; }
  .code-table th, .code-table td { padding: 9px 6px; font-size: 12px; }
}
