/* Power Up 学习助手 · 公共样式（竖屏优先 / 平板自适应） */
* { margin:0; padding:0; box-sizing:border-box; -webkit-tap-highlight-color:transparent; }
:root {
  --blue:#4A90D9; --blue-d:#2E6FB5; --green:#5CB85C; --green-d:#3E8E4E;
  --orange:#F4A259; --purple:#8E6FB5; --bg:#F6F4EF; --card:#FFF;
  --txt:#2B2B2B; --sub:#8A8A8A; --line:#E8E4DC;
}
html, body { height:100%; }
body {
  font-family:"PingFang SC","Microsoft YaHei","Segoe UI",Arial,sans-serif;
  background:var(--bg); color:var(--txt);
  min-height:100dvh;
}
button { font-family:inherit; }
a { color:var(--blue-d); }

/* ── 顶栏 ── */
header.app { background:linear-gradient(135deg,#5CB85C,#3E8E4E); color:#fff; padding:12px 18px 10px; }
.h-top { display:flex; justify-content:space-between; align-items:center; gap:10px; max-width:1080px; margin:0 auto; }
.h-title { font-size:17px; font-weight:700; }
.h-sub { font-size:12px; opacity:.92; margin-top:2px; }
.h-badges { display:flex; gap:8px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.h-chip { font-size:13px; background:rgba(255,255,255,.22); border-radius:20px; padding:5px 13px; font-weight:600; white-space:nowrap; border:none; color:#fff; cursor:pointer; min-height:36px; }
.h-chip.gold { background:#FFD75E; color:#7A5A00; }
.h-chip.plain { background:rgba(255,255,255,.12); }

main { max-width:1080px; margin:0 auto; padding:14px 16px 40px; }

/* ── 卡片与通用 ── */
.panel { background:var(--card); border-radius:16px; border:1px solid var(--line); padding:14px 16px; margin-bottom:12px; }
.panel h3 { font-size:14.5px; color:var(--green-d); margin-bottom:10px; }
.row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.hint { font-size:12.5px; color:var(--sub); line-height:1.7; }
.btn { border:none; border-radius:14px; padding:11px 18px; font-size:14px; font-weight:700; cursor:pointer; min-height:46px; }
.btn.green { background:var(--green); color:#fff; }
.btn.blue { background:#EAF2FB; color:var(--blue-d); }
.btn.orange { background:var(--orange); color:#fff; }
.btn.ghost { background:var(--bg); color:var(--sub); }
.btn.danger { background:#fff; border:1.5px solid #E2B4B4; color:#B44; }
.btn:disabled { background:#C9D8C9; color:#fff; cursor:default; }

/* ── 登录页 ── */
.login-wrap { max-width:420px; margin:8dvh auto; padding:0 18px; }
.login-logo { text-align:center; font-size:52px; margin-bottom:6px; }
.login-title { text-align:center; font-size:20px; font-weight:800; color:var(--green-d); }
.login-sub { text-align:center; font-size:13px; color:var(--sub); margin:6px 0 22px; }
.field { margin-bottom:14px; }
.field label { display:block; font-size:13px; font-weight:700; color:var(--sub); margin-bottom:6px; }
.field input { width:100%; border:1.5px solid var(--line); border-radius:14px; padding:12px 14px; font-size:17px; background:#fff; min-height:50px; }
.field input.pin { letter-spacing:12px; text-align:center; font-size:24px; }
.login-err { color:#C0392B; font-size:13px; min-height:20px; margin:4px 0; text-align:center; }
.pin-pad { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px; }
.pin-pad button { border:1.5px solid var(--line); background:#fff; border-radius:14px; font-size:20px; font-weight:700; padding:12px 0; cursor:pointer; min-height:54px; }
.pin-pad button:active { background:#EAF6EA; }

/* ── 门户（单元卡片）── */
.rec-card { border-radius:18px; padding:16px 18px; color:#fff; margin-bottom:14px; background:linear-gradient(135deg,#F4A259,#E8833A); }
.rec-card h2 { font-size:16px; margin-bottom:6px; }
.rec-card p { font-size:13.5px; opacity:.96; line-height:1.6; }
.rec-card .go { margin-top:12px; background:#fff; color:#B26A1B; border:none; border-radius:14px; padding:11px 22px; font-size:15px; font-weight:800; cursor:pointer; min-height:46px; }
.unit-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px; }
.unit-card { background:var(--card); border:1.5px solid var(--line); border-radius:18px; padding:15px 16px; cursor:pointer; transition:transform .12s; }
.unit-card:active { transform:scale(.98); }
.unit-card .u-no { font-size:13px; font-weight:800; color:#fff; background:var(--uc,#5CB85C); border-radius:10px; display:inline-block; padding:2px 10px; }
.unit-card .u-name { font-size:16.5px; font-weight:800; margin-top:8px; }
.unit-card .u-zh { font-size:12.5px; color:var(--sub); margin-top:2px; }
.u-bar { height:10px; background:#EFECE4; border-radius:6px; margin-top:12px; overflow:hidden; }
.u-bar i { display:block; height:100%; background:var(--uc,#5CB85C); border-radius:6px; }
.u-meta { display:flex; justify-content:space-between; font-size:12px; color:var(--sub); margin-top:6px; }
.child-dice { text-align:center; font-size:15px; font-weight:700; color:var(--green-d); padding:10px; }

/* ── 单元页布局：竖屏优先单列 ── */
nav.tabs { display:flex; background:var(--card); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; max-width:1080px; margin:0 auto; }
nav.tabs button { flex:1; border:none; background:none; padding:10px 2px 9px; font-size:12.5px; font-weight:600; color:var(--sub); cursor:pointer; border-bottom:3px solid transparent; min-height:52px; }
nav.tabs button.on { color:var(--green-d); border-bottom-color:var(--green); }
nav.tabs .ico { display:block; font-size:16px; margin-bottom:2px; }
main.unit-main { max-width:1080px; margin:0 auto; padding:14px 16px 120px; }
main.unit-main section { display:none; }
main.unit-main section.on { display:block; }

/* 书页 */
.subtabs { display:flex; gap:8px; margin-bottom:10px; }
.subtabs button { border:1.5px solid var(--line); background:var(--card); border-radius:20px; padding:8px 16px; font-size:13px; font-weight:600; color:var(--sub); cursor:pointer; min-height:40px; }
.subtabs button.on { border-color:var(--green); color:var(--green-d); background:#EAF6EA; }
.page-box { background:var(--card); border-radius:16px; border:1px solid var(--line); overflow:hidden; }
.page-img { width:100%; height:auto; display:block; }
.page-meta { padding:10px 12px 0; font-size:15px; font-weight:700; color:var(--green-d); }
.page-ctrl { display:flex; align-items:center; justify-content:space-between; padding:8px 12px; }
.page-ctrl button { border:none; background:var(--bg); border-radius:12px; padding:10px 16px; font-size:14px; font-weight:600; color:var(--blue-d); cursor:pointer; min-height:46px; }
.page-num { font-size:13px; color:var(--sub); text-align:center; }
.audio-row { display:flex; flex-wrap:wrap; gap:8px; padding:4px 12px 12px; }
.a-btn { border:1.5px solid var(--green); background:#fff; color:var(--green-d); border-radius:20px; padding:8px 14px; font-size:13px; font-weight:600; cursor:pointer; min-height:42px; display:inline-flex; align-items:center; gap:5px; }
.a-btn.playing { background:var(--green); color:#fff; }
.video-row { padding:0 12px 12px; }
.v-btn { display:block; width:100%; border:none; background:var(--orange); color:#fff; border-radius:12px; padding:12px 14px; font-size:14px; font-weight:700; cursor:pointer; min-height:46px; }
.tip { margin:0 12px 12px; background:#FFF8F0; border:1px solid #F3E3CF; border-radius:12px; padding:10px 12px; font-size:13px; line-height:1.7; }
.tip b { color:var(--orange); }

/* 词卡 */
.word-flex { display:flex; gap:14px; align-items:flex-start; }
.word-img { width:44%; max-width:230px; border-radius:14px; border:1px solid var(--line); display:block; height:auto; }
.word-img.placeholder { background:#EAF6EA; aspect-ratio:3/4; display:flex; align-items:center; justify-content:center; font-size:40px; }
.word-info { flex:1; min-width:0; }
.w-word { font-size:34px; font-weight:800; letter-spacing:1px; color:var(--blue-d); margin-top:6px; line-height:1.15; }
.w-zh { font-size:14px; color:var(--sub); margin-top:4px; }
.w-btns { display:flex; flex-wrap:wrap; gap:10px; margin-top:14px; }
.w-nav { display:flex; justify-content:space-between; align-items:center; margin-top:14px; }
.w-nav button { border:1px solid var(--line); background:var(--card); border-radius:12px; padding:9px 16px; font-size:14px; font-weight:600; cursor:pointer; min-height:44px; }
.w-dots { display:flex; gap:5px; flex-wrap:wrap; justify-content:center; max-width:55%; }
.dot { width:8px; height:8px; border-radius:50%; background:#ddd; }
.dot.on { background:var(--green); }
.star-row { display:flex; align-items:center; gap:8px; margin-top:10px; flex-wrap:wrap; }
.star-row .lbl { font-size:13px; color:var(--sub); }
.star-row button { border:1.5px solid #F0D9A8; background:#FFF8F0; border-radius:12px; font-size:15px; padding:7px 12px; cursor:pointer; min-height:42px; }
.ai-line { font-size:12.5px; color:var(--sub); margin-top:8px; word-break:break-all; }
.ai-line .ok { color:var(--green-d); font-weight:700; }
.score-badge { display:inline-block; background:#EAF6EA; color:var(--green-d); border-radius:10px; padding:2px 10px; font-weight:800; }

/* 句子 */
.grp-tabs { display:flex; gap:8px; overflow-x:auto; padding-bottom:8px; }
.grp-tabs button { flex:0 0 auto; border:1.5px solid var(--line); background:var(--card); border-radius:20px; padding:8px 14px; font-size:13px; font-weight:600; color:var(--sub); cursor:pointer; min-height:42px; }
.grp-tabs button.on { border-color:var(--green); color:var(--green-d); background:#EAF6EA; }
.sent { background:var(--card); border:1px solid var(--line); border-radius:14px; padding:12px 14px; margin-bottom:10px; }
.sent .en { font-size:16px; font-weight:700; line-height:1.5; }
.sent .zh { font-size:12px; color:var(--sub); margin-top:3px; }
.sent-ops { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.sent-ops button { border:none; border-radius:14px; padding:8px 13px; font-size:13px; font-weight:700; cursor:pointer; min-height:42px; }

/* 游戏 */
.chip-row { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:10px; }
.chip-row button { border:1.5px solid var(--line); background:var(--card); border-radius:20px; padding:8px 15px; font-size:13px; font-weight:600; color:var(--sub); cursor:pointer; min-height:42px; }
.chip-row button.on { border-color:var(--green); color:var(--green-d); background:#EAF6EA; }
.big-btn { display:block; width:100%; border:none; background:var(--green); color:#fff; border-radius:14px; padding:14px; font-size:16px; font-weight:700; cursor:pointer; min-height:52px; }
.q-head { display:flex; justify-content:space-between; margin-bottom:10px; font-size:13px; color:var(--sub); }
.q-img { width:200px; max-width:60%; border-radius:14px; border:1px solid var(--line); display:block; margin:6px auto 12px; height:auto; }
.opt-grid { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.opt { border:2px solid var(--line); background:#fff; border-radius:14px; padding:10px; font-size:15px; font-weight:700; cursor:pointer; min-height:52px; display:flex; align-items:center; justify-content:center; }
.opt img { max-width:100%; max-height:150px; border-radius:8px; }
.opt.right { border-color:var(--green); background:#EAF6EA; }
.opt.wrong { border-color:#D9534F; background:#FDEDEC; }
.q-play { display:block; margin:0 auto 14px; border:none; background:var(--blue); color:#fff; border-radius:50px; padding:12px 26px; font-size:15px; font-weight:700; min-height:50px; }
.q-feed { text-align:center; font-size:14px; font-weight:700; margin-top:10px; min-height:22px; }
.q-feed .ok { color:var(--green-d); } .q-feed .bad { color:#D9534F; }

/* Mission */
.step-bar { display:flex; gap:6px; margin-bottom:12px; }
.step-bar button { flex:1; border:1.5px solid var(--line); background:var(--card); border-radius:12px; padding:8px 4px; font-size:12px; font-weight:600; color:var(--sub); cursor:pointer; min-height:54px; }
.step-bar button.on { border-color:var(--orange); color:#B26A1B; background:#FFF4E8; }
.step-bar button.done { border-color:var(--green); background:#EAF6EA; color:var(--green-d); }
.animal-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(96px,1fr)); gap:10px; }
.animal-chip { border:2px solid var(--line); background:#fff; border-radius:14px; padding:8px 4px; text-align:center; cursor:pointer; }
.animal-chip img { width:64px; height:80px; object-fit:cover; border-radius:8px; display:block; margin:0 auto 6px; }
.animal-chip .nm { font-size:13px; font-weight:700; color:var(--blue-d); }
.animal-chip.sel { border-color:var(--green); background:#EAF6EA; }
canvas#missionCv { width:100%; border:2px solid var(--line); border-radius:14px; touch-action:none; display:block; background:#fff; }
.cv-tools { display:flex; gap:8px; flex-wrap:wrap; margin-top:10px; align-items:center; }
.swatch { width:34px; height:34px; border-radius:50%; border:3px solid #fff; outline:2px solid var(--line); cursor:pointer; }
.swatch.on { outline:2.5px solid var(--orange); }
.cv-tools .act { border:none; background:var(--bg); border-radius:12px; padding:9px 12px; font-size:13px; font-weight:600; cursor:pointer; min-height:42px; }
.stamp-row { display:flex; gap:6px; flex-wrap:wrap; margin-top:10px; }
.stamp-row img { width:52px; height:66px; object-fit:cover; border-radius:8px; border:2px solid var(--line); cursor:pointer; }
.stamp-row img.on { border-color:var(--orange); }
.build-line { font-size:15px; font-weight:700; color:var(--green-d); margin:12px 0 6px; }
.word-chips { display:flex; gap:7px; flex-wrap:wrap; }
.word-chips button { border:1.5px solid var(--line); background:#fff; border-radius:16px; padding:7px 13px; font-size:13.5px; font-weight:600; cursor:pointer; min-height:40px; }
.word-chips button.sel { border-color:var(--orange); background:#FFF4E8; color:#B26A1B; }
.slot-group { margin-bottom:8px; }
.slot-label { font-size:12px; color:var(--sub); margin-bottom:4px; }
.build-result { margin-top:10px; font-size:15px; font-weight:700; color:var(--blue-d); min-height:24px; line-height:1.5; }
.m-sent { background:#F4FBF4; border:1px dashed #BBDDBB; border-radius:10px; padding:7px 10px; font-size:13.5px; margin-top:8px; display:flex; justify-content:space-between; align-items:center; gap:8px; }
.m-sent button { border:none; background:#EAF2FB; color:var(--blue-d); border-radius:10px; padding:5px 10px; font-size:12px; cursor:pointer; min-height:36px; }

/* 家长区 */
details { border:1px solid var(--line); border-radius:12px; background:#fff; margin-bottom:10px; }
details summary { padding:12px 14px; font-size:14px; font-weight:700; color:var(--green-d); cursor:pointer; }
details .d-body { padding:0 14px 12px; font-size:13px; line-height:1.7; }
.kv { margin:6px 0; }
.kv b.k { color:var(--blue-d); }
table.gtab { width:100%; border-collapse:collapse; font-size:12.5px; margin-top:6px; }
table.gtab th, table.gtab td { border:1px solid var(--line); padding:5px 7px; text-align:left; vertical-align:top; line-height:1.5; }
table.gtab th { background:#F2F7F2; }
pre.script { white-space:pre-wrap; font-family:inherit; font-size:12.5px; color:#555; background:#FAFAF7; border-radius:8px; padding:8px 10px; margin:4px 0 0; }

/* 仪表盘 */
.dash-user { border:1.5px solid var(--line); border-radius:16px; padding:12px 14px; margin-bottom:12px; background:#fff; }
.dash-user h4 { font-size:15px; margin-bottom:8px; }
.dash-user h4 .role { font-size:11px; background:#EAF2FB; color:var(--blue-d); border-radius:8px; padding:2px 8px; margin-left:6px; font-weight:700; }
.tl { font-size:12.5px; color:var(--sub); line-height:1.9; }

/* 播放器 */
.player { position:fixed; left:0; right:0; bottom:0; background:rgba(255,255,255,.97); border-top:1px solid var(--line); box-shadow:0 -2px 12px rgba(0,0,0,.08); display:none; z-index:50; }
.player.show { display:block; }
.p-inner { max-width:1080px; margin:0 auto; padding:6px 14px; display:flex; align-items:center; gap:12px; }
.p-btn { width:44px; height:44px; border-radius:50%; border:none; background:var(--green); color:#fff; cursor:pointer; display:flex; align-items:center; justify-content:center; flex:0 0 auto; }
.p-info { min-width:64px; font-size:13px; font-weight:700; color:var(--green-d); }
.p-range { flex:1; min-width:0; }
.p-range input[type=range] { width:100%; accent-color:var(--green); height:30px; margin:0; cursor:pointer; }
.p-time { font-size:12px; color:var(--sub); min-width:92px; text-align:right; font-variant-numeric:tabular-nums; }
.p-close { border:none; background:none; color:var(--sub); font-size:17px; cursor:pointer; min-height:40px; }

/* 视频层 */
.video-mask { position:fixed; inset:0; background:rgba(0,0,0,.82); display:none; align-items:center; justify-content:center; z-index:100; padding:16px; }
.video-mask.show { display:flex; }
.video-box { width:100%; max-width:760px; background:#111; border-radius:16px; overflow:hidden; }
.video-head { display:flex; align-items:center; justify-content:space-between; padding:10px 14px; background:#1A1A1A; }
.video-head span { color:#fff; font-size:14px; font-weight:700; }
.video-head button { border:none; background:none; color:#fff; font-size:18px; cursor:pointer; padding:4px 10px; }
.video-box video { width:100%; max-height:72dvh; display:block; background:#000; }

@keyframes blink { 50% { opacity:.5; } }
.rec-on { background:#D9534F !important; color:#fff !important; animation:blink 1s infinite; }

/* ── 横屏（桌面/平板横持 ≥900px）：书页区双栏 ── */
@media (orientation:landscape) and (min-width:900px) {
  #bookSplit { display:flex; gap:16px; align-items:flex-start; }
  #bookSplit .page-col { flex:0 0 52%; position:sticky; top:70px; }
  #bookSplit .ctrl-col { flex:1; min-width:0; }
  .page-ctrl, .audio-row, .video-row, .tip, .page-meta { padding-left:0; padding-right:0; margin-left:0; margin-right:0; }
  .audio-row, .video-row { padding:8px 0 12px; }
  .tip { margin:0 0 12px; }
  .feel-panel { margin-top:12px; }
}
/* 窄屏词卡竖排 */
@media (max-width:560px) {
  .word-flex { flex-direction:column; }
  .word-img, .word-img.placeholder { width:100%; max-width:none; }
  .h-title { font-size:15px; }
}
