:root {
  --blue: #3B82C4;
  --blue-soft: #E6F1FB;
  --orange: #E08A2B;
  --orange-soft: #FAEEDA;
  --green: #4CAF7D;
  --green-soft: #EAF3DE;
  --ink: #2C2C2A;
  --muted: #6B6B66;
  --bg: #FBF7EF;
  --card: #FFFFFF;
  --line: #ECE6D8;
  --radius: 20px;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 18px;
  line-height: 1.75;
}

#app {
  max-width: 880px;
  margin: 0 auto;
  padding: 20px 18px 60px;
}

/* 顶部欢迎条 */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #FFF6E0, #E6F1FB);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
}
.topbar h1 {
  font-size: 26px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 1px;
}
.topbar .sub {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 16px;
}
.topbar .stars { margin-left: auto; display: flex; gap: 2px; }

/* 模块大卡片 */
.modules { display: grid; gap: 18px; }
.module-card {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 22px;
  border: 2px solid var(--blue-soft);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
  text-decoration: none;
  color: inherit;
}
.module-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.06); }
.module-card.orange { border-color: var(--orange-soft); }
.module-icon {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto;
}
.module-card .mc-title { font-size: 22px; font-weight: 800; margin: 0; }
.module-card .mc-sub { margin: 4px 0 0; color: var(--muted); font-size: 15px; }

/* 返回 */
.back {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--blue); font-size: 16px; cursor: pointer;
  background: none; border: none; padding: 6px 0; margin-bottom: 14px;
  font-family: inherit;
}

/* 区块标题 */
.section-title {
  font-size: 22px; font-weight: 800; margin: 26px 0 12px;
  display: flex; align-items: center; gap: 8px;
}
.intro {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  color: var(--muted); font-size: 17px;
}

/* 课程列表 */
.lesson-list { display: grid; gap: 14px; margin-top: 8px; }
.lesson-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  transition: transform .12s ease;
}
.lesson-item:hover { transform: translateX(3px); }
.lesson-badge {
  width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
  font-weight: 800; color: #fff; font-size: 18px;
}
.lesson-item .li-title { font-size: 19px; font-weight: 700; margin: 0; }
.lesson-item .li-sub { margin: 3px 0 0; color: var(--muted); font-size: 15px; }

/* 课程详情 */
.lesson-head {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px; margin-bottom: 18px;
}
.lesson-head h2 { font-size: 24px; margin: 0 0 6px; font-weight: 800; }
.lesson-head p { margin: 0; color: var(--muted); }

.teach-step {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; margin-bottom: 12px;
}
.teach-step h3 {
  font-size: 19px; margin: 0 0 6px; font-weight: 700;
  color: var(--blue);
}
.teach-step.green h3 { color: var(--green); }
.teach-step p { margin: 0; font-size: 17px; }

/* 标签块 */
.block {
  border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;
  border: 1px solid var(--line);
}
.block.soft-green { background: var(--green-soft); }
.block.soft-orange { background: var(--orange-soft); }
.block.soft-yellow { background: #FFF6E0; border-color: #E0B04A; }

/* 首页家长使用说明 */
.help-box {
  background: #EAF4FF; border: 1px solid #85B7EB;
  border-radius: 16px; padding: 18px 20px; margin-top: 14px;
}
.help-box h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; color: #1D64B4; }
.help-box p { margin: 8px 0 4px; font-size: 16px; }
.help-box ul { margin: 4px 0; padding-left: 22px; }
.help-box li { margin: 5px 0; font-size: 15px; line-height: 1.6; }
.help-box code {
  background: #fff; border: 1px solid #cfe0f5; border-radius: 6px;
  padding: 1px 6px; font-size: 14px; color: #1D64B4;
}
.help-box .btn { margin-top: 10px; }
.block h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; }
.block ul { margin: 0; padding-left: 22px; }
.block li { margin: 6px 0; font-size: 16px; }
.block ul.mat-list {
  max-height: 380px; overflow-y: auto;
  border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px;
}
.block ul.mat-list li { font-size: 15px; line-height: 1.65; }
.block .quote {
  font-size: 17px; padding: 10px 14px; border-radius: 12px;
  background: #fff; border-left: 4px solid var(--orange); margin: 8px 0;
}
.block .why { color: var(--muted); font-size: 15px; margin-top: 6px; }

/* 支架 */
.scaffold { background: var(--blue-soft); border-radius: 16px; padding: 18px 20px; }
.scaffold h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; color: var(--blue); }
.scaffold ol { margin: 0; padding-left: 22px; }
.scaffold li { margin: 8px 0; font-size: 16px; }

/* 写作区 */
.draft {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; margin-top: 8px;
}
.draft h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; color: var(--orange); }
.draft textarea {
  width: 100%; min-height: 160px; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-size: 17px; line-height: 1.7;
  font-family: inherit; resize: vertical; background: #FFFBF3;
}
.draft .saved { color: var(--green); font-size: 14px; margin-top: 8px; min-height: 20px; }

/* 带练 */
.passage {
  background: #FFFBF3; border: 1px solid var(--line);
  border-radius: 16px; padding: 20px; white-space: pre-wrap;
  font-size: 18px; line-height: 1.9; margin-bottom: 16px;
}
.q-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; margin-bottom: 14px;
}
.q-card .q { font-size: 18px; font-weight: 700; margin: 0 0 10px; }
.q-card .hint {
  background: var(--blue-soft); border-radius: 12px; padding: 10px 14px;
  font-size: 15px; color: #2c3e50; margin-bottom: 10px;
}
.q-card .explain {
  background: var(--green-soft); border-radius: 12px; padding: 12px 14px;
  font-size: 16px; white-space: pre-wrap; margin-top: 8px;
}
.btn {
  border: none; border-radius: 12px; padding: 10px 18px;
  font-size: 16px; font-weight: 700; cursor: pointer;
  font-family: inherit; background: var(--green); color: #fff;
}
.btn.ghost { background: var(--blue-soft); color: var(--blue); }

.tip {
  background: var(--orange-soft); border-radius: 12px;
  padding: 12px 16px; font-size: 15px; margin-bottom: 14px; color: #6b4a1a;
}

.footer-note { text-align: center; color: var(--muted); font-size: 14px; margin-top: 30px; }

/* ---- 作文闯关问答 ---- */
.quiz-progress { background: var(--line); border-radius: 999px; height: 12px; margin: 16px 0 10px; overflow: hidden; }
.quiz-progress-bar { height: 100%; background: var(--orange); border-radius: 999px; transition: width 0.3s ease; }
.quiz-count { text-align: center; color: var(--muted); font-size: 15px; margin-bottom: 10px; }
.quiz-options { display: flex; flex-direction: column; gap: 14px; margin: 18px 0; }
.quiz-opt {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 16px;
  padding: 18px 16px;
  font-size: 17px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
  color: var(--ink);
  font-family: inherit;
}
.quiz-opt:hover { border-color: var(--blue); background: var(--blue-soft); }
.quiz-opt.selected { border-color: var(--orange); background: var(--orange-soft); box-shadow: 0 4px 0 rgba(224,138,43,0.15); }
.quiz-opt:disabled { cursor: default; }
.quiz-feedback {
  background: #E6F8F1;
  border: 1.5px dashed var(--green);
  border-radius: 16px;
  padding: 16px;
  font-size: 16px;
  line-height: 1.6;
  color: #065F46;
  margin-bottom: 14px;
}
.check-list { list-style: none; padding-left: 0; }
.check-list li { position: relative; padding-left: 28px; margin: 10px 0; }
.check-list li::before { content: '✓'; position: absolute; left: 0; top: 0; color: var(--green); font-weight: 700; }
.block.soft-blue { background: var(--blue-soft); border-color: #BCD8F2; }

/* 勋章条 */
.badges-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.badge-pill {
  background: #FFF3D6; border: 1px solid #F4D58A; color: #8a5a00;
  border-radius: 999px; padding: 7px 14px; font-size: 15px; font-weight: 700;
}
.badge-pill.link { cursor: pointer; }
.badge-pill.link:hover { background: #FFE9B0; }

/* 侦探任务卡 */
.mission-card {
  background: linear-gradient(135deg, #FFF8E6, #EAF2FB);
  border: 2px dashed var(--blue); border-radius: 18px;
  padding: 18px 20px; margin-bottom: 16px;
}
.mission-card.soft { background: var(--blue-soft); border-color: #BCD8F2; }
.mission-tag {
  display: inline-block; background: var(--blue); color: #fff;
  font-size: 14px; font-weight: 800; padding: 3px 12px; border-radius: 999px;
  margin-bottom: 8px;
}
.mission-text { font-size: 19px; font-weight: 700; line-height: 1.6; margin: 0 0 12px; }

/* 线索盒 */
.clue-box {
  background: #FFFDF5; border: 1px dashed #E0C97A; border-radius: 16px;
  padding: 16px 18px; margin-bottom: 14px;
}
.clue-box h3 { margin: 0 0 8px; font-size: 18px; font-weight: 800; color: #B8860B; }
.clue-box ul { margin: 0; padding-left: 22px; }
.clue-box li { margin: 6px 0; font-size: 16px; }

/* 我的发现 / 写作区（共用 discover） */
.discover {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 16px; padding: 18px 20px; margin: 8px 0 14px;
}
.discover h3 { margin: 0 0 10px; font-size: 19px; font-weight: 800; color: var(--orange); }
.discover textarea {
  width: 100%; min-height: 140px; border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; font-size: 17px; line-height: 1.7;
  font-family: inherit; resize: vertical; background: #FFFBF3;
}
.discover .saved { color: var(--green); font-size: 14px; margin-top: 8px; min-height: 20px; }

/* 得勋章提示 */
.badge-earned {
  background: linear-gradient(135deg, #FFF3D6, #FFE9B0);
  border: 2px solid #F4B400; color: #8a5a00;
  border-radius: 14px; padding: 14px; text-align: center;
  font-size: 17px; font-weight: 800; margin-top: 14px;
}

/* 主按钮 */
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { filter: brightness(1.05); }

/* 我的小问号 */
.q-list { display: grid; gap: 10px; margin-top: 14px; }
.q-item {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px;
}
.q-text { font-size: 17px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.q-meta { color: var(--muted); font-size: 14px; margin-top: 6px; }
.q-del { color: #C0564B; cursor: pointer; margin-left: 6px; }

/* 素材库搜索 + 分类 */
.mat-search { margin: 14px 0 6px; }
.mat-search input {
  width: 100%; padding: 12px 16px; font-size: 17px;
  border: 1px solid var(--line); border-radius: 14px;
  background: #fff; color: var(--ink); outline: none;
}
.mat-search input:focus { border-color: var(--blue); }
.mat-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.mat-tab {
  padding: 7px 16px; font-size: 15px; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  cursor: pointer; transition: all .15s;
}
.mat-tab.active { background: var(--blue); color: #fff; border-color: var(--blue); }

/* 体育人物故事卡 */
.sports-card { border-color: #BCD8F2; }
.sports-tag {
  font-size: 13px; font-weight: 600; color: var(--blue);
  background: #fff; border: 1px solid #BCD8F2; border-radius: 999px;
  padding: 1px 10px; margin-left: 6px; vertical-align: middle;
}
.sports-identity { font-size: 16px; color: var(--muted); margin: 4px 0 12px; }
.story {
  background: #fff; border: 1px solid #D6E6F7; border-radius: 14px;
  padding: 12px 14px; margin: 10px 0;
}
.story-title { font-size: 17px; font-weight: 800; color: #0C447C; margin-bottom: 6px; }
.story-text { font-size: 16px; line-height: 1.7; }
.story-quality { font-size: 15px; color: var(--green); margin-top: 8px; font-weight: 600; }
.story-words { font-size: 15px; color: var(--orange); margin-top: 4px; }

/* 优美句子：翻卡背诵 */
.flip-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.flip-head h3 { margin: 0; }
.flip-toggle { font-size: 14px; color: var(--muted); cursor: pointer; display: flex; align-items: center; gap: 4px; }
.flip-card { background: #fff; border: 1px solid #CDE8C9; border-radius: 14px; padding: 16px; }
.flip-text { font-size: 18px; line-height: 1.8; color: #27500A; }
.flip-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.flip-btn { font-size: 15px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: border-color .15s; }
.flip-btn:hover { border-color: var(--green); }
.flip-progress { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* 体育人物：猜揭 + 我要写他 */
.reveal-btn { margin-top: 10px; font-size: 14px; padding: 7px 12px; border-radius: 10px; border: 1px dashed #F0997B; background: #FAECE7; color: #993C1D; cursor: pointer; }
.write-him { margin-top: 12px; font-size: 15px; padding: 9px 16px; border-radius: 12px; border: 1px solid #85B7EB; background: #E6F1FB; color: #0C447C; cursor: pointer; font-weight: 500; }

/* 人物描写：卡片墙 + 角度筛选 */
.angle-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }
.angle-tab { font-size: 14px; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; transition: all .15s; }
.angle-tab:hover { border-color: var(--orange); }
.angle-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 600; }
.people-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.people-card { background: #fff; border: 1px solid #F2D9B8; border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.people-angles { display: flex; flex-wrap: wrap; gap: 6px; }
.angle-chip { font-size: 12px; padding: 2px 9px; border-radius: 999px; font-weight: 600; }
.angle-外貌 { background: #FDEBD2; color: #9A5B00; }
.angle-动作 { background: #D7ECF8; color: #0C5A8C; }
.angle-神态 { background: #E6E2F7; color: #4B3B8C; }
.angle-语言 { background: #DDF2E0; color: #2C6B33; }
.people-text { font-size: 15px; line-height: 1.7; color: var(--ink); }
.people-tip { font-size: 13px; line-height: 1.6; color: var(--muted); background: #FBF6EC; border-left: 3px solid var(--orange); border-radius: 6px; padding: 7px 10px; }

/* ===== 书海探险 ===== */
.book-shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-top: 14px; }
.book-card { display: flex; align-items: center; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; cursor: pointer; transition: transform .12s, box-shadow .12s; }
.book-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(0,0,0,.06); }
.book-cover { width: 56px; height: 56px; border-radius: 14px; display: flex; align-items: center; justify-content: center; font-size: 30px; flex: none; }
.book-name { font-size: 19px; font-weight: 700; margin: 0; }
.book-sub { font-size: 14px; color: var(--muted); margin: 4px 0 0; }
.book-progress { font-size: 16px; color: var(--green); font-weight: 600; margin: 12px 0; }

/* 探险地图 */
.book-map { display: flex; align-items: flex-start; overflow-x: auto; padding: 8px 0 14px; }
.map-node { flex: none; text-align: center; cursor: pointer; width: 72px; }
.map-node.locked { cursor: default; opacity: .55; }
.map-dot { width: 40px; height: 40px; border-radius: 50%; margin: 0 auto; display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700; background: #EDE7DA; color: var(--muted); border: 2px solid #D8CFBE; }
.map-node.done .map-dot { background: var(--green); color: #fff; border-color: var(--green); }
.map-node.current .map-dot { background: var(--orange); color: #fff; border-color: var(--orange); box-shadow: 0 0 0 4px #FBE6CC; }
.map-label { font-size: 13px; margin-top: 6px; color: var(--ink); line-height: 1.3; }
.map-line { flex: none; width: 36px; height: 3px; background: var(--line); margin-top: 19px; }

/* 章节列表 */
.chapter-list { display: grid; gap: 10px; margin-top: 8px; }
.chapter-item { display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 14px 16px; cursor: pointer; position: relative; }
.chapter-item.locked { cursor: default; opacity: .7; }
.chapter-no { width: 34px; height: 34px; border-radius: 50%; color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; flex: none; }
.ch-title { font-size: 17px; font-weight: 600; margin: 0; }
.ch-sub { font-size: 13px; color: var(--muted); margin: 3px 0 0; }
.lock { position: absolute; right: 16px; font-size: 18px; }

/* 我的好词本 */
.collect-bar { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; }
.collect-head { font-size: 15px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 6px; }
.caret { color: var(--muted); }
.collect-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }
.collect-chip { font-size: 14px; background: var(--orange-soft); color: #854F0B; border-radius: 999px; padding: 4px 12px; }

/* 关卡：三步 + 词汇加油站 */
.quiz-step { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-top: 14px; }
.step-head { color: #fff; font-size: 15px; font-weight: 700; border-radius: 10px; padding: 7px 12px; display: inline-block; margin-bottom: 8px; }
.step-q { font-size: 17px; line-height: 1.7; margin: 4px 0; }
.step-hint { font-size: 14px; color: var(--muted); margin: 6px 0 10px; }
.step-ta { width: 100%; min-height: 80px; margin-top: 10px; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 12px; font-family: inherit; resize: vertical; }
.vocab-box { margin-top: 16px; background: var(--orange-soft); border: 1px solid #F2D9B8; border-radius: 16px; padding: 14px 16px; }
.vocab-title { font-size: 16px; font-weight: 700; color: #854F0B; margin-bottom: 10px; }
.vocab-strip { display: flex; flex-wrap: wrap; gap: 8px; }
.vocab-chip { font-size: 15px; background: #fff; border: 1px solid #E6C98E; border-radius: 12px; padding: 6px 12px; cursor: pointer; color: #5A3D0E; display: inline-flex; flex-direction: column; gap: 2px; max-width: 100%; }
.vocab-chip.on { background: #FFF3D6; border-color: var(--orange); }
.vocab-note { font-size: 12px; color: var(--muted); font-weight: 400; }
.replace-box { margin-top: 14px; background: #fff; border: 1px solid #F2D9B8; border-radius: 12px; padding: 12px; }
.replace-row { display: flex; align-items: flex-start; gap: 10px; margin: 8px 0; font-size: 16px; line-height: 1.7; }
.rep-tag { font-size: 13px; font-weight: 700; border-radius: 8px; padding: 2px 9px; flex: none; }
.rep-tag.plain { background: #EEEAE0; color: var(--muted); }
.rep-tag.good { background: var(--orange); color: #fff; }
.replace-prompt { font-size: 14px; color: #854F0B; margin: 10px 0 4px; }
.btn.sm { font-size: 13px; padding: 5px 10px; }

/* 关卡：步骤闯关 */
.chapter-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 12px 0 4px; }
.step-pill { font-size: 13px; font-weight: 700; border-radius: 999px; padding: 5px 12px; background: #F0F0F0; color: var(--muted); }
.step-pill.done { background: #D4EDDA; color: #155724; }
.step-pill.current { background: var(--orange); color: #fff; }
.step-pill.locked { background: #F5F5F5; color: #bbb; }
.step-arrow { font-size: 14px; color: var(--muted); }
.active-step { border: 2px solid var(--orange); background: #FFFBF5; }
.locked-box { text-align: center; color: var(--muted); background: #F9F9F9; border: 1px dashed var(--line); border-radius: 14px; padding: 16px; margin-top: 14px; }
.done-step { background: #F8FFF8; border-color: #B7DDBE; }
.answers-review { display: flex; flex-direction: column; gap: 12px; }
.answer-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.answer-item p { margin: 6px 0 0; font-size: 15px; line-height: 1.7; color: #333; }
