/* ==================== 基础 ==================== */
:root {
  --bg: #f5f7fa;
  --card: #ffffff;
  --primary: #d94f4f;
  --primary-soft: #fdeaea;
  --accent: #3a7bd5;
  --accent-soft: #e8f0fc;
  --text: #22262b;
  --text-sub: #6b7280;
  --text-light: #9aa3af;
  --line: #e8ebf0;
  --green: #2f9e6e;
  --green-soft: #e6f6ef;
  --shadow: 0 2px 12px rgba(20, 30, 50, .06);
  --radius: 14px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
               "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: 40px; }

/* ==================== 顶部栏 ==================== */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 6px;
  height: 52px; padding: 0 12px;
  background: linear-gradient(135deg, #d94f4f 0%, #e06a5a 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(217, 79, 79, .22);
}
.app-title {
  flex: 1; margin: 0;
  font-size: 17px; font-weight: 600; letter-spacing: .5px;
  text-align: center;
}
.back-btn, .setup-btn {
  width: 34px; height: 34px; flex: 0 0 34px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.16); border: none; border-radius: 10px;
  color: #fff; font-size: 18px; cursor: pointer; transition: background .15s;
}
.back-btn { font-size: 24px; line-height: 1; padding-bottom: 3px; }
.setup-btn:active, .back-btn:active { background: rgba(255,255,255,.3); }

/* ==================== 页面 ==================== */
.page { padding: 14px; max-width: 720px; margin: 0 auto; }
.page[hidden] { display: none; }

/* ==================== 设置页 ==================== */
.setup-card {
  background: var(--card); border-radius: var(--radius);
  padding: 22px 18px; box-shadow: var(--shadow);
  margin-top: 8px;
}
.setup-h2 { margin: 0 0 20px; font-size: 19px; font-weight: 650; }
.field { margin-bottom: 22px; }
.field > label {
  display: block; font-size: 13px; color: var(--text-sub);
  margin-bottom: 9px; font-weight: 500;
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  padding: 8px 16px; border-radius: 20px;
  background: #f0f2f6; color: var(--text-sub);
  font-size: 14px; cursor: pointer;
  border: 1.5px solid transparent; transition: all .16s;
}
.chip.active {
  background: var(--primary-soft); color: var(--primary);
  border-color: var(--primary); font-weight: 600;
}
.primary-btn {
  width: 100%; padding: 13px; margin-top: 6px;
  background: linear-gradient(135deg, #d94f4f, #e06a5a);
  color: #fff; border: none; border-radius: 12px;
  font-size: 16px; font-weight: 600; cursor: pointer;
  box-shadow: 0 4px 14px rgba(217,79,79,.28);
  transition: transform .12s;
}
.primary-btn:active { transform: scale(.98); }
.secondary-btn {
  width: 100%; padding: 11px; margin-top: 10px;
  background: #fff; color: var(--primary, #d94f4f);
  border: 1.5px solid rgba(217,79,79,.45); border-radius: 12px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: transform .12s;
}
.secondary-btn:active { transform: scale(.98); }
.secondary-btn:disabled { opacity: .55; }
.hint { text-align: center; color: var(--text-light); font-size: 12px; margin: 12px 0 0; }

/* ==================== 当前教材条 ==================== */
.current-book {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); border-radius: 12px;
  padding: 13px 16px; margin-bottom: 14px;
  box-shadow: var(--shadow); font-size: 14px;
}
.current-book .book-name { font-weight: 650; color: var(--text); }
.current-book .book-sub { color: var(--text-light); font-size: 12.5px; margin-left: auto; }

/* ==================== 搜索 ==================== */
.search-box { position: relative; margin-bottom: 16px; }
.search-box input {
  width: 100%; padding: 12px 40px 12px 16px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); font-size: 15px; color: var(--text);
  outline: none; transition: border-color .15s;
}
.search-box input:focus { border-color: var(--primary); }
.clear-btn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 24px; height: 24px; border: none; border-radius: 50%;
  background: #e5e8ee; color: var(--text-sub); font-size: 16px;
  line-height: 1; cursor: pointer;
}

/* ==================== 课文列表 ==================== */
.section-label {
  font-size: 12.5px; color: var(--text-light); font-weight: 500;
  margin: 4px 0 10px 4px;
}
.lesson-list { display: flex; flex-direction: column; gap: 9px; }
.lesson-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 12px;
  padding: 14px 16px; cursor: pointer;
  box-shadow: var(--shadow); transition: transform .12s, box-shadow .15s;
  border-left: 3px solid transparent;
}
.lesson-item:active { transform: scale(.985); }
.lesson-item.has-content { border-left-color: var(--primary); }
.lesson-item .li-title { font-size: 15.5px; font-weight: 550; }
.lesson-item .li-title mark { background: #ffe9a8; padding: 0 1px; border-radius: 2px; }
.lesson-item .li-unit {
  font-size: 11.5px; color: var(--text-light);
  background: #f3f5f8; padding: 2px 8px; border-radius: 6px;
}
.lesson-item .li-badge {
  margin-left: auto; font-size: 11px; padding: 2px 8px;
  border-radius: 6px; flex: 0 0 auto;
}
.badge-full { background: var(--primary-soft); color: var(--primary); }
.badge-stub { background: #f0f2f6; color: var(--text-light); }

/* ==================== 课程讲解 ==================== */
.lesson-head {
  background: var(--card); border-radius: var(--radius);
  padding: 18px 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.lesson-title-row { display: flex; align-items: center; gap: 10px; }
.lesson-title-row h2 { margin: 0; font-size: 21px; font-weight: 700; }
.tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent); flex: 0 0 auto;
}
.lesson-meta { font-size: 12.5px; color: var(--text-light); margin-top: 7px; }
.stroke-entry {
  width: 100%; margin-top: 14px; padding: 11px;
  background: var(--primary-soft); color: var(--primary);
  border: none; border-radius: 10px;
  font-size: 14.5px; font-weight: 600; cursor: pointer;
  transition: background .15s;
}
.stroke-entry:active { background: #fbdcdc; }

.block {
  background: var(--card); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.block h3 {
  margin: 0 0 12px; font-size: 15px; font-weight: 650;
  display: flex; align-items: center; gap: 7px;
}
.block h3::before {
  content: ''; width: 3px; height: 15px; border-radius: 2px;
  background: var(--primary);
}
.block.empty { color: var(--text-light); font-size: 13.5px; text-align: center; padding: 22px 16px; }

/* 课文原文 */
.poem { margin: 0; }
.poem p {
  margin: 0 0 8px; font-size: 17px; line-height: 2.1;
  letter-spacing: 1.5px; text-indent: 0;
}
.poem.center { text-align: center; }
.poem.center p { letter-spacing: 3px; }
/* 正在朗读的那一行：左侧竖条 + 淡底色，便于跟读时定位 */
.poem p[data-line] { position: relative; padding: 2px 8px 2px 10px; border-radius: 8px;
  transition: background .18s, box-shadow .18s; }
.poem p.playing {
  background: linear-gradient(90deg, rgba(74, 158, 255, .16), rgba(74, 158, 255, .04));
  box-shadow: inset 3px 0 0 #4a9eff;
}

/* 课文朗读音频按钮 */
.audio-btn {
  margin-left: 8px; padding: 3px 12px; font-size: 13px; font-weight: 500;
  color: #fff; background: linear-gradient(135deg, #4a9eff, #3a7bd5);
  border: none; border-radius: 14px; cursor: pointer;
  box-shadow: 0 2px 6px rgba(58, 123, 213, .28);
  transition: transform .12s, box-shadow .15s;
  vertical-align: middle;
}
.audio-btn:active { transform: scale(.95); }
.audio-btn.playing {
  background: linear-gradient(135deg, #ff9a4a, #f57c1f);
  box-shadow: 0 2px 6px rgba(245, 124, 31, .28);
}

/* 拼音开关 */
.py-toggle { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }.py-switch {
  border: 1px solid var(--primary); color: var(--primary); background: #f2f7ff;
  border-radius: 14px; padding: 3px 12px; font-size: 12.5px; cursor: pointer;
  transition: all .15s;
}
.py-switch.on { background: var(--primary); color: #fff; }
.py-switch:active { transform: scale(.96); }
.py-hint { font-size: 11.5px; color: var(--text-light); }

/* 逐字注音（ruby） */
.poem.with-py p { line-height: 2.9; letter-spacing: 0; }
.poem.with-py.center p { letter-spacing: 0; }
.py-ruby {
  ruby-align: center;
  margin: 0 1px;
  font-size: 17px;
}
.py-ruby .py-rt {
  font-size: 11px; color: var(--primary); font-weight: 500;
  letter-spacing: 0; line-height: 1.1;
  font-family: "Times New Roman", Arial, sans-serif;
}

/* 分段解析 */
.seg { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.seg:last-child { border-bottom: none; padding-bottom: 0; }
.seg:first-child { padding-top: 0; }
.seg-text { font-weight: 600; color: var(--text); font-size: 15px; margin-bottom: 5px; }
.seg-note { color: var(--text-sub); font-size: 14px; }

/* 句子赏析 */
.sent { padding: 12px 0; border-bottom: 1px dashed var(--line); }
.sent:last-child { border-bottom: none; padding-bottom: 0; }
.sent:first-child { padding-top: 0; }
.sent-q {
  color: var(--accent); font-weight: 600; font-size: 14.5px;
  padding-left: 11px; border-left: 2.5px solid var(--accent-soft);
  margin-bottom: 6px;
}
.sent-a { color: var(--text-sub); font-size: 14px; }

/* 技能标签 */
.skill-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.skill-tag {
  font-size: 13px; padding: 5px 12px; border-radius: 8px;
  background: var(--green-soft); color: var(--green);
}

/* 任务列表 */
.task-list { margin: 0; padding-left: 20px; }
.task-list li { margin-bottom: 6px; font-size: 14.5px; }
.task-list li:last-child { margin-bottom: 0; }

/* ==================== 生字词 ==================== */
.tabs {
  display: flex; gap: 8px; background: var(--card);
  padding: 6px; border-radius: 12px; margin-bottom: 14px;
  box-shadow: var(--shadow); overflow-x: auto;
}
.tab {
  flex: 1; text-align: center; padding: 9px 12px; border-radius: 8px;
  font-size: 14px; color: var(--text-sub); cursor: pointer;
  white-space: nowrap; transition: all .16s;
}
.tab.active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }

.char-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 10px; }
.char-card {
  background: var(--card); border-radius: 12px; padding: 10px 6px;
  text-align: center; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .12s; position: relative; overflow: hidden;
}
.char-card:active { transform: scale(.95); }
.char-card .cc-pinyin {
  font-size: 12px; color: var(--primary); font-weight: 600;
  height: 18px; letter-spacing: .3px;
}
.char-card .cc-char { font-size: 34px; line-height: 1.25; font-weight: 400; }
.char-card .cc-info { font-size: 10.5px; color: var(--text-light); margin-top: 3px; }
/* 音序徽标（字典查字用，大写首字母） */
.char-card .cc-initial {
  display: inline-block; min-width: 14px; padding: 0 4px;
  margin-right: 3px; font-size: 10px; font-weight: 700;
  color: #fff; background: var(--primary); border-radius: 4px;
  line-height: 1.5; letter-spacing: .3px; vertical-align: baseline;
}
.char-card.no-anim .cc-initial { background: var(--text-light); }
.char-card .cc-play {
  position: absolute; bottom: 4px; right: 6px;
  font-size: 11px; color: var(--text-light); opacity: .55;
  pointer-events: none;   /* 不拦截点击，避免遮挡星标/朗读按钮 */
}
/* 卡片上的组词（年级匹配） */
.char-card .cc-words {
  display: flex; flex-wrap: wrap; gap: 3px; justify-content: center;
  margin-top: 6px; padding-top: 5px; border-top: 1px dashed #eef1f6;
}
.char-card .cc-word {
  font-size: 10.5px; line-height: 1.4; color: var(--primary);
  background: #f2f7ff; border-radius: 5px; padding: 1px 5px;
  cursor: pointer; white-space: nowrap;
}
.char-card .cc-word:active { background: #dfeaff; }
.char-card.no-anim .cc-word { color: var(--text-sub); background: #f3f5f8; }

/* 词语列表 */
.word-list { display: flex; flex-direction: column; gap: 8px; }
.word-item {
  background: var(--card); border-radius: 10px; padding: 13px 15px;
  box-shadow: var(--shadow); display: flex; align-items: center; gap: 12px;
}
.word-item .wi-text { font-size: 16px; font-weight: 550; letter-spacing: .5px; }
.word-item .wi-py { font-size: 12.5px; color: var(--primary); margin-left: auto; }

/* ==================== 笔顺弹层 ==================== */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; }
.modal[hidden] { display: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(15,20,30,.45); }
.modal-panel {
  position: relative; width: 100%; max-width: 480px; margin: 0 auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  padding: 20px 18px 26px; max-height: 92vh; overflow-y: auto;
  animation: slideUp .22s ease-out;
}
@keyframes slideUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border: none; border-radius: 50%;
  background: #f0f2f6; color: var(--text-sub); font-size: 19px;
  line-height: 1; cursor: pointer;
}
.stroke-char-name { font-size: 24px; font-weight: 700; text-align: center; }
.stroke-meta {
  text-align: center; font-size: 13px; color: var(--text-sub);
  margin: 6px 0 14px; line-height: 1.9;
}
.stroke-meta .m-pinyin { color: var(--primary); font-weight: 600; font-size: 15px; }
.stroke-meta .m-item {
  display: inline-block; margin: 0 5px; padding: 1px 9px;
  background: #f3f5f8; border-radius: 6px; font-size: 12px;
}
.stroke-meta .m-seq { background: #eaf2ff; color: var(--primary); font-weight: 600; }
/* 弹层里的组词（年级匹配） */
.stroke-words {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  justify-content: center; margin: 0 0 14px;
}
.stroke-words .sw-label {
  font-size: 12px; color: var(--text-light); margin-right: 2px;
}
.stroke-words .sw-item {
  font-size: 13px; color: var(--primary); background: #f2f7ff;
  border-radius: 7px; padding: 3px 10px; cursor: pointer;
}
.stroke-words .sw-item:active { background: #dfeaff; }
.stroke-words .sw-speak {
  border: none; background: #f3f5f8; border-radius: 7px;
  font-size: 13px; padding: 3px 8px; cursor: pointer;
}

.tian-grid {
  position: relative; width: 200px; height: 200px; margin: 0 auto 16px;
  color: var(--text);
}
.grid-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
#writerTarget { position: absolute; inset: 0; }

.stroke-actions { display: flex; gap: 9px; justify-content: center; margin-bottom: 14px; flex-wrap: wrap; }
.act-btn {
  padding: 9px 16px; border: 1.5px solid var(--line); border-radius: 10px;
  background: var(--card); color: var(--text); font-size: 13.5px;
  cursor: pointer; transition: all .15s;
}
.act-btn:active { background: #f5f7fa; }
.act-btn.on { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); font-weight: 600; }

.speed-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-sub); margin-bottom: 16px;
}
.speed-row input[type=range] { flex: 1; accent-color: var(--primary); }

.stroke-list {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding-top: 14px; border-top: 1px dashed var(--line);
}
.stroke-chip {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; background: #f3f5f8; color: var(--text-sub);
  cursor: pointer; transition: all .15s;
}
.stroke-chip:hover { background: var(--primary-soft); color: var(--primary); }
.stroke-list-label { width: 100%; font-size: 12px; color: var(--text-light); margin-bottom: 2px; }

/* ==================== Toast ==================== */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(30,36,46,.9); color: #fff;
  padding: 10px 20px; border-radius: 22px; font-size: 13.5px;
  z-index: 200; animation: fadeUp .2s; max-width: 80vw; text-align: center;
}
@keyframes fadeUp { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }
.toast[hidden] { display: none; }

/* 加载态 */
.loading { text-align: center; color: var(--text-light); padding: 40px 0; font-size: 14px; }
.loading::after { content: ''; display: inline-block; width: 12px; text-align: left; animation: dots 1.2s infinite; }
@keyframes dots { 0% { content: ''; } 33% { content: '.'; } 66% { content: '..'; } 100% { content: '...'; } }

@media (max-width: 380px) {
  .char-grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
  .tian-grid { width: 170px; height: 170px; }
}

/* ===== 自动分配生字的说明条 ===== */
.auto-note {
  margin: 0 0 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff7e6;
  border-left: 3px solid #f0a020;
  color: #8a6100;
  font-size: 12.5px;
  line-height: 1.6;
}

/* 笔顺数据尚未加载完成的字卡 */
.char-card.no-anim { opacity: .55; }
.char-card.no-anim .cc-play { opacity: .3; }

/* ===== 设置页：版本说明与可用性提示 ===== */
.field-note {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--text-sub, #8a8f99);
  line-height: 1.5;
  min-height: 1em;
}

.setup-warn {
  margin: 0 0 14px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fff7e6;
  border-left: 3px solid #f0a020;
  color: #8a6100;
  font-size: 12.5px;
  line-height: 1.6;
}

.chip.disabled {
  opacity: .45;
  pointer-events: none;
}

/* 主按钮禁用态 */
.primary-btn:disabled {
  background: #c9ccd2;
  cursor: not-allowed;
  opacity: .9;
}

/* ================================================================== */
/* 学习进度                                                           */
/* ================================================================== */
.progress-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 10px 0;
  box-shadow: 0 1px 6px rgba(0, 0, 0, .06);
}
.progress-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.progress-label { font-size: 13px; color: #5a6472; font-weight: 600; }
.progress-num { font-size: 15px; color: #2f6fed; font-weight: 700; }
.progress-bar {
  height: 8px;
  border-radius: 4px;
  background: #eef1f5;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  width: 0;
  border-radius: 4px;
  background: linear-gradient(90deg, #4f8df7, #2f6fed);
  transition: width .35s ease;
}
.progress-legend {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  font-size: 11.5px;
  color: #7a8493;
  flex-wrap: wrap;
}
.progress-legend .lg::before {
  content: '';
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: 1px;
}
.lg-done::before { background: #34c759; }
.lg-learning::before { background: #f0a020; }
.lg-todo::before { background: #c9ccd2; }
.progress-legend b { color: #40485a; }

.quick-row { margin: 10px 0; }
.quick-btn {
  width: 100%;
  padding: 11px;
  border: 1px solid #ffe0a3;
  background: #fffaf0;
  border-radius: 10px;
  font-size: 13.5px;
  color: #8a6100;
  font-weight: 600;
  cursor: pointer;
}
.quick-btn:active { background: #fff4de; }
.quick-btn b { color: #f0a020; }

/* 课文条目的学习状态 */
.li-status {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: 1px;
  white-space: nowrap;
}
.st-done { background: #e6f9ec; color: #1f9d4d; }
.st-learning { background: #fff4e0; color: #b8760a; }

/* 课文页状态切换 */
.status-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.status-hint { font-size: 12px; color: #8a93a2; margin-right: 2px; }
.status-btn {
  padding: 5px 13px;
  border-radius: 15px;
  border: 1px solid #d9dee6;
  background: #fff;
  font-size: 12.5px;
  color: #5a6472;
  cursor: pointer;
  transition: .15s;
}
.status-btn:active { transform: scale(.96); }
.status-btn.on-done { background: #34c759; border-color: #34c759; color: #fff; font-weight: 600; }
.status-btn.on-learning { background: #f0a020; border-color: #f0a020; color: #fff; font-weight: 600; }

/* 朗读按钮 */
.speak-btn {
  border: none;
  background: #eef4ff;
  color: #2f6fed;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
.speak-btn:active { transform: scale(.9); }
.speak-inline {
  border: none;
  background: transparent;
  color: #2f6fed;
  font-size: 13px;
  cursor: pointer;
  padding: 0 4px;
  opacity: .75;
}
.speak-inline:active { opacity: 1; }
.char-speak {
  position: absolute;
  top: 4px; left: 5px;
  border: none;
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  opacity: .55;
  padding: 2px;
  z-index: 2;
}
.char-speak:active { opacity: 1; }

/* 生字卡上的收藏星标 */
.char-star {
  position: absolute;
  top: 3px; right: 3px;
  border: none;
  background: transparent;
  font-size: 14px;
  cursor: pointer;
  padding: 3px 5px;
  line-height: 1;
  filter: grayscale(1);
  opacity: .4;
  transition: .15s;
  z-index: 2;
}
.char-star.on { filter: none; opacity: 1; transform: scale(1.12); }

/* 我的生字本 */
.stars-head { padding: 4px 0 10px; }
.stars-head h2 { font-size: 17px; margin: 0 0 4px; color: #23303f; }
.stars-sub { font-size: 12px; color: #8a93a2; margin: 0; }
.stars-toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.act-btn.danger { color: #d64545; border-color: #ffd9d9; background: #fff6f6; }
.stars-empty {
  text-align: center;
  color: #9aa3b0;
  padding: 40px 20px;
  font-size: 13.5px;
  line-height: 1.8;
}

/* 生字页「依次朗读」按钮 */
.tab-play {
  margin-left: auto;
  align-self: center;
  border: 1px solid #cfe0ff;
  background: #eef4ff;
  color: #2f6fed;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.tab-play:active { background: #dfeaff; }
.tabs { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* 朗读按钮：正在播放状态 */
[data-speak].speaking {
  background: var(--brand, #2f6fed) !important;
  color: #fff !important;
  animation: speakPulse 1s ease-in-out infinite;
}
@keyframes speakPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .7; transform: scale(1.08); }
}

/* ============ 语文园地 ============ */
.lesson-item.li-yard {
  background: linear-gradient(90deg, #fff8ec 0%, #fffdf8 100%);
  border-left: 3px solid #e8a33d;
}
.lesson-item.li-yard .li-title { font-weight: 600; color: #a8661b; }
.badge-yard {
  background: #fdf1dc; color: #b8771f; border: 1px solid #f0d9b0;
}

.yd-block { padding-bottom: 6px; }
.yd-h3 {
  font-size: 15px; font-weight: 700; color: var(--primary);
  margin: 4px 0 10px; padding-left: 9px; border-left: 3px solid var(--primary);
}
.yd-body { font-size: 15px; line-height: 2; color: var(--text); }
.yd-line { margin: 4px 0; }
.yd-tip {
  margin-top: 8px; font-size: 13px; color: var(--text-sub);
  background: #f7f9fc; border-radius: 8px; padding: 8px 10px; line-height: 1.7;
}

/* 识字加油站：词语 + 要认的字 */
.yd-char-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 7px 0; border-bottom: 1px dashed #eef1f6;
}
.yd-char-row:last-child { border-bottom: none; }
.yd-words { flex: 1 1 auto; min-width: 140px; color: var(--text); }
.yd-chars { display: flex; gap: 5px; flex-wrap: wrap; }

/* 园地里所有可点的汉字（点击看笔顺/拼音/组词） */
.yd-char,
.tap-ch {
  cursor: pointer;
  transition: background-color .15s, color .15s, transform .1s;
}
.yd-char {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: #fff4f4; color: var(--primary);
  font-size: 16px; font-weight: 600;
}
.yd-char:hover { background: #ffe4e4; transform: translateY(-1px); }
.yd-char:active { transform: scale(.94); }

/* 正文里的字：默认不加装饰，只在下划线提示可点，避免影响阅读 */
.tap-ch {
  border-bottom: 1px dashed rgba(214, 78, 78, .35);
  padding-bottom: 1px;
}
.tap-ch:hover {
  background: #fff0f0; color: var(--primary);
  border-radius: 3px;
}
.tap-ch:active { background: #ffe0e0; }

/* 日积月累 / 我爱阅读里的字，用更轻的提示（不打断整句观感） */
.yd-poem-line .tap-ch,
.yd-para .tap-ch { border-bottom-color: rgba(214, 78, 78, .22); }

/* 日积月累 */
.yd-poem { text-align: center; padding: 12px 0 4px; }
.yd-poem-title { font-size: 17px; font-weight: 700; letter-spacing: 2px; margin-bottom: 2px; }
.yd-poem-author { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
.yd-poem-line { font-size: 16px; line-height: 2.1; letter-spacing: 1px; }

/* 我爱阅读 */
.yd-para { margin: 6px 0; text-indent: 2em; line-height: 2; }
.yd-para.yd-art-title { text-indent: 0; text-align: center; font-weight: 700; font-size: 16px; margin-bottom: 8px; }
