* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --bg: #fff6e9; --card: #ffffff; --ink: #3a2f24; --sub: #6e5f4c;
  --accent: #f29d35; --accent-strong: #d97b00; --line: #f0e2cc; --ok: #2f8f44; --soft: #fdf1dd;
}
/* 全局按压反馈 + 防误触(低龄孩子点下去要有即时视觉反馈) */
button {
  user-select: none; -webkit-user-select: none; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; transition: transform .1s, box-shadow .1s;
}
button:active { transform: scale(.97); }
@media (hover: hover) {
  .card, .island-card, .level-row, .pg-module, .game { transition: transform .12s, box-shadow .12s; }
  .card:hover, .island-card:hover, .level-row:hover, .pg-module:hover, .game:hover {
    transform: translateY(-1px); box-shadow: 0 4px 14px rgba(120, 80, 20, .12);
  }
}
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--ink);
  display: flex; flex-direction: column; max-width: 480px; margin: 0 auto;
  height: 100vh; height: 100dvh; overflow: hidden;
}
/* 主应用容器必须是 flex 列,header/main/tabbar 才能正确布局 */
#view-app { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.hidden { display: none !important; }

/* ============ 顶栏 ============ */
header {
  flex: 0 0 auto; padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  background: linear-gradient(160deg, #ffd9a0, #ffb96b); border-radius: 0 0 22px 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
header .htitle { font-size: 19px; font-weight: 800; letter-spacing: 1px; }
header .hdate { font-size: 12px; opacity: .8; margin-top: 2px; }
header .hright { display: flex; align-items: center; gap: 6px; }
.child-chip {
  background: rgba(255,255,255,.75); border: none; border-radius: 999px; padding: 8px 14px;
  font-size: 14px; font-weight: 700; cursor: pointer; color: var(--ink); min-height: 36px;
}
.streak-pill {
  background: rgba(255,255,255,.75); border-radius: 999px; padding: 8px 14px;
  font-size: 14px; font-weight: 700; white-space: nowrap; min-height: 36px;
}

/* ============ 主区 ============ */
main { flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 14px 90px; min-height: 0; }

.card {
  background: var(--card); border-radius: 16px; padding: 14px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(120, 80, 20, .08);
}
.card h2 { font-size: 15px; font-weight: 800; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.card .sub { font-size: 13px; color: var(--sub); line-height: 1.6; }

.dim-banner {
  border-radius: 16px; padding: 16px; color: #fff; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 4px 12px rgba(0,0,0,.12);
}
.dim-banner .icon { font-size: 34px; }
.dim-banner .txt .d { font-size: 13px; opacity: .9; }
.dim-banner .txt .n { font-size: 20px; font-weight: 800; margin-top: 2px; }

.week-pills { display: flex; gap: 6px; margin: 4px 0 12px; }
.week-pill {
  flex: 1; text-align: center; padding: 8px 0; border-radius: 10px; font-size: 13px; font-weight: 700;
  background: var(--soft); color: var(--sub); border: none; cursor: pointer;
}
.week-pill.active { background: var(--accent-strong); color: #fff; }

.game { border: 1.5px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.game.primary { border-color: var(--accent); background: #fffdf7; }
.game .ghead { display: flex; align-items: center; justify-content: space-between; }
.game .gname { font-size: 14.5px; font-weight: 800; }
.game .ghead .pill { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--soft); border-radius: 999px; padding: 3px 8px; }
.game .ghow { font-size: 12.5px; color: var(--sub); margin-top: 6px; line-height: 1.6; }
.game .glad { margin-top: 8px; font-size: 12px; }
.game .glad .w { display: flex; align-items: center; gap: 6px; padding: 3px 0; }
.game .glad .tag { width: 34px; flex: 0 0 auto; font-size: 11px; color: var(--sub); }
.game .glad .dot { width: 8px; height: 8px; border-radius: 50%; background: #d9cbb3; flex: 0 0 auto; }
.game .glad .w.cur .dot { background: var(--accent); }
.game .glad .w.cur .txt { font-weight: 700; }

/* 计时器 */
.timer-box { text-align: center; padding: 6px 0 2px; }
.timer-time { font-size: 46px; font-weight: 900; font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-phase { font-size: 14px; font-weight: 800; margin-top: 2px; }
.timer-tip { font-size: 12px; color: var(--sub); margin-top: 4px; line-height: 1.5; }
.timer-bar { height: 8px; background: #f0e2cc; border-radius: 999px; margin: 10px 0; overflow: hidden; }
.timer-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), #ff8a5c); width: 0%; transition: width .3s; }
.timer-phases { display: flex; justify-content: space-between; font-size: 12px; color: var(--sub); }
.timer-phases .ph { text-align: center; flex: 1; }
.timer-phases .ph.on { color: var(--accent); font-weight: 800; }
.timer-btns { display: flex; gap: 8px; margin-top: 10px; }
.tbtn { flex: 1; padding: 11px 0; border-radius: 12px; font-size: 15px; font-weight: 800; border: none; cursor: pointer; }
.tbtn.go { background: var(--accent-strong); color: #fff; }
.tbtn.ghost { background: var(--soft); color: var(--sub); }

.check-btn {
  width: 100%; padding: 14px 0; border-radius: 14px; font-size: 16px; font-weight: 800; border: none; cursor: pointer;
  background: var(--ok); color: #fff; box-shadow: 0 3px 0 #236b33;
}
.check-btn.done { background: #e4e4e4; color: #888; box-shadow: 0 3px 0 #c8c8c8; }
.check-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #236b33; }

/* 课表 */
.sched-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.sched { width: 100%; border-collapse: collapse; font-size: 12px; }
.sched th, .sched td { border: 1px solid var(--line); padding: 8px 5px; text-align: center; vertical-align: top; }
.sched th { background: var(--soft); font-weight: 800; }
.sched td.row-w { font-weight: 800; background: #faf5ea; white-space: nowrap; }

/* 话术 */
.talk { margin-bottom: 12px; }
.talk .tt { font-size: 14.5px; font-weight: 800; margin-bottom: 6px; }
.talk li { font-size: 12.5px; color: var(--sub); line-height: 1.7; margin: 4px 0 4px 18px; }
.talk li.bad { color: #c0503c; }

/* 成长记录 */
.log-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.log-grid .dow { text-align: center; font-size: 11px; color: var(--sub); padding: 2px 0; }
.log-cell {
  aspect-ratio: 1; border-radius: 10px; background: #faf5ea; display: flex; flex-direction: column;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: var(--sub);
}
.log-cell .dm { font-size: 10px; font-weight: 400; opacity: .7; }
.log-cell.done { background: var(--ok); color: #fff; }
.log-cell.today { outline: 2px solid var(--accent); }
.log-cell.today.done { outline-color: #fff; }
.log-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.log-stat { flex: 1; text-align: center; background: var(--soft); border-radius: 12px; padding: 10px 4px; }
.log-stat .v { font-size: 20px; font-weight: 900; }
.log-stat .k { font-size: 11px; color: var(--sub); }
.log-line { display: flex; justify-content: space-between; align-items: center; gap: 6px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.log-line .ll-s { color: var(--accent); font-weight: 700; white-space: nowrap; }

/* 底栏 */
nav.tabbar {
  flex: 0 0 auto; display: flex; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); position: relative;
}
.tab { flex: 1; border: none; background: none; cursor: pointer; padding: 6px 0; text-align: center; color: var(--sub); }
.tab .ti { font-size: 24px; display: block; }
.tab .tl { font-size: 12px; font-weight: 700; }
.tab.active { color: var(--accent); }

/* 学习游戏 */
.lv-pills { display: flex; gap: 6px; margin: 4px 0 10px; }
.lv-pill { flex: 1; padding: 7px 0; border-radius: 9px; font-size: 12.5px; font-weight: 700; background: var(--soft); color: var(--sub); border: none; cursor: pointer; }
.lv-pill.active { background: var(--accent-strong); color: #fff; }
.quiz .q { font-size: 15px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.quiz .objs { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 5px; font-size: 30px; margin-bottom: 12px; min-height: 42px; line-height: 1; }
.opts, .quiz .opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.opt, .quiz .opt { padding: 14px 4px; border-radius: 12px; font-size: 20px; font-weight: 800; background: var(--soft); color: var(--ink); border: 2px solid transparent; cursor: pointer; }
.quiz .q .spk { border: none; background: #fff2d4; border-radius: 8px; padding: 2px 7px; font-size: 13px; cursor: pointer; vertical-align: middle; margin-left: 3px; }
.tts-toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-200%);
  background: rgba(40, 30, 20, .92); color: #fff; font-size: 15px; padding: 9px 16px; border-radius: 999px;
  max-width: 86%; text-align: center; z-index: 99; pointer-events: none;
  opacity: 0; transition: transform .25s, opacity .2s;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .25); line-height: 1.5;
}
.tts-toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.quiz .opt.py { font-size: 15px; line-height: 1.5; }
.quiz .opt.right, .opts .opt.right { background: #d9f2dd; border-color: var(--ok); }
.quiz .opt.wrong, .opts .opt.wrong { background: #f8d9d2; border-color: #c0503c; animation: shake .3s; }
.quiz .score { text-align: center; font-size: 13px; color: var(--sub); margin-top: 9px; }
.quiz .corr-hint { text-align: center; font-size: 15px; font-weight: 600; color: #2e7d32; margin-top: 10px; }

/* 拼音「先认一认」学习卡片 */
.learn-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.learn-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: var(--soft); border: 1.5px solid var(--line); border-radius: 12px;
  padding: 10px 4px; cursor: pointer; color: var(--ink); font-family: inherit;
}
.learn-item:active { transform: scale(.96); }
.learn-item .li-main { font-size: 22px; font-weight: 800; line-height: 1.1; }
.learn-item .li-sub { font-size: 12px; color: var(--sub); line-height: 1.3; }
.learn-item .li-spk { font-size: 12px; opacity: .6; }

/* 诗词「先读一读」学习卡片 */
.poem-view { margin-top: 10px; }
.poem-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.poem-emoji { font-size: 36px; }
.poem-title { font-size: 20px; font-weight: 800; }
.poem-by { font-size: 12px; color: var(--sub); }
.poem-lines { background: var(--soft); border-radius: 12px; padding: 12px 8px; margin: 0 auto; }
.poem-line { display: flex; justify-content: center; padding: 3px 0; }
.pl-unit { display: flex; flex-direction: column; align-items: center; width: 40px; gap: 1px; }
.pl-char { font-size: 24px; font-weight: 700; line-height: 1.3; }
.pl-py { font-size: 10.5px; color: var(--sub); line-height: 1.1; }
.poem-btns { display: flex; gap: 8px; margin-top: 10px; }
.poem-btns .tbtn { flex: 1; }
.poem-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.poem-nav .tbtn { flex: 0 0 auto; padding: 8px 12px; }
.poem-prog { font-size: 13px; font-weight: 700; color: var(--sub); }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.type-chips { display: flex; gap: 6px; overflow-x: auto; margin: 4px 0 8px; -webkit-overflow-scrolling: touch; padding-bottom: 2px; }
.type-chip { flex: 0 0 auto; padding: 7px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 700; background: var(--soft); color: var(--sub); border: none; cursor: pointer; }
.type-chip.active { background: var(--accent-strong); color: #fff; }
.quiz .qlbl { text-align: center; font-size: 14px; color: var(--sub); margin-top: 2px; }
.quiz .calc { font-size: 40px; text-align: center; font-weight: 800; margin: 6px 0 12px; letter-spacing: 2px; }
.quiz .two { display: flex; gap: 16px; justify-content: center; align-items: flex-start; margin-bottom: 8px; }
.quiz .two .lbl { text-align: center; font-size: 12px; color: var(--sub); margin-top: 2px; }
.ref-box { background: var(--soft); border-radius: 10px; padding: 9px 11px; margin-top: 7px; font-size: 12.5px; color: var(--ink); line-height: 1.7; }
.ref-box b { color: var(--accent); }

/* 线上游戏 */
.sg-top { text-align: center; font-size: 15px; font-weight: 800; margin: 2px 0 10px; }
.sg-grid { display: grid; gap: 8px; }
.sg-cell { aspect-ratio: 1; border-radius: 12px; font-size: 24px; font-weight: 800; background: var(--soft); color: var(--ink); border: none; cursor: pointer; }
.sg-cell.done { background: #d9f2dd; color: #2f7d40; }
.sg-cell.wrong { background: #f8d9d2; color: #c0503c; animation: shake .3s; }
.sg-cell.found { background: #d9f2dd; color: #2f7d40; }
.mem-info { text-align: center; font-size: 14px; font-weight: 700; margin: 2px 0 10px; }
.mem-grid { display: grid; gap: 8px; }
.mem-card { aspect-ratio: 1; border-radius: 12px; font-size: 26px; font-weight: 800; background: var(--soft); color: var(--ink); border: none; cursor: pointer; }
.mem-card.up { background: #eaf4ff; }
.mem-card.matched { background: #d9f2dd; }
.game-result { text-align: center; font-size: 15px; font-weight: 800; margin-top: 7px; }
.sg-cell.hint { background: #fff3b8; box-shadow: inset 0 0 0 3px var(--accent); }
.listen-q { text-align: center; font-size: 15px; font-weight: 800; margin: 6px 0 2px; line-height: 1.5; }

/* 报告图表 */
.radar-wrap { display: flex; justify-content: center; margin-top: 6px; }
.line-legend { display: flex; gap: 12px; justify-content: center; font-size: 11.5px; color: var(--sub); margin-top: 6px; }
.ach-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.ach-row .aic { font-size: 26px; }
.ach-row .at { flex: 1; font-size: 13.5px; font-weight: 700; }
.ach-row .as { font-size: 11.5px; color: var(--sub); }
.ach-row.unlocked .as { color: var(--accent); }
.tree-wrap { display: flex; justify-content: center; padding: 10px 0 4px; }

/* 弹层 */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal-mask { position: absolute; inset: 0; background: rgba(40,30,20,.45); }
.modal-body {
  position: relative; width: 100%; max-width: 480px; background: #fff; border-radius: 20px 20px 0 0;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(40%); opacity: .5; } to { transform: translateY(0); opacity: 1; } }
.modal-title { font-size: 16px; font-weight: 800; margin-bottom: 12px; }
.child-row { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; margin-bottom: 8px; background: var(--soft); }
.child-row.active { outline: 2px solid var(--accent); background: #fffdf7; }
.child-row .ca { font-size: 24px; }
.child-row .cn { flex: 1; font-weight: 700; }
.child-add-row { display: flex; gap: 8px; margin-top: 8px; }
.modal-close { width: 100%; margin-top: 10px; padding: 11px 0; border-radius: 12px; font-size: 14px; font-weight: 700; background: var(--soft); color: var(--sub); border: none; cursor: pointer; }

/* 登录 */
.auth-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 360px; background: #fff; border-radius: 20px; padding: 28px 22px; box-shadow: 0 6px 24px rgba(120,80,20,.12); text-align: center; }
.auth-logo { font-size: 52px; }
.auth-title { font-size: 22px; font-weight: 800; margin-top: 6px; }
.auth-sub { font-size: 12.5px; color: var(--sub); margin-top: 4px; }
.auth-tabs { display: flex; gap: 8px; margin: 18px 0 14px; }
.auth-tab { flex: 1; padding: 9px 0; border-radius: 10px; font-size: 14px; font-weight: 700; background: var(--soft); color: var(--sub); border: none; cursor: pointer; }
.auth-tab.active { background: var(--accent); color: #fff; }
.auth-input { width: 100%; padding: 12px 14px; border-radius: 12px; font-size: 15px; border: 1.5px solid var(--line); background: #fffdf8; margin-bottom: 10px; }
.auth-input:focus { outline: none; border-color: var(--accent); }
.auth-btn { width: 100%; padding: 13px 0; border-radius: 12px; font-size: 16px; font-weight: 800; background: var(--accent-strong); color: #fff; border: none; cursor: pointer; box-shadow: 0 3px 0 #b36b00; }
.auth-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 #d98420; }
.auth-msg { font-size: 13px; color: #c0503c; min-height: 18px; margin-top: 8px; }
.auth-hint { font-size: 11px; color: var(--sub); margin-top: 10px; }

.btn-link {
  display: block; text-align: center; text-decoration: none; padding: 12px 0; border-radius: 12px;
  background: #fff; border: 1.5px solid var(--accent); color: var(--accent-strong);
  font-weight: 800; font-size: 15px; margin-top: 6px;
}
.mine-item { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); font-size: 14.5px; font-weight: 700; }
.mine-item .mi { font-size: 20px; }

/* ============ 成长小镇 ============ */
/* 灯灯语音引导狐狸 */
.town-mascot {
  display: flex; align-items: center; gap: 10px; margin: 0 0 12px;
  background: #fff2d4; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 8px 14px; cursor: pointer;
}
.town-mascot .mascot-fox { font-size: 28px; line-height: 1; }
.town-mascot .mascot-bubble { flex: 1; font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.5; }
.town-mascot .mascot-spk { font-size: 14px; opacity: .7; }

.town-hero {
  border-radius: 18px; padding: 16px; color: #fff; margin-bottom: 12px;
  background: linear-gradient(150deg, #7cc6ff 0%, #5aa9e6 55%, #7c6bd6 100%);
  box-shadow: 0 4px 12px rgba(60, 120, 200, .22);
  position: relative; overflow: hidden;
}
.town-hero::after {
  content: '☀️'; position: absolute; right: 14px; top: 8px; font-size: 30px;
  filter: drop-shadow(0 2px 3px rgba(0,0,0,.18));
}
.town-hero .town-greet { font-size: 21px; font-weight: 800; letter-spacing: 1px; }
.town-hero .town-date { font-size: 13px; opacity: .92; margin-top: 3px; }

.town-party {
  background: linear-gradient(160deg, #fff6d6, #ffe6a8);
  border: 1.5px solid #ffc24d; text-align: center;
  font-size: 16px; font-weight: 800; color: #7a5200;
}

.town-task { position: relative; }
.task-head { display: flex; align-items: center; gap: 12px; }
.town-head-click { cursor: pointer; }
.task-label { font-size: 11px; font-weight: 800; color: var(--sub); letter-spacing: .5px; }
.task-title { font-size: 16.5px; font-weight: 800; margin-top: 2px; }
.task-sub { font-size: 12px; color: var(--sub); margin-top: 3px; line-height: 1.55; }
.task-cta { margin-top: 11px; width: 100%; padding: 13px 16px; box-sizing: border-box; }
.task-note {
  margin-top: 10px; display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 800; color: var(--ok);
  background: #eef8ef; border-radius: 10px; padding: 8px 11px;
}
#learnCta:disabled { opacity: .75; }

.town-lamp {
  width: 22px; height: 22px; border-radius: 50%; flex: 0 0 auto;
  background: radial-gradient(circle at 38% 32%, #efe8d8, #ddd0b8);
  box-shadow: inset 0 1px 2px rgba(0,0,0,.18);
}
.town-lamp.on {
  background: radial-gradient(circle at 35% 30%, #fff8d8, #ffc93d 62%, #f0a41f);
  box-shadow: 0 0 10px 3px rgba(255, 190, 50, .65);
  animation: lampGlow 1.8s ease-in-out infinite;
}
@keyframes lampGlow {
  0%, 100% { box-shadow: 0 0 8px 2px rgba(255,190,50,.55); }
  50% { box-shadow: 0 0 15px 5px rgba(255,190,50,.9); }
}

.timer-wrap { margin-top: 12px; border-top: 1.5px dashed var(--line); padding-top: 12px; }

/* ============ 探索 · 学科岛 + 关卡 ============ */
.island-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 12px; }
.island-card {
  background: var(--card); border: 1.5px solid var(--line); border-radius: 16px;
  padding: 12px 8px; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: 0 2px 8px rgba(120, 80, 20, .08);
}
.island-card.open { border-color: var(--accent); background: #fffdf7; }
.island-icon { font-size: 30px; line-height: 1; }
.island-name { font-size: 13.5px; font-weight: 800; }
.island-prog { font-size: 11.5px; color: var(--sub); }

/* 游乐场:游戏模块网格 → 点进单个游戏 */
.pg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 12px; }
.pg-module {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 16px 10px; cursor: pointer; text-align: center;
  border: 1.5px solid var(--line); color: var(--ink); font-family: inherit;
}
.pg-module.today { border-color: var(--accent); background: #fffdf7; box-shadow: 0 2px 10px rgba(255,122,60,.14); }
.pg-module:active { transform: scale(.97); }
.pg-icon { font-size: 34px; line-height: 1; }
.pg-name { font-size: 14px; font-weight: 800; }
.pg-sub { font-size: 11px; color: var(--sub); line-height: 1.4; }
.pg-badge {
  font-size: 10px; font-weight: 800; color: #fff; margin-top: 3px;
  background: linear-gradient(135deg, #ffb347, #ff7a3c);
  border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
.pg-back-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.pg-back-row .tbtn { flex: 0 0 auto; }
.pg-open-title { font-size: 15px; font-weight: 800; }

/* 首次引导弹层 */
.ob-overlay {
  position: fixed; inset: 0; z-index: 999; display: flex; align-items: center; justify-content: center;
  background: rgba(60, 40, 20, .45); padding: 20px;
}
.ob-card {
  width: 100%; max-width: 340px; background: #fffdf7; border-radius: 20px; padding: 22px 20px;
  text-align: center; box-shadow: 0 12px 40px rgba(60, 40, 20, .35);
}
.ob-card .ob-icon { font-size: 46px; line-height: 1; margin-bottom: 6px; }
.ob-card h2 { font-size: 19px; font-weight: 800; margin: 6px 0; }
.ob-sub { font-size: 13px; color: var(--sub); line-height: 1.6; margin: 6px 0 12px; }
.ob-card .auth-input { width: 100%; margin: 4px 0 12px; }
.ob-steps { text-align: left; margin: 10px 0 4px; }
.ob-step { display: flex; align-items: center; gap: 10px; padding: 9px 10px; background: var(--soft); border-radius: 12px; margin-bottom: 8px; font-size: 14px; font-weight: 700; }
.ob-step span { font-size: 17px; }
.ob-btns { display: flex; gap: 10px; margin-top: 12px; }
.ob-btns .tbtn { flex: 1; }

/* 成长页:各学科正确率 + 游戏最佳记录 */
.rate-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 12.5px; }
.rr-name { flex: 0 0 78px; font-weight: 700; }
.rr-bar { flex: 1; height: 10px; background: var(--soft); border-radius: 999px; overflow: hidden; }
.rr-bar i { display: block; height: 100%; background: linear-gradient(90deg, #ffb347, #ff7a3c); border-radius: 999px; }
.rr-v { flex: 0 0 38px; text-align: right; font-weight: 800; color: var(--ok); }
.game-best-pill {
  font-size: 11.5px; font-weight: 700; color: var(--ink);
  background: var(--soft); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}

.island-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.island-detail-head .island-icon { font-size: 26px; }
.island-detail-head .island-name { font-size: 16px; font-weight: 800; }
.island-detail-head .island-prog { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--sub); }

.level-list { display: flex; flex-direction: column; gap: 7px; }
.level-row {
  display: flex; align-items: center; gap: 8px; width: 100%;
  background: var(--soft); border: 1.5px solid transparent; border-radius: 12px;
  padding: 10px 12px; font-size: 14px; font-weight: 700; color: var(--ink); cursor: pointer; text-align: left;
}
.level-row.locked { color: var(--sub); background: #f3ece0; cursor: default; opacity: .82; }
.level-row .level-name { flex: 1; }
.level-stars { display: inline-flex; gap: 1px; font-size: 13px; letter-spacing: 1px; }
.level-star { opacity: .28; }
.level-star.on { opacity: 1; }
.level-lock { font-size: 15px; }

.quiz-hint { text-align: center; font-size: 12.5px; color: var(--sub); margin-bottom: 8px; }

.level-result { text-align: center; padding: 8px 0 4px; }
.result-stars { font-size: 34px; letter-spacing: 4px; margin-bottom: 4px; }
.result-score { font-size: 14px; font-weight: 800; }
.result-sub { font-size: 12px; color: var(--sub); margin: 3px 0 12px; }
.result-btns { display: flex; gap: 8px; }

/* ============ Task 7: 游乐场 + 家长专区 ============ */
.today-badge {
  display: inline-block; margin-left: 6px; vertical-align: middle;
  font-size: 10.5px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, #ffb347, #ff7a3c);
  border-radius: 999px; padding: 2px 8px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(255, 122, 60, .4);
}
.week-summary {
  text-align: center; font-size: 13px; font-weight: 800;
  color: var(--ok); margin-top: 8px;
}

/* 家长专区:折叠面板 */
details.card.parent-zone { padding: 0; overflow: hidden; }
details.card.parent-zone > summary {
  cursor: pointer; padding: 14px; list-style: none;
  font-size: 15px; font-weight: 800;
  display: flex; align-items: baseline; gap: 8px;
}
details.card.parent-zone > summary::-webkit-details-marker { display: none; }
details.card.parent-zone > summary::before {
  content: '▸'; color: var(--accent); transition: transform .2s;
  align-self: center;
}
details.card.parent-zone[open] > summary::before { transform: rotate(90deg); }
.pz-sub { font-size: 11px; color: var(--sub); font-weight: 700; }
.parent-zone .pz-body { padding: 2px 14px 14px; }
.parent-zone .card {
  background: #fdfbf5; border: 1.5px solid var(--line); box-shadow: none;
}

/* ============ 三只小猪(空间推理拼块) ============ */
.pigs-top { text-align: center; font-size: 14px; font-weight: 800; margin-bottom: 4px; line-height: 1.5; }
.pigs-top-sub { display: block; font-size: 11.5px; font-weight: 600; color: var(--sub); }

.pigs-dots { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 6px 0 10px; }
.pigs-dot {
  width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--line);
  background: #fff; color: var(--sub); font-size: 11px; font-weight: 800; cursor: pointer; padding: 0;
}
.pigs-dot.done { background: #d9f2dd; border-color: var(--ok); color: var(--ok); }
.pigs-dot.cur { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.pigs-dot.open { background: var(--soft); }
.pigs-dot.lock { background: #f3ece0; cursor: default; }

.pigs-board {
  position: relative; width: 100%; max-width: 340px; margin: 0 auto;
  /* 浅色底 + 独立绿格:缺角处露出浅底,异形轮廓一目了然 */
  background: #fffdf4;
  border: 3px solid #d8c9a6; border-radius: 18px; touch-action: none; overflow: hidden;
  box-shadow: 0 3px 8px rgba(120, 90, 30, .15);
}
.pigs-cell {
  position: absolute; display: flex; align-items: center; justify-content: center; font-size: 24px;
  background: linear-gradient(160deg, #c9ea9f, #a3d87c);
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.65), 0 1px 2px rgba(80, 120, 40, .25);
  border-radius: 8px;
}
.pigs-house { position: absolute; z-index: 2; border-radius: 10px; }
.pigs-house svg { display: block; pointer-events: none; }
.pigs-house.placed { cursor: pointer; pointer-events: auto; box-shadow: 0 3px 7px rgba(60, 40, 10, .28); transition: transform .18s, box-shadow .12s; }
.pigs-house.placed.selected { box-shadow: 0 4px 10px rgba(60, 40, 10, .32), 0 0 0 3px var(--accent); }
.pigs-char { display: block; width: 66%; height: 66%; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .2)); }
.pigs-ghost { opacity: .72; z-index: 6; pointer-events: none; outline: 2px dashed rgba(0, 0, 0, .3); outline-offset: -3px; box-shadow: none; filter: drop-shadow(0 6px 10px rgba(60, 40, 10, .3)); }
.pigs-ghost.invalid { filter: grayscale(.85); outline: 3px solid #c0503c; }
.pigs-tray-item .pigs-house { z-index: 1; box-shadow: none; }
/* 放下吸附:从缩放弹入目标格 */
.pigs-house.drop-in { animation: pigs-drop-in .22s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes pigs-drop-in { 0% { transform: scale(.7); opacity: .5; } 100% { transform: scale(1); opacity: 1; } }
/* 拖拽目标格高亮:可行绿闪 / 不可行红框 */
.pigs-cell.valid { box-shadow: inset 0 0 0 3px var(--ok), inset 0 0 0 100px rgba(63, 168, 85, .16); }
.pigs-cell.invalid { box-shadow: inset 0 0 0 3px #c0503c; }
/* 场景装饰(白天/夜晚角标 + 草地小花) */
.pigs-deco { position: absolute; inset: 0; z-index: 0; pointer-events: none; font-size: 17px; }
.pigs-deco .d-sun { position: absolute; right: 7px; top: 5px; font-size: 24px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .15)); }
.pigs-deco .d-moon { position: absolute; right: 7px; top: 5px; font-size: 21px; }
.pigs-deco .d-star { position: absolute; font-size: 11px; }
.pigs-deco .d-star.s1 { left: 9px; top: 7px; }
.pigs-deco .d-star.s2 { left: 47px; top: 3px; }
.pigs-deco .d-flower { position: absolute; left: 8px; bottom: 6px; }
.pigs-deco .d-grass { position: absolute; left: 44px; bottom: 4px; font-size: 14px; }
.pigs-pig-in { position: absolute; z-index: 3; display: flex; align-items: center; justify-content: center; font-size: 24px; }
.pigs-night { position: absolute; inset: 0; z-index: 4; background: rgba(15, 30, 60, .16); pointer-events: none; border-radius: 12px; }
.pigs-hint-target { position: absolute; z-index: 5; background: rgba(255, 215, 90, .55); border: 2px dashed #e8a100; border-radius: 8px; animation: pigs-pulse .7s ease-in-out infinite alternate; pointer-events: none; }
@keyframes pigs-pulse { from { opacity: .5; } to { opacity: 1; } }
/* 过关庆祝:房子跳动闪光 + 棋盘晕轮 + 星星雨 + 结果弹入 */
.pigs-celebrate { animation: pigs-board-glow .5s ease-in-out 3; }
@keyframes pigs-board-glow { 50% { box-shadow: 0 0 0 5px rgba(255, 215, 90, .8), 0 0 26px rgba(255, 215, 90, .55); } }
.pigs-celebrate .pigs-house.placed { animation: pigs-flash .45s ease-in-out 3; }
@keyframes pigs-flash { 50% { filter: brightness(1.6) drop-shadow(0 0 12px rgba(255, 215, 90, 1)); transform: scale(1.06); } }
.pigs-result { position: relative; }
.pigs-confetti { position: absolute; left: 0; right: 0; top: -6px; height: 0; pointer-events: none; }
.pigs-confetti span { position: absolute; font-size: 20px; opacity: 0; animation: pigs-confetti-up .9s ease-out forwards; }
@keyframes pigs-confetti-up {
  0% { transform: translateY(6px) scale(.4); opacity: 0; }
  25% { opacity: 1; }
  100% { transform: translateY(-52px) scale(1.25); opacity: 0; }
}
.pigs-win { animation: pigs-win-pop .55s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pigs-win-pop { 0% { transform: scale(.3); opacity: 0; } 70% { transform: scale(1.12); } 100% { transform: scale(1); opacity: 1; } }

.pigs-msg { min-height: 20px; text-align: center; font-size: 13px; font-weight: 700; color: #c0503c; margin: 7px 0 2px; }
.pigs-controls { display: flex; gap: 8px; max-width: 340px; margin: 6px auto 0; }
.pigs-controls .tbtn { flex: 1; padding: 9px 0; font-size: 13.5px; }
.pigs-tray { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 10px; min-height: 64px; }
.pigs-tray-item { position: relative; background: #fffdf8; border: 1.5px solid var(--line); border-radius: 12px; touch-action: none; cursor: grab; transition: transform .1s; }
.pigs-tray-item:active { cursor: grabbing; transform: scale(.94); }
.pigs-tray-item .pigs-house { z-index: 1; }
.pigs-tray-item svg { width: 100%; height: 100%; display: block; }

.pigs-result { text-align: center; margin-top: 12px; }
.pigs-win { font-size: 22px; font-weight: 800; margin-bottom: 10px; }

/* 三只小猪:房子上的旋转按钮 */
.pigs-rotate {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 36px; height: 36px;
  border-radius: 50%; border: 2.5px solid #fff;
  background: var(--accent-strong); color: #fff;
  font-size: 20px; font-weight: 900; line-height: 1; cursor: pointer; padding: 0;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .3); z-index: 8; pointer-events: auto;
  animation: pigs-pulse .8s ease-in-out infinite alternate;
}
