:root {
  --bg: #f4f6fd;
  --card: #ffffff;
  --ink: #1f2b46;
  --muted: #6b7a99;
  --line: #e6eaf5;
  --brand: #4f6df5;
  --brand-soft: #eaefff;
  --accent: #ff9f43;
  --ok: #16a34a;
  --ok-soft: #e7f8ee;
  --bad: #e5484d;
  --bad-soft: #fdecec;
  --radius: 20px;
  --shadow: 0 8px 24px rgba(31, 43, 70, 0.08);
}

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  padding-bottom: 92px;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 16px 12px;
}

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

button {
  font-family: inherit;
  color: inherit;
  border: none;
  background: none;
  cursor: pointer;
}

/* ---------- 首页 ---------- */
.hero {
  background: linear-gradient(135deg, #4f6df5 0%, #7b9bff 55%, #9db8ff 100%);
  color: #fff;
  border-radius: 26px;
  padding: 20px 22px 24px;
  box-shadow: 0 14px 30px rgba(79, 109, 245, 0.28);
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 8px; }

.pill {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 13px;
}

.hero h1 { font-size: 24px; letter-spacing: 0.5px; }

.hero .sub { margin-top: 8px; font-size: 14px; opacity: 0.9; }

.quick { display: flex; gap: 12px; margin: 16px 0 4px; }

.quick-card {
  flex: 1;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}

.quick-card:active { transform: scale(0.97); }

.quick-card b { font-size: 26px; color: var(--brand); line-height: 1.1; }

.quick-card span { font-size: 13px; color: var(--muted); margin-top: 4px; }

.panel {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 18px 18px;
  margin-top: 14px;
  box-shadow: var(--shadow);
}

.panel h2 { font-size: 16px; margin-bottom: 10px; }

.panel h2 small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 6px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip-btn {
  border: 1.5px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 14px;
  color: var(--ink);
  transition: all 0.15s ease;
}

.chip-btn.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 6px 14px rgba(79, 109, 245, 0.25);
}

/* ---------- 按钮 ---------- */
.btn {
  display: block;
  width: 100%;
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 17px;
  font-weight: 700;
  margin-top: 16px;
  text-align: center;
  transition: transform 0.12s ease, opacity 0.12s ease;
}

.btn:active { transform: scale(0.98); }

.btn.primary {
  background: linear-gradient(135deg, #4f6df5, #6f8bff);
  color: #fff;
  box-shadow: 0 10px 22px rgba(79, 109, 245, 0.3);
}

.btn.primary.big { padding: 18px; font-size: 18px; margin-top: 20px; }

.btn.ghost { background: #fff; border: 1.5px solid var(--line); color: var(--ink); box-shadow: none; }

.btn.link { background: none; color: var(--muted); font-weight: 500; }

.btn.danger { background: var(--bad-soft); color: var(--bad); }

.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

.btn.file { position: relative; overflow: hidden; }

.btn.file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.tip { text-align: center; color: var(--muted); font-size: 13px; margin-top: 12px; }

/* ---------- 答题 ---------- */
.qtop { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }

.icon {
  width: 40px; height: 40px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow);
  font-size: 17px;
  color: var(--muted);
  flex: none;
}

.bar { flex: 1; height: 10px; background: #e6eaf5; border-radius: 999px; overflow: hidden; }

.bar > span { display: block; height: 100%; background: linear-gradient(90deg, #4f6df5, #82a0ff); border-radius: 999px; transition: width 0.3s ease; }

.bar.small { height: 8px; flex: 1; margin: 0 10px; }

.counter { font-size: 13px; color: var(--muted); min-width: 44px; text-align: right; }

.card {
  background: var(--card);
  border-radius: 24px;
  padding: 20px 18px 22px;
  box-shadow: var(--shadow);
  min-height: 420px;
}

.badge {
  display: inline-block;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  border-radius: 999px;
  padding: 4px 10px;
}

.qtitle { font-size: 19px; margin: 10px 0 6px; }

.stem { margin: 12px 0 18px; }

.big-cn { font-size: 38px; font-weight: 800; letter-spacing: 2px; }

.pos { color: var(--muted); font-size: 14px; margin-top: 2px; }

.speaker {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 18px;
  padding: 18px 20px;
  font-size: 30px;
  width: 100%;
}

.speaker span { font-size: 15px; font-weight: 600; }

.picture {
  font-size: 84px;
  text-align: center;
  background: #f8faff;
  border-radius: 20px;
  padding: 14px 0;
  line-height: 1.2;
}

.cn-hint { color: var(--muted); font-size: 16px; margin-top: 10px; }

.cn-hint.big { font-size: 30px; color: var(--ink); font-weight: 700; }

.masked {
  font-family: "SF Mono", Consolas, "Courier New", monospace;
  font-size: 34px;
  letter-spacing: 8px;
  font-weight: 700;
}

.sentence { font-size: 21px; line-height: 1.7; font-weight: 500; }

.blank { color: var(--brand); letter-spacing: 2px; }

/* 选项 */
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.opt {
  background: #f7f9ff;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  padding: 16px 12px;
  font-size: 18px;
  font-weight: 600;
  word-break: break-word;
  transition: all 0.15s ease;
}

.opt:active { transform: scale(0.98); }

.opt.right { background: var(--ok-soft); border-color: var(--ok); color: var(--ok); }

.opt.wrong { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }

/* 输入 */
.input {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 22px;
  font-family: inherit;
  outline: none;
  background: #fbfcff;
  letter-spacing: 1px;
}

.input:focus { border-color: var(--brand); background: #fff; }

.typed {
  border-radius: 16px;
  padding: 15px 16px;
  font-size: 22px;
  font-weight: 700;
  word-break: break-word;
}

.typed.ok { background: var(--ok-soft); color: var(--ok); }

.typed.bad { background: var(--bad-soft); color: var(--bad); text-decoration: line-through; }

.hintline { color: var(--muted); font-size: 13px; margin-top: 8px; min-height: 18px; }

/* 拼字 */
.slots {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 62px;
  background: #f8faff;
  border-radius: 16px;
  padding: 10px;
  margin-bottom: 14px;
}

.slot {
  min-width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1.5px dashed #c9d4ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--brand);
  background: #fff;
  padding: 0 10px;
}

.slot.filled { border-style: solid; border-color: var(--brand); background: var(--brand-soft); }

.slot.letter { min-width: 40px; padding: 0 4px; }

.tchips { display: flex; flex-wrap: wrap; gap: 8px; }

.tchip {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 19px;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(31, 43, 70, 0.06);
}

.tchip.used { opacity: 0.28; }

/* 反馈 */
.fb { border-radius: 18px; padding: 14px 16px; margin-bottom: 4px; }

.fb.ok { background: var(--ok-soft); }

.fb.bad { background: var(--bad-soft); }

.fb-title { font-weight: 800; font-size: 17px; margin-bottom: 8px; }

.fb.ok .fb-title { color: var(--ok); }

.fb.bad .fb-title { color: var(--bad); }

.wordline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.wordline b { font-size: 24px; }

.ipa { color: var(--muted); font-size: 14px; }

.cn { color: var(--muted); font-size: 15px; }

.mini {
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 14px;
  color: var(--brand);
}

.mini.ok { color: var(--ok); }

.sent { margin-top: 10px; font-size: 15px; color: var(--ink); }

.sent span { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ---------- 结果 ---------- */
.result { text-align: center; padding: 10px 0 4px; }

.ring { width: 168px; height: 168px; border-radius: 50%; margin: 0 auto 14px; display: grid; place-items: center; }

.ring-in {
  width: 132px; height: 132px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 0 1px var(--line);
}

.ring-in b { font-size: 34px; }

.ring-in span { color: var(--muted); font-size: 14px; }

.result h2 { font-size: 22px; }

.muted { color: var(--muted); font-size: 14px; }

.small { font-size: 12px; }

.row { display: flex; align-items: center; font-size: 14px; margin: 8px 0; }

.row span { width: 118px; flex: none; }

.row em { font-style: normal; color: var(--muted); font-size: 13px; min-width: 48px; text-align: right; }

/* ---------- 错题本 ---------- */
.page-head { padding: 6px 4px 12px; }

.page-head h1 { font-size: 26px; }

.page-head p { color: var(--muted); font-size: 14px; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }

.tag { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; font-size: 12px; color: var(--muted); }

.wrong-list { display: flex; flex-direction: column; gap: 10px; }

.wrong-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 16px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px rgba(31, 43, 70, 0.06);
}

.wi-main b { font-size: 19px; margin-right: 8px; }

.wi-main .meta { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.wi-acts { display: flex; gap: 6px; flex: none; }

.empty { text-align: center; color: var(--muted); padding: 40px 0 10px; font-size: 15px; }

/* ---------- 统计 ---------- */
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 4px; }

.kpi { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); display: flex; flex-direction: column; }

.kpi b { font-size: 26px; color: var(--brand); }

.kpi span { font-size: 12px; color: var(--muted); }

.days { display: flex; align-items: flex-end; justify-content: space-between; height: 80px; gap: 6px; }

.day { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; }

.day .col { width: 100%; max-width: 26px; background: linear-gradient(180deg, #82a0ff, #4f6df5); border-radius: 8px 8px 4px 4px; }

.day span { font-size: 10px; color: var(--muted); margin-top: 4px; }

/* ---------- 设置 ---------- */
.switch { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; font-size: 15px; }

.switch input { width: 22px; height: 22px; accent-color: var(--brand); }

input[type="range"] { width: 100%; accent-color: var(--brand); height: 32px; }

/* ---------- 导航 ---------- */
.nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  z-index: 20;
}

.nav-item {
  flex: 1;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0;
  color: var(--muted);
  font-size: 11px;
  border-radius: 12px;
}

.nav-item i { font-style: normal; font-size: 20px; line-height: 1; }

.nav-item.on { color: var(--brand); background: var(--brand-soft); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 110px;
  transform: translate(-50%, 20px);
  background: rgba(31, 43, 70, 0.92);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 50;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }




.options.three { grid-template-columns: repeat(3, 1fr); }

/* ---------- 家长计划 / 跟读 ---------- */
.task-row { display: flex; align-items: center; font-size: 14px; margin: 10px 0; }

.task-row > span { width: 64px; flex: none; color: var(--muted); }

.task-row em { font-style: normal; color: var(--muted); font-size: 13px; min-width: 44px; text-align: right; }

.pin {
  width: 100%;
  border: 2px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  margin: 8px 0;
  background: #fbfcff;
  font-family: inherit;
}

.pin:focus { border-color: var(--brand); outline: none; }

.field { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; font-size: 15px; }

.field .pin { max-width: 150px; margin: 0; letter-spacing: 4px; font-size: 18px; }

.mic {
  display: block;
  width: 96px;
  height: 96px;
  margin: 6px auto 4px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 40px;
  box-shadow: 0 8px 20px rgba(79, 109, 245, 0.18);
}

.mic.on { background: var(--ok-soft); color: var(--ok); animation: pulse 1.2s infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}

.speak-result { text-align: center; font-size: 14px; border-radius: 12px; padding: 10px; margin-top: 10px; }

.speak-result.ok { background: var(--ok-soft); color: var(--ok); }

.speak-result.bad { background: var(--bad-soft); color: var(--bad); }

.speak-result span { display: block; font-size: 12px; opacity: 0.8; margin-top: 2px; }

.copy-word { text-align: center; background: #f8faff; border-radius: 18px; padding: 14px 10px 10px; }

.copy-word b { font-size: 40px; letter-spacing: 2px; }

.copy-word .ipa { display: block; margin-top: 4px; }

/* ---------- 一年级启蒙 ---------- */
.goal { margin-top: 14px; }

.goal-bar { height: 8px; background: rgba(255, 255, 255, 0.25); border-radius: 999px; overflow: hidden; }

.goal-bar span { display: block; height: 100%; background: #fff; border-radius: 999px; transition: width 0.3s ease; }

.goal-txt { font-size: 12px; opacity: 0.85; margin-top: 6px; }

.big-word {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 1px;
  text-align: center;
  padding: 12px 0 6px;
}

.options.emoji { grid-template-columns: repeat(3, 1fr); }

.opt.emoji { font-size: 46px; line-height: 1.15; padding: 16px 6px; }

/* ---------- 周报 ---------- */
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; }

.report-grid b { display: block; font-size: 22px; color: var(--brand); line-height: 1.2; }

.report-grid span { font-size: 11px; color: var(--muted); }

.report-tip {
  margin-top: 12px;
  font-size: 13px;
  background: var(--brand-soft);
  color: var(--ink);
  border-radius: 12px;
  padding: 10px 12px;
}

@media (min-width: 560px) {
  .options.emoji { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 560px) {
  .options { grid-template-columns: repeat(4, 1fr); }
  .options.emoji { grid-template-columns: repeat(3, 1fr); }
  .card { padding: 26px 26px 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
