:root {
  --bg: #fff8ec;
  --ink: #3a2e22;
  --muted: #9a8a78;
  --card: #ffffff;
  --primary: #ff8a3d;
  --primary-ink: #ffffff;
  --ok: #3cb371;
  --bad: #e5533d;
  --dim: #e9dfd0;
  --shadow: 0 6px 18px rgba(90, 60, 20, 0.15);
  --r: 28px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; overscroll-behavior: none; }
body { -webkit-user-select: none; user-select: none; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; }

#app { position: fixed; inset: 0; display: flex; flex-direction: column; }
.screen { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 28px; padding: 88px 24px 32px; position: relative; overflow: hidden; }

/* 顶栏：返回、进度点、重听 */
.topbar { position: absolute; top: 0; left: 0; right: 0; height: 80px; display: flex;
  align-items: center; justify-content: space-between; padding: 0 16px; z-index: 5; }
.icon-btn { width: 64px; height: 64px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  font-size: 30px; display: flex; align-items: center; justify-content: center; }
.dots { display: flex; gap: 10px; }
.dots i { width: 16px; height: 16px; border-radius: 50%; background: var(--dim); display: block; }
.dots i.on { background: var(--primary); }
.dots i.done { background: var(--ok); }

/* 主按钮 */
.primary { min-width: 140px; height: 120px; padding: 0 36px; border-radius: 60px; background: var(--primary);
  color: var(--primary-ink); font-size: 56px; box-shadow: var(--shadow); display: flex; align-items: center;
  justify-content: center; gap: 12px; }
.primary.round { width: 140px; height: 140px; min-width: 0; padding: 0; border-radius: 50%; }
.primary.rec { background: var(--bad); animation: pulse 1.2s infinite; }
.primary.ok { background: var(--ok); }
@keyframes pulse { 50% { transform: scale(1.08); } }
.secondary { width: 88px; height: 88px; border-radius: 50%; background: var(--card); box-shadow: var(--shadow);
  font-size: 40px; display: flex; align-items: center; justify-content: center; }
.row { display: flex; gap: 24px; align-items: center; justify-content: center; flex-wrap: wrap; }

/* 今天 */
.today-cards { display: flex; gap: 28px; width: 100%; max-width: 900px; }
.today-card { flex: 1; height: min(60vh, 540px); border-radius: var(--r); background: var(--card); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden;
  opacity: .55; transform: scale(.94); transition: .3s; }
.today-card.next { opacity: 1; transform: scale(1); outline: 8px solid var(--primary); animation: glow 1.8s infinite; }
.today-card.done { opacity: 1; transform: scale(.94); }
.today-card img { width: 100%; height: 100%; object-fit: cover; }
.today-card .emoji { font-size: 160px; }
.today-card .check { position: absolute; inset: 0; background: rgba(60, 179, 113, .55); display: flex;
  align-items: center; justify-content: center; font-size: 140px; }
@keyframes glow { 50% { outline-color: #ffc59b; } }
.bag-btn { position: relative; }
.bag-btn b { position: absolute; right: -6px; top: -6px; background: var(--bad); color: #fff; font-size: 18px;
  min-width: 28px; height: 28px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.more { position: absolute; bottom: 24px; display: flex; gap: 20px; align-items: center; }
/* 家长入口：顶部正中隐形区域，长按 2 秒 */
.parent-zone { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: 160px; height: 80px; z-index: 6; }

/* 选项与内容 */
.tiles { display: flex; gap: 24px; justify-content: center; flex-wrap: wrap; }
.tile { width: 200px; height: 200px; border-radius: var(--r); background: var(--card); box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; font-size: 110px;
  overflow: hidden; }
.tile img { width: 100%; height: 100%; object-fit: cover; }
.tile small { font-size: 30px; font-weight: 600; }
.tile.right { outline: 8px solid var(--ok); }
.tile.wrong { animation: shake .4s; outline: 8px solid var(--bad); }
@keyframes shake { 25% { transform: translateX(-10px); } 75% { transform: translateX(10px); } }
.big-word { font-size: 96px; font-weight: 700; letter-spacing: 2px; }
.model { font-size: 52px; font-weight: 600; text-align: center; }
.huge-emoji { font-size: 160px; line-height: 1; }

/* 拼词 */
.slots, .letters { display: flex; gap: 16px; justify-content: center; }
.slot { width: 96px; height: 110px; border-bottom: 8px solid var(--dim); font-size: 72px; font-weight: 700;
  display: flex; align-items: flex-end; justify-content: center; }
.letter { width: 104px; height: 104px; border-radius: 24px; background: var(--card); box-shadow: var(--shadow);
  font-size: 64px; font-weight: 700; }
.letter.used { visibility: hidden; }

/* 视频 */
.video-wrap { position: absolute; inset: 0; background: #000; display: flex; align-items: center; justify-content: center; }
.video-wrap video { width: 100%; height: 100%; object-fit: contain; }
.video-ctrl { position: absolute; bottom: 24px; left: 24px; right: 24px; display: flex; align-items: center; gap: 20px; }
.video-ctrl .bar { flex: 1; height: 14px; border-radius: 7px; background: rgba(255,255,255,.3); overflow: hidden; }
.video-ctrl .bar i { display: block; height: 100%; background: var(--primary); width: 0; }
.video-start { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.35); }

/* 绘本 */
.book { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.book-page { display: flex; align-items: center; gap: 16px; }
.book-page img { height: min(58vh, 640px); border-radius: 16px; box-shadow: var(--shadow); background: #fff; }
.chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; min-height: 64px; }
.chip { padding: 10px 18px; border-radius: 16px; background: var(--card); box-shadow: var(--shadow); font-size: 34px; font-weight: 600; }
.rec-dot { position: absolute; top: 96px; left: 50%; transform: translateX(-50%); color: var(--bad); font-size: 28px; font-weight: 700; }

/* 纸面任务 */
.paper { display: flex; gap: 40px; align-items: center; }
.paper .pages { font-size: 80px; font-weight: 700; text-align: center; }
.copy-list { display: flex; flex-direction: column; gap: 14px; }
.copy-list div { font-size: 48px; font-weight: 600; display: flex; gap: 16px; align-items: center; }

/* 对比 */
.compare { display: flex; flex-direction: column; gap: 24px; }
.compare .line { display: flex; align-items: center; gap: 20px; font-size: 64px; }
.compare .line .bar { width: 360px; height: 18px; border-radius: 9px; background: var(--dim); overflow: hidden; }
.compare .line .bar i { display: block; height: 100%; width: 0; background: var(--primary); }

/* 奖励卡 */
.word-card { width: 300px; height: 380px; border-radius: var(--r); background: linear-gradient(160deg, #ffe7a8, #ffc58a);
  box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  animation: flip .8s; }
.word-card .huge-emoji { font-size: 150px; }
.word-card .big-word { font-size: 64px; }
@keyframes flip { from { transform: rotateY(90deg); } to { transform: rotateY(0); } }
.bag-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 20px; width: 100%; max-width: 900px; }
.bag-grid .word-card { width: auto; height: 200px; animation: none; }
.bag-grid .word-card .huge-emoji { font-size: 80px; }
.bag-grid .word-card .big-word { font-size: 36px; }

/* 休息 */
.rest .tree { font-size: 200px; }
.ring { font-size: 64px; font-weight: 700; color: var(--muted); }

/* 弹层 */
#overlay:empty { display: none; }
#overlay { position: fixed; inset: 0; background: rgba(40, 30, 20, .45); display: flex; align-items: center;
  justify-content: center; z-index: 50; }
.pop { background: var(--card); border-radius: var(--r); padding: 32px; min-width: 360px; display: flex;
  flex-direction: column; align-items: center; gap: 20px; position: relative; box-shadow: var(--shadow); }
.pop .close { position: absolute; top: 12px; right: 12px; }
.pop .zh { font-size: 40px; }

/* 批注 */
.anno-badge { position: fixed; left: 16px; bottom: 16px; z-index: 60; background: #6b5bd6; color: #fff;
  border-radius: 32px; padding: 14px 22px; font-size: 22px; box-shadow: var(--shadow); }
body.annotating #app * { outline: 1px dashed rgba(107, 91, 214, .35); }
.anno-pop { background: #fff; border-radius: 20px; padding: 20px; width: min(560px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.anno-pop textarea { width: 100%; height: 140px; font-size: 20px; padding: 10px; border-radius: 12px; border: 1px solid #ccc; }
.anno-pop .meta { font-size: 14px; color: var(--muted); word-break: break-all; }

/* 家长端（成人界面，可以有文字） */
.parent { position: fixed; inset: 0; background: #f6f6f8; color: #222; overflow: auto; z-index: 40;
  -webkit-user-select: text; user-select: text; font-size: 18px; }
.parent header { position: sticky; top: 0; background: #fff; display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid #e5e5ea; z-index: 2; flex-wrap: wrap; }
.parent header h1 { font-size: 20px; margin: 0 12px 0 0; }
.parent .tab { padding: 10px 16px; border-radius: 10px; background: #f0f0f3; }
.parent .tab.on { background: #222; color: #fff; }
.parent .x { margin-left: auto; font-size: 26px; width: 48px; height: 48px; }
.parent main { padding: 16px; max-width: 980px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.parent section { background: #fff; border-radius: 14px; padding: 16px; }
.parent h2 { font-size: 18px; margin: 0 0 12px; }
.parent .item { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #f0f0f3; flex-wrap: wrap; }
.parent .item:last-child { border-bottom: 0; }
.parent .item .grow { flex: 1; min-width: 200px; }
.parent .seg button { padding: 8px 14px; border-radius: 8px; background: #f0f0f3; margin-left: 4px; }
.parent .seg button.on { background: #3cb371; color: #fff; }
.parent .seg button.on.bad { background: #e5533d; }
.parent .btn { padding: 10px 16px; border-radius: 10px; background: #222; color: #fff; }
.parent .btn.light { background: #f0f0f3; color: #222; }
.parent input[type=text], .parent input[type=number], .parent textarea, .parent select {
  font: inherit; padding: 8px 10px; border: 1px solid #d0d0d6; border-radius: 8px; }
.parent textarea { width: 100%; min-height: 60px; }
.parent table { width: 100%; border-collapse: collapse; font-size: 15px; }
.parent td, .parent th { border-bottom: 1px solid #f0f0f3; padding: 6px; text-align: left; vertical-align: top; }
.parent .muted { color: #888; font-size: 14px; }
.parent .timer { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 760px) {
  .tile { width: 150px; height: 150px; font-size: 80px; }
  .primary { height: 100px; font-size: 44px; }
  .primary.round { width: 120px; height: 120px; }
  .today-card .emoji { font-size: 110px; }
}
