/* 开心拼读 V1 —— 平板优先，大按钮，少文字 */
:root {
  --blue: #4a7cff;
  --blue-dark: #3564e0;
  --green: #2fbf71;
  --red: #ff6b6b;
  --ink: #1f2433;
  --muted: #7a8296;
  --bg: #f4f7ff;
  --card: #ffffff;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; height: 100%;
  background: var(--bg); color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  overscroll-behavior: none;
}
body { display: flex; }

.screen { display: none; flex-direction: column; width: 100%; height: 100dvh; padding: 16px env(safe-area-inset-right) 16px env(safe-area-inset-left); }
.screen.active { display: flex; }

/* ---------- 首页 ---------- */
.home-top { display: flex; gap: 12px; }
.stat { flex: 1; background: var(--card); border-radius: 18px; padding: 12px; text-align: center; box-shadow: 0 2px 10px rgba(31,36,51,.06); }
.stat-num { display: block; font-size: 28px; font-weight: 700; color: var(--blue); }
.stat-label { font-size: 13px; color: var(--muted); }

.home-main { flex: 1; display: flex; flex-direction: column; justify-content: flex-start; gap: 18px; overflow-y: auto; padding: 4px 0 8px; -webkit-overflow-scrolling: touch; }
.cal { background: var(--card); border-radius: 20px; padding: 12px; box-shadow: 0 2px 10px rgba(31,36,51,.06); }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-size: 15px; margin-bottom: 8px; color: var(--muted); }
.cal-nav { width: 34px; height: 34px; border: 0; border-radius: 10px; background: #e8edfa; color: var(--blue); font-size: 18px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-w { text-align: center; font-size: 12px; color: var(--muted); }
.cal-cell {
  position: relative; height: 40px; border: 0; border-radius: 10px;
  background: var(--bg); color: var(--ink); font-size: 14px; font-family: inherit;
}
.cal-cell.empty { background: transparent; }
.cal-cell.on { background: #e6f7ee; color: #1d7a4c; font-weight: 700; }
.cal-cell.today { outline: 2px solid var(--blue); }
.cal-badge { position: absolute; top: 2px; right: 5px; font-size: 10px; font-style: normal; color: var(--green); }
.cal-detail { margin-top: 10px; font-size: 13px; line-height: 1.6; color: var(--muted); min-height: 20px; }
.card { background: var(--card); border-radius: 24px; padding: 24px; text-align: center; box-shadow: 0 6px 24px rgba(31,36,51,.08); }
.card h2 { margin: 0 0 16px; font-size: 24px; }
.plan { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }
.seg { display: flex; gap: 14px; justify-content: center; margin: 4px 0 16px; }
.seg-btn {
  flex: 1; border: 0; border-radius: 18px; background: var(--bg); padding: 14px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; font-family: inherit; color: var(--ink);
}
.seg-btn .seg-num { font-size: 34px; font-weight: 800; color: var(--blue); line-height: 1.1; }
.seg-btn .seg-label { font-size: 14px; color: var(--muted); }
.seg-btn:disabled { opacity: .45; }
.seg-btn#btn-review { background: #eef3ff; }
.plan-item { flex: 1; background: var(--bg); border-radius: 16px; padding: 14px 8px; }
.plan-num { display: block; font-size: 36px; font-weight: 800; color: var(--blue); }
.plan-item span:last-child { font-size: 14px; color: var(--muted); }
.progress { height: 10px; background: #e6ebf7; border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--green); border-radius: 999px; transition: width .3s; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 12px; }
.big-emoji { font-size: 76px; line-height: 1.1; }

.primary {
  width: 100%; border: 0; border-radius: 20px; padding: 22px;
  background: var(--blue); color: #fff; font-size: 22px; font-weight: 700;
  box-shadow: 0 6px 0 var(--blue-dark);
}
.primary:disabled { background: #b9c6e6; box-shadow: 0 6px 0 #a4b2d4; }
.primary:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--blue-dark); }

.home-foot { display: flex; justify-content: center; padding-top: 12px; }
.gear { border: 0; background: transparent; font-size: 26px; opacity: .45; display: flex; flex-direction: column; align-items: center; }
.gear-hint { font-size: 10px; color: var(--muted); }

/* ---------- 学习 ---------- */
.learn-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ghost { border: 0; background: #e8edfa; color: var(--muted); font-size: 20px; width: 44px; height: 44px; border-radius: 14px; }
.learn-meta { display: flex; align-items: center; gap: 10px; flex: 1; }
.tag { background: var(--blue); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 14px; }
.count { color: var(--muted); font-size: 15px; }
.bar { width: 100%; height: 8px; background: #e6ebf7; border-radius: 999px; overflow: hidden; margin-top: 8px; }
.bar-fill { height: 100%; background: var(--blue); border-radius: 999px; transition: width .3s; }

.step {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 18px; text-align: center;
  justify-content: center;             /* 不被支持的浏览器保持居中 */
  justify-content: safe center;        /* 内容超高时不会被裁掉顶部 */
  overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.hint { font-size: 18px; color: var(--muted); }
.big-word { font-size: 64px; font-weight: 800; letter-spacing: 2px; }
.big-word.small { font-size: 44px; }
.zh { font-size: 22px; color: var(--muted); }
.tip { font-size: 14px; color: var(--blue-dark); background: #eef3ff; padding: 6px 14px; border-radius: 12px; }
.speaker { border: 0; background: var(--card); border-radius: 18px; padding: 16px 24px; font-size: 20px; box-shadow: 0 3px 12px rgba(31,36,51,.08); }
.icon-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.icon-btn {
  border: 0; background: var(--card); border-radius: 20px; padding: 12px 22px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 30px; line-height: 1.1; box-shadow: 0 3px 12px rgba(31,36,51,.08);
}
.icon-btn span { font-size: 13px; color: var(--muted); }
.icon-btn.mic { background: #eaf0ff; }
.icon-btn:disabled { opacity: .55; }
.step-top { width: 100%; display: flex; justify-content: flex-start; }
.fab {
  width: 64px; height: 64px; border: 0; border-radius: 50%; background: var(--card);
  font-size: 28px; box-shadow: 0 4px 14px rgba(31,36,51,.14);
}
.fab:active { transform: translateY(2px); }
.rec-row { display: flex; gap: 18px; align-items: center; justify-content: center; }
.star-label { font-size: 16px; color: var(--muted); }
.star-row { display: flex; gap: 10px; }
.star {
  border: 0; background: transparent; font-size: 38px; line-height: 1;
  filter: grayscale(1); opacity: .3; transition: transform .12s, opacity .12s;
}
.star.on { filter: none; opacity: 1; transform: scale(1.12); }
.icon-btn.play { position: relative; }
.icon-btn.play { background: #eafaf1; color: var(--green); }
.rec-row .wave { display: none; align-items: center; gap: 5px; height: 46px; }
.rec-row.recording .wave { display: flex; }
.rec-row.recording .mic { background: #ffe9e9; animation: ring 1.1s infinite; }
.rec-row.recording .mic .label { color: var(--red); }
.wave i { width: 5px; height: 12px; background: var(--red); border-radius: 3px; animation: bounce .7s infinite ease-in-out; }
.wave i:nth-child(2) { animation-delay: .1s; }
.wave i:nth-child(3) { animation-delay: .2s; }
.wave i:nth-child(4) { animation-delay: .3s; }
.wave i:nth-child(5) { animation-delay: .4s; }
@keyframes bounce { 0%, 100% { height: 10px; } 50% { height: 36px; } }
@keyframes ring { 0% { box-shadow: 0 0 0 0 rgba(255,107,107,.45); } 100% { box-shadow: 0 0 0 16px rgba(255,107,107,0); } }
.hidden { display: none !important; }

.tiles { display: flex; gap: 12px; }
.tile {
  min-width: 74px; height: 86px; display: flex; align-items: center; justify-content: center;
  background: var(--card); border-radius: 18px; font-size: 42px; font-weight: 800;
  box-shadow: 0 4px 14px rgba(31,36,51,.08); transition: transform .15s, color .15s;
}
.tile.lit { transform: translateY(-10px) scale(1.06); color: var(--blue); }
.tiles.big .tile { min-width: 86px; height: 100px; font-size: 52px; }

.slots, .pool { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.slot {
  width: 74px; height: 86px; border-radius: 18px; border: 3px dashed #c3cfea;
  display: flex; align-items: center; justify-content: center; font-size: 40px; font-weight: 800; background: #fff;
}
.slot.filled { border-style: solid; border-color: var(--blue); color: var(--blue); }
.slot { transition: background .2s, border-color .2s; }
.slots.ok .slot { border-color: var(--green); color: var(--green); background: #eafaf1; }
.slots.no .slot { border-color: var(--red); background: #fff0f0; animation: shake .3s; }
.pool-tile {
  width: 74px; height: 86px; border: 0; border-radius: 18px; background: #ffe9a8;
  font-size: 40px; font-weight: 800; color: #6b5200; box-shadow: 0 4px 0 #e8cf7c;
}
.pool-tile:active { transform: translateY(2px); box-shadow: 0 2px 0 #e8cf7c; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

.options { display: flex; flex-direction: column; gap: 14px; width: min(560px, 100%); }
.option {
  border: 0; border-radius: 18px; background: var(--card); padding: 22px;
  font-size: 34px; font-weight: 800; color: var(--ink); box-shadow: 0 4px 14px rgba(31,36,51,.08);
}
.option.ok { background: #eafaf1; color: var(--green); }
.option.no { background: #fff0f0; color: var(--red); }

.learn-foot { padding-top: 12px; }

/* ---------- 完成 ---------- */
.done-main { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; text-align: center; }
.done-stats { display: flex; gap: 14px; width: 100%; }
.done-item { flex: 1; background: var(--card); border-radius: 18px; padding: 16px 8px; box-shadow: 0 2px 10px rgba(31,36,51,.06); }
.done-num { display: block; font-size: 32px; font-weight: 800; color: var(--blue); }
.done-item span:last-child { font-size: 13px; color: var(--muted); }

/* ---------- 家长页 ---------- */
.parent-title { font-size: 20px; margin: 0; }
.parent-main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; padding-bottom: 24px; }
.row {
  background: var(--card); border-radius: 16px; padding: 16px;
  display: flex; align-items: center; justify-content: space-between; font-size: 17px;
}
.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button { width: 44px; height: 44px; border: 0; border-radius: 14px; background: #e8edfa; font-size: 22px; color: var(--blue); }
.speed-group { display: flex; gap: 6px; }
.speed-btn {
  border: 0; border-radius: 12px; background: #e8edfa; color: var(--muted);
  padding: 10px 10px; font-size: 14px; font-family: inherit; min-width: 52px;
}
.speed-btn.on { background: var(--blue); color: #fff; font-weight: 700; }
.step-num { font-size: 22px; font-weight: 700; min-width: 28px; text-align: center; }
input[type="checkbox"] { width: 30px; height: 30px; }
.parent-sub { margin: 14px 4px 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.wrap-right { max-width: 60%; text-align: right; color: var(--muted); }
.secondary {
  border: 0; border-radius: 16px; background: var(--card); padding: 16px;
  font-size: 17px; color: var(--blue); font-weight: 600; box-shadow: 0 2px 10px rgba(31,36,51,.06); text-align: center;
}
.file-label { display: block; position: relative; overflow: hidden; }
.file-label input { position: absolute; inset: 0; opacity: 0; }
@media (min-width: 700px) {
  .screen { max-width: 760px; margin: 0 auto; }
}
