:root {
  --bg: #f5f9fc;
  --panel: #ffffff;
  --primary: #2f9e6e;
  --primary-dark: #237a54;
  --accent: #ffb302;
  --text: #2c3e50;
  --muted: #8a97a5;
  --wrong: #e5484d;
  --right: #2f9e6e;
  --radius: 14px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

/* ===== 全屏应用骨架 ===== */
.app {
  display: flex; flex-direction: column;
  height: 100vh;
  height: 100dvh; /* iPad/手机 Safari：避开浏览器工具栏遮挡，底部工具栏可见 */
}

/* ---- 顶部主色通栏（含进度条）---- */
.topbar {
  position: relative;
  background: var(--primary);
  color: #fff;
  padding: 10px 20px;
  display: flex; align-items: center; gap: 14px;
  flex-wrap: wrap;
}
.topbar .logo { font-size: 24px; }
.topbar h1 { font-size: 18px; font-weight: 600; }
.topbar h1 span { color: var(--accent); }
.topbar select {
  padding: 6px 10px; border: none; border-radius: 8px;
  font-size: 13px; background: rgba(255,255,255,.92); color: var(--text);
  max-width: 260px;
}
.btn-new {
  padding: 6px 12px; border: none; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: 13px;
  cursor: pointer; white-space: nowrap;
}
.topbar-stats {
  margin-left: auto; display: flex; gap: 18px;
  font-size: 12px; opacity: .95;
}
.topbar-stats b { font-size: 16px; margin-right: 3px; }
.progress-track {
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 4px; background: rgba(255,255,255,.25);
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--accent);
  transition: width .25s;
}

/* ---- 课文胶囊行 ---- */
.lesson-list {
  list-style: none;
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 1px solid #e8eef4;
  max-height: 96px; overflow-y: auto;
}
.lesson-list li {
  padding: 5px 14px;
  border: 1px solid #dbe3ea;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
  background: #fff;
  transition: all .15s;
  white-space: nowrap;
}
.lesson-list li:hover { border-color: var(--primary); }
.lesson-list li.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.lesson-list li .del { color: #ff8a8a; font-size: 12px; margin-left: 6px; }
.lesson-list li.active .del { color: #ffd7d7; }
.lesson-list li .ledit { color: var(--muted); }
.lesson-list li .ledit:hover { color: var(--primary-dark); }
/* 单考点编辑弹窗的输入框 */
.nc-modal input {
  width: 100%; border: 1px solid #dbe3ea; border-radius: 8px;
  padding: 8px; font-size: 14px; font-family: inherit; background: #fff;
  margin-bottom: 4px;
}

/* ---- 田字格书写台（整篇）---- */
.text-stage {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  cursor: text;
  padding: 14px;
}
.sheet {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,.05);
  padding: 18px 20px;
}
.line-group { margin-bottom: 20px; }
.grid-row { display: flex; flex-wrap: wrap; }
.cell {
  position: relative;
  width: 52px; height: 56px;
  border: 1px solid #d8e0e8;
  margin: 0 -1px -1px 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px;
  background: #fff;
}
.cell.ref { color: #a7b3bf; }
.grid-row.type .cell {
  height: 48px; font-size: 28px;
  background: #fcfdff;
}
.grid-row.type .cell.tianzg::before {
  content: ""; position: absolute; left: 4px; right: 4px; top: 50%;
  border-top: 1px dashed #e6ecf2;
}
.grid-row.type .cell.tianzg::after {
  content: ""; position: absolute; top: 4px; bottom: 4px; left: 50%;
  border-left: 1px dashed #e6ecf2;
}
.grid-row.type .cell.hengxian { border-top: none; background: transparent; }
.grid-row.type .cell.hengxian::before { content: none; }
.grid-row.type .cell.hengxian::after { content: none; }
.grid-row.type { border-bottom: 1px solid #d8e0e8; }
.cell.current { box-shadow: inset 0 -4px 0 var(--accent); }

/* ---- 底部工具栏 ---- */
.toolbar {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 16px;
  background: var(--panel);
  border-top: 1px solid #e8eef4;
  padding: 10px 20px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  flex-wrap: wrap;
}
.tb-stats { display: flex; gap: 20px; font-size: 14px; color: var(--muted); }
.tb-stats b { color: var(--text); font-size: 16px; margin: 0 2px; }
.tb-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.tb-btn {
  padding: 7px 16px; border: 1px solid #dbe3ea; border-radius: 8px;
  background: #fff; font-size: 14px; cursor: pointer; color: var(--text);
}
.tb-btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg-toggle { display: flex; }
.seg-toggle .tb-btn { border-radius: 0; }
.seg-toggle .tb-btn:first-child { border-radius: 8px 0 0 8px; }
.seg-toggle .tb-btn:last-child { border-radius: 0 8px 8px 0; }

/* ---- 跟打模式 ---- */
.follow-line {
  font-size: 34px; line-height: 2.2; letter-spacing: 4px;
  color: #c3cdd8;
  margin-bottom: 8px;
}
.follow-line.done { color: #9fd6bd; }
.follow-line .f-char.done { color: var(--right); }
.follow-line .f-char.wrong { color: #fff; background: var(--wrong); border-radius: 4px; }
.follow-line .f-char.current { background: var(--accent); color: #fff; }

/* ---- 拼句游戏（卡片式）---- */
.quiz-stage {
  min-height: 100%;
  max-width: 720px; margin: 0 auto;
  padding-top: 14px;
  display: flex; flex-direction: column; align-items: center;
  gap: 24px;
  box-sizing: border-box;
}
.quiz-q {
  font-size: 46px; font-weight: 700; color: var(--primary-dark);
  display: flex; align-items: baseline; gap: 14px;
}
.quiz-q small {
  font-size: 14px; font-weight: 400; color: var(--muted);
  border: 1px solid #dbe3ea; border-radius: 999px; padding: 2px 12px;
}
.quiz-slots {
  width: 100%; max-width: 640px;
  background: #f6fafd;
  border: 1px solid #e3edf5;
  border-radius: 14px;
  padding: 18px 22px;
  min-height: 64px;
  font-size: 24px; line-height: 2; letter-spacing: 1px;
  text-align: left;
  box-shadow: inset 0 1px 4px rgba(0,0,0,.03);
}
.quiz-slots .b-chunk { color: var(--text); }
.quiz-slots .b-chunk.punc { color: #9aa7b5; }
.quiz-empty { color: #b7c2cd; font-size: 18px; letter-spacing: 0; }
.quiz-slot {
  display: inline-flex;
  min-width: 76px; height: 40px;
  margin-left: 4px; vertical-align: middle;
  border: 2px dashed #b8c6d4; border-radius: 10px;
  align-items: center; justify-content: center;
  font-size: 22px; color: #b7c2cd;
  background: #fff;
}
.quiz-slot.shake { border-color: var(--wrong); color: var(--wrong); }
.quiz-pool {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; width: 100%;
  margin-top: auto;      /* 沉到页面底部 */
  padding-top: 20px;
}
.quiz-chip {
  font-size: 21px;
  padding: 10px 18px;
  border-radius: 12px;
  line-height: 1.4;
  word-break: break-all;
}
.quiz-chip.ok {
  background: #e7f5ee; color: var(--primary-dark);
  border: 1px solid #bfe3d2;
}
.quiz-chip.pick {
  border: 1px solid #dbe3ea; background: #fff;
  cursor: pointer; color: var(--text);
  transition: all .12s;
  font-family: inherit;
  text-align: center;
}
.quiz-chip.pick:hover {
  border-color: var(--primary); transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(47,158,110,.15);
}
.quiz-tip { color: var(--wrong); font-size: 16px; }
/* 候选词的按键提示角标（数字键 1-6） */
.quiz-chip .quiz-key {
  display: inline-block;
  margin-right: 8px; padding: 0 7px;
  font-size: 13px; line-height: 20px;
  border-radius: 999px;
  background: rgba(47,158,110,.1);
  color: var(--primary-dark);
  vertical-align: 2px;
}
/* 可点击发音的内容 */
.speakable { cursor: pointer; }
.speakable:hover { opacity: .75; }
.speakable::after {
  content: "🔊";
  font-size: 14px;
  margin-left: 8px;
  opacity: .45;
}
/* 短语填空的空格槽位 */
.q-blank {
  text-decoration: none;
  border-bottom: 3px solid var(--accent);
  padding: 0 6px;
}

/* 题型自动切换提示 */
.mode-toast {
  position: fixed; top: 64px; left: 50%; transform: translateX(-50%) translateY(-8px);
  background: rgba(30, 41, 59, .92); color: #fff;
  padding: 8px 18px; border-radius: 999px;
  font-size: 13px; z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
  max-width: calc(100vw - 32px); text-align: center;
}
.mode-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 题干提示行（真题课文：题目在上，答案格子里写） */
.prompt-line {
  margin: 8px auto 0; max-width: 720px; width: calc(100% - 24px);
  padding: 8px 14px;
  background: #fff7e8; border: 1px solid #f0ddb8; border-radius: 10px;
  font-size: 15px; font-weight: 600; color: #7a5b1e;
  text-align: center;
}

/* ---- 判断题模式（✓/✗ 大按钮 + 解析）---- */
.judge-stage {
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; width: 100%; max-width: 640px;
}
.judge-q { font-size: 24px; line-height: 1.7; text-align: center; color: var(--text); }
.judge-opts { display: flex; gap: 14px; width: 100%; }
.judge-opt {
  flex: 1; padding: 18px 0; font-size: 20px; font-weight: 700;
  border-radius: 14px; border: none; cursor: pointer; color: #fff; font-family: inherit;
}
.judge-opt.ok { background: var(--primary); }
.judge-opt.no { background: var(--wrong); }
.judge-result { font-size: 18px; font-weight: 700; padding: 10px 20px; border-radius: 12px; }
.judge-result.ok { background: #e8f5ee; color: var(--primary); }
.judge-result.no { background: #fdecec; color: var(--wrong); }
.judge-explain {
  background: #f6fafd; border: 1px solid #e3edf5; border-radius: 12px;
  padding: 14px; font-size: 15px; line-height: 1.8; color: var(--text);
  text-align: left; width: 100%;
}
.judge-next {
  padding: 10px 32px; border: none; border-radius: 999px;
  background: var(--accent); color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}

/* ---- 作文填空（文章挖空）---- */
.cloze-stage {
  display: flex; flex-direction: column; gap: 14px;
  align-items: center; width: 100%; max-width: 680px;
}
.cloze-text {
  background: #f6fafd; border: 1px solid #e3edf5; border-radius: 12px;
  padding: 14px 16px; width: 100%;
  font-size: 17px; line-height: 2.1; color: var(--text);
}
.cloze-line { margin-bottom: 4px; }
.cloze-slot {
  display: inline-block; min-width: 56px; text-align: center;
  border-bottom: 3px solid var(--accent);
  padding: 0 8px; margin: 0 2px; font-weight: 700;
}
.cloze-slot.cur {
  background: #fff3d6; border-bottom-color: var(--wrong);
  border-radius: 6px 6px 0 0;
}
.cloze-slot.done { color: var(--primary); border-bottom-color: var(--primary); }
.cloze-pool {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; width: 100%;
}

/* ---- 预览：编辑原文 ---- */
.preview-edit {
  align-self: center;
  padding: 6px 18px; border: 1px solid var(--primary); border-radius: 999px;
  background: #fff; color: var(--primary); font-size: 14px;
  cursor: pointer; font-family: inherit;
}
.preview-edit:hover { background: var(--primary); color: #fff; }
.edit-modal { width: min(680px, calc(100vw - 32px)); }
.edit-modal textarea {
  width: 100%; box-sizing: border-box;
  border: 1px solid #dbe3ea; border-radius: 10px;
  padding: 10px 12px; font-size: 15px; line-height: 1.7;
  font-family: inherit; color: var(--text); resize: vertical;
}
.edit-actions { display: flex; gap: 10px; justify-content: center; margin-top: 12px; }

/* ---- 预览模式：词块编辑区（✂ 合并 / ＋ 拆分）---- */
.preview-tabs {
  display: flex; gap: 0; align-self: center;
  border: 1px solid #dbe3ea; border-radius: 8px; overflow: hidden;
}
.preview-tab {
  padding: 6px 18px; border: none; background: #fff;
  font-size: 14px; cursor: pointer; color: var(--text); font-family: inherit;
}
.preview-tab.active { background: var(--primary); color: #fff; }
.chunk-editor {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 6px; width: 100%; max-width: 640px;
  background: #f6fafd; border: 1px solid #e3edf5; border-radius: 14px;
  padding: 18px 14px;
}
.chunk-block {
  display: inline-flex; align-items: center;
  background: #fff; border: 1px solid #cfe0d6; border-radius: 8px;
  padding: 4px 2px;
}
.chunk-char { font-size: 24px; color: var(--text); padding: 0 2px; }
.chunk-bound {
  cursor: pointer; color: var(--wrong); font-size: 16px;
  padding: 2px 4px; user-select: none;
}
.chunk-bound:hover { transform: scale(1.3); }
.chunk-gap {
  cursor: pointer; color: var(--primary); font-size: 14px; font-weight: 700;
  padding: 0 3px; opacity: .55; user-select: none;
}
.chunk-gap:hover { opacity: 1; }
.quiz-meta { color: var(--muted); font-size: 13px; }
.quiz-preview {
  width: 100%;
  background: #f6fafd;
  border: 1px solid #e3edf5;
  border-radius: 14px;
  padding: 20px 24px;
  font-size: 22px; line-height: 2; letter-spacing: 1px;
  text-align: left;
  color: var(--text);
}

@media (max-width: 700px) {
  .quiz-stage { gap: 16px; padding-top: 8px; padding-bottom: 8px; }
  .quiz-q { font-size: 36px; }
  .quiz-slots { font-size: 20px; padding: 14px 16px; }
  .quiz-pool { grid-template-columns: repeat(2, 1fr); gap: 10px; padding-top: 12px; }
  .quiz-chip { font-size: 18px; padding: 12px 10px; }
  .quiz-stage, .quiz-chip { min-width: 0; }
}

/* ---- 首页 / 练习页双视图 ---- */
/* 首页两级视图统一用页面自然滚动：内层固定高度滚动容器在手机/iPad 上不可靠，
   且 iPad Pro 横屏宽达 1366px，无法用媒体查询可靠区分设备 */
#homeView,
#groupView {
  background: var(--bg);
  min-height: 100vh;
  min-height: 100dvh; /* 手机动态工具栏下用真实可视高度 */
  overflow: visible;
}
body { overflow-y: auto; }
.home-main { max-width: 860px; margin: 0 auto; padding: 26px 20px 96px; }
.home-h2 { font-size: 15px; color: var(--muted); margin: 20px 0 10px; font-weight: 500; }
.mode-cards { display: flex; gap: 14px; flex-wrap: wrap; }
.mode-card {
  flex: 1; min-width: 200px; background: var(--panel);
  border: 2px solid transparent; border-radius: 16px;
  padding: 20px 14px; text-align: center; cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  transition: all .15s;
}
.mode-card:hover { transform: translateY(-2px); }
.mode-card.active { border-color: var(--primary); background: #f2faf6; }
.mode-card .ic {
  width: 52px; height: 52px; margin: 0 auto 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, #ffd54d, #ffb302);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700; color: #fff;
}
.mode-card b { display: block; font-size: 16px; margin-bottom: 4px; }
.mode-card span { font-size: 13px; color: var(--muted); }
.home-course {
  background: var(--panel); border-radius: 16px;
  padding: 16px; box-shadow: 0 1px 6px rgba(0,0,0,.05);
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}
.home-course .category-select {
  flex: 1; min-width: 200px;
  border: 1px solid #dbe3ea; border-radius: 8px;
  padding: 8px; font-size: 14px; background: #fff;
}
.home-course .lesson-list {
  width: 100%; padding: 6px 0 0; margin: 0;
  border: none; background: transparent; max-height: none;
}
.chapters { margin-top: 14px; display: flex; flex-direction: column; gap: 14px; }
/* 一级页大分类卡片 */
.group-cards {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.group-card {
  position: relative;
  background: #eef7f2; border: 2px solid transparent; border-radius: 16px;
  padding: 20px 14px; text-align: center; cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,.05);
  transition: all .15s;
}
.group-rename {
  position: absolute; top: 8px; right: 10px;
  font-size: 14px; color: var(--muted);
  padding: 2px 6px; border-radius: 6px;
}
.group-rename:hover { background: #fff; color: var(--primary-dark); }
.group-card:hover { transform: translateY(-2px); border-color: var(--primary); }
.group-card .g-ic {
  width: 52px; height: 52px; margin: 0 auto 8px;
  border-radius: 14px; background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px;
  overflow: hidden; /* 防止意外长文字撑出图标框盖住标题 */
}
.group-card b { display: block; font-size: 16px; margin-bottom: 4px; color: var(--primary-dark); }
.group-card span { font-size: 13px; color: var(--muted); }
/* 大类分组 */
.group-box {
  background: #eef7f2; border: 1px solid #d8ecdf; border-radius: 18px;
  padding: 12px 14px 14px;
}
.group-name {
  font-weight: 700; font-size: 16px; color: var(--primary-dark);
  margin-bottom: 10px; padding-left: 2px;
}
.group-chapters {
  display: flex; flex-direction: column; gap: 12px;
}
.group-chapters .chapter { box-shadow: none; }
.chapter {
  background: var(--panel); border-radius: 16px;
  padding: 14px 16px; box-shadow: 0 1px 6px rgba(0,0,0,.05);
}
.chapter-name {
  font-weight: 600; font-size: 15px;
  color: var(--primary-dark); margin-bottom: 10px;
}
.chapter .lesson-list {
  max-height: 200px; overflow-y: auto;
  padding: 0; margin: 0; border: none; background: transparent;
}
.btn-start {
  margin-top: 22px; width: 100%; padding: 14px;
  border: none; border-radius: 12px;
  background: var(--primary); color: #fff;
  font-size: 17px; cursor: pointer;
  transition: background .15s;
}
.btn-start:hover { background: var(--primary-dark); }
#startBar {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 40;
  display: flex; align-items: center; gap: 12px;
  background: var(--panel);
  border-top: 1px solid #e3edf5;
  box-shadow: 0 -2px 10px rgba(0,0,0,.06);
  padding: 10px 16px;
}
#startBarLabel {
  flex: 1; font-size: 13px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
#startBarLabel b { color: var(--primary-dark); }
.btn-start-bar {
  flex-shrink: 0;
  padding: 12px 28px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff;
  font-size: 16px; cursor: pointer;
  transition: background .15s;
}
.btn-start-bar:hover { background: var(--primary-dark); }
.btn-back {
  padding: 6px 14px; border: none; border-radius: 8px;
  background: rgba(255,255,255,.2); color: #fff;
  font-size: 13px; cursor: pointer; white-space: nowrap;
}
.btn-back:hover { background: rgba(255,255,255,.32); }

#ghost-input {
  position: fixed; opacity: 0;
  width: 2px; height: 2px;
  border: none; outline: none;
  pointer-events: none;
  left: 0; top: 0;
}
.hint {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 4px 0; background: var(--bg);
}

/* ---- 底部虚拟键盘 ---- */
.keyboard {
  background: #e9eff5;
  padding: 10px 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
  align-items: center;
  user-select: none;
  flex-shrink: 0;
}
.kb-row { display: flex; gap: 6px; }
.key {
  min-width: 42px; height: 42px;
  background: #fff; border-radius: 8px;
  box-shadow: 0 2px 0 #c9d4e0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #5b6b7a;
  transition: all .08s;
}
.key.wide { min-width: 66px; }
.key.space { min-width: 300px; }
.key.pressed {
  background: var(--accent); color: #fff;
  transform: translateY(2px); box-shadow: none;
}

/* ---- 弹窗 ---- */
.overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(20,40,60,.45);
  align-items: center; justify-content: center;
  z-index: 50;
}
.overlay.show { display: flex; }
.result-card {
  background: #fff; border-radius: 18px;
  padding: 30px 40px; text-align: center;
  width: 340px;
  box-shadow: 0 10px 40px rgba(0,0,0,.2);
}
.result-card .emoji { font-size: 44px; }
.result-card h3 { margin: 8px 0 16px; }
.result-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 18px; }
.result-grid .stat { background: #f6fafd; border-radius: 10px; padding: 8px 4px; }
.result-grid .stat b { display: block; font-size: 20px; color: var(--primary-dark); }
.result-grid .stat span { font-size: 12px; color: var(--muted); }
.result-card button {
  padding: 10px 26px; margin: 0 5px;
  border: none; border-radius: 10px;
  font-size: 15px; cursor: pointer;
}
.btn-retry { background: var(--primary); color: #fff; }
.btn-next { background: var(--accent); color: #fff; }

.modal-form label {
  display: block; font-size: 13px; color: var(--muted);
  margin: 10px 0 4px; text-align: left;
}
.modal-form input, .modal-form textarea {
  width: 100%; border: 1px solid #dbe3ea; border-radius: 8px;
  padding: 8px; font-size: 14px; font-family: inherit;
}
.modal-form textarea { height: 120px; resize: vertical; }

/* ---- 新建/编辑课程弹窗 ---- */
.nc-modal {
  width: 460px; max-width: 92vw;
  max-height: 86vh; overflow-y: auto;
  text-align: left;
}
.nc-modal select {
  width: 100%; border: 1px solid #dbe3ea; border-radius: 8px;
  padding: 8px; font-size: 14px; font-family: inherit; background: #fff;
  margin-bottom: 4px;
}
.nc-format-hint {
  background: #f6fafd; border: 1px solid #e3edf5; border-radius: 8px;
  padding: 8px 10px; font-size: 12px; color: var(--muted);
  line-height: 1.6; margin-bottom: 6px;
}
.nc-actions { margin-top: 14px; }
.nc-errors {
  margin-top: 10px; font-size: 13px; color: var(--wrong);
  line-height: 1.6; word-break: break-all;
}
/* 章节卡片的编辑按钮 */
.chapter-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.chapter-name .edit {
  cursor: pointer; color: var(--muted); font-size: 14px;
  padding: 2px 8px; border-radius: 6px;
}
.chapter-name .edit:hover { color: var(--primary-dark); background: #eef7f2; }

@media (max-width: 700px) {
  .keyboard { display: none; }
  .text-inner { font-size: 22px; }
}

/* ---- 答对奖励弹窗（英文选义）---- */
.reward-pop {
  position: fixed; left: 50%; top: 38%;
  transform: translate(-50%, -50%) scale(.6);
  z-index: 80;
  background: #fff; border-radius: 20px;
  padding: 22px 44px; text-align: center;
  box-shadow: 0 12px 48px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s;
}
.reward-pop.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.reward-big { font-size: 52px; line-height: 1.2; }
.reward-msg {
  margin-top: 6px; font-size: 17px; font-weight: 600;
  color: var(--primary-dark);
}
