:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2a44;
  --ink-soft: #5b6b88;
  --line: #e6ebf3;
  --brand: #ff8a3d;       /* Bluey 暖橙 */
  --brand2: #4f8cff;      /* Think0 蓝 */
  --green: #2bb673;
  --red: #e8554e;
  --gold: #f5b301;
  --purple: #8a6cf0;
  --shadow: 0 6px 22px rgba(31,42,68,.08);
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; }
button:disabled { cursor: not-allowed; opacity: .5; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 22px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 210px; }
.logo { font-size: 26px; }
.brand-title { font-weight: 800; font-size: 16px; letter-spacing: .3px; }
.brand-sub { font-size: 11px; color: var(--ink-soft); }
.brand-sub .ver { color: var(--brand); font-weight: 600; opacity: .8; }

.dashboard { flex: 1; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.kpi { background: linear-gradient(135deg,#fff7ef,#fff); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 14px; min-width: 150px; }
.kpi .k-label { font-size: 11px; color: var(--ink-soft); }
.kpi .k-val { font-size: 20px; font-weight: 800; }
.kpi.gold .k-val { color: var(--gold); }
.kpi.prog .k-val { color: var(--green); }
.progress-wrap { flex: 1; min-width: 220px; }
.progress-track { height: 12px; background: #eef1f7; border-radius: 99px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg,var(--green),#7ee0a8); transition: width .4s; }
.progress-meta { font-size: 11px; color: var(--ink-soft); margin-top: 3px; display:flex; justify-content:space-between; }

.role-switch { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.role-label { font-size: 11px; color: var(--ink-soft); }
.seg { display: flex; background: #eef1f7; border-radius: 10px; padding: 3px; }
.seg button { padding: 7px 12px; border-radius: 8px; font-weight: 700; color: var(--ink-soft); font-size: 13px; }
.seg button.on { background: var(--ink); color: #fff; }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: calc(100vh - 64px); }
.sidenav { width: 188px; background: var(--panel); border-right: 1px solid var(--line);
  padding: 14px 10px; display: flex; flex-direction: column; gap: 6px; position: sticky; top: 64px; height: calc(100vh - 64px); }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 12px 12px; border-radius: 11px;
  font-weight: 700; color: var(--ink-soft); text-align: left; width: 100%; }
.nav-item .ico { font-size: 18px; }
.nav-item:hover { background: #f3f6fc; }
.nav-item.active { background: var(--ink); color: #fff; }
.nav-item .badge { margin-left: auto; background: var(--green); color:#fff; font-size:10px; padding:1px 7px; border-radius:99px; }
.nav-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.nav-tip { font-size: 10px; color: var(--ink-soft); padding: 4px 10px; line-height: 1.5; margin-top:auto; }

.main { flex: 1; padding: 18px 22px; overflow: auto; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { padding: 10px 18px; border-radius: 11px; font-weight: 800; color: var(--ink-soft);
  background: var(--panel); border: 1px solid var(--line); }
.tab.active { color: #fff; background: var(--ink); border-color: var(--ink); }
.tab-body { animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px);} to {opacity:1; transform:none;} }

/* ---------- 卡片/通用 ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card h3 { margin: 0 0 12px; font-size: 15px; display:flex; align-items:center; gap:8px; }
.card h3 .tag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; }
.tag.bluey { background: #fff0e6; color: var(--brand); }
.tag.think0 { background: #eaf1ff; color: var(--brand2); }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 14px; }
.muted { color: var(--ink-soft); }
.small { font-size: 12px; }
.btn { padding: 9px 16px; border-radius: 10px; font-weight: 700; background: var(--ink); color:#fff; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #eef1f7; color: var(--ink); }
.btn.brand { background: var(--brand); }
.btn.blue { background: var(--brand2); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.gold { background: var(--gold); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }

/* 状态徽章 */
.pill { font-size: 11px; padding: 3px 10px; border-radius: 99px; font-weight: 700; }
.pill.done { background: #e6f8ef; color: var(--green); }
.pill.todo { background: #fff3e6; color: #d98324; }
.pill.lock { background: #fdeaea; color: var(--red); }

/* 列表 */
.list { display: flex; flex-direction: column; gap: 8px; }
.li { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; }
.li .name { font-weight: 700; }
.li .sub { font-size: 12px; color: var(--ink-soft); }

/* 媒体播放器 */
.player { width: 100%; border-radius: 12px; background: #0e1422; aspect-ratio: 16/9; }
.player.audio { aspect-ratio: auto; background: transparent; border-radius: 8px; }
.video-box { background: #0e1422; border-radius: 12px; overflow: hidden; }
/* 纯音频素材：不显示黑屏视频框，仅保留播放栏 */
.audio-box { background: #f3f6fb; border: 1px solid var(--line); border-radius: 10px; padding: 8px; }
/* 家长端每日打卡设置 */
.daily-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.daily-row:last-child { border-bottom: none; }
.daily-name { font-weight: 700; min-width: 78px; }
.daily-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; }
/* 家长端解锁提醒 */
.notice-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.notice-row { display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 8px; background: #f7f9fc; }
.notice-row.unread { background: #fff6e5; }
.notice-text { flex: 1; font-size: 14px; }
/* 片段标题：双击进入重命名，无需常驻输入栏 */
.seg-title-edit { cursor: pointer; font-weight: 700; border-bottom: 1px dashed transparent; }
.seg-title-edit:hover { border-bottom-color: var(--line); color: #2f6fed; }
.seg-name-input { flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 6px 8px; font-family: inherit; font-size: 14px; }
/* 兜底：容器内最终渲染为音频元素时，一律去掉 16:9 深色底，避免任何残留黑屏 */
.video-box:has(audio), .media-wrap:has(audio) { background: transparent; aspect-ratio: auto; }
.video-box > audio, .media-wrap > audio { display: block; width: 100%; }
/* 音频场景的浅色占位（不使用 16:9 深色视频占位） */
.placeholder-audio { display:flex; align-items:center; justify-content:center;
  background:#f3f6fb; border:1px dashed var(--line); border-radius:10px; color:var(--muted); padding:18px; font-size:14px; }
.placeholder-media { aspect-ratio: 16/9; display:flex; align-items:center; justify-content:center;
  background: repeating-linear-gradient(45deg,#1a2236,#1a2236 12px,#141b2c 12px,#141b2c 24px); color:#9fb0cf; flex-direction:column; gap:8px; }
.placeholder-media .big { font-size: 34px; }

/* 片段 */
.seg-item { border: 1px solid var(--line); border-radius: 11px; padding: 12px; margin-bottom: 10px; }
.seg-item .seg-head { display:flex; align-items:center; gap:8px; margin-bottom:8px; font-weight:700; }
.seg-item textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-family: inherit; resize: vertical; }

/* 弹层 */
.modal-mask { position: fixed; inset: 0; background: rgba(20,28,46,.45); display:flex; align-items:center; justify-content:center; z-index: 60; }
.modal { background: #fff; border-radius: 16px; padding: 22px; width: min(680px, 92vw); max-height: 86vh; overflow:auto; box-shadow: var(--shadow); }
.modal h3 { margin-top: 0; }
.field { margin-bottom: 12px; }
.field label { display:block; font-weight:700; margin-bottom:5px; font-size: 13px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; font-family: inherit; }
.modal-actions { display:flex; gap: 10px; justify-content: flex-end; margin-top: 10px; }

/* 打分显示 */
.score-big { font-size: 40px; font-weight: 900; }
.score-ring { display:inline-flex; align-items:center; justify-content:center; width: 84px; height:84px; border-radius:50%; }

/* 报告 */
table.rpt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rpt th, table.rpt td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
table.rpt th { color: var(--ink-soft); font-weight: 700; }

/* 打卡 */
.checkin-col { display:flex; flex-direction:column; gap: 14px; }
.ci-task { display:flex; align-items:center; gap:10px; padding: 12px 14px; border:1px solid var(--line); border-radius: 11px; }
.ci-task .ci-ico { width: 38px; height:38px; border-radius: 10px; display:flex; align-items:center; justify-content:center; font-size:18px; background:#eef1f7; }
.ci-task.done { background:#f3fbf6; border-color:#cdeed9; }
.ci-task[data-act] { cursor:pointer; transition: background .15s, box-shadow .15s; }
.ci-task[data-act]:hover { background:#f5f8ff; box-shadow: 0 2px 10px rgba(60,90,180,.12); }
/* 打卡行编辑器 */
.daily-row-card { background:#fbfcfe; }
.cs-input, .cs-select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; background:#fff; }
.cs-input { min-width: 120px; }
.daily-chk { display:inline-flex; align-items:center; gap:5px; font-size:14px; white-space:nowrap; }

/* 提示横幅 */
.banner { padding: 10px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; margin-bottom: 14px; }
.banner.warn { background: #fff4e6; color: #b9721a; }
.banner.info { background: #eaf1ff; color: #2f6bd8; }
.banner.ok { background: #e9f9f0; color: #1f9d57; }

.hidden { display: none !important; }
.locked-overlay { position:absolute; inset:0; background: rgba(8,12,22,.82); color:#fff; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:12px; border-radius:12px; text-align:center; padding:20px; }
.media-wrap { position: relative; }

/* ---------- 金币商城 ---------- */
.mall-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 4px; }
.mall-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; background: var(--panel); display: flex; flex-direction: column; align-items: center; gap: 8px; transition: transform .15s, box-shadow .15s; }
.mall-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.mall-img { width: 100%; max-width: 150px; aspect-ratio: 1/1; border-radius: 14px; overflow: hidden; }
.mall-img.sm { width: 56px; max-width: 56px; }
.prod-svg { width: 100%; height: 100%; display: block; }
.mall-name { font-weight: 700; font-size: 14px; }
.mall-price { font-weight: 800; color: var(--gold); }
.mall-preview-label { font-size: 12px; color: var(--ink-soft); }
#malfPreview, #mallPreview { display: block; }

/* ---------- 家长端密码锁 ---------- */
.lock-modal { max-width: 340px; }
.shake { animation: shake .4s; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-8px); }
  40%,80% { transform: translateX(8px); }
}
.modal-mask a { cursor: pointer; }

/* ---------- 闪卡 ---------- */
.seg-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.seg-tab { padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-weight: 700; }
.seg-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.tag.flash { background: #fff4e6; color: var(--brand); border: 1px solid #ffd9b3; }
.tag.flash.done { background: #e7f8ef; color: var(--green); border-color: #b6e6cd; }

.fc-card {
  margin: 6px 0 4px; padding: 30px 20px; border-radius: 18px;
  background: linear-gradient(135deg,#fff8f1,#eef4ff);
  border: 2px solid #ffd9b3; text-align: center; min-height: 160px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
}
.fc-word { font-size: 40px; font-weight: 900; letter-spacing: .5px; color: var(--ink); }
.fc-sentence { font-size: 18px; font-style: italic; color: var(--ink-soft); line-height: 1.5; }
.fc-hint { font-size: 14px; color: var(--ink-soft); }
.fc-score { font-size: 16px; color: var(--brand); }
.fc-progress { margin-bottom: 6px; }
.fc-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); gap: 10px; }
.fc-list-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.fc-li-word { font-weight: 800; font-size: 15px; }
.fc-li-meta { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }
.divider { height: 1px; background: var(--line); margin: 12px 0; }
.zh-only { } /* 仅家长端表格渲染，无需隐藏 */

/* ============ 自动分句编辑器 ============ */
.modal.wide { max-width: 720px; }
.as-row { display: flex; align-items: center; gap: 6px; padding: 6px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: #fff; flex-wrap: wrap; }
.as-idx { font-weight: 800; color: var(--brand); width: 26px; }
.as-st, .as-en { width: 64px; }
.as-dur { font-size: 12px; color: var(--ink-soft); }
.as-text { flex: 1; min-width: 160px; resize: vertical; font-size: 14px; }
.as-btns { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.btn.xs { padding: 3px 8px; font-size: 12px; }
.as-row.as-play { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(108,99,255,.22); background: #fbfbff; }
.btn.play { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn.play:hover { filter: brightness(1.05); }
#autoSegPlayer audio, #autoSegPlayer video { border-radius: 10px; background: #000; max-height: 280px; }

/* ============ 分句跟读练习 ============ */
.prog-strip { display: flex; gap: 6px; margin: 6px 0 14px; }
.prog-dot { width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; background: #eef1f6; color: var(--ink-soft); }
.prog-dot.cur { background: var(--brand); color: #fff; box-shadow: 0 0 0 3px rgba(108,99,255,.2); }
.prog-dot.done { background: #d6f5e3; color: #1a8a4f; }
.prog-dot[data-act] { cursor: pointer; transition: transform .12s; }
.prog-dot[data-act]:hover { outline: 2px solid var(--brand); transform: translateY(-2px); }
.seg-fulltext { margin-top: 14px; padding: 12px 14px; background: #f6f8ff; border: 1px dashed var(--line); border-radius: 12px; }
.seg-fulltext-body { font-size: 16px; line-height: 1.7; font-weight: 600; }
.sentence-text { font-size: 26px; font-weight: 800; text-align: center; padding: 16px 10px; background: #f6f8ff; border-radius: 12px; margin: 10px 0; letter-spacing: .4px; }
.countdown { text-align: center; font-size: 15px; color: var(--brand2); min-height: 22px; font-weight: 700; }
.score-card { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; text-align: center; background: #fff; }
.score-total { font-size: 38px; font-weight: 900; color: var(--brand); }
.score-dims { display: flex; gap: 14px; justify-content: center; margin-top: 6px; font-size: 14px; color: var(--ink); }
.big-score { font-size: 44px; font-weight: 900; color: var(--brand); }
.sent-preview { margin: 6px 0; padding: 8px 10px; background: #f6f8ff; border-radius: 10px; font-size: 13px; }
.sent-line { display: flex; gap: 6px; padding: 2px 0; }

/* ---------- 儿童切换器 / 账户 ---------- */
.child-switch { display: flex; align-items: center; gap: 8px; }
.cs-label { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.cs-select { padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line); background: #fff; font-size: 13px; font-weight: 700; color: var(--ink); }
.cs-add { padding: 6px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--ink); color: #fff; font-weight: 700; font-size: 12px; }
.cs-add:hover { background: #2c3a5e; }

/* ---------- 用户菜单（登录后） ---------- */
.user-menu { position: relative; display: inline-block; }
.user-menu-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 10px 4px 4px; border-radius: 22px;
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  font-weight: 700; font-size: 13px; cursor: pointer;
  transition: background .15s, box-shadow .15s;
}
.user-menu-btn:hover { background: #f6f8ff; box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.user-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 50%;
  font-weight: 900; font-size: 14px; color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,.12);
}
.user-menu-name { max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-btn .caret { font-size: 11px; color: var(--ink-soft); transition: transform .15s; }
.user-menu-btn[aria-expanded="true"] .caret { transform: rotate(180deg); }

.user-menu-pop {
  position: absolute; top: calc(100% + 6px); right: 0;
  min-width: 220px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.14);
  padding: 6px; z-index: 90;
  animation: umPop .12s ease-out;
}
@keyframes umPop { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.user-menu-head {
  display: flex; align-items: center; gap: 10px;
  padding: 10px; border-bottom: 1px solid var(--line); margin-bottom: 6px;
}
.user-menu-head .user-avatar { width: 36px; height: 36px; font-size: 16px; }
.user-menu-nm { font-weight: 800; font-size: 14px; color: var(--ink); }
.user-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border: 0; background: transparent;
  text-align: left; font-size: 13px; font-weight: 700; color: var(--ink);
  border-radius: 8px; cursor: pointer; transition: background .12s;
}
.user-menu-item:hover { background: #f0f4ff; }
.user-menu-item.danger { color: var(--red); }
.user-menu-item.danger:hover { background: #ffecec; }
.user-menu-item .ico { font-size: 15px; width: 20px; text-align: center; }
.user-menu-sep { height: 1px; background: var(--line); margin: 4px 0; }

/* ---------- 注册/登录 弹窗 Tab ---------- */
.acc-modal { max-width: 420px; width: 92%; }
.acc-tabs {
  display: flex; gap: 4px; background: #f0f4ff;
  padding: 4px; border-radius: 10px; margin-bottom: 14px;
}
.acc-tab {
  flex: 1; padding: 9px 14px; border: 0; background: transparent;
  font-weight: 800; font-size: 14px; color: var(--ink-soft);
  border-radius: 7px; cursor: pointer; transition: background .12s, color .12s;
}
.acc-tab:hover { color: var(--ink); }
.acc-tab.active {
  background: #fff; color: var(--brand);
  box-shadow: 0 2px 6px rgba(0,0,0,.06);
}
.acc-body { animation: umPop .15s ease-out; }
.acc-body.hide { display: none; }
.acc-body .field { margin-bottom: 12px; }
.acc-body .field label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--ink-soft); margin-bottom: 5px;
}
.acc-body .field input {
  width: 100%; padding: 9px 12px; border-radius: 8px;
  border: 1px solid var(--line); font-size: 14px; box-sizing: border-box;
}
.acc-body .field input:focus { outline: 0; border-color: var(--brand); }

/* 账户管理弹层 */
.modal.wide { max-width: 560px; width: 92%; }
.ac-section { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 12px; }
.ac-section h4 { margin: 0 0 10px; font-size: 14px; color: var(--ink); }
.ac-kids { display: flex; flex-direction: column; gap: 8px; }
.ac-kid { display: flex; align-items: center; gap: 8px; background: #f6f8ff; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; flex-wrap: wrap; }
.ac-kid-name { font-weight: 800; min-width: 80px; }
.ac-input { padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; min-width: 160px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.field input { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--line); font-size: 14px; }

/* 家长管理：快速定位跳转栏 + 跳转后目标区块短暂高亮 */
.jump-bar { background: #fbfcff; }
.jump-bar .btn.ghost.sm { font-size: 12px; padding: 4px 10px; }
@keyframes jumpFlash {
  0%   { box-shadow: 0 0 0 0 rgba(255, 184, 77, 0); }
  25%  { box-shadow: 0 0 0 4px rgba(255, 184, 77, .55); }
  100% { box-shadow: 0 0 0 0 rgba(255, 184, 77, 0); }
}
.jump-hl { animation: jumpFlash 1.5s ease 1; border-radius: 14px; }
.btn.xs { font-size: 11px; padding: 2px 8px; border-radius: 7px; }

/* 磨眼睛片段截取 */
.clip-row { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 6px; padding: 6px 8px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; }
.clip-row .clip-in { width: 84px; padding: 4px 6px; font-size: 13px; }
.clip-preview { width: 100%; max-width: 440px; aspect-ratio: 16/9; border-radius: 10px; background: #0b0b0b; display: block; }

/* 儿童端播放列表（当天打卡内容随机循环） */
.playlist-wrap { min-height: 80px; }
.playlist-wrap .pl-player .player { width: 100%; }
.playlist-wrap .pl-info { text-align: center; }

/* 儿童端磨耳朵：可见的当日播放列表（默认随机，可点选） */
.pl-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 10px 0 6px; }
.pl-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.pl-item { display: flex; align-items: center; gap: 10px; padding: 9px 12px; background: #fff; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; transition: background .15s, border-color .15s; }
.pl-item:hover { background: #fff8ec; border-color: var(--brand); }
.pl-item.cur { background: #fff3dd; border-color: var(--brand); box-shadow: 0 1px 4px rgba(255, 150, 40, .18); }
.pl-item.done .pl-name { color: var(--ink-soft); }
.pl-item .pl-no { flex: 0 0 22px; height: 22px; line-height: 22px; text-align: center; border-radius: 50%; background: #f1f3f7; color: var(--ink-soft); font-size: 12px; }
.pl-item.cur .pl-no { background: var(--brand); color: #fff; }
.pl-item .pl-name { flex: 1 1 auto; font-weight: 600; font-size: 14px; }
.pl-item .pl-sub { flex: 0 0 auto; }

/* 台词本 */
.scriptbook { background: #fffdf7; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; max-height: 520px; overflow: auto; }
.script-line { display: flex; gap: 10px; align-items: baseline; padding: 7px 4px; border-bottom: 1px dashed var(--line); }
.script-line:last-child { border-bottom: 0; }
.script-line .sl-no { flex: 0 0 26px; color: var(--muted); font-size: 12px; text-align: right; }
.script-line .sl-time { flex: 0 0 96px; color: var(--brand2); font-size: 12px; font-variant-numeric: tabular-nums; }
.script-line .sl-text { flex: 1; color: var(--ink); font-size: 15px; line-height: 1.6; }

/* 磨嘴巴：家长多选跟读片段 */
.seg-pick { display: flex; flex-direction: column; gap: 6px; }
.seg-pick-item { display: flex; align-items: center; gap: 8px; padding: 7px 10px; background: #f7f9fc; border: 1px solid var(--line); border-radius: 9px; cursor: pointer; }
.seg-pick-item input[type="checkbox"] { width: 16px; height: 16px; }
.seg-pick-item:hover { background: #eef3fb; }

/* 台词本 PDF 阅读 */
.pdf-wrap { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #f4f5f7; }
.pdf-frame { width: 100%; height: 70vh; min-height: 420px; border: 0; display: block; background: #fff; }

/* 原声播放速度选择器（磨嘴巴） */
.spd { font-size: 12px; padding: 3px 6px; border-radius: 7px; width: auto; min-width: 64px; }
.sent-line .spd { margin-left: auto; }

/* 磨耳朵儿童端：每句临时播放容器（不渲染整段播放器，避免「播放整段视频」） */
.ear-player-host { margin: 4px 0 8px; min-height: 8px; }
.ear-player-host audio, .ear-player-host video { width: 100%; border-radius: 10px; }

/* 儿童端：点击分句 → 放大浮层（大号文本 + 大号按钮） */
.sent-focus-overlay { position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(20, 24, 35, .46); z-index: 9000; backdrop-filter: blur(2px); padding: 18px; }
.sent-focus-box { background: #fff; border-radius: 22px; padding: 24px 26px 22px; width: min(92vw, 560px);
  text-align: center; box-shadow: 0 22px 60px rgba(0,0,0,.32); animation: encouragePop .26s ease; }
.sent-focus-bar { display: flex; align-items: center; justify-content: space-between; font-weight: 800; color: var(--ink-soft); margin-bottom: 10px; }
.sent-focus-x { border: none; background: #f1f3f7; color: var(--ink-soft); width: 34px; height: 34px; border-radius: 50%; font-size: 18px; cursor: pointer; line-height: 1; }
.sent-focus-x:hover { background: #e6ebf3; }
.sent-focus-text { font-size: clamp(26px, 6vw, 40px); font-weight: 800; line-height: 1.4; color: var(--ink); margin: 6px 0 12px; word-break: break-word; }
.sent-focus-meta { font-size: 15px; color: var(--ink-soft); margin-bottom: 18px; }
.sent-focus-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn.big { padding: 16px 26px; font-size: 19px; border-radius: 14px; min-width: 132px; }
.sent-focus-hint { margin-top: 14px; }

/* 放大浮层分屏：含视频时左视频、右文本（画中画式左右平铺）；纯音频时仅居中显示文本栏 */
.sent-focus-split { display: flex; align-items: stretch; width: auto; max-width: 96vw; max-height: 92vh;
  background: #fff; border-radius: 22px; overflow: hidden; box-shadow: 0 22px 60px rgba(0,0,0,.32); }
.sent-focus-overlay.with-video .sent-focus-split { width: min(1180px, 96vw); }
.sent-focus-overlay:not(.with-video) .sf-video-pane { display: none; }
.sf-video-pane { flex: 0 0 45%; background: #000; display: flex; align-items: center; justify-content: center; min-height: 340px; position: relative; }
.sf-video-pane video { width: 100%; height: 100%; max-height: 92vh; object-fit: contain; background: #000; }
.sf-pip-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 8px; align-items: center; padding: 8px 10px; background: rgba(0,0,0,.52); z-index: 2; }
.sf-pip-bar .btn { color: #fff; background: rgba(255,255,255,.16); border-color: transparent; }
.sf-pip-bar .btn:hover { background: rgba(255,255,255,.3); }
/* 音频素材：放大浮层左侧显示音频栏（磨耳朵音源也可能是音频） */
.sf-video-pane audio { width: 92%; max-width: 92%; }
/* 跟读按钮「正在录音」状态 */
.btn.recording { background: #c62828; color: #fff; border-color: #c62828; animation: recPulse 1s ease-in-out infinite; }
@keyframes recPulse { 0%, 100% { opacity: 1; } 50% { opacity: .55; } }
.sf-box-pane { flex: 1 1 auto; padding: 26px 28px 22px; display: flex; align-items: center; justify-content: center; overflow: auto; }
.sf-box-pane .sent-focus-box { width: 100%; max-width: 560px; box-shadow: none; animation: none; }

/* 分句行：文本可点击放大 + 🔍 按钮 */
.sent-ptext { cursor: pointer; }
.sent-ptext:hover { color: var(--brand); text-decoration: underline dotted; }
.sent-expand { border: none; background: #eef1f7; color: var(--ink-soft); width: 26px; height: 26px; border-radius: 8px; cursor: pointer; font-size: 13px; flex: 0 0 auto; }
.sent-expand:hover { background: var(--brand); color: #fff; }

/* 每日打卡：双击多选列表（眼/嘴/耳/闪卡） */
.pick-list { border: 1px solid var(--line); border-radius: 10px; padding: 6px; max-height: 210px; overflow: auto; background: #fff; }
.pick-item { padding: 7px 10px; border-radius: 8px; cursor: pointer; user-select: none; font-size: 14px; color: var(--ink); transition: background .12s; }
.pick-item:hover { background: #f1f6ff; }
.pick-item.sel { background: #e6efff; color: var(--brand2); font-weight: 600; }
.pick-done { color: var(--green); font-weight: 700; font-size: 12px; margin-left: 2px; }

/* ============ 儿童端：进入打卡内容后左导航栏自动隐藏 ============ */
.child-nav-hidden .sidenav { display: none; }
.child-nav-hidden .main { padding-left: 26px; } /* 给最左端的唤出按钮留一点空间 */
.child-nav-toggle {
  display: none;
  position: fixed; left: 0; top: 50%; transform: translateY(-50%);
  z-index: 55; align-items: center; gap: 6px;
  background: var(--ink); color: #fff; border: none; cursor: pointer;
  padding: 14px 12px; border-radius: 0 12px 12px 0;
  font-size: 14px; font-weight: 800; box-shadow: 0 6px 18px rgba(20,28,46,.28);
}
.child-nav-toggle:hover { background: #2c3a5e; }
.child-nav-hidden .child-nav-toggle { display: flex; }
/* 仅儿童端需要此按钮（避免家长端误显示）：非 child-nav-hidden 时彻底隐藏 */
body:not(.child-nav-hidden) .child-nav-toggle { display: none !important; }

/* ============ 儿童端：磨耳朵 / 磨嘴巴 列表与按钮字号（2026-09-14 调小，适配 iPad 与手机） ============ */
/* 磨耳朵：基准尺寸（iPad 舒适、不再巨大） */
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-ptext { font-size: 20px; line-height: 1.6; font-weight: 700; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list { display: flex; flex-direction: column; gap: 12px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-prow { flex-wrap: wrap; align-items: center; row-gap: 10px; padding: 10px 0; border-bottom: 2px dashed #e6e9f0; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-prow > .row { margin-left: 0; width: 100%; display: flex; gap: 14px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .sent-pidx { font-size: 17px; font-weight: 800; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .sent-pdur { font-size: 14px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .btn.xs,
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .btn.green.xs { font-size: 15px; padding: 12px 18px; border-radius: 12px; min-height: 44px; flex: 1 1 auto; font-weight: 700; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .sent-expand { width: 40px; height: 40px; font-size: 18px; border-radius: 12px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list select.spd { font-size: 15px; min-width: 96px; padding: 10px 10px; height: 44px; border-radius: 12px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .pill { font-size: 12px; padding: 5px 12px; border-radius: 99px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .small,
:is(body.child-ear, .seg-item[data-kind="ear"]) .seg-item .small { font-size: 13px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item { padding: 14px 12px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item .pl-no { flex: 0 0 30px; height: 30px; line-height: 30px; font-size: 13px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item .pl-name { flex: 1 1 auto; font-weight: 700; font-size: 17px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item .pl-sub { font-size: 13px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .pl-bar .btn.sm { font-size: 15px; padding: 11px 18px; border-radius: 12px; min-height: 42px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .pl-info { font-size: 13px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .seg-item .seg-name,
:is(body.child-ear, .seg-item[data-kind="ear"]) .seg-item h4 { font-size: 17px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .seg-head > span:first-child { font-size: 17px; font-weight: 700; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .seg-head .pill { font-size: 12px; padding: 5px 12px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .card > h3 { font-size: 15px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .audio-box audio, :is(body.child-ear, .seg-item[data-kind="ear"]) .pl-player audio,
:is(body.child-ear, .seg-item[data-kind="ear"]) .ear-player-host audio { width: 100%; height: 34px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-focus-text { font-size: clamp(26px, 5vw, 34px); line-height: 1.45; font-weight: 700; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-focus-meta { font-size: 15px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-focus-box .btn.big { font-size: 18px; padding: 14px 24px; min-height: 50px; border-radius: 14px; font-weight: 800; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .sent-focus-hint { font-size: 13px; line-height: 1.5; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .btn.rec-btn.xs .rec-bars { height: 12px; gap: 2px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .btn.rec-btn.xs .rec-bars i { width: 2px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .btn.rec-btn.big .rec-bars { height: 18px; gap: 3px; }
:is(body.child-ear, .seg-item[data-kind="ear"]) .btn.rec-btn.big .rec-bars i { width: 3px; }

/* 磨嘴巴：比磨耳朵略大、更醒目（约 1.4×），但不夸张（不依赖 body class，靠 data-kind 命中） */
.seg-item[data-kind="mouth"] .sent-ptext { font-size: 28px; line-height: 1.6; font-weight: 700; }
.seg-item[data-kind="mouth"] .sent-practice-list { display: flex; flex-direction: column; gap: 20px; }
.seg-item[data-kind="mouth"] .sent-prow { flex-wrap: wrap; align-items: center; row-gap: 16px; padding: 16px 0; border-bottom: 2px dashed #e6e9f0; }
.seg-item[data-kind="mouth"] .sent-prow > .row { margin-left: 0; width: 100%; display: flex; gap: 24px; }
.seg-item[data-kind="mouth"] .sent-practice-list .sent-pidx { font-size: 24px; font-weight: 800; }
.seg-item[data-kind="mouth"] .sent-practice-list .sent-pdur { font-size: 18px; }
.seg-item[data-kind="mouth"] .sent-practice-list .btn.xs,
.seg-item[data-kind="mouth"] .sent-practice-list .btn.green.xs { font-size: 20px; padding: 18px 28px; border-radius: 18px; min-height: 60px; flex: 1 1 auto; font-weight: 800; }
.seg-item[data-kind="mouth"] .sent-practice-list .sent-expand { width: 56px; height: 56px; font-size: 26px; border-radius: 16px; }
.seg-item[data-kind="mouth"] .sent-practice-list select.spd { font-size: 20px; min-width: 130px; padding: 14px; height: 56px; border-radius: 16px; }
.seg-item[data-kind="mouth"] .sent-practice-list .pill { font-size: 15px; padding: 7px 16px; border-radius: 99px; }
.seg-item[data-kind="mouth"] .sent-practice-list .small,
.seg-item[data-kind="mouth"] .seg-item .small { font-size: 15px; }
.seg-item[data-kind="mouth"] .pl-item { padding: 20px 14px; }
.seg-item[data-kind="mouth"] .pl-item .pl-no { flex: 0 0 40px; height: 40px; line-height: 40px; font-size: 17px; }
.seg-item[data-kind="mouth"] .pl-item .pl-name { flex: 1 1 auto; font-weight: 700; font-size: 24px; }
.seg-item[data-kind="mouth"] .pl-item .pl-sub { font-size: 16px; }
.seg-item[data-kind="mouth"] .pl-bar .btn.sm { font-size: 20px; padding: 16px 26px; border-radius: 18px; min-height: 56px; }
.seg-item[data-kind="mouth"] .pl-info { font-size: 16px; }
.seg-item[data-kind="mouth"] .seg-item .seg-name,
.seg-item[data-kind="mouth"] .seg-item h4 { font-size: 22px; }
.seg-item[data-kind="mouth"] .seg-head > span:first-child { font-size: 22px; font-weight: 700; }
.seg-item[data-kind="mouth"] .seg-head .pill { font-size: 15px; padding: 7px 16px; }
.seg-item[data-kind="mouth"] .card > h3 { font-size: 18px; }
.seg-item[data-kind="mouth"] .audio-box audio, .seg-item[data-kind="mouth"] .pl-player audio,
.seg-item[data-kind="mouth"] .ear-player-host audio { width: 100%; height: 40px; }
.seg-item[data-kind="mouth"] .sent-focus-text { font-size: clamp(38px, 8vw, 52px); line-height: 1.4; font-weight: 700; }
.seg-item[data-kind="mouth"] .sent-focus-meta { font-size: 20px; }
.seg-item[data-kind="mouth"] .sent-focus-box .btn.big { font-size: 26px; padding: 22px 34px; min-height: 74px; border-radius: 22px; font-weight: 800; }
.seg-item[data-kind="mouth"] .sent-focus-hint { font-size: 17px; line-height: 1.5; }
.seg-item[data-kind="mouth"] .btn.rec-btn.xs .rec-bars { height: 20px; gap: 3px; }
.seg-item[data-kind="mouth"] .btn.rec-btn.xs .rec-bars i { width: 3px; }
.seg-item[data-kind="mouth"] .btn.rec-btn.big .rec-bars { height: 28px; gap: 5px; }
.seg-item[data-kind="mouth"] .btn.rec-btn.big .rec-bars i { width: 5px; }

/* ============ 台词本全屏阅读器 ============ */
.script-reader { position: fixed; inset: 0; display: none; flex-direction: column;
  background: #1b2336; z-index: 9500; }
.script-reader.open { display: flex; }
.sr-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: #232c44; color: #fff; }
.sr-title { font-weight: 800; font-size: 16px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-page { font-size: 14px; color: #cdd6ee; white-space: nowrap; }
.sr-close { border: none; background: #3a4566; color: #fff; width: 38px; height: 38px; border-radius: 10px; font-size: 18px; cursor: pointer; flex: 0 0 auto; }
.sr-close:hover { background: #4a577e; }
.sr-stage { position: relative; flex: 1; overflow: hidden; background: #2a3450; }
.sr-pdf { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; padding: 14px; }
.sr-pdf canvas { max-width: 100%; max-height: 100%; box-shadow: 0 8px 30px rgba(0,0,0,.4); background: #fff; }
.sr-pdf iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.sr-text { width: 100%; height: 100%; overflow: auto; padding: 22px; color: #f3f6ff; }
.sr-text .script-line { border-bottom: 1px dashed #44507a; }
.sr-text .sl-text { color: #f3f6ff; font-size: 18px; }
/* 翻页点击区：常驻可见（iPad 无 hover，需让孩子看得见），hover/按下更明显 */
.sr-zone { position: absolute; top: 0; bottom: 0; width: 46%; cursor: pointer; display: flex; align-items: center; opacity: .55; transition: opacity .15s; }
.sr-zone.prev { left: 0; justify-content: flex-start; padding-left: 18px; }
.sr-zone.next { right: 0; justify-content: flex-end; padding-right: 18px; }
.sr-zone .arrow { font-size: 44px; color: #fff; background: rgba(0,0,0,.32); border-radius: 50%; width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; }
.sr-stage:hover .sr-zone { opacity: 1; }
.sr-zone:active { opacity: 1; }
/* 文本模式（家长未上传 PDF）：隐藏翻页区，避免误导 */
.sr-stage.text-mode .sr-zone { display: none; }
.sr-stage.text-mode .sr-hint { display: none; }
.sr-audio { padding: 8px 16px 0; background: #232c44; }
.sr-audio audio { width: 100%; }
.sr-tip { padding: 4px 16px 10px; background: #232c44; color: #9fb0cf; font-size: 12px; text-align: center; }
.sr-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  font-size: 13px; color: #cdd6ee; background: rgba(0,0,0,.35); padding: 5px 12px; border-radius: 99px; pointer-events: none; }

/* ---------- 跟读录音：图标态（跳动音量条）+ 回放（2026-09-12） ---------- */
/* 录音控件容器：录音按钮 + 结束后的回放按钮 */
.rec-wrap { display: inline-flex; align-items: center; gap: 8px; }
.rec-btn { display: inline-flex; align-items: center; justify-content: center; }
/* 录音中：变红、只显示跳动音量条图标（不显示文字） */
.rec-btn.recording { background: #e5484d; color: #fff; }
.rec-btn.recording:hover { filter: brightness(1.05); }
.rec-bars { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; }
.rec-bars i { display: block; width: 3px; height: 6px; border-radius: 2px; background: #fff;
  animation: recBar .8s ease-in-out infinite; }
.rec-bars i:nth-child(2) { animation-delay: .15s; }
.rec-bars i:nth-child(3) { animation-delay: .3s; }
@keyframes recBar {
  0%, 100% { height: 5px; opacity: .7; }
  50% { height: 16px; opacity: 1; }
}
/* 小尺寸（分句卡片 xs）与大尺寸（放大浮层 big）适配 */
.btn.rec-btn.xs .rec-bars { height: 12px; gap: 2px; }
.btn.rec-btn.xs .rec-bars i { width: 2px; }
.btn.rec-btn.xs.recording .rec-bars i { animation-duration: .7s; }
.btn.rec-btn.big .rec-bars { height: 20px; gap: 4px; }
.btn.rec-btn.big .rec-bars i { width: 4px; }
@keyframes recBarBig { 0%, 100% { height: 6px; } 50% { height: 20px; } }
.btn.rec-btn.big.recording .rec-bars i { animation-name: recBarBig; }
/* 回放按钮 */
.rec-play { color: var(--green); font-weight: 700; }

/* ============================================================================
   响应式适配：iPad 竖屏（≤1024px）与 手机（≤700px / ≤380px）
   仅用 CSS 覆盖，不改 DOM 与逻辑；运行时 body class（child-nav-hidden / child-ear）不受影响。
   桌面（>1024px）版面保持不变。
   ========================================================================== */

/* ---------------- iPad 竖屏及以下（≤1024px） ---------------- */
@media (max-width: 1024px) {
  /* 顶栏：允许换行，仪表盘在空间不足时自然折行 */
  .topbar { gap: 12px; padding: 10px 14px; flex-wrap: wrap; }
  .brand { min-width: 0; }
  .dashboard { flex: 1 1 auto; flex-wrap: wrap; gap: 10px; }
  .kpi { min-width: 124px; padding: 7px 12px; }
  .progress-wrap { min-width: 190px; }

  /* 侧栏不再吸顶（顶栏可能变高，避免被遮挡） */
  .layout { min-height: 0; }
  .sidenav { width: 158px; height: auto; position: static; top: auto; padding: 12px 8px; }
  .nav-item { padding: 11px 10px; }
  .main { padding: 14px 16px; }

  .grid3 { grid-template-columns: repeat(2, 1fr); }

  /* 宽表格：让所在卡片横向滚动，避免撑破版面 */
  .card:has(table.rpt) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.rpt { min-width: 560px; }

  .modal { width: min(680px, 94vw); }
  .sent-focus-overlay.with-video .sent-focus-split { width: min(1000px, 96vw); }
}

/* ---------------- 手机（≤700px） ---------------- */
@media (max-width: 700px) {
  /* 兜底：禁止整页横向溢出（宽表格/长文本各自容器内滚动） */
  html, body { overflow-x: hidden; max-width: 100%; }
  body { font-size: 15px; }

  /* 顶栏：不吸顶、纵向堆叠，尽量省竖向空间 */
  .topbar {
    position: static; flex-wrap: wrap; gap: 8px 10px; padding: 10px 12px;
    padding-left: max(12px, env(safe-area-inset-left));
    padding-right: max(12px, env(safe-area-inset-right));
  }
  .brand { flex: 1 1 auto; min-width: 0; order: 0; }
  .logo { font-size: 22px; }
  .brand-title { font-size: 15px; }
  .brand-sub { display: inline; font-size: 10px; }
  .brand-sub .ver { display: inline; }
  .role-switch { order: 1; margin-left: auto; flex-direction: row; align-items: center; gap: 8px; }
  .role-label { display: none; }
  .seg button { padding: 7px 10px; font-size: 13px; }
  .child-switch { order: 2; flex: 1 1 auto; }
  .dashboard {
    order: 3; flex: 1 1 100%; flex-wrap: nowrap; overflow-x: auto;
    -webkit-overflow-scrolling: touch; gap: 8px; padding-bottom: 2px;
  }
  .kpi { min-width: 112px; flex: 0 0 auto; padding: 6px 10px; border-radius: 10px; }
  .kpi .k-val { font-size: 17px; }
  .progress-wrap { flex: 0 0 auto; min-width: 170px; }
  .progress-meta { font-size: 10px; }

  /* 布局：侧栏 → 顶部横向滚动条 */
  .layout { flex-direction: column; min-height: 0; }
  .sidenav {
    width: 100%; height: auto; position: static; top: auto;
    flex-direction: row; align-items: center; gap: 8px;
    padding: 8px 10px; border-right: 0; border-bottom: 1px solid var(--line);
    overflow-x: auto; -webkit-overflow-scrolling: touch;
  }
  .sidenav .nav-item { width: auto; flex: 0 0 auto; white-space: nowrap; padding: 9px 14px; font-size: 14px; }
  .sidenav .nav-item .badge { margin-left: 6px; }
  .nav-sep, .nav-tip { display: none; }
  .main { padding: 12px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }

  /* 网格单列 */
  .grid2, .grid3 { grid-template-columns: 1fr; gap: 10px; }
  .card { padding: 14px; border-radius: 12px; margin-bottom: 12px; }
  .card h3 { font-size: 15px; }

  /* 页签横向滚动 */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 6px; padding-bottom: 2px; }
  .tab { flex: 0 0 auto; white-space: nowrap; padding: 9px 14px; font-size: 14px; }

  /* 宽表格横向滚动 */
  .card:has(table.rpt) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.rpt { min-width: 520px; font-size: 12px; }
  table.rpt th, table.rpt td { padding: 6px 8px; }

  /* 表单：≥16px 可防止 iOS 聚焦时自动放大页面 */
  input, select, textarea, .cs-input, .cs-select,
  .acc-body .field input, .ac-input, .field input, .field select, .field textarea { font-size: 16px; }

  /* 按钮：加大点按区域 */
  .btn { padding: 10px 15px; }
  .btn.sm { padding: 8px 12px; font-size: 13px; }
  .btn.xs, .btn.ghost.xs { padding: 6px 10px; font-size: 12px; }

  /* 弹窗：留更多可用宽度，按钮自动铺满 */
  .modal { padding: 16px; width: 94vw; border-radius: 14px; max-height: 90vh; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .btn { flex: 1 1 auto; }
  .acc-modal, .modal.wide { width: 94vw; }

  /* 放大浮层：左右分屏 → 上下堆叠（视频/音频在上，文本在下） */
  .sent-focus-overlay { padding: 10px; }
  .sent-focus-split, .sent-focus-overlay.with-video .sent-focus-split {
    flex-direction: column; width: 96vw; max-height: 94vh; border-radius: 18px;
  }
  .sf-video-pane { flex: 0 0 auto; min-height: 0; width: 100%; }
  .sf-video-pane video { max-height: 38vh; }
  .sf-video-pane audio { width: 94%; }
  .sf-box-pane { padding: 16px 14px; overflow: auto; }

  /* 跟读进度点：数量多时换行，避免溢出 */
  .prog-strip { flex-wrap: wrap; }

  /* 台词本行：时间列收窄 */
  .script-line .sl-time { flex: 0 0 62px; }
  .script-line .sl-text { font-size: 14px; }
  .sr-text .sl-text { font-size: 16px; }
  .sr-zone .arrow { width: 52px; height: 52px; font-size: 34px; }
  .sr-top { padding: 8px 10px; gap: 8px; }
  .sr-title { font-size: 15px; }
  .pdf-frame { height: 60vh; min-height: 320px; }

  /* 儿童端列表/按钮：手机屏更窄，进一步缩小 */
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-ptext { font-size: 17px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .btn.xs,
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .btn.green.xs {
    font-size: 14px; padding: 10px 16px; min-height: 40px; border-radius: 10px;
  }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list { gap: 10px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list .sent-expand { width: 34px; height: 34px; font-size: 16px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-practice-list select.spd { font-size: 14px; min-width: 84px; height: 40px; padding: 8px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item { padding: 12px 10px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item .pl-name { font-size: 16px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .pl-item .pl-no { flex: 0 0 26px; height: 26px; line-height: 26px; font-size: 12px; }

  .seg-item[data-kind="mouth"] .sent-ptext { font-size: 22px; }
  .seg-item[data-kind="mouth"] .sent-practice-list { gap: 14px; }
  .seg-item[data-kind="mouth"] .sent-practice-list .btn.xs,
  .seg-item[data-kind="mouth"] .sent-practice-list .btn.green.xs {
    font-size: 17px; padding: 14px 20px; min-height: 48px; border-radius: 14px;
  }
  .seg-item[data-kind="mouth"] .sent-practice-list .sent-pidx { font-size: 19px; }
  .seg-item[data-kind="mouth"] .sent-practice-list .sent-pdur { font-size: 14px; }
  .seg-item[data-kind="mouth"] .sent-practice-list .sent-expand { width: 44px; height: 44px; font-size: 20px; }
  .seg-item[data-kind="mouth"] .sent-practice-list select.spd { font-size: 17px; min-width: 110px; height: 46px; padding: 10px; }
  .seg-item[data-kind="mouth"] .pl-item { padding: 14px 12px; }
  .seg-item[data-kind="mouth"] .pl-item .pl-name { font-size: 19px; }
  .seg-item[data-kind="mouth"] .pl-item .pl-no { flex: 0 0 32px; height: 32px; line-height: 32px; font-size: 14px; }
  .seg-item[data-kind="mouth"] .seg-item h4 { font-size: 18px; }
  .seg-item[data-kind="mouth"] .sent-focus-text { font-size: clamp(28px, 7vw, 40px); }

  /* 商城 / 闪卡：网格自动收紧 */
  .mall-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .fc-list { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  .fc-card { padding: 22px 14px; }
  .fc-word { font-size: 34px; }
  .fc-sentence { font-size: 16px; }

  /* 脚本阅读器 / 自动分句编辑器 */
  .as-st, .as-en { width: 56px; }
  .as-text { min-width: 120px; }
  #autoSegPlayer audio, #autoSegPlayer video { max-height: 220px; }
}

/* ---------------- 小屏手机（≤380px） ---------------- */
@media (max-width: 380px) {
  .kpi { min-width: 100px; }
  .brand-title { font-size: 14px; }
  .seg button { padding: 6px 8px; font-size: 12px; }
  .btn { padding: 9px 12px; }
  .sidenav .nav-item { padding: 8px 12px; font-size: 13px; }
  :is(body.child-ear, .seg-item[data-kind="ear"]) .sent-ptext { font-size: 16px; }
  .seg-item[data-kind="mouth"] .sent-ptext { font-size: 20px; }
}

/* 兜底（任何断点都安全）：让 flex 子项允许收缩，避免宽内容把整页撑出横向滚动 */
.layout, .main, .tab-body, .dashboard, .topbar, .card { min-width: 0; }
.tab-body { overflow-x: clip; }


