/* =============================
   Talk8 MVP 样式（移动优先）
   ============================= */
:root {
  --brand: #e64c3c;
  --brand-2: #ff7a5c;
  --ink: #222831;
  --sub: #6b7280;
  --line: #eef0f4;
  --bg: #f5f6fa;
  --ok: #2ecc71;
  --warn: #f39c12;
  --bad: #e74c3c;
  --card: #ffffff;
  --radius: 16px;
  --shadow: 0 4px 16px rgba(30, 30, 60, .08);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.5;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 84px;
}

/* ---------- 页面通用 ---------- */
.page { padding: 16px; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h2 { font-size: 18px; margin-bottom: 10px; }
.card h3 { font-size: 15px; margin-bottom: 8px; color: var(--sub); }
.section-title { font-size: 15px; font-weight: 700; margin: 18px 0 10px; color: var(--ink); }
.muted { color: var(--sub); font-size: 13px; }
.empty { text-align: center; color: var(--sub); padding: 28px 0; font-size: 14px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border: none; border-radius: 12px; padding: 12px 18px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  background: #eef1f6; color: var(--ink);
  transition: transform .1s, opacity .15s;
  font-family: inherit;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .45; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn-ok { background: var(--ok); color: #fff; }
.btn-warn { background: var(--warn); color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--sub); }
.btn-block { display: flex; width: 100%; }
.btn-row { display: flex; gap: 10px; }

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; border-radius: var(--radius);
  padding: 20px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.hero h1 { font-size: 22px; }
.hero .sub { opacity: .9; font-size: 13px; margin-top: 6px; }
.hero .streak { margin-top: 12px; font-size: 13px; opacity: .95; }

.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.chip {
  background: var(--card); border-radius: 12px; padding: 12px 14px;
  box-shadow: var(--shadow); font-size: 14px; font-weight: 600;
  display: flex; flex-direction: column; gap: 4px;
}
.chip .num { font-size: 22px; color: var(--brand); }
.chip .lbl { color: var(--sub); font-weight: 400; font-size: 12px; }

.unit-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.unit-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 10px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.unit-card .u { font-size: 24px; font-weight: 800; color: var(--brand); }
.unit-card .t { font-size: 11px; color: var(--sub); line-height: 1.3; }
.unit-card .done { font-size: 12px; color: var(--ok); font-weight: 600; }
.unit-card.locked { opacity: .45; }
.unit-card.today { outline: 3px solid var(--brand-2); outline-offset: 2px; }

/* ---------- 词汇卡 ---------- */
.word-card {
  background: var(--card); border-radius: 16px; box-shadow: var(--shadow);
  padding: 18px 16px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 12px;
  border-left: 5px solid var(--brand);
}
.word-card .w { font-size: 24px; font-weight: 800; }
.word-card .ipa { font-size: 14px; color: var(--sub); font-style: italic; }
.word-card .mean { font-size: 14px; color: var(--sub); margin-left: auto; text-align: right; }

/* ---------- 练习播放器 ---------- */
.player {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 16px; margin-bottom: 14px;
}
.player .ptext { font-size: 18px; line-height: 1.7; margin: 12px 0; }
.player .pills { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.pill {
  font-size: 12px; padding: 5px 10px; border-radius: 20px;
  background: #eef1f6; color: var(--sub); font-weight: 600;
}
.speed-btn {
  border: 1px solid var(--brand); color: var(--brand);
  background: #fff; border-radius: 8px; padding: 2px 8px; font-size: 12px; cursor: pointer;
}
.speed-btn.active { background: var(--brand); color: #fff; }

/* ---------- 跟读页 ---------- */
.read-target {
  background: #fff7f2; border: 1px dashed var(--brand-2); border-radius: 12px;
  padding: 14px; font-size: 20px; line-height: 2; margin: 12px 0;
}
.ipa-hint { font-size: 13px; color: var(--sub); margin-bottom: 10px; }
.recorder {
  border-radius: 20px; padding: 14px; text-align: center; font-size: 14px; font-weight: 600;
  margin: 12px 0;
}
.recorder.idle { background: #eef1f6; color: var(--ink); }
.recorder.listening { background: #fff3e0; color: #e67e22; }
.recorder.analyzing { background: #e3f2fd; color: #1976d2; }
.wave {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  height: 36px; margin: 10px 0;
}
.wave i {
  width: 4px; border-radius: 2px; background: var(--brand-2);
  height: 10%; transition: height .07s;
}

/* ---------- 侧边进度条 / 作答题 ---------- */
.quiz-stem { font-size: 16px; margin-bottom: 12px; font-weight: 600; }
.opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  background: #fff; border: 2px solid #e6e8ef; border-radius: 12px;
  padding: 12px 14px; font-size: 16px; font-family: inherit; cursor: pointer;
  margin-bottom: 10px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.opt:active { transform: scale(.98); }
.opt .k {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: #eef1f6; font-weight: 700; color: var(--sub);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.opt.correct { border-color: var(--ok); background: #f0fdf4; }
.opt.correct .k { background: var(--ok); color: #fff; }
.opt.wrong { border-color: var(--bad); background: #fdf0f0; }
.opt.wrong .k { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; }

.review {
  border-radius: 12px; padding: 12px; font-size: 14px; margin-bottom: 10px;
}
.review.right { background: #f0fdf4; color: #1d7a44; }
.review.wrong { background: #fdf2f2; color: #b33a3a; }
.next-only { margin-top: 14px; }

/* ---------- 反馈页（评分结果） ---------- */
.score-hero { text-align: center; }
.score-hero .total {
  font-size: 44px; font-weight: 800;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.grade { font-size: 15px; color: var(--sub); }

.dims { margin-top: 8px; }
.dim { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 13px; }
.dim .name { width: 118px; color: var(--sub); }
.dim .bar { flex: 1; height: 10px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.dim .bar i { display: block; height: 100%; border-radius: 5px; transition: width .5s; }
.dim .val { width: 36px; text-align: right; font-weight: 700; }

.feedback {
  background: #fff7f2; border-left: 4px solid var(--brand);
  border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.7;
  margin: 12px 0;
}
.feedback b { color: var(--brand); }

/* 词级染色标注 */
.mk { display: inline-block; min-width: 1ch; }
.mk.good { color: #1d7a44; font-weight: 600; }
.mk.near { color: var(--warn); font-weight: 700; text-decoration: underline wavy var(--warn); }
.mk.bad { color: var(--bad); font-weight: 700; text-decoration: underline var(--bad); }
.mk.miss { color: var(--sub); background: #f1f3f7; padding: 0 4px; border-radius: 4px; }
.mk.extra { color: #999; text-decoration: line-through; }
.mkline { font-size: 19px; line-height: 2.2; margin: 4px 0; word-break: break-word; }

/* ---------- 录音条 ---------- */
.rec-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-size: 13px; color: var(--sub); }
.rec-row audio { flex: 1; height: 34px; }

/* ---------- 步骤 / 目标 ---------- */
.objectives { background: #e3f2fd; border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.objectives li { list-style: none; padding-left: 24px; border: none; }
.objective-item { display: flex; align-items: center; gap: 8px; }
.objective-item input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); }

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; max-width: 480px; margin: 0 auto;
  background: #fff; border-top: 1px solid var(--line);
  display: flex; padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 10;
}
.tab {
  flex: 1; text-align: center; padding: 6px 0; font-size: 12px; color: var(--sub);
  background: none; border: none; font-family: inherit; cursor: pointer;
}
.tab .ic { font-size: 20px; display: block; }
.tab.on { color: var(--brand); font-weight: 700; }

/* ---------- 错题本 ---------- */
.err-item {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 12px; padding: 12px;
  box-shadow: var(--shadow); margin-bottom: 10px;
}
.err-item .txt { flex: 1; font-size: 14px; line-height: 1.4; }
.err-item .re { color: var(--bad); font-size: 12px; font-weight: 700; }
.err-item .done { color: var(--ok); font-size: 11px; font-weight: 600; }
.err-tag { font-size: 11px; padding: 3px 8px; border-radius: 10px; font-weight: 600; }
.err-tag.listening { background: #e3f2fd; color: #1976d2; }
.err-tag.speaking { background: #fef3e2; color: #b26a00; }

/* ---------- 家长页 ---------- */
.kp-banner {
  background: linear-gradient(135deg, #6a5af9, #a78bfa); color: #fff;
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 14px;
}

/* ---------- 提示条 ---------- */
.notice {
  background: #fffbe6; border: 1px solid #ffe58f; color: #8a6d00;
  border-radius: 12px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px;
}
