/* 小学英语 AI 教师 · 试点课 —— 手机竖屏极简界面 */
:root {
  --bg: #f7f9fc;
  --card: #ffffff;
  --ink: #1f2a44;
  --ink-soft: #64708a;
  --brand: #ff7a45;
  --brand-deep: #ef5f24;
  --blue: #4a8bf5;
  --green: #2fb37a;
  --line: #e8edf5;
  --hl: #fff2c9;
  --shadow: 0 6px 24px rgba(31, 42, 68, .08);
  --radius: 20px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) 16px calc(16px + env(safe-area-inset-bottom));
}
.hidden { display: none !important; }

/* ---------- 顶部栏 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 2px 8px;
}
.topbar .brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff; display: grid; place-items: center; font-size: 17px;
}
.topbar .meta { font-size: 12px; color: var(--ink-soft); }
.icon-btn {
  border: none; background: #fff; color: var(--ink-soft);
  width: 40px; height: 40px; border-radius: 12px; box-shadow: var(--shadow);
  font-size: 18px; cursor: pointer;
}

/* ---------- 进度条 ---------- */
.progress { display: flex; gap: 6px; margin: 4px 2px 14px; }
.progress .seg { flex: 1; height: 6px; border-radius: 3px; background: var(--line); transition: background .3s; }
.progress .seg.done { background: var(--green); }
.progress .seg.current { background: var(--brand); }

/* ---------- 分段 Tab ---------- */
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab {
  flex: 1; padding: 11px 0; border: 2px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--ink-soft); font-weight: 700; font-size: 15px;
  cursor: pointer; transition: all .2s;
}
.tab.active { border-color: var(--brand); color: var(--brand-deep); background: #fff7f3; }

/* ---------- 学习卡片 ---------- */
.stage { flex: 1; display: flex; flex-direction: column; }
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; text-align: center;
}
.card .counter { align-self: flex-start; font-size: 12px; color: var(--ink-soft); font-weight: 700; }
.scene {
  width: 100%; aspect-ratio: 16 / 9; max-height: 200px; margin: 12px 0 8px;
  border-radius: 16px; background: #f0f5ff; display: grid; place-items: center; overflow: hidden;
}
.scene svg { width: 100%; height: 100%; }
.word-text {
  font-size: 46px; font-weight: 800; letter-spacing: .5px; color: var(--ink);
  line-height: 1.15; word-break: break-word;
}
.word-ipa { font-size: 18px; color: var(--blue); margin-top: 4px; font-weight: 600; }
.sent-text {
  font-size: 27px; font-weight: 800; line-height: 1.5; color: var(--ink);
  max-width: 100%; word-break: break-word;
}
.tok { padding: 1px 2px; border-radius: 6px; transition: background .12s, color .12s; }
.tok.hl { background: var(--hl); color: var(--brand-deep); }

/* 释义区（分时显示） */
.reveal {
  margin-top: 12px; min-height: 30px; width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.meaning { font-size: 20px; font-weight: 700; color: var(--green); }
.meaning-pos { font-size: 13px; color: var(--ink-soft); font-style: italic; }
.translation { font-size: 17px; color: var(--green); font-weight: 700; line-height: 1.5; }
.reveal-hint { font-size: 13px; color: var(--ink-soft); }

/* 例句条 */
.example {
  margin-top: 10px; width: 100%; background: #f7f9fc; border-radius: 12px;
  padding: 10px 12px; font-size: 14px; color: var(--ink); line-height: 1.5;
}
.example .zh { display: block; color: var(--ink-soft); font-size: 12px; margin-top: 2px; }

/* ---------- 控制区 ---------- */
.controls { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1; min-height: 56px; border: none; border-radius: 16px;
  font-size: 16px; font-weight: 800; cursor: pointer; display: flex;
  flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  transition: transform .08s, box-shadow .2s;
}
.btn:active { transform: scale(.96); }
.btn .ico { font-size: 22px; line-height: 1; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-deep)); color: #fff; box-shadow: 0 6px 16px rgba(255,122,69,.35); }
.btn-ghost { background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.btn-blue { background: var(--blue); color: #fff; box-shadow: 0 6px 16px rgba(74,139,245,.3); }
.btn-rec { background: #fff; color: var(--brand-deep); box-shadow: var(--shadow); border: 2px solid var(--brand); }
.btn-rec.recording { background: var(--brand-deep); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.row2 { display: flex; gap: 10px; margin-top: 10px; }
.chip {
  flex: 1; min-height: 44px; border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink-soft); font-weight: 700; font-size: 14px; cursor: pointer;
}
.chip.active { border-color: var(--blue); color: var(--blue); background: #f0f6ff; }
.voice-chip.active { border-color: var(--green); color: var(--green); background: #eefaf4; }

/* 反馈气泡 */
.feedback {
  margin-top: 12px; padding: 12px 16px; border-radius: 14px; text-align: center;
  font-weight: 700; font-size: 15px; min-height: 20px;
}
.feedback.good { background: #eefaf4; color: var(--green); }
.feedback.info { background: #f0f6ff; color: var(--blue); }

/* 复盘/完成卡 */
.done-card { text-align: center; padding: 30px 20px; }
.done-card .big { font-size: 52px; }
.done-card h2 { margin: 12px 0 6px; }
.done-card p { color: var(--ink-soft); line-height: 1.6; }

/* 底部翻页 */
.footer-nav { display: flex; gap: 10px; margin-top: 14px; }
.footer-nav .btn { min-height: 48px; font-size: 15px; }

/* 提示条 */
.tip {
  background: #fff8e6; border: 1px solid #ffe3a6; color: #a86b00;
  font-size: 12px; line-height: 1.5; padding: 8px 12px; border-radius: 10px; margin-bottom: 10px;
}

@media (min-width: 560px) {
  #app { padding-left: 24px; padding-right: 24px; }
}

/* ---------- 课时切换 ---------- */
.lessonbar { display: flex; gap: 8px; overflow-x: auto; padding: 2px; margin-bottom: 8px; }
.lessonbar::-webkit-scrollbar { display: none; }
.lesson-chip {
  flex: 0 0 auto; padding: 9px 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fff;
  color: var(--ink-soft); font-weight: 700; font-size: 13px; cursor: pointer;
}
.lesson-chip.active { border-color: var(--green); color: var(--green); background: #eefaf4; }
.goal { font-size: 12px; color: var(--ink-soft); line-height: 1.55; margin: 0 2px 12px; }

/* ---------- 图片卡 ---------- */
.scene img { width: 100%; height: 100%; object-fit: contain; display: block; }
.scene { aspect-ratio: auto; height: clamp(150px, 30vh, 230px); }
.scene.ratio { height: auto; max-height: none; aspect-ratio: 16 / 9; background: #eef4ff; }
.scene.photo { height: clamp(150px, 30vh, 230px); background: #fff; }

/* ---------- 句型标签 ---------- */
.pattern {
  display: inline-block; font-size: 12px; font-weight: 700; color: #fff;
  background: var(--blue); border-radius: 999px; padding: 3px 12px; margin-bottom: 8px;
}
.tok.target { border-bottom: 2px dotted var(--brand); }

/* ---------- 对话气泡 ---------- */
.bubbles { display: flex; flex-direction: column; gap: 10px; width: 100%; margin-top: 6px; }
.bubble {
  max-width: 88%; text-align: left; padding: 10px 14px; border: none;
  border-radius: 16px; background: #f1f6ff; color: var(--ink);
  font-size: 19px; font-weight: 700; line-height: 1.45; cursor: pointer;
  box-shadow: 0 2px 8px rgba(31, 42, 68, .06);
}
.bubble.B { align-self: flex-end; background: #fff2e8; }
.bubble.current { outline: 2px solid var(--brand); outline-offset: 1px; }
.bubble .who {
  display: block; font-size: 11px; font-weight: 700; color: var(--ink-soft);
  margin-bottom: 3px; letter-spacing: .5px;
}
.bubble .zh { display: block; font-size: 13px; font-weight: 600; color: var(--green); margin-top: 5px; }
.bubble .tok.hl { background: var(--hl); color: var(--brand-deep); }

/* ---------- 完成卡任务 ---------- */
.done-task { margin-top: 10px; color: var(--ink); font-weight: 700; background: #eefaf4; border-radius: 12px; padding: 10px 14px; }

/* 对话模式：情境图收成横幅，避免与气泡重复 */
.scene.banner { height: 116px; }
.scene.banner img { object-fit: cover; object-position: center 55%; }


