/* ==========================================================
   朗读小助手 —— 移动端样式
   设计基调：温暖、清晰、不花哨；家长单手可用
   ========================================================== */

:root {
  --brand: #2f7cf6;
  --brand-dark: #1e5fd0;
  --brand-light: #e8f1ff;
  --ok: #16a34a;
  --ok-bg: #e7f8ed;
  --near: #0891b2;
  --near-bg: #e0f7fb;
  --warn: #d97706;
  --warn-bg: #fff5e5;
  --bad: #dc2626;
  --bad-bg: #fdeaea;
  --ink: #1a2233;
  --ink-2: #5a6577;
  --ink-3: #93a0b4;
  --line: #e6eaf1;
  --bg: #f4f6fa;
  --card: #ffffff;
  --r: 14px;
  --r-lg: 20px;
  --shadow: 0 2px 10px rgba(28, 45, 82, .06);
  --shadow-lg: 0 8px 28px rgba(28, 45, 82, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; }

/* ============ 顶部栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 6px;
  padding: 12px 14px calc(12px + env(safe-area-inset-top, 0px) * 0) ;
  padding-top: calc(12px + env(safe-area-inset-top, 0px));
  background: rgba(244, 246, 250, .92);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.tb-title { flex: 1; margin: 0; font-size: 18px; font-weight: 700; letter-spacing: .3px; text-align: center; }
.tb-btn {
  width: 38px; height: 38px; border: none; background: transparent;
  font-size: 22px; color: var(--ink-2); cursor: pointer; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}
.tb-btn:active { background: #e9edf5; }
.tb-btn:disabled { opacity: 0; pointer-events: none; }

/* ============ 页面切换 ============ */
.page { display: none; padding: 6px 14px 40px; }
.page.active { display: block; animation: fadeUp .26s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ============ 首页问候卡 ============ */
.hello-card {
  display: flex; align-items: center; gap: 14px;
  background: linear-gradient(135deg, #2f7cf6, #5b9bff);
  color: #fff; border-radius: var(--r-lg); padding: 20px 18px;
  box-shadow: 0 6px 20px rgba(47, 124, 246, .25);
}
.hello-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.hello-sub { font-size: 13px; opacity: .9; line-height: 1.5; }

/* ============ 统计条 ============ */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.stat-item {
  background: var(--card); border-radius: var(--r); padding: 12px 6px;
  text-align: center; box-shadow: var(--shadow);
}
.stat-num { font-size: 20px; font-weight: 800; color: var(--brand); line-height: 1.1; }
.stat-num.green { color: var(--ok); }
.stat-num.orange { color: var(--warn); }
.stat-lbl { font-size: 11px; color: var(--ink-3); margin-top: 4px; }

/* ============ 区块标题 ============ */
.sec-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 22px 2px 10px; font-size: 14px; font-weight: 700; color: var(--ink);
}
.link-btn {
  background: none; border: none; color: var(--brand); font-size: 13px;
  cursor: pointer; padding: 4px 2px; font-family: inherit;
}
.link-btn.danger { color: var(--bad); }

/* ============ 年级筛选 ============ */
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 15px; border-radius: 999px; font-size: 13px;
  background: #fff; color: var(--ink-2); border: 1px solid var(--line);
  cursor: pointer; font-family: inherit; white-space: nowrap; transition: all .16s;
}
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 600; }

/* ============ 课文列表 ============ */
.text-list, .recent-list, .hist-list, .cust-list, .err-list { display: flex; flex-direction: column; gap: 10px; }
.text-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--r); padding: 14px 15px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform .12s;
}
.text-item:active { transform: scale(.985); }
.ti-badge {
  flex: 0 0 auto; width: 42px; height: 42px; border-radius: 12px;
  background: var(--brand-light); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; line-height: 1.15; text-align: center; padding: 2px;
}
.ti-main { flex: 1; min-width: 0; }
.ti-title { font-size: 15px; font-weight: 650; margin-bottom: 3px; }
.ti-preview {
  font-size: 12px; color: var(--ink-3); overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}
.ti-right { flex: 0 0 auto; text-align: right; }
.ti-score { font-size: 15px; font-weight: 800; color: var(--brand); }
.ti-times { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

/* ============ 最近朗读 ============ */
.rec-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: var(--r); padding: 13px 15px;
  box-shadow: var(--shadow); cursor: pointer;
}
.rec-score {
  flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800;
}
.rec-main { flex: 1; min-width: 0; }
.rec-title { font-size: 14px; font-weight: 650; margin-bottom: 3px; }
.rec-meta { font-size: 11.5px; color: var(--ink-3); }
.rec-errs { flex: 0 0 auto; font-size: 11.5px; }

/* ============ 朗读页 ============ */
.read-head { padding: 12px 4px 10px; }
.read-title { font-size: 20px; font-weight: 750; }
.read-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }

.live-box {
  background: var(--card); border-radius: var(--r); padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 14px;
  border: 2px solid transparent; transition: border-color .25s;
}
.live-box.recording { border-color: #ffd0d0; }
.live-label { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-3); margin-bottom: 9px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: 0 0 auto; }
.dot.on { background: var(--bad); animation: pulse 1.1s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: .45; transform: scale(.82); } }
.live-text { font-size: 15.5px; line-height: 1.75; color: var(--ink-2); word-break: break-word; min-height: 26px; }
.live-text.has { color: var(--ink); }

.oral-sec-head { font-size: 13px; font-weight: 700; color: var(--ink-2); margin: 4px 2px 8px; }
.ref-box {
  background: var(--card); border-radius: var(--r); padding: 16px;
  box-shadow: var(--shadow); font-size: 19px; line-height: 2.1;
  letter-spacing: .5px; color: var(--ink); word-break: break-word;
}
.ref-box .py { font-size: 10px; color: var(--ink-3); display: block; line-height: 1; margin-bottom: 1px; }
.ref-box .ch { display: inline-block; }
.ref-box .ch.now { background: var(--brand-light); border-radius: 5px; }
.ref-box .ch.good { color: var(--ok); }
.ref-box .ch.near { color: var(--near); }
.ref-box .ch.bad { color: var(--bad); background: var(--bad-bg); border-radius: 5px; text-decoration: underline wavy var(--bad); }
.ref-box .ch.miss { color: var(--warn); background: var(--warn-bg); border-radius: 5px; border-bottom: 2px dashed var(--warn); }

/* ============ 录音控制 ============ */
.ctrl-bar {
  position: sticky; bottom: 0; margin-top: 18px; padding: 12px 0 calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 65%, rgba(244,246,250,0));
}
.btn-record {
  width: 100%; border: none; border-radius: 16px; padding: 17px;
  background: linear-gradient(135deg, #2f7cf6, #5b9bff); color: #fff;
  font-size: 17px; font-weight: 700; font-family: inherit; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  box-shadow: 0 6px 18px rgba(47,124,246,.3); transition: all .18s;
}
.btn-record:active { transform: scale(.98); }
.btn-record.recording { background: linear-gradient(135deg, #ef4444, #f87171); box-shadow: 0 6px 18px rgba(239,68,68,.32); }
.btn-record:disabled { opacity: .55; box-shadow: none; }
.rec-icon { font-size: 20px; }
.ctrl-row { display: flex; gap: 10px; margin-top: 10px; }
.btn-ghost {
  flex: 1; padding: 12px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); font-size: 14px; font-family: inherit;
  cursor: pointer; font-weight: 600;
}
.btn-ghost:active { background: #f0f3f8; }
.btn-ghost.wide { width: 100%; margin-top: 10px; }
.btn-primary {
  padding: 14px 22px; border: none; border-radius: 12px;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 700;
  font-family: inherit; cursor: pointer;
}
.btn-primary:active { background: var(--brand-dark); }
.btn-primary.wide { width: 100%; }

/* ============ 结果页 ============ */
.score-card {
  background: var(--card); border-radius: var(--r-lg); padding: 22px 18px;
  box-shadow: var(--shadow-lg); text-align: center; margin-top: 8px;
}
.sc-emoji { font-size: 44px; line-height: 1; }
.sc-points { font-size: 46px; font-weight: 850; line-height: 1.1; margin-top: 6px; letter-spacing: -1px; }
.sc-points .u { font-size: 17px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.sc-level { display: inline-block; margin-top: 8px; padding: 4px 14px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.sc-desc { font-size: 14px; color: var(--ink-2); margin-top: 11px; line-height: 1.55; }
.sc-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.sc-m { text-align: center; }
.sc-m-num { font-size: 17px; font-weight: 750; }
.sc-m-lbl { font-size: 11px; color: var(--ink-3); margin-top: 3px; }

/* 比对结果展示 */
.compare-box {
  background: var(--card); border-radius: var(--r); padding: 16px;
  box-shadow: var(--shadow); font-size: 18px; line-height: 2.15;
  letter-spacing: .4px; word-break: break-word;
}
.compare-box .ch { display: inline-block; padding: 0 1px; border-radius: 4px; }
.compare-box .ch.good { color: var(--ok); }
.compare-box .ch.near { color: var(--near); border-bottom: 1.5px dotted var(--near); }
.compare-box .ch.bad {
  color: #fff; background: var(--bad); border-radius: 5px; padding: 0 3px;
  position: relative;
}
.compare-box .ch.miss {
  color: var(--warn); background: var(--warn-bg); border-radius: 5px; padding: 0 3px;
  border-bottom: 2px dashed var(--warn);
}
.compare-box .heard {
  font-size: 11px; color: var(--bad); vertical-align: super;
  margin-left: 1px; font-weight: 700;
}
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin: 10px 2px 0; font-size: 11.5px; color: var(--ink-3); }
.lg { display: flex; align-items: center; gap: 5px; }
.lg-i { width: 12px; height: 12px; border-radius: 4px; flex: 0 0 auto; }

/* ============ 错误清单 ============ */
.err-count { font-size: 12px; color: var(--ink-3); font-weight: 500; }
.err-item {
  background: var(--card); border-radius: var(--r); padding: 13px 15px;
  box-shadow: var(--shadow); display: flex; gap: 12px; align-items: flex-start;
  border-left: 4px solid var(--bad);
}
.err-item.omit { border-left-color: var(--warn); }
.err-item.extra { border-left-color: var(--ink-3); }
.err-no {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--bad-bg); color: var(--bad); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.err-item.omit .err-no { background: var(--warn-bg); color: var(--warn); }
.err-item.extra .err-no { background: #eef1f6; color: var(--ink-2); }
.err-body { flex: 1; min-width: 0; }
.err-tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; padding: 2px 7px;
  border-radius: 5px; background: var(--bad-bg); color: var(--bad); margin-bottom: 5px;
}
.err-item.omit .err-tag { background: var(--warn-bg); color: var(--warn); }
.err-item.extra .err-tag { background: #eef1f6; color: var(--ink-2); }
.err-words { font-size: 14.5px; font-weight: 650; margin-bottom: 4px; }
.err-words .q { color: var(--bad); font-size: 16px; }
.err-words .a { color: var(--ink-3); }
.err-hint { font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.err-sent { font-size: 11.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.6; }
.err-sent .hl { color: var(--brand); font-weight: 650; }
.empty-tip {
  text-align: center; padding: 30px 20px; color: var(--ink-3); font-size: 13.5px;
  background: var(--card); border-radius: var(--r); box-shadow: var(--shadow);
}
.result-actions { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }

/* ============ 历史页 ============ */
.hist-summary {
  background: linear-gradient(135deg, #2f7cf6, #5b9bff); color: #fff;
  border-radius: var(--r-lg); padding: 18px; box-shadow: 0 6px 20px rgba(47,124,246,.22);
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; text-align: center;
  margin-top: 8px;
}
.hs-num { font-size: 20px; font-weight: 800; }
.hs-lbl { font-size: 11px; opacity: .88; margin-top: 3px; }

.trend-box, .freq-box { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.freq-list { display: flex; flex-wrap: wrap; gap: 8px; }
.freq-chip {
  display: flex; align-items: center; gap: 6px; padding: 7px 12px;
  background: var(--bad-bg); border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--bad);
}
.freq-chip .n { font-size: 11px; background: var(--bad); color: #fff; border-radius: 999px; padding: 1px 6px; font-weight: 700; }

.hist-item {
  background: var(--card); border-radius: var(--r); padding: 13px 15px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px; cursor: pointer;
}
.hist-main { flex: 1; min-width: 0; }
.hist-title { font-size: 14px; font-weight: 650; margin-bottom: 3px; }
.hist-meta { font-size: 11.5px; color: var(--ink-3); }
.hist-del {
  flex: 0 0 auto; border: none; background: transparent; color: var(--ink-3);
  font-size: 17px; padding: 6px; cursor: pointer; border-radius: 8px;
}
.hist-del:active { background: var(--bad-bg); color: var(--bad); }
/* 编辑按钮复用删除按钮的形制，只换激活色 */
.hist-edit:active { background: #e8f0fb; color: var(--brand); }
.form-box .chips { padding: 0 0 10px; }

/* ============ 表单 ============ */
.form-box { background: var(--card); border-radius: var(--r); padding: 15px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 11px; }
.inp {
  width: 100%; padding: 13px 14px; border: 1.5px solid var(--line); border-radius: 11px;
  font-size: 15px; font-family: inherit; color: var(--ink); background: #fbfcfe;
  transition: border-color .18s; outline: none;
}
.inp:focus { border-color: var(--brand); background: #fff; }
.inp.ta { resize: vertical; line-height: 1.65; font-size: 15px; }

/* ============ 弹层 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20,28,44,.42); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px);
}
.modal-mask.show { display: flex; animation: fadeIn .18s; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--r-lg); padding: 22px; width: 100%;
  max-width: 430px; box-shadow: var(--shadow-lg); animation: popIn .22s;
  max-height: 88vh; overflow-y: auto;
}
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(10px); } to { opacity: 1; transform: none; } }
.modal-title { font-size: 17px; font-weight: 750; margin-bottom: 8px; }
.modal-sub { font-size: 12.5px; color: var(--ink-3); line-height: 1.6; margin-bottom: 14px; }
.modal-btns { display: flex; gap: 10px; margin-top: 16px; }
.modal-btns .btn-ghost, .modal-btns .btn-primary { flex: 1; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 650; color: var(--ink-2); margin-bottom: 7px; }
.switch-row { display: flex; align-items: center; justify-content: space-between; }
.switch-row label { margin: 0; }
.sw { width: 22px; height: 22px; accent-color: var(--brand); }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: rgba(26,34,51,.92); color: #fff; padding: 11px 20px; border-radius: 12px;
  font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .26s; z-index: 200;
  max-width: 82vw; text-align: center; line-height: 1.5;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 全局计时器（固定在 tabbar 上方，任意页面可见） ============ */
.gtimer {
  position: fixed; right: 14px; bottom: 96px; z-index: 70;
  display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 12px;
  border-radius: 999px; background: rgba(255,255,255,.94); border: 2px solid #e4ece8;
  box-shadow: 0 6px 0 rgba(43,77,78,.08), 0 12px 20px rgba(38,72,74,.14);
  backdrop-filter: blur(6px); transition: transform .16s, background .2s;
}
.gtimer:active { transform: translateY(2px); }
.gtimer-main { display: flex; align-items: center; gap: 7px; padding: 0; border: 0; background: none; font: inherit; color: var(--brand-dark); cursor: pointer; }
.gtimer-icon { font-size: 15px; line-height: 1; }
.gtimer-time { font-size: 15px; font-weight: 850; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
/* 计时中：暖色高亮 + 呼吸感，扫一眼就知道还在走 */
.gtimer.on { background: linear-gradient(135deg, #fff8ea, #ffeccd); border-color: #f3dcae; }
.gtimer.on .gtimer-time { color: #8a5a12; }
.gtimer.on .gtimer-icon { animation: gtPulse 1.6s ease-in-out infinite; }
/* 手动暂停 / 切走 App 后：降一点饱和度，别让人误以为还在计时 */
.gtimer.paused { background: rgba(246,248,247,.95); border-color: #e2e8e5; }
.gtimer.paused .gtimer-icon, .gtimer.paused .gtimer-time { color: #6d7f7a; }
.gtimer-done { width: 30px; height: 30px; border: 0; border-radius: 50%; background: var(--brand); color: #fff; font: 800 15px/1 inherit; cursor: pointer; }
.gtimer-done[hidden] { display: none !important; }
@keyframes gtPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
@media (max-width: 390px) { .gtimer { right: 10px; bottom: 90px; padding: 6px 7px 6px 10px; } .gtimer-time { font-size: 14px; } }
@media (prefers-reduced-motion: reduce) { .gtimer.on .gtimer-icon { animation: none !important; } }

/* ============ 自动生成的封面（无图课文 / 小故事） ============ */
/* 主题 emoji + 由 id 稳定推导的渐变，纯 CSS 渲染，不请求任何网络资源 */
.cover {
  position: relative; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(150deg, var(--c1), var(--c2));
  border: 2px solid rgba(255, 255, 255, .9); border-radius: 12px;
  box-shadow: 0 4px 9px rgba(31, 60, 72, .15);
}
.cover-emoji { font-size: 26px; line-height: 1; filter: drop-shadow(0 2px 2px rgba(24, 46, 56, .18)); }
.cover-grade {
  position: absolute; right: 3px; bottom: 3px; padding: 1px 5px; border-radius: 7px;
  background: rgba(255, 255, 255, .84); color: #2c5b52; font-size: 9px; font-weight: 850;
}
/* 小故事卡上的小方块 */
.cover-sm { flex: 0 0 34px; width: 34px; height: 34px; border-radius: 11px; }
.cover-sm .cover-emoji { font-size: 18px; }

/* ============ 趋势图 ============ */
.trend-svg { width: 100%; height: auto; display: block; }
.trend-empty { text-align: center; color: var(--ink-3); font-size: 13px; padding: 22px 0; }

@media (max-width: 360px) {
  .stat-row { grid-template-columns: repeat(2, 1fr); }
  .sc-metrics { grid-template-columns: repeat(3, 1fr); }
}

/* ==========================================================
   课外阅读模块
   ========================================================== */

/* ============ 底部主导航 ============ */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 0; width: 100%; max-width: 560px; z-index: 60;
  display: flex; background: rgba(255,255,255,.96);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  flex: 1; border: none; background: transparent; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 9px; font-family: inherit; color: var(--ink-3);
  transition: color .15s;
}
.tab-i { font-size: 19px; line-height: 1; filter: grayscale(1) opacity(.55); transition: filter .15s; }
.tab-t { font-size: 10.5px; font-weight: 600; }
.tab.on { color: var(--brand); }
.tab.on .tab-i { filter: none; }
body { padding-bottom: 62px; }
.page { padding-bottom: 30px; }
.ctrl-bar { bottom: 62px; }

/* ============ 今日进度环 ============ */
.ring-card {
  background: var(--card); border-radius: var(--r-lg); padding: 18px;
  box-shadow: var(--shadow); margin-top: 8px;
  display: flex; align-items: center; gap: 16px;
}
.ring-svg { width: 96px; height: 96px; flex: 0 0 auto; }
.ring-info { flex: 1; min-width: 0; }
.ring-big { font-size: 26px; font-weight: 800; line-height: 1.1; }
.ring-big .u { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.ring-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; line-height: 1.5; }
.ring-badge {
  display: inline-block; margin-top: 8px; padding: 4px 11px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700;
}
.ring-badge.done { background: var(--ok-bg); color: var(--ok); }
.ring-badge.todo { background: var(--warn-bg); color: var(--warn); }
.ring-streak {
  font-size: 11.5px; color: var(--ink-3); margin-top: 8px;
}
.ring-streak b { color: var(--bad); font-size: 13px; }

/* ============ 快捷按钮 ============ */
.quick-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; margin-top: 14px; }
.quick-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: var(--r);
  padding: 14px 6px; display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; font-family: inherit; box-shadow: var(--shadow); transition: transform .12s;
}
.quick-btn:active { transform: scale(.97); }
.quick-btn.primary { background: var(--brand); border-color: var(--brand); }
.qb-i { font-size: 21px; line-height: 1; }
.qb-t { font-size: 11.5px; font-weight: 650; color: var(--ink-2); }
.quick-btn.primary .qb-t { color: #fff; }

/* ============ 书架 ============ */
.book-list { display: flex; flex-direction: column; gap: 10px; }
.book-item {
  display: flex; gap: 12px; background: var(--card); border-radius: var(--r);
  padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; transition: transform .12s;
}
.book-item:active { transform: scale(.985); }
.book-cover {
  flex: 0 0 auto; width: 44px; height: 60px; border-radius: 7px; overflow: hidden;
  background: linear-gradient(135deg, #dbe8ff, #eef4ff); display: flex;
  align-items: center; justify-content: center; font-size: 20px;
}
.book-cover img { width: 100%; height: 100%; object-fit: cover; }
.book-main { flex: 1; min-width: 0; }
.book-title { font-size: 14.5px; font-weight: 650; margin-bottom: 3px; }
.book-meta { font-size: 11.5px; color: var(--ink-3); margin-bottom: 7px; }
.book-bar { height: 5px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.book-bar i { display: block; height: 100%; border-radius: 99px; background: var(--brand); }
.book-prog { font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }
.book-tag {
  display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px;
  border-radius: 4px; background: var(--ok-bg); color: var(--ok); margin-left: 6px;
}
.book-del {
  flex: 0 0 auto; align-self: flex-start; border: none; background: transparent;
  color: var(--ink-3); font-size: 16px; padding: 4px 6px; cursor: pointer; border-radius: 8px;
}

/* ============ 阅读记录条目 ============ */
.session-list { display: flex; flex-direction: column; gap: 9px; }
.session-item {
  display: flex; align-items: center; gap: 12px; background: var(--card);
  border-radius: var(--r); padding: 12px 14px; box-shadow: var(--shadow);
}
.ss-min {
  flex: 0 0 auto; min-width: 50px; text-align: center;
  background: var(--brand-light); border-radius: 10px; padding: 7px 6px;
}
.ss-min b { font-size: 16px; font-weight: 800; color: var(--brand); }
.ss-min span { font-size: 10px; color: var(--ink-3); display: block; }
.ss-main { flex: 1; min-width: 0; }
.ss-title { font-size: 13.5px; font-weight: 650; margin-bottom: 3px; }
.ss-meta { font-size: 11px; color: var(--ink-3); }
.ss-src {
  display: inline-block; font-size: 9.5px; font-weight: 700; padding: 1px 5px;
  border-radius: 4px; background: #eef1f6; color: var(--ink-2); margin-left: 5px;
}
.ss-src.timer { background: var(--ok-bg); color: var(--ok); }
.ss-src.photo { background: #f3ebff; color: #7c3aed; }

/* ============ 周打卡 ============ */
.week-box { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.week-row { display: flex; justify-content: space-between; gap: 6px; }
.week-day { flex: 1; text-align: center; }
.week-dot {
  width: 100%; aspect-ratio: 1; max-width: 40px; margin: 0 auto;
  border-radius: 11px; background: #eef1f6; display: flex;
  align-items: center; justify-content: center; font-size: 11px;
  font-weight: 700; color: var(--ink-3); position: relative; overflow: hidden;
}
.week-dot .fill {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--brand); opacity: .22;
}
.week-dot.partial { color: var(--brand); }
.week-dot.done { background: var(--brand); color: #fff; }
.week-dot.done .fill { display: none; }
.week-dot.today { box-shadow: 0 0 0 2px var(--brand-light), 0 0 0 3px var(--brand); }
.week-lbl { font-size: 10px; color: var(--ink-3); margin-top: 5px; }
.week-num { font-size: 10px; color: var(--ink-3); margin-top: 2px; position: relative; z-index: 1; }

/* ============ 计时页 ============ */
.timer-wrap { text-align: center; padding: 18px 6px 10px; }
.timer-book { font-size: 17px; font-weight: 700; }
.timer-ring { margin: 22px auto 14px; width: 216px; height: 216px; position: relative; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-face {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.timer-time { font-size: 42px; font-weight: 800; letter-spacing: -1px; font-variant-numeric: tabular-nums; }
.timer-time .s { font-size: 18px; color: var(--ink-3); }
.timer-status { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.timer-meta { font-size: 13px; color: var(--ink-2); margin-bottom: 20px; }
.timer-meta b { color: var(--brand); }
.timer-ctrl { max-width: 340px; margin: 0 auto; }
.timer-tip {
  font-size: 12px; color: var(--ink-3); line-height: 1.7;
  margin-top: 20px; padding: 0 14px; text-align: left;
  background: var(--card); border-radius: var(--r); padding: 13px 15px;
  box-shadow: var(--shadow);
}

/* ============ 打卡日历 ============ */
.cal-box { background: var(--card); border-radius: var(--r); padding: 16px; box-shadow: var(--shadow); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.cal-month { font-size: 13.5px; font-weight: 700; }
.cal-nav { border: none; background: transparent; color: var(--brand); font-size: 16px; cursor: pointer; padding: 4px 9px; border-radius: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal-wd { font-size: 10.5px; color: var(--ink-3); text-align: center; padding: 3px 0; font-weight: 600; }
.cal-cell {
  aspect-ratio: 1; border-radius: 8px; background: #f4f6fa;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 11px; color: var(--ink-3); position: relative; overflow: hidden;
}
.cal-cell.empty { background: transparent; }
.cal-cell .cf { position: absolute; left: 0; right: 0; bottom: 0; background: var(--brand); opacity: .2; }
.cal-cell.has { color: var(--brand); font-weight: 650; }
.cal-cell.done { background: var(--brand); color: #fff; font-weight: 700; }
.cal-cell.done .cf { display: none; }
.cal-cell.today { box-shadow: inset 0 0 0 1.5px var(--brand); }
.cal-cell .cn { position: relative; z-index: 1; line-height: 1.15; }
.cal-cell .cm { position: relative; z-index: 1; font-size: 8.5px; opacity: .85; line-height: 1; }
.cal-legend { display: flex; gap: 12px; margin-top: 12px; font-size: 10.5px; color: var(--ink-3); }

/* ============ 拍照 ============ */
.photo-row { display: flex; gap: 11px; align-items: center; }
.photo-btn {
  flex: 1; border: 1.5px dashed #b8cdf3; background: var(--brand-light);
  border-radius: 11px; padding: 14px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 8px;
}
.pb-i { font-size: 18px; }
.pb-t { font-size: 13.5px; font-weight: 650; color: var(--brand); }
.cover-preview { flex: 0 0 auto; width: 56px; height: 74px; border-radius: 8px; overflow: hidden; display: none; }
.cover-preview img { width: 100%; height: 100%; object-fit: cover; }
.cover-preview.show { display: block; }

.cam-stage {
  position: relative; width: 100%; aspect-ratio: 3/4; max-height: 46vh;
  background: #eef1f6; border-radius: var(--r); overflow: hidden; margin-bottom: 11px;
}
.cam-video, .cam-shot { width: 100%; height: 100%; object-fit: cover; display: block; }
.cam-video { display: none; }
.cam-stage.live .cam-video { display: block; }
.cam-stage.live .cam-shot { display: none; }
.cam-stage:not(.live) .cam-shot:not([src]) { display: none; }
.cam-frame {
  position: absolute; inset: 12% 8%; border-radius: 10px;
  border: 2px dashed rgba(47,124,246,.6); pointer-events: none; display: none;
}
.cam-stage.live .cam-frame { display: block; }
.photo-status {
  font-size: 12px; color: var(--ink-3); text-align: center;
  padding: 9px 10px; background: #f7f9fc; border-radius: 10px; margin-bottom: 11px;
  line-height: 1.55;
}
.photo-status.err { background: var(--warn-bg); color: var(--warn); }
.photo-status.ok { background: var(--ok-bg); color: var(--ok); }
.photo-actions { display: flex; gap: 9px; margin-bottom: 12px; }
.photo-actions .btn-primary, .photo-actions .btn-ghost { flex: 1; }
.ocr-result { border-top: 1px solid var(--line); padding-top: 13px; display: flex; flex-direction: column; gap: 9px; }
.ocr-label { font-size: 12px; font-weight: 650; color: var(--ink-2); }
.ocr-cands { display: flex; flex-wrap: wrap; gap: 7px; }
.ocr-cand {
  padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line);
  background: #fbfcfe; font-size: 12.5px; cursor: pointer; font-family: inherit;
  color: var(--ink-2);
}
.ocr-cand.on { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 650; }

.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.pick-item {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px;
  border: 1.5px solid var(--line); border-radius: var(--r); cursor: pointer; background: #fbfcfe;
}
.pick-item.on { border-color: var(--brand); background: var(--brand-light); }
.pick-i { font-size: 19px; }
.pick-t { flex: 1; min-width: 0; }
.pick-name { font-size: 14px; font-weight: 650; }
.pick-sub { font-size: 11px; color: var(--ink-3); margin-top: 2px; }

.inp-row { display: flex; gap: 9px; }
.inp-row .inp { flex: 1; }
.min-chips { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.min-chip {
  padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: #fbfcfe; font-size: 12.5px; cursor: pointer; font-family: inherit;
  color: var(--ink-2); font-weight: 600;
}
.min-chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }
select.inp { appearance: none; background-image: none; }

.timer-face { z-index: 1; }

/* 聪明小阿睿：温暖的绘本式个人阅读空间 */
:root {
  --brand: #185c81;
  --brand-dark: #123f5a;
  --brand-light: #e6f3f3;
  --ink: #20333c;
  --ink-2: #58717b;
  --ink-3: #8c9ea1;
  --line: #e5e7df;
  --bg: #f9f6ed;
  --card: #fffdf7;
  --r: 17px;
  --r-lg: 25px;
  --shadow: 0 5px 20px rgba(42, 75, 71, .07);
}
html, body { background: #e9e4d5; }
#app { background: linear-gradient(180deg, #f8f4e8 0%, #f8f6ef 520px, #f9f6ed 100%); box-shadow: 0 0 45px rgba(46, 59, 54, .09); }
.topbar { background: rgba(249, 246, 237, .92); }
.tb-title { color: var(--brand-dark); font-weight: 800; letter-spacing: 1px; }
.hello-card {
  position: relative; min-height: 242px; overflow: hidden;
  margin-top: 9px; padding: 25px 20px 78px;   /* 底部留出任务条的高度 */
  background: radial-gradient(circle at 85% 4%, #f9e5b1 0%, transparent 36%), linear-gradient(120deg, #ddf0e9, #eef3dd 66%, #fbeaca);
  color: var(--brand-dark); border: 1px solid #d9e9d9;
  box-shadow: 0 12px 28px rgba(65, 111, 96, .12);
}
.hello-card::after { content: '✦'; position: absolute; right: 12px; top: 8px; color: #e8b95d; font-size: 24px; }
.hero-copy { position: relative; z-index: 2; width: 62%; display: flex; flex-direction: column; align-items: flex-start; }
.hero-kicker { padding: 5px 9px; border-radius: 999px; background: rgba(255,255,255,.66); color: #417c72; font-size: 10px; font-weight: 800; letter-spacing: .5px; white-space: nowrap; }
.hello-title { margin: 22px 0 8px; font-size: clamp(21px, 5.7vw, 28px); line-height: 1.36; font-weight: 850; letter-spacing: -.5px; }
.hello-sub { max-width: 205px; color: #526b64; font-size: 12px; font-weight: 600; opacity: 1; }
/* 连续打卡徽章：整张卡的视觉锚点，暖橙渐变 + 硬投影，和绿色卡片形成对比 */
.streak-badge {
  display: inline-flex; align-items: center; gap: 7px;
  margin-top: 15px; padding: 8px 15px 8px 11px; border-radius: 999px;
  background: linear-gradient(135deg, #ffb648, #ff8a3d); color: #5a2c07;
  box-shadow: 0 5px 0 #d9741f, 0 10px 16px rgba(196, 109, 32, .26);
  animation: streakPop .52s cubic-bezier(.2, 1.5, .4, 1) both;
}
.streak-flame { font-size: 17px; line-height: 1; animation: flameFlicker 2.6s ease-in-out infinite; }
.streak-num { font-size: 25px; font-weight: 900; line-height: 1; letter-spacing: -.5px; color: #fff; text-shadow: 0 2px 0 #cf6d1c; }
.streak-unit { margin-left: -3px; font-size: 12px; font-weight: 850; }
.streak-lbl { font-size: 11.5px; font-weight: 850; letter-spacing: .3px; }
/* 还没开始打卡：不显示"0"，换成安静的灰底＋一句鼓励 */
.streak-badge.empty { background: #eef3ef; color: #6b8378; box-shadow: 0 4px 0 #d6e2d9; animation: none; }
.streak-badge.empty .streak-num, .streak-badge.empty .streak-unit { display: none; }
.streak-badge.empty .streak-flame { filter: grayscale(.75); animation: none; }

/* 今日任务条：贴在卡片底部，和上方内容分层 */
.quest-strip {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  display: flex; align-items: center; gap: 8px; padding: 12px 19px;
  background: rgba(255, 255, 255, .74); border-top: 1px solid rgba(255, 255, 255, .85);
  color: #2b5b52; font-size: 12px; font-weight: 750; line-height: 1.4;
}
.quest-strip.done { background: linear-gradient(90deg, rgba(211, 243, 228, .95), rgba(255, 250, 227, .95)); color: #1d5c46; }
.quest-icon { flex: 0 0 auto; font-size: 14px; }

@keyframes streakPop { from { opacity: 0; transform: scale(.62) rotate(-7deg); } to { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes flameFlicker { 0%, 100% { transform: scale(1) rotate(-3deg); } 50% { transform: scale(1.13) rotate(3deg); } }
/* 人物插画：2:3 竖图（1024x1536），卡片是矮宽的，所以由高度决定尺寸并整体收进卡内。
   宽高都显式给值（115*1.5=172.5 等），保证元素框就等于图片框，不依赖 width:auto 的比例解析 */
.hero-character { position: absolute; z-index: 1; right: 6px; bottom: 68px; width: 152px; height: 228px; object-fit: contain; object-position: bottom right; filter: drop-shadow(0 12px 14px rgba(61, 81, 68, .13)); }
.reader-welcome { position: relative; display: flex; align-items: center; gap: 12px; min-height: 76px; margin: 9px 0 13px; padding: 10px 13px; overflow: hidden; border-radius: 18px; background: linear-gradient(100deg,#e7f2e7,#fff3d5); border: 1px solid #e1ead9; }
.reader-welcome img { width: 49px; height: 58px; object-fit: cover; object-position: center 8%; border-radius: 13px; background: #fff9e9; }
.reader-welcome div { display: flex; flex-direction: column; gap: 3px; }
.reader-welcome span { font-size: 11px; font-weight: 800; color: #3c8175; }
.reader-welcome strong { font-size: 16px; color: #234e5c; }
.stat-item, .text-item, .rec-item { border: 1px solid rgba(42, 94, 82, .06); }
.stat-num { color: var(--brand); }
.tabbar { background: rgba(255,253,247,.96); }

/* 一年级友好：任务优先、大字、宽松点击区 */
.page { padding-left: 18px; padding-right: 18px; }
#page-home .hello-card { min-height: 308px; }
#page-home .hello-title { font-size: clamp(24px, 6.6vw, 31px); line-height: 1.32; margin-top: 22px; }
#page-home .hello-sub { font-size: 14px; line-height: 1.55; }
#page-home .hero-kicker { font-size: 11px; }
.text-item:focus-visible, .tab:focus-visible, .chip:focus-visible { outline: 3px solid #e28830; outline-offset: 3px; }
#page-home .sec-head { font-size: 18px; margin-top: 24px; }
#page-home #btnManageText { color: #6b7876; font-size: 12px; }
#gradeChips { gap: 9px; padding: 4px 1px 8px; }
#gradeChips .chip { min-height: 44px; padding: 9px 17px; font-size: 15px; font-weight: 700; }
#page-home .text-item { min-height: 82px; padding: 15px; border-radius: 19px; border: 1px solid #e8e9dd; }
#page-home .ti-badge { width: 48px; height: 48px; font-size: 15px; border-radius: 15px; }
#page-home .ti-title { font-size: 18px; line-height: 1.35; }
#page-home .ti-preview { font-size: 13px; color: #627477; margin-top: 4px; }
#page-home .ti-times { font-size: 12px; color: #3d7780; font-weight: 700; }
.kid-progress-title { margin: 25px 2px 9px; font-size: 18px; font-weight: 800; color: var(--ink); }
#page-home .stat-row { margin-top: 0; gap: 7px; }
#page-home .stat-item { min-height: 72px; padding: 11px 3px; }
#page-home .stat-lbl { font-size: 11px; line-height: 1.25; }
#page-home .stat-num { font-size: 21px; }
.tab { min-height: 66px; padding-top: 9px; }
.tab-i { font-size: 24px; }
.tab-t { font-size: 13px; font-weight: 750; color: #536a70; }
.tab.on .tab-t { color: var(--brand-dark); }
body { padding-bottom: 75px; }
.ctrl-bar { bottom: 75px; }
#page-reader .quick-btn { min-height: 88px; }
#page-reader .qb-i { font-size: 27px; }
#page-reader .qb-t { font-size: 13px; font-weight: 800; }
#page-read .read-title { font-size: 25px; }
#page-read .read-sub { font-size: 15px; }
#page-read .ref-box { font-size: 23px; line-height: 2.15; }
#page-read .btn-record { min-height: 68px; font-size: 18px; }
#page-result .sc-points { font-size: 58px; }
@media (prefers-reduced-motion: reduce) { .page { animation: none !important; transition: none !important; } }

/* 阅读冒险：首页视觉层次 */
#app { background: radial-gradient(circle at 8% 210px, rgba(255,195,113,.2), transparent 180px), radial-gradient(circle at 98% 690px, rgba(87,193,184,.19), transparent 220px), #fff9eb; }
#page-home .hello-card { background: radial-gradient(circle at 8% 15%, rgba(255,255,255,.28) 0 2px, transparent 3px) 0 0 / 28px 28px, radial-gradient(circle at 80% -10%, #ffdd85 0%, transparent 41%), linear-gradient(128deg,#56c4ad 0%,#86d7b7 45%,#cae9ab 100%); border: 3px solid #fdf2c8; box-shadow: 0 10px 0 #d9e4bd, 0 18px 28px rgba(38,96,86,.18); }
#page-home .hello-card::after { content: '★'; right: 17px; top: 14px; color: #fff8d8; font-size: 30px; text-shadow: 0 3px 0 #e4a65c; }
#page-home .hero-kicker { color: #145f5a; background: #fff8db; padding: 7px 10px; box-shadow: 0 3px 0 rgba(34,97,83,.15); }
#page-home .hello-title { color: #134a58; text-shadow: 0 2px 0 rgba(255,255,255,.4); }
#page-home .hello-sub { color: #235665; }
#page-home .hero-character { filter: drop-shadow(0 11px 3px rgba(38,87,72,.18)); }
#page-home .sec-head { color: #1f4659; }
#page-home .story-card { position: relative; border: 3px solid white; box-shadow: 0 6px 0 rgba(37,90,92,.09), 0 12px 17px rgba(48,80,83,.06); }
#page-home .story-0 { background: #dff5ec; }
#page-home .story-1 { background: #fff0d0; }
#page-home .story-2 { background: #efe9fc; }
#page-home .story-0 .ti-badge { background: #67c6aa; color: #124e4d; }
#page-home .story-1 .ti-badge { background: #ffcb6a; color: #6c492c; }
#page-home .story-2 .ti-badge { background: #c7b0f2; color: #514272; }
#page-home .story-card .ti-title { color: #203c53; }
#page-home .story-card .ti-preview { color: #536b6a; }
#page-home .story-card .ti-times { color: #336983; }
#page-home .story-card:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(37,90,92,.09); }
#page-home .kid-progress-title { color: #2d5073; }
#page-home .stat-item:nth-child(1) { background: #dff5ec; }
#page-home .stat-item:nth-child(2) { background: #fff0d0; }
#page-home .stat-item:nth-child(3) { background: #efe9fc; }
#page-home .stat-item { border: 2px solid #fff; box-shadow: 0 5px 0 rgba(43,77,78,.07); }
@media (prefers-reduced-motion: reduce) { .streak-badge, .streak-flame { animation: none !important; } }

/* 窄屏修正：入口完整显示，隐藏状态不被按钮样式覆盖 */
.tb-btn[hidden], .btn-ghost[hidden] { display: none !important; }
#app { overflow-x: clip; }
#page-home .hero-copy { width: 65%; }
@media (max-width: 390px) { .hero-character { width: 143px; height: 214px; right: 4px; } #page-home .hello-title { font-size: 27px; line-height: 1.34; } .streak-badge { margin-top: 12px; padding: 7px 13px 7px 10px; } .streak-num { font-size: 22px; } .quest-strip { padding: 11px 15px; font-size: 11.5px; } }
/* 超窄屏（≤360px）：文字栏收窄一点，人物相应缩小，保证两者不互相压住 */
@media (max-width: 360px) { #page-home .hero-copy { width: 58%; } .hero-character { width: 108px; height: 162px; right: 4px; } }

/* 小故事卡：两列网格，全部一屏可见。
   原来是横向滚动条、还把滚动条隐藏了 —— 手机上一屏只露 1.8 张、第二张被切断，
   电脑上鼠标无法横滑，后 6 篇等于进不去 */
.science-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 2px 2px 4px; }
.science-card { width: 100%; min-height: 168px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; padding: 15px; border: 3px solid #fff; border-radius: 23px; color: #163d5c; font-family: inherit; cursor: pointer; box-shadow: 0 6px 0 rgba(49,71,91,.09), 0 12px 18px rgba(52,80,110,.08); transition: transform .16s; }
.science-card:active { transform: translateY(3px); }
.science-card:focus-visible { outline: 3px solid #d77430; outline-offset: 3px; }
.science-card[data-topic="航天"] { background: linear-gradient(155deg,#cde4ff,#a3c7ff); }
.science-card[data-topic="科技"] { background: linear-gradient(155deg,#d9f5ee,#a5e3d2); }
.science-card[data-topic="星球"] { background: linear-gradient(155deg,#eee2ff,#d8c2fb); }
.science-card[data-topic="国家"] { background: linear-gradient(155deg,#fff0cd,#ffcfad); }
.science-card-top { display: flex; align-items: center; justify-content: space-between; width: 100%; margin-bottom: 14px; }
.science-topic { padding: 4px 9px; border-radius: 999px; background: rgba(255,255,255,.76); color: #1f5f72; font-size: 11px; font-weight: 850; }
.science-card strong { font-size: 19px; line-height: 1.3; }
.science-preview { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; min-height: 34px; margin-top: 7px; color: #476b77; font-size: 12px; line-height: 1.45; }
.science-go { color: #0c5e80; font-size: 12px; font-weight: 850; }
/* 卡片底部一行：左边"点我开始读"，右边编辑/删除 */
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; width: 100%; margin-top: auto; padding-top: 8px; }
.card-tools { display: flex; gap: 4px; }
.card-tool { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 50%; background: rgba(255,255,255,.78); font-size: 12px; line-height: 1; cursor: pointer; box-shadow: 0 2px 4px rgba(31,60,72,.12); }
.card-tool:active { transform: translateY(1px); }
.read-source { display: inline-block; margin-top: 7px; padding: 5px 0; color: #27677b; font-size: 12px; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; }
.read-source[hidden] { display: none !important; }
@media (max-width: 390px) { .science-list { gap: 10px; } .science-card { min-height: 174px; padding: 13px; } .science-card strong { font-size: 17px; } }
/* 宽屏（应用最宽 560）用三列，九篇正好三行，页面不至于被拉太长 */
@media (min-width: 480px) { .science-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* 故事星球：课外阅读与进步页 */
#page-reader .reader-welcome { min-height: 168px; margin: 9px 0 17px; padding: 19px 20px; border: 3px solid #fff; border-radius: 25px; background: radial-gradient(circle at 72% 8%,#ffe69d 0%,transparent 43%), linear-gradient(125deg,#80d7c3,#c7ecc6); box-shadow: 0 8px 0 #daebcd, 0 16px 23px rgba(49,103,88,.12); }
.reader-welcome::after { content: '✦'; position: absolute; top: 13px; right: 18px; color: #fff8cb; font-size: 26px; text-shadow: 0 2px 0 #d89e53; }
.reader-welcome-copy { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; width: 67%; gap: 0 !important; }
#page-reader .reader-welcome-copy span { display: inline-block; padding: 6px 10px; border-radius: 99px; background: #fff8dd; color: #21645d; font-size: 11px; font-weight: 850; }
#page-reader .reader-welcome-copy strong { margin-top: 14px; color: #174e58; font-size: clamp(22px,5.6vw,28px); line-height: 1.3; }
#page-reader .reader-welcome-copy small { margin-top: 8px; color: #276a61; font-size: 12px; font-weight: 750; }
#page-reader .reader-welcome img { position: absolute; width: 43%; height: 115%; right: 1%; bottom: -12%; object-fit: contain; object-position: bottom; border-radius: 0; background: none; }
#page-reader .ring-card { min-height: 145px; margin-top: 2px; padding: 15px 18px; border: 3px solid #fff; border-radius: 24px; background: linear-gradient(130deg,#fff1cc,#fff9e9 58%,#e4f5e9); box-shadow: 0 7px 0 #e9dfc6, 0 15px 20px rgba(92,91,56,.1); }
#page-reader .ring-svg { width: 106px; height: 106px; filter: drop-shadow(0 3px 4px rgba(37,96,128,.13)); }
#page-reader .ring-big { color: #234c6b; font-size: 33px; }
#page-reader .ring-big .u { color: #5b7676; font-size: 14px; }
#page-reader .ring-sub { color: #356d68; font-size: 13px; font-weight: 750; }
#page-reader .ring-badge { font-size: 12px; background: #ffdfa0; color: #80541d; }
#page-reader .ring-badge.done { background: #c7ebce; color: #216848; }
#page-reader .ring-streak { color: #667c77; font-size: 12px; }
#page-reader .quick-row { gap: 11px; margin-top: 19px; }
#page-reader .quick-btn { min-height: 101px; border: 3px solid #fff; border-radius: 20px; box-shadow: 0 6px 0 rgba(56,79,83,.09), 0 13px 16px rgba(54,79,85,.07); }
#page-reader .quick-btn.primary { background: linear-gradient(145deg,#ffca69,#ffa16f); border-color: #fff; }
#page-reader .quick-btn:nth-child(2) { background: linear-gradient(145deg,#d8eef8,#a6d9ee); }
#page-reader .quick-btn:nth-child(3) { background: linear-gradient(145deg,#efe6fb,#d6c3ef); }
#page-reader .quick-btn.primary .qb-t { color: #60401f; }
#page-reader .quick-btn .qb-t { color: #244b61; font-size: 14px; }
#page-reader .sec-head, #page-reader-stats .sec-head { color: #204a60; font-size: 17px; margin-top: 24px; }
#page-reader .link-btn, #page-reader-stats .link-btn { font-size: 13px; font-weight: 750; }
#page-reader .book-empty { min-height: 150px; display: flex; align-items: center; gap: 9px; padding: 10px 14px; overflow: hidden; border: 3px solid #fff; border-radius: 23px; background: linear-gradient(120deg,#e7e4ff,#fff0d7); box-shadow: 0 6px 0 #e3ddec, 0 12px 19px rgba(68,68,104,.08); }
#page-reader .book-empty img { flex: 0 0 36%; width: 36%; height: 124px; object-fit: contain; }
#page-reader .book-empty div { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; gap: 6px; }
#page-reader .book-empty strong { color: #3d5279; font-size: 15px; line-height: 1.35; }
#page-reader .book-empty span { color: #6d7591; font-size: 11px; line-height: 1.4; }
#page-reader .book-empty button { min-height: 38px; margin-top: 3px; padding: 6px 10px; border: 0; border-radius: 11px; background: #625aab; color: #fff; font: 750 11px inherit; cursor: pointer; }
#page-reader .empty-tip { border: 2px dashed #c6d8d7; background: #f0f8f2; color: #3f6d69; font-size: 14px; font-weight: 700; line-height: 1.55; }
#page-reader .week-box { border: 3px solid #fff; border-radius: 23px; background: #e8f3ff; box-shadow: 0 6px 0 #dbe8f0; }
#page-reader .week-dot { background: #d0e6f9; border-radius: 13px; }
#page-reader .week-dot.done { background: #328f7c; }
#page-reader .week-lbl { color: #4e7283; font-size: 11px; font-weight: 750; }
#page-reader .book-item, #page-reader .session-item { border: 2px solid #fff; border-radius: 19px; box-shadow: 0 5px 0 rgba(48,87,87,.08); }
#page-reader-stats .stats-welcome { position: relative; min-height: 166px; display: flex; align-items: center; margin-top: 9px; padding: 19px 20px; overflow: hidden; border: 3px solid #fff; border-radius: 25px; background: radial-gradient(circle at 80% 0%,#7b80cb 0%,transparent 40%), linear-gradient(120deg,#314f91,#4b68a9); box-shadow: 0 8px 0 #d8d7ec, 0 16px 23px rgba(56,71,131,.13); }
#page-reader-stats .stats-welcome div { position: relative; z-index: 2; display: flex; flex-direction: column; align-items: flex-start; width: 59%; }
#page-reader-stats .stats-welcome span { padding: 5px 9px; border-radius: 99px; background: #ffdc76; color: #5a4771; font-size: 11px; font-weight: 850; }
#page-reader-stats .stats-welcome strong { margin-top: 11px; color: #fff; font-size: clamp(22px,5.7vw,28px); line-height: 1.27; }
#page-reader-stats .stats-welcome small { margin-top: 7px; color: #e1eafa; font-size: 11px; font-weight: 700; }
#page-reader-stats .stats-welcome img { position: absolute; width: 56%; height: 115%; right: -8%; bottom: -8%; object-fit: contain; filter: drop-shadow(0 6px 8px rgba(15,32,82,.24)); }
#page-reader-stats .hist-summary { margin-top: 19px; padding: 0; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; background: none; box-shadow: none; }
#page-reader-stats .hist-summary > div { min-height: 84px; display: flex; flex-direction: column; justify-content: center; border: 3px solid #fff; border-radius: 18px; box-shadow: 0 5px 0 rgba(54,74,95,.08); }
#page-reader-stats .hist-summary > div:nth-child(1) { background: #d8f1e8; color: #245e59; }
#page-reader-stats .hist-summary > div:nth-child(2) { background: #fff0ce; color: #745328; }
#page-reader-stats .hist-summary > div:nth-child(3) { background: #e7e0fa; color: #5b5086; }
#page-reader-stats .hist-summary > div:nth-child(4) { background: #d9eafd; color: #345f87; }
#page-reader-stats .hs-num { font-size: 29px; }
#page-reader-stats .hs-lbl { font-size: 12px; font-weight: 750; opacity: 1; }
#page-reader-stats .chip { min-height: 42px; padding: 9px 15px; font-size: 14px; }
#page-reader-stats .trend-box, #page-reader-stats .cal-box, #page-reader-stats .freq-box { border: 3px solid #fff; border-radius: 23px; box-shadow: 0 6px 0 rgba(50,74,96,.08); }
#page-reader-stats .trend-box { background: #edf4ff; }
#page-reader-stats .trend-empty-scene { min-height: 136px; display: flex; align-items: center; gap: 10px; }
#page-reader-stats .trend-empty-scene img { flex: 0 0 80px; width: 80px; height: 116px; object-fit: contain; }
#page-reader-stats .trend-empty-scene div { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
#page-reader-stats .trend-empty-scene strong { color: #294f79; font-size: 16px; line-height: 1.35; }
#page-reader-stats .trend-empty-scene span { color: #617995; font-size: 12px; line-height: 1.5; }
#page-reader-stats .trend-empty-scene button { min-height: 36px; margin-top: 3px; padding: 6px 12px; border: 0; border-radius: 11px; background: #376b9e; color: #fff; font: 750 12px inherit; cursor: pointer; }
#page-reader-stats .cal-box { background: #fffdf4; }
#page-reader-stats .cal-cell { background: #e8f2fb; border-radius: 12px; }
#page-reader-stats .cal-cell:nth-child(4n) { background: #eaf5e7; }
#page-reader-stats .cal-cell.done { background: #318f7d; color: white; }
#page-reader-stats .cal-cell.empty { background: transparent; }
#page-reader-stats .freq-box { background: #f7f1ff; }
@media (max-width: 390px) { #page-reader .reader-welcome-copy strong, #page-reader-stats .stats-welcome strong { font-size: 22px; } #page-reader .book-empty img { flex-basis: 31%; width: 31%; } #page-reader .book-empty strong { font-size: 14px; } }

/* 按课文自动显示对应的绘本封面 */
#page-home .text-item { min-height: 104px; gap: 13px; }
#page-home .ti-cover { flex: 0 0 58px; width: 58px; height: 76px; object-fit: cover; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; box-shadow: 0 4px 9px rgba(31,60,72,.15); }
#page-home .ti-main { align-self: center; }
#page-home .ti-right { align-self: center; }
@media (max-width: 390px) { #page-home .ti-cover { flex-basis: 52px; width: 52px; height: 70px; } #page-home .text-item { gap: 10px; padding: 12px; } }

/* ============ 小故事朗读 / 家长自编故事 ============ */
/* 主题是家长自己填的，没有对应的配色规则时兜个底，避免卡片发白 */
.science-card { background: linear-gradient(155deg, #eaf1fb, #d3e2f6); }
.science-card[data-topic="我的故事"] { background: linear-gradient(155deg, #ffe7f1, #f6c9dd); }
.story-count { margin: -6px 2px 9px; color: #63818b; font-size: 10.5px; font-weight: 750; }
.story-len { margin: -4px 2px 11px; text-align: right; color: #7c8a99; font-size: 11.5px; font-weight: 650; }
.story-len.over { color: var(--ok); }
