/* ==========================================================================
   磨耳朵 Little Ears — 样式表
   设计约束（来自需求文档 v2.0 交互规范）：
   · 触控目标：主操作按钮 ≥ 88pt，子按钮 ≥ 64pt
   · 禁用系统手势：user-select / touch-callout / touch-action
   · 播放 30 秒后自动降亮度
   · 单屏一任务，无导航概念（首页除外）
   ========================================================================== */

:root {
  /* 底色与文字 */
  --bg:        #FFF9F2;
  --card:      #FFFFFF;
  --ink:       #2E2A26;
  --ink-2:     #7A6F63;
  --ink-3:     #AFA396;
  --line:      #F1E7DA;

  /* 品牌色（暖橙） */
  --brand:     #FF8A3D;
  --brand-2:   #FFB627;
  --brand-ink: #FFFFFF;

  /* 四个板块的强调色 */
  --c-word:    #4EA8DE;
  --c-phrase:  #9B7BE0;
  --c-rhyme:   #FF7A9C;
  --c-story:   #4FB87B;

  /* 当前页面的强调色，由 JS 覆盖 */
  --accent:        var(--brand);
  --accent-soft:   #FFEEDF;

  /* 安全区域 */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);

  /* 触控尺寸 */
  --tap-main: 88px;
  --tap-min:  64px;

  --topbar-h: 56px;
  --radius:   24px;
  --shadow:   0 2px 8px rgba(122, 90, 60, .06), 0 8px 24px rgba(122, 90, 60, .05);
  --ease:     cubic-bezier(.22, .82, .28, 1);
}

/* ── 基础重置 ───────────────────────────────────────────────── */

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

/* ⚠️ 全局兜底：让 hidden 属性一定生效。
   浏览器默认的 [hidden] { display: none } 来自 UA 样式表，优先级低于
   本文件里的任何作者样式。所以只要某个元素被写了 display: flex/grid
   （.dimmer / .splash / .topbar / .btn-back 全都是），它的 hidden 属性
   就会静默失效：元素仍然存在并参与布局，全屏的那种还会挡住所有点击。
   这条 !important 规则必须保留，删掉就会重现「整页点不动」。 */
[hidden] {
  display: none !important;
}

html {
  height: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro SC", "PingFang SC",
               "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;

  /* 禁用系统手势：需求文档「交互规范」 */
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  touch-action: manipulation;
}

img { display: block; max-width: 100%; }

button {
  font: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
  touch-action: manipulation;
}

input, textarea { user-select: text; -webkit-user-select: text; }

h1, h2, h3, p { margin: 0; }

/* ── 应用容器 ───────────────────────────────────────────────── */

#app {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-left: var(--safe-l);
  padding-right: var(--safe-r);
}

.view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  outline: none;
}

/* 视图内容宽度：iPhone 上铺满，桌面上收窄 */
.view-inner {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 20px calc(32px + var(--safe-b));
}

/* ── 顶栏 ───────────────────────────────────────────────────── */

.topbar {
  flex: 0 0 auto;
  height: calc(var(--topbar-h) + var(--safe-t));
  padding-top: var(--safe-t);
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 8px;
  padding-right: 12px;
  background: rgba(255, 249, 242, .92);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.btn-back {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: var(--accent);
  transition: background .15s, transform .12s;
}
.btn-back:active { background: var(--accent-soft); transform: scale(.94); }

.topbar-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
#topbar-title-text {
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub {
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar-sub:empty { display: none; }

.topbar-right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 顶栏里的「正在播放」指示 */
.now-playing {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 14px;
  border-radius: 20px;
  background: var(--accent-soft);
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}
.now-playing .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1;   transform: scale(1); }
  50%      { opacity: .35; transform: scale(.75); }
}

/* ── 进度条 ─────────────────────────────────────────────────── */

.progress-wrap {
  flex: 0 0 auto;
  height: 6px;
  background: #F5EDE3;
  position: relative;
  z-index: 19;
}
.progress-bar {
  height: 100%;
  width: 0;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(90deg, var(--brand-2), var(--brand));
  transition: width .5s var(--ease);
}

/* ── 通用按钮 ───────────────────────────────────────────────── */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: var(--tap-min);
  padding: 0 26px;
  border-radius: 22px;
  font-size: 18px;
  font-weight: 700;
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
  transition: transform .12s var(--ease), background .15s, opacity .2s;
  /* 按钮文字永远不换行：换行会让「慢速」变成两行、高度失控 */
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }
.btn:disabled { opacity: .4; }

.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: var(--brand-ink);
  box-shadow: 0 4px 14px rgba(255, 138, 61, .32);
}

.btn-xl {
  min-height: var(--tap-main);
  font-size: 21px;
  border-radius: 28px;
  width: 100%;
}

.btn-ghost {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: none;
}

/* 圆形播放按钮 */
.btn-round {
  width: var(--tap-main);
  height: var(--tap-main);
  padding: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

/* ── 首页 ───────────────────────────────────────────────────── */

.home-hero {
  margin-bottom: 22px;
}

.hero-greeting {
  font-size: 14px;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.hero-task {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}

.hero-task-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.hero-task-name {
  font-size: 19px;
  font-weight: 750;
}
.hero-task-count {
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
  flex: 0 0 auto;
}

/* 任务进度点：一排小圆点，完成变实心 */
.task-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.task-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #F2EAE0;
  display: grid;
  place-items: center;
  font-size: 13px;
  color: transparent;
  transition: background .3s, transform .3s var(--ease);
}
.task-dot.done {
  background: var(--brand);
  color: #fff;
  transform: scale(1.06);
}
.task-dot.done::after { content: "✓"; }

/* 两个时段 */
.plan-segments {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}
.plan-segment {
  flex: 1;
  background: #FBF5ED;
  border-radius: 16px;
  padding: 12px;
  font-size: 13px;
  color: var(--ink-2);
}
.plan-segment b {
  display: block;
  color: var(--ink);
  font-size: 14.5px;
  margin-bottom: 3px;
}
.plan-segment.done {
  background: #EAF6EE;
  color: #3C8B5C;
}
.plan-segment.done b { color: #2E7349; }

/* 四入口大卡 */
.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  letter-spacing: .06em;
  margin: 26px 0 12px;
  text-transform: uppercase;
}

.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.entry-card {
  background: var(--card);
  border-radius: 20px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-align: left;
  min-height: 108px;
  transition: transform .14s var(--ease);
  position: relative;
  overflow: hidden;
}
.entry-card:active { transform: scale(.97); }
.entry-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--accent);
}
.entry-emoji { font-size: 30px; line-height: 1; margin-bottom: 4px; }
.entry-name { font-size: 17px; font-weight: 700; }
.entry-meta { font-size: 12.5px; color: var(--ink-3); }

/* ── 列表 ───────────────────────────────────────────────────── */

.list-group-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-3);
  margin: 22px 0 10px;
  letter-spacing: .04em;
}
.list-group-title:first-child { margin-top: 4px; }

.item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: var(--tap-min);
  padding: 10px 14px;
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  text-align: left;
  transition: transform .12s var(--ease);
}
.item-row:active { transform: scale(.975); }

.item-thumb {
  width: 56px;
  height: 56px;
  flex: 0 0 auto;
  border-radius: 14px;
  background: #FBF5ED;
  display: grid;
  place-items: center;
  font-size: 28px;
  overflow: hidden;
}
.item-thumb img { width: 100%; height: 100%; object-fit: contain; }

.item-body { flex: 1; min-width: 0; }
.item-en {
  font-size: 17px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-zh {
  font-size: 13px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.item-play {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
}

/* ── 全屏单词卡 ─────────────────────────────────────────────── */

.card-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 20px calc(20px + var(--safe-b));
  position: relative;
}

.card-art {
  width: min(66vw, 320px);
  height: min(66vw, 320px);
  display: grid;
  place-items: center;
  overflow: hidden;
  margin-bottom: 6px;
}
.card-art img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 620ms var(--ease);
}
/* FR-1.3：播放时图片轻微缩放 1.0 → 1.04 */
.card-art.is-playing img { transform: scale(1.04); }
.card-art .art-fallback {
  font-size: min(30vw, 140px);
  line-height: 1;
  filter: saturate(.95);
}

.card-en {
  font-size: clamp(40px, 13vw, 66px);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  text-align: center;
}
.card-zh {
  font-size: 19px;
  color: var(--ink-2);
  text-align: center;
}

.card-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 22px;
}

.card-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, .9);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  z-index: 5;
}
.card-nav.prev { left: 10px; }
.card-nav.next { right: 10px; }
.card-nav:disabled { opacity: .25; }
.card-nav:active { transform: translateY(-50%) scale(.92); }

/* 页码 */
.card-index {
  position: absolute;
  top: 8px;
  left: 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-3);
}

/* 慢速按钮激活态 */
.btn.is-on {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 4px 14px rgba(255, 138, 61, .3);
}

/* ── 播放器（歌谣 / 故事） ──────────────────────────────────── */

.player-view {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 8px 20px calc(24px + var(--safe-b));
}

.player-art {
  width: min(50vw, 240px);
  height: min(50vw, 240px);
  margin: 4px auto 14px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.player-art img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform 620ms var(--ease);
}
.player-art.is-playing img { transform: scale(1.04); }
.player-art .art-fallback { font-size: min(24vw, 110px); }

.player-title {
  font-size: 22px;
  font-weight: 750;
  text-align: center;
  line-height: 1.25;
}
.player-subtitle {
  font-size: 14px;
  color: var(--ink-3);
  text-align: center;
  margin-top: 3px;
  margin-bottom: 14px;
}

/* 逐句列表：当前句高亮，其余淡出 */
.verse-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 6px 4px 14px;
  margin-bottom: 8px;
  mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14px, #000 calc(100% - 20px), transparent 100%);
}

.verse {
  padding: 9px 12px;
  border-radius: 14px;
  font-size: 18px;
  line-height: 1.45;
  color: var(--ink);
  opacity: .3;
  transform-origin: left center;
  transition: opacity .4s var(--ease), transform .4s var(--ease), background .3s;
  margin-bottom: 2px;
}
.verse.active {
  opacity: 1;
  font-weight: 700;
  background: var(--accent-soft);
  transform: translateX(4px);
}
.verse.past { opacity: .55; }

.verse-zh {
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 400;
  margin-top: 2px;
}

/* 播放控制排 */
.player-controls {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ctrl {
  width: var(--tap-min);
  height: var(--tap-min);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--ink-2);
  box-shadow: var(--shadow);
  transition: transform .12s var(--ease), background .2s, color .2s;
}
.ctrl:active { transform: scale(.93); }
.ctrl-main {
  width: var(--tap-main);
  height: var(--tap-main);
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 6px 18px rgba(255, 138, 61, .34);
}
.ctrl.is-on {
  background: var(--accent);
  color: #fff;
}

/* 进度条（播放器内） */
.player-progress {
  flex: 0 0 auto;
  height: 4px;
  background: #F2EAE0;
  border-radius: 2px;
  margin: 14px 2px 0;
  overflow: hidden;
}
.player-progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: 2px;
  transition: width .25s linear;
}

/* ── 短句卡的亲子动作提示 ───────────────────────────────────── */

.action-tip {
  margin-top: 16px;
  background: var(--accent-soft);
  border-radius: 18px;
  padding: 14px 16px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--ink-2);
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.action-tip .tip-icon { flex: 0 0 auto; font-size: 18px; line-height: 1.3; }
.action-tip b { color: var(--ink); }

/* ── 空状态 / 提示 ──────────────────────────────────────────── */

.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-3);
}
.empty-emoji { font-size: 52px; margin-bottom: 12px; }

.notice {
  background: #FFF4E3;
  border: 1px solid #FFE0B8;
  color: #9A6212;
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13.5px;
  line-height: 1.55;
  margin-bottom: 16px;
}

/* ── 护眼降亮度遮罩（FR-1.7） ───────────────────────────────── */

.dimmer {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, .72);
  display: grid;
  place-items: center;
  opacity: 0;
  transition: opacity .8s ease;
  /* 未变暗时绝不能吃触摸事件（这是全屏层，一旦吃事件整个应用就点不动） */
  pointer-events: none;
}
.dimmer.show { opacity: 1; pointer-events: auto; }

.dimmer-hint {
  color: rgba(255, 255, 255, .34);
  font-size: 15px;
  letter-spacing: .18em;
  animation: breathe 4.5s ease-in-out infinite;
}
@keyframes breathe {
  0%, 100% { opacity: .28; }
  50%      { opacity: .7; }
}

/* ── 启动页（首次手势解锁） ─────────────────────────────────── */

.splash {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: linear-gradient(170deg, #FFF9F2 0%, #FFF1E2 100%);
  display: grid;
  place-items: center;
  padding: 24px;
  transition: opacity .4s ease, visibility .4s;
}
.splash.hide {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-inner {
  text-align: center;
  max-width: 340px;
  width: 100%;
}
.splash-emoji { font-size: 76px; line-height: 1; margin-bottom: 10px; }
.splash-title {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: .01em;
}
.splash-sub {
  font-size: 15px;
  color: var(--ink-3);
  letter-spacing: .22em;
  text-transform: uppercase;
  margin: 2px 0 30px;
}
.splash-note {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 14px;
  line-height: 1.5;
}

/* ── Toast ──────────────────────────────────────────────────── */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(34px + var(--safe-b));
  transform: translate(-50%, 12px);
  z-index: 120;
  background: rgba(46, 42, 38, .93);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 11px 20px;
  border-radius: 20px;
  max-width: calc(100vw - 48px);
  text-align: center;
  opacity: 0;
  transition: opacity .25s, transform .25s var(--ease);
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 工具类 ─────────────────────────────────────────────────── */

/* emoji 占位图：插画缺失或加载失败时顶上来。
   字号不在这里定，交给各上下文（列表缩略图继承父级、卡片页单独覆盖） */
.art-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  line-height: 1;
  filter: saturate(.95);
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; }
.spacer { flex: 1; }

/* ── 列表项内部元素（span 需要显式变成块级） ────────────────── */

.item-en, .item-zh { display: block; }

/* ── 连播队列 ───────────────────────────────────────────────── */

.queue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
  gap: 12px;
}
.queue-title { font-size: 21px; font-weight: 780; }
.queue-count { font-size: 15px; font-weight: 700; color: var(--accent); }

.queue-list { display: flex; flex-direction: column; gap: 8px; }

.queue-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--card);
  border-radius: 16px;
  box-shadow: var(--shadow);
  opacity: .62;
  transition: opacity .3s, transform .3s var(--ease), background .3s;
  min-height: 62px;
}
.queue-item.active {
  opacity: 1;
  background: var(--accent-soft);
  transform: scale(1.015);
  box-shadow: 0 4px 14px rgba(122, 90, 60, .12);
}
.queue-item.done { opacity: .9; }

.qi-thumb {
  width: 46px; height: 46px;
  flex: 0 0 auto;
  border-radius: 13px;
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 24px;
  overflow: hidden;
}
.qi-thumb img { width: 100%; height: 100%; object-fit: contain; }

.qi-body { flex: 1; min-width: 0; }
.qi-en {
  display: block;
  font-size: 16px;
  font-weight: 650;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qi-zh {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.qi-state {
  flex: 0 0 auto;
  font-size: 17px;
  font-weight: 700;
  color: var(--c-story);
  min-width: 18px;
  text-align: center;
}

/* ── 家长页：统计卡 ─────────────────────────────────────────── */

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.stat-card {
  background: var(--card);
  border-radius: 18px;
  padding: 16px;
  box-shadow: var(--shadow);
}
.stat-card b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--accent);
}
.stat-card span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}

/* 最近 7 天 */
.week-dots {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.day-cell {
  background: var(--card);
  border-radius: 14px;
  padding: 10px 4px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1.5px solid transparent;
}
.day-cell.checked {
  background: #EAF6EE;
  border-color: #BFE3CC;
}
.day-num {
  display: block;
  font-size: 15px;
  font-weight: 700;
}
.day-cell.checked .day-num { color: #2E7349; }
.day-min {
  display: block;
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 1px;
}
.day-cell.checked .day-min { color: #479468; }

/* ── 家长页：计划选择 ───────────────────────────────────────── */

.plan-picker { display: flex; flex-direction: column; gap: 10px; }

.plan-option {
  text-align: left;
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border: 2px solid transparent;
  transition: border-color .2s, transform .12s var(--ease);
}
.plan-option:active { transform: scale(.98); }
.plan-option.active { border-color: var(--accent); }
.plan-option b {
  display: block;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 2px;
}
.plan-option span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

/* ── 家长页：设置行 ─────────────────────────────────────────── */

.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--card);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 10px;
}
.setting-label b {
  display: block;
  font-size: 15.5px;
  font-weight: 650;
  margin-bottom: 2px;
}
.setting-label span {
  display: block;
  font-size: 12.5px;
  color: var(--ink-3);
  line-height: 1.45;
}

/* 开关 */
.switch {
  flex: 0 0 auto;
  width: 58px;
  height: 34px;
  border-radius: 17px;
  background: #E6DDD2;
  position: relative;
  transition: background .25s var(--ease);
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
  transition: transform .25s var(--ease);
}
.switch.on { background: var(--brand); }
.switch.on::after { transform: translateX(24px); }

/* 选项芯片 */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  min-height: 44px;
  padding: 0 18px;
  border-radius: 22px;
  background: #FBF5ED;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-2);
  transition: background .2s, color .2s, transform .12s var(--ease);
}
.chip:active { transform: scale(.95); }
.chip.active { background: var(--accent); color: #fff; }

/* 尊重系统「减弱动态效果」 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ═══════════════════════════════════════════════════════════
   v1.1 新增：家长门 / 家长录音 / Ken Burns
   ═══════════════════════════════════════════════════════════ */

/* ── 家长门 ──────────────────────────────────────────────── */

.gate-view {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
}
.gate-emoji { font-size: 54px; }
.gate-title { font-size: 22px; font-weight: 750; margin-top: 8px; }
.gate-hint { color: var(--ink-3); font-size: 15px; margin: 4px 0 26px; }
.gate-hold {
  border-radius: 50%;
  padding: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform .15s var(--ease);
}
.gate-hold:active { transform: scale(.96); }
.gate-hold svg { display: block; }

/* ── 家长录音（家长页 + 底部录音面板） ───────────────────── */

.rec-status { font-size: 14.5px; color: var(--ink-2); }
.rec-status b { color: var(--brand); font-size: 18px; }

.rec-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 10px;
  max-height: 320px;
  overflow-y: auto;
  padding: 2px;
  -webkit-overflow-scrolling: touch;
}
.rec-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 18px;
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
  transition: transform .12s var(--ease), background .2s;
}
.rec-chip:active { transform: scale(.95); }
.rec-chip.has-rec { background: #EAF6EF; }
.rc-emoji { font-size: 22px; flex-shrink: 0; }
.rc-text {
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
}
.rc-mark { font-size: 13px; flex-shrink: 0; }

/* 底部录音面板 */
.rec-sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 18px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 32px rgba(60, 40, 20, .18);
  transform: translateY(105%);
  transition: transform .3s var(--ease);
}
.rec-sheet.show { transform: translateY(0); }
.rec-sheet.recording .rs-hold { background: #FFE9E5; color: #D35440; }

.rs-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.rs-emoji { font-size: 34px; }
.rs-title { flex: 1; display: flex; flex-direction: column; }
.rs-title b { font-size: 20px; }
.rs-title span { font-size: 13.5px; color: var(--ink-3); }
.rs-close {
  width: 44px; height: 44px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--ink-3);
  background: #F5EEE3;
}
.rs-hint { text-align: center; color: var(--ink-2); font-size: 14.5px; min-height: 40px; }
.rs-hold {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 132px; height: 132px;
  margin: 6px auto 14px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  transition: transform .15s var(--ease);
}
.rs-hold:active { transform: scale(.95); }
.rs-time { font-size: 13px; font-weight: 700; min-height: 16px; }
.rs-actions { display: flex; gap: 10px; justify-content: center; }

/* ── 卡片页「家长读的」角标 ──────────────────────────────── */

.card-art { position: relative; }
.card-rec-badge {
  position: absolute;
  left: 50%;
  bottom: 10px;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, .88);
  font-size: 13px;
  font-weight: 650;
  color: var(--ink-2);
  white-space: nowrap;
  box-shadow: var(--shadow);
}

/* ── Ken Burns 缓慢推拉（歌谣/故事播放器） ───────────────── */

.player-art { overflow: hidden; }
.player-art.kenburns img {
  animation: kenburns 22s ease-in-out infinite alternate;
  transform-origin: 55% 45%;
  will-change: transform;
}
@keyframes kenburns {
  from { transform: scale(1) translate(0, 0); }
  to   { transform: scale(1.08) translate(-2%, 1.5%); }
}
@media (prefers-reduced-motion: reduce) {
  .player-art.kenburns img { animation: none; }
}
