@charset "utf-8";
/* v9 generated assets (present only when files exist) */
:root {
  --gen-art-box: url("art/art_box.fcbb28e9.webp");
  --gen-art-done: url("art/art_done.71e3290e.webp");
  --gen-art-empty: url("art/art_empty.a63707fd.webp");
  --gen-art-hero: url("art/art_hero.979a3459.webp");
  --gen-art-play: url("art/art_play.0f443537.webp");
  --gen-bg-app: url("art/bg_app.2c14b6fd.webp");
  --gen-bg-app-m: url("art/bg_app_m.97a28305.webp");
  --gen-bg-hero: url("art/bg_hero.8f37cdb6.webp");
  --gen-bg-lilac-premium: url("art/bg_lilac_premium.71dbd061.webp");
  --gen-bg-lilac-premium-m: url("art/bg_lilac_premium_m.465b2b36.webp");
  --gen-bg-paper: url("art/bg_paper.b8369b40.webp");
  --gen-bg-paper-m: url("art/bg_paper_m.c8209b8e.webp");
  --gen-icon-v19-arcade: url("art/icon_v19_arcade.31dbe02d.webp");
  --gen-icon-v19-match: url("art/icon_v19_match.31356d48.webp");
  --gen-icon-v19-review: url("art/icon_v19_review.739b2891.webp");
  --gen-icon-v19-spell: url("art/icon_v19_spell.f2d7d80c.webp");
  --gen-icon-v19-split: url("art/icon_v19_split.635040d3.webp");
  --gen-icon-v19-stroke: url("art/icon_v19_stroke.31bd4d62.webp");
}
/* CSS:APP:BEGIN */
/* 全局色彩与高定 Token (Scheme D: Apple VisionOS / HIG 纯净外框 + Duolingo 3D 萌趣内核) */
:root {
  --bg-warm: #F8FAFC;
  --bg-soft: #F1F5F9;
  --card-bg: #FFFFFF;
  --huer-indigo: #4F46E5;
  --huer-indigo-dark: #1E1B4B;
  --huer-indigo-light: #EEF2FF;
  --huer-purple: #6366F1;
  --green: #16A34A;
  --green-light: #DCFCE7;
  --orange: #EA580C;
  --orange-light: #FFEDD5;
  --amber: #D97706;
  --amber-light: #FEF3C7;
  --blue: #2563EB;
  --blue-light: #DBEAFE;
  --red: #E11D48;
  --red-light: #FFE4E6;
  --teal: #0D9488;
  --text-main: #0F172A;
  --text-sub: #475569;
  --text-muted: #94A3B8;
  --border-warm: rgba(226, 232, 240, 0.85);
  --border-subtle: rgba(226, 232, 240, 0.65);
  --shadow-sm: 0 2px 8px -1px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  --shadow-card: 0 4px 6px -1px rgba(15, 23, 42, 0.03), 0 12px 24px -4px rgba(15, 23, 42, 0.06);
  --shadow-pop: 0 20px 44px -10px rgba(79, 70, 229, 0.22);
  --shadow-elevation: 0 20px 35px -5px rgba(15, 23, 42, 0.08), 0 10px 10px -5px rgba(15, 23, 42, 0.03);
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  width: 100%;
  /* dvh：iOS Safari 地址栏收起/展开时 100vh 会大于可视高度，底部多出一截空白 */
  min-height: 100vh;
  min-height: 100dvh;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-warm);
  color: var(--text-main);
  overflow-x: hidden;
}

.kaiti {
  font-family: "KaiTi", "STKaiti", "BiauKai", "楷体", "PingFang SC", serif;
}

/* 整体双栏骨架：桌面端左侧固定导航栏 + 右侧主工作区 */
.huer-layout {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
}

/* 方案 D: 奢华深色极夜紫微光渐变侧边栏 (Apple VisionOS / HIG 奢华质感) */
.huer-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #1E1B4B 0%, #2E1065 60%, #0F172A 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  flex-shrink: 0;
  z-index: 40;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.15);
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 6px 10px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  margin-bottom: 16px;
  cursor: pointer;
  transition: opacity 0.15s ease;
}
.brand-box:hover {
  opacity: 0.92;
}

.brand-logo {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 50%, #4338CA 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 20px;
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45), inset 0 1px 1px rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 900;
  color: #FFFFFF;
  letter-spacing: 0.4px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.brand-sub {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-top: 2px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.side-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  text-align: left;
  cursor: pointer;
  transition: all 0.16s ease;
  width: 100%;
}

.side-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  transform: translateX(2px);
}

.side-nav-item.active {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.side-nav-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  transition: all 0.16s ease;
}

.side-nav-item.active .side-nav-icon {
  background: linear-gradient(135deg, #6366F1, #4F46E5);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.45);
}

.side-nav-text {
  flex: 1;
  min-width: 0;
}

.side-nav-name {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.25;
}

.side-nav-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: #F43F5E;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(244, 63, 94, 0.4);
}

.st-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.14);
}

.st-item:last-child {
  border-bottom: none;
}

.st-item.done {
  color: #4ADE80;
  font-weight: 700;
}

/* 主工作区 */
.huer-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 28px 48px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* 顶部全局状态与奖励条 */
/* 方案 D: Apple HIG 纯净毛玻璃顶部栏与微浮雕药丸奖励胶囊 */
.global-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 20px;
  padding: 10px 18px;
  margin-bottom: 20px;
  box-shadow: 0 4px 16px -2px rgba(15, 23, 42, 0.04), 0 1px 2px rgba(15, 23, 42, 0.02);
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.crumb-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 100%);
  border: 1px solid #C7D2FE;
  color: #4338CA;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.1);
}

.reward-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.reward-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.03);
  transition: transform 0.12s ease;
}
.reward-pill:hover {
  transform: translateY(-1px);
}

.reward-pill.star { background: linear-gradient(135deg, #FFFDF5, #FEF3C7); border-color: #FDE68A; color: #B45309; }
.reward-pill.gem  { background: linear-gradient(135deg, #F8FAFC, #DBEAFE); border-color: #BFDBFE; color: #1D4ED8; }
.reward-pill.flw  { background: linear-gradient(135deg, #FFF5F5, #FFE4E6); border-color: #FECDD3; color: #BE123C; }

/* 嵌入模式 (?embed=1) 精简外框 */
body.embed-mode .huer-sidebar {
  display: none;
}
body.embed-mode .huer-main {
  padding: 12px 16px 28px;
}

/* 视图切换动画 */
.view-section {
  display: none;
  flex: 1;
  flex-direction: column;
  animation: viewFade 0.2s ease-out;
}
.view-section.active {
  display: flex;
}
@keyframes viewFade {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 首页科学训练版深靛紫渐变英雄横幅 */
.hero-banner {
  background: linear-gradient(135deg, #2E2B73 0%, #474D94 52%, #4F46E5 100%);
  border-radius: var(--radius-xl);
  padding: 28px 32px;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  box-shadow: var(--shadow-pop);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
  flex-wrap: wrap;
}

.hero-banner::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 1px;
  margin-bottom: 6px;
}

.hero-sub {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

.hero-continue-btn {
  background: #FFFFFF;
  color: var(--huer-indigo-dark);
  border: none;
  border-radius: 20px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  transition: transform 0.16s ease;
  text-align: left;
}
.hero-continue-btn:hover {
  transform: translateY(-2px);
}
.hc-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--green-light);
  color: var(--green);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}
.hc-label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 700;
}
.hc-val {
  font-size: 15px;
  font-weight: 900;
  color: var(--text-main);
  margin-top: 2px;
}

/* 首页三大核心入口卡片 + 四大训练模式预览 */
.home-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.entry-card {
  position: relative;
  background: var(--card-bg);
  border-radius: 24px;
  padding: 28px 22px;
  text-align: left;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--border-warm);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.entry-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-pop);
  border-color: #C7D2FE;
}

.entry-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.entry-icon-box {
  width: 60px;
  height: 60px;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
}
.entry-icon-box.writing   { background: var(--huer-indigo-light); }
.entry-icon-box.reading   { background: var(--green-light); }
.entry-icon-box.errorbook { background: var(--red-light); }

.entry-tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #FFFFFF;
}
.entry-tag.writing   { background: var(--huer-indigo); }
.entry-tag.reading   { background: var(--green); }
.entry-tag.errorbook { background: var(--red); }

.entry-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 6px;
}
.entry-desc {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.55;
}

.science-modes-strip {
  background: #FFFFFF;
  border: 1px solid var(--border-warm);
  border-radius: 22px;
  padding: 18px 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}
.sms-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--huer-indigo-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.sms-card {
  background: var(--bg-warm);
  border-radius: 16px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
}
.sms-card:hover {
  border-color: var(--huer-indigo);
  background: var(--huer-indigo-light);
}
.sms-ico {
  font-size: 24px;
}
.sms-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
}
.sms-tip {
  font-size: 11px;
  color: var(--text-sub);
}

/* 通用二级顶栏 */
.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--border-warm);
  background: #FFFFFF;
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.btn-back:hover {
  transform: translateY(-1px);
  border-color: var(--huer-indigo);
}
.btn-back.blue-pill {
  background: var(--huer-indigo);
  color: #FFFFFF;
  border-color: var(--huer-indigo);
}
.page-title-wrap {
  text-align: center;
  flex: 1;
}
.page-title {
  font-size: 24px;
  font-weight: 900;
  color: var(--text-main);
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 3px;
}

/* 分波微关卡切换器（降低单局认知负荷：每关 6~8 字） */
.wave-switcher-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.wave-tab-pill {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--border-warm);
  background: #FFFFFF;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.15s;
}
.wave-tab-pill.active {
  background: var(--huer-indigo);
  border-color: var(--huer-indigo);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(71, 77, 148, 0.25);
}

/* 年级与课文网格 */
.school-sys-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
}
.sys-btn {
  padding: 6px 15px;
  border-radius: 999px;
  border: none;
  background: transparent;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub);
  cursor: pointer;
}
.sys-btn.active {
  background: var(--huer-indigo);
  color: #FFFFFF;
}

.grades-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.grade-card {
  background: #FFFFFF;
  border-radius: 22px;
  padding: 22px 16px;
  text-align: center;
  box-shadow: var(--shadow-card);
  border: 1.5px solid var(--border-warm);
  cursor: pointer;
  transition: all 0.18s;
}
.grade-card:hover {
  transform: translateY(-3px);
  border-color: var(--huer-indigo);
}
.grade-card.preschool {
  background: linear-gradient(180deg, #FFFFFF 0%, #F0FDF4 100%);
  border-color: #BBF7D0;
}
.grade-icon { font-size: 38px; margin-bottom: 8px; }
.grade-name { font-size: 19px; font-weight: 900; color: var(--text-main); margin-bottom: 4px; }
.grade-meta { font-size: 12px; color: var(--text-sub); }

/* 识字表多出的「语文园地拓展字」单独标出来，避免和教材页脚官方识字量对不上 */
.grade-extra {
  font-style: normal;
  display: inline-block;
  margin-left: 3px;
  padding: 0 4px;
  border-radius: 5px;
  background: rgba(110, 116, 184, .14);
  color: #5C63A8;
  font-size: 10.5px;
  line-height: 15px;
  vertical-align: 1px;
  cursor: help;
}

.lessons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.lesson-card {
  background: #FFFFFF;
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1.5px solid var(--border-warm);
  transition: border-color 0.15s;
}
.lesson-card:hover {
  border-color: #C7D2FE;
}
.lesson-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 8px;
  background: var(--huer-indigo-light);
  color: var(--huer-indigo);
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 8px;
}
.lesson-title {
  font-size: 18px;
  font-weight: 900;
  color: var(--text-main);
  margin-bottom: 10px;
}
.char-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: 10px;
  min-height: 60px;
}
.char-preview-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-warm);
  border: 1px solid var(--border-warm);
  border-radius: 8px;
  padding: 3px 7px;
  min-width: 34px;
}
.char-preview-chip .py { font-size: 10px; color: var(--text-sub); line-height: 1.1; }
.char-preview-chip .hz { font-size: 19px; font-weight: 800; color: var(--text-main); }
.char-more-chip { font-size: 12px; font-weight: 800; color: var(--text-sub); padding: 4px 6px; }
.lesson-total-txt { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }

.mode-btns-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mode-btn {
  border: none;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #FFFFFF;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: transform 0.12s, opacity 0.12s;
}
.mode-btn:hover { opacity: 0.94; transform: translateY(-1px); }
.mode-btn.m-simple { background: var(--green); }
.mode-btn.m-bubble { background: var(--huer-indigo); }
.mode-btn.m-write  { background: var(--orange); }
.mode-btn.m-match  { background: var(--teal); }

/* 状态胶囊 */
.status-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.stat-pill {
  padding: 6px 14px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid var(--border-warm);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}
.stat-pill.score-pill {
  background: linear-gradient(135deg, var(--huer-indigo) 0%, var(--huer-purple) 100%);
  color: #FFFFFF;
  border: none;
}
.stat-pill.clickable {
  cursor: pointer;
}

/* 模式一：简单拆字 */
.simple-stage-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 0;
}
.simple-card {
  position: relative;
  width: 100%;
  max-width: 760px;
  min-height: 390px;
  background: #FFFFFF;
  border-radius: 30px;
  border: 1.5px solid var(--border-warm);
  box-shadow: var(--shadow-card);
  padding: 34px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.struct-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--huer-indigo-light);
  color: var(--huer-indigo);
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 10px;
}
.simple-prompt {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 20px;
  text-align: center;
}
.equation-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 8px 0 22px;
}
.eq-part-box {
  min-width: 96px;
  height: 96px;
  padding: 0 16px;
  border-radius: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 54px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.15s;
}
.eq-part-box:hover { transform: scale(1.06); }
.eq-part-box.c0 { color: #DC2626; background: #FEF2F2; border: 2px solid #FECACA; }
.eq-part-box.c1 { color: #2563EB; background: #EFF6FF; border: 2px solid #BFDBFE; }
.eq-part-box.c2 { color: #D97706; background: #FFFBEB; border: 2px solid #FDE68A; }
.eq-part-box.c3 { color: #7C3AED; background: #F5F3FF; border: 2px solid #DDD6FE; }
.eq-op { font-size: 34px; font-weight: 900; color: var(--text-sub); }
.eq-op.minus { color: var(--red); }
.eq-question-box {
  width: 104px;
  height: 104px;
  border-radius: 24px;
  background: linear-gradient(135deg, var(--huer-indigo) 0%, var(--huer-purple) 100%);
  color: #FFFFFF;
  font-size: 52px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(71, 77, 148, 0.3);
  transition: transform 0.15s;
}
.eq-question-box:hover { transform: scale(1.06); }
.eq-answer-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  animation: popScale 0.24s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes popScale {
  from { transform: scale(0.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.eq-answer-py { font-size: 26px; font-weight: 800; color: var(--huer-indigo-dark); margin-bottom: -4px; }
.eq-answer-hz { font-size: 108px; font-weight: 900; color: var(--green); line-height: 1.05; }
.eq-meaning {
  max-width: 22em; margin-top: 6px; text-align: center;
  font-size: 14px; font-weight: 600; line-height: 1.5; color: var(--ink);
}
.eq-poly { margin-top: 3px; font-size: 12px; font-weight: 700; color: var(--ink-soft); text-align: center; }
.words-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 10px;
}
.word-chip {
  border: 1.5px solid #86EFAC;
  background: #F0FDF4;
  border-radius: 14px;
  padding: 8px 18px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s;
}
.word-chip:hover { transform: translateY(-2px); background: #DCFCE7; }
.word-chip .w-py { font-size: 12px; color: #15803D; margin-bottom: 2px; }
.word-chip .w-hz { font-size: 18px; font-weight: 800; color: #14532D; }

.nav-circle-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}
.nav-circle-btn.prev { left: 16px; background: var(--bg-warm); color: var(--text-sub); }
.nav-circle-btn.next { right: 16px; background: var(--green); color: #FFFFFF; box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3); }

/* 模式二：气泡拼字 */
.bubble-arena-card {
  position: relative;
  width: 100%;
  max-width: 900px;
  min-height: 390px;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 30px;
  box-shadow: var(--shadow-card);
  padding: 24px 24px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}
.bubbles-field {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 18px 12px;
  min-height: 270px;
}
/* 方案 D: 3D 水晶微拟物泡泡球 (双层曲面反光 + 悬浮阻尼力场) */
.part-bubble {
  width: 86px;
  height: 86px;
  border-radius: 50%;
  color: #FFFFFF;
  font-size: 36px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  position: relative;
  touch-action: none;
  user-select: none;
  z-index: 2;
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.32), inset 0 8px 14px rgba(255, 255, 255, 0.8), 0 14px 28px -4px rgba(15, 23, 42, 0.28);
  transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.18s ease, filter 0.18s ease;
  animation: bubbleFloat 3.5s ease-in-out infinite alternate;
}
.part-bubble::before {
  content: '';
  position: absolute;
  top: 10px;
  left: 16px;
  width: 28px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.96) 0%, rgba(255, 255, 255, 0) 80%);
  transform: rotate(-28deg);
  pointer-events: none;
}
.part-bubble::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 18px;
  width: 24px;
  height: 9px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 80%);
  pointer-events: none;
}
.part-bubble:hover {
  transform: scale(1.08) translateY(-4px);
  filter: brightness(1.06);
  box-shadow: inset 0 -10px 18px rgba(0, 0, 0, 0.28), inset 0 8px 14px rgba(255, 255, 255, 0.9), 0 20px 36px -4px rgba(15, 23, 42, 0.32);
}
@keyframes bubbleFloat {
  0%   { transform: translateY(0px) rotate(0deg); }
  50%  { transform: translateY(-7px) rotate(1.5deg); }
  100% { transform: translateY(0px) rotate(-1deg); }
}
.part-bubble.selected {
  outline: 4px solid #FBBF24;
  transform: scale(1.12);
  z-index: 10;
}
.part-bubble.drop-target {
  outline: 5px solid var(--green);
  transform: scale(1.15);
  z-index: 12;
}
.part-bubble.hint-glow {
  outline: 5px solid var(--green);
  box-shadow: 0 0 0 8px rgba(22, 163, 74, 0.35), 0 8px 18px rgba(0,0,0,0.18);
  z-index: 11;
}
.part-bubble.shake-err {
  animation: shakeErr 0.35s ease;
}
@keyframes shakeErr {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}
.bubble-pop-char {
  position: absolute;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%);
  font-size: 128px;
  font-weight: 900;
  color: var(--green);
  text-shadow: 0 8px 24px rgba(22, 163, 74, 0.32);
  pointer-events: none;
  z-index: 30;
  animation: popFade 0.85s ease forwards;
}
@keyframes popFade {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(0.4); }
  40% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  80% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -65%) scale(0.9); }
}
.combo-toast {
  position: absolute;
  right: 20px;
  top: 20px;
  background: linear-gradient(135deg, #F97316, #EA580C);
  color: #FFFFFF;
  padding: 7px 15px;
  border-radius: 14px;
  font-weight: 900;
  font-size: 16px;
  display: none;
  z-index: 25;
}
.bubble-footer-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 6px;
}
.collected-bar {
  margin-top: 14px;
  text-align: center;
}
.collected-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
}
.collected-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.collected-chip {
  min-width: 52px;
  height: 50px;
  padding: 3px 10px;
  border-radius: 14px;
  background: var(--green-light);
  border: 1.5px solid #86EFAC;
  color: #15803D;
  font-size: 19px;
  font-weight: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.collected-chip .c-py { font-size: 10px; line-height: 1.1; color: var(--green); }
.collected-chip.pending {
  background: #FFFFFF;
  border: 1.5px dashed #CBD5E1;
  color: var(--text-sub);
}

/* 模式三：笔顺跟写 / 自由默写 */
.write-header-bar {
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 20px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  flex-wrap: wrap;
  gap: 10px;
}
.write-submode-tabs { display: flex; align-items: center; gap: 8px; }
.w-tab-btn {
  padding: 7px 15px;
  border-radius: 12px;
  border: none;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  background: var(--bg-warm);
  color: var(--text-sub);
}
.w-tab-btn.active-trace { background: var(--huer-indigo); color: #FFFFFF; }
.w-tab-btn.active-free  { background: var(--orange); color: #FFFFFF; }
.write-py-center { display: flex; flex-direction: column; align-items: center; }
.write-py-row { display: flex; align-items: center; gap: 10px; }
.write-py-text { font-size: 36px; font-weight: 900; color: var(--red); line-height: 1; }
.btn-Variables-audio {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: none;
  background: var(--orange);
  color: #FFFFFF;
  font-size: 15px;
  cursor: pointer;
}
.write-parts-hint { font-size: 13px; color: var(--huer-indigo); font-weight: 800; margin-top: 4px; }
.btn-demo-orange {
  padding: 7px 16px;
  border-radius: 12px;
  border: none;
  background: var(--orange);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.memory-banner {
  margin: 0 auto 12px;
  padding: 8px 20px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--huer-indigo) 0%, var(--huer-purple) 100%);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  display: none;
  align-items: center;
  gap: 10px;
}
.memory-banner.show { display: inline-flex; }
.memory-skip-btn {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.22);
  border: none;
  color: #FFFFFF;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.mizige-box {
  position: relative;
  width: 340px;
  height: 340px;
  background: #FFFFFF;
  border-radius: 26px;
  border: 2.5px solid #FED7AA;
  box-shadow: var(--shadow-card);
  margin: 0 auto;
  overflow: hidden;
  touch-action: none;
}

/* 写字工坊双栏架构 */
.write-smart-studio {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: center;
  max-width: 920px;
  margin: 0 auto;
  width: 100%;
}
.write-sidebar-col {
  flex: 0 0 320px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.write-main-col {
  flex: 0 0 360px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

/* 左侧汉字结构与词语卡 */
.char-anatomy-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1.5px solid var(--border-warm);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.anatomy-pills {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.anatomy-pill {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}
.anatomy-pill.struct { background: #EFF6FF; color: #1D4ED8; }
.anatomy-pill.count  { background: #FEF3C7; color: #B45309; }
.anatomy-pill.op     { background: #F0FDF4; color: #15803D; }
.anatomy-formula {
  font-size: 20px;
  font-weight: 900;
  color: var(--text-main);
  text-align: center;
}

.write-words-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1.5px solid var(--border-warm);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.sidebar-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-sub);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.write-words-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.write-word-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1.5px solid var(--border-warm);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.15s ease;
}
.write-word-chip:hover {
  transform: translateX(3px);
  background: #FFF7ED;
  border-color: #FDBA74;
}

/* 笔顺分解步骤条 */
.stroke-breakdown-card {
  background: #FFFFFF;
  border-radius: 20px;
  border: 1.5px solid var(--border-warm);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
}
.stroke-cur-badge {
  font-size: 12px;
  font-weight: 800;
  color: var(--orange);
  background: #FFF7ED;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #FFEDD5;
}
.stroke-steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}
.stroke-step-chip {
  padding: 6px 2px;
  border-radius: 10px;
  border: 1.5px solid var(--border-warm);
  background: var(--bg-warm);
  text-align: center;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.18s;
  user-select: none;
}
.stroke-step-chip.done {
  background: #F0FDF4;
  border-color: #86EFAC;
  color: #15803D;
}
.stroke-step-chip.active {
  background: linear-gradient(135deg, var(--orange) 0%, #EA580C 100%);
  border-color: #C2410C;
  color: #FFFFFF;
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(234,88,12,0.3);
  animation: pulseChip 1.2s infinite alternate;
}
@keyframes pulseChip {
  0%   { transform: scale(1.03); }
  100% { transform: scale(1.08); }
}

/* 实时诊断提示横幅 */
.write-diagnostic-banner {
  width: 340px;
  border-radius: 18px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #FFFBEB;
  border: 1.5px solid #FDE68A;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  box-sizing: border-box;
}
.write-diagnostic-banner.err {
  background: #FEF2F2;
  border-color: #FECACA;
  animation: shakeErr 0.35s ease;
}
.write-diagnostic-banner.succ {
  background: #F0FDF4;
  border-color: #BBF7D0;
}
.diag-icon {
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
}
.diag-text-box {
  flex: 1;
  min-width: 0;
}
.diag-title {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.diag-desc {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  line-height: 1.35;
  margin-top: 2px;
}
.btn-diag-speak {
  border: none;
  background: rgba(0,0,0,0.06);
  width: 28px;
  height: 28px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-diag-speak:hover { background: rgba(0,0,0,0.12); }

.btn-3d {
  box-shadow: 0 4px 0 rgba(0,0,0,0.12), var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn-3d:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15) !important;
}

.write-bottom-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.btn-write-act {
  padding: 9px 18px;
  border-radius: 14px;
  border: 1.5px solid var(--border-warm);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
  cursor: pointer;
}
.btn-write-act.add-err { border-color: #FECDD3; background: #FFF1F2; color: #BE123C; }
.btn-write-act.in-err  { border-color: #BBF7D0; background: #F0FDF4; color: #15803D; }

/* 自由默写子模式 */
.free-write-layout {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 24px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.free-left-col { width: 250px; display: flex; flex-direction: column; gap: 12px; }
.blur-hint-card {
  background: #FFFFFF;
  border-radius: 18px;
  border: 1.5px solid var(--border-warm);
  padding: 14px;
  text-align: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.blur-card-label { font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.blur-parts-text { font-size: 22px; font-weight: 800; color: var(--red); transition: filter 0.2s; }
.blur-parts-text.masked { filter: blur(8px); }
.blur-char-box { height: 104px; display: flex; align-items: center; justify-content: center; margin: 4px 0 10px; }
.blur-char-text { font-size: 72px; font-weight: 900; color: var(--red); transition: filter 0.22s; }
.blur-char-text.masked {
  filter: blur(16px);
  background: radial-gradient(circle, rgba(234,88,12,0.75) 0%, rgba(234,88,12,0) 70%);
  border-radius: 50%;
  width: 90px;
  height: 90px;
  color: transparent;
}
.btn-full-blue {
  width: 100%;
  padding: 9px;
  border-radius: 12px;
  border: none;
  background: var(--huer-indigo);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 6px;
}
.btn-full-red {
  width: 100%;
  padding: 9px;
  border-radius: 12px;
  border: none;
  background: var(--red);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

/* 模式四：拼音消消乐 */
.match-board-card {
  max-width: 820px;
  width: 100%;
  margin: 12px auto;
  background: #FFFFFF;
  border: 1.5px solid var(--border-warm);
  border-radius: 28px;
  padding: 24px;
  box-shadow: var(--shadow-card);
}
.match-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.match-tile {
  height: 70px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.14s, background 0.14s, opacity 0.2s;
  box-shadow: var(--shadow-sm);
}
.match-tile.py-tile {
  background: var(--bg-warm);
  border: 1.5px solid var(--border-warm);
  color: var(--text-main);
  font-size: 19px;
}
.match-tile.hz-tile {
  background: var(--huer-indigo);
  border: 1.5px solid var(--huer-indigo-dark);
  color: #FFFFFF;
  font-size: 28px;
}
.match-tile.selected {
  background: #F59E0B !important;
  border-color: #D97706 !important;
  color: #FFFFFF !important;
  transform: scale(1.05);
}
.match-tile.matched {
  background: var(--green) !important;
  border-color: var(--green) !important;
  color: #FFFFFF !important;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.82);
}

/* 错字库管理 */
.err-warn-banner {
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  border-radius: 14px;
  padding: 10px 16px;
  font-size: 13px;
  color: #92400E;
  margin-bottom: 12px;
}
.err-search-input {
  width: 100%;
  padding: 11px 16px;
  border-radius: 14px;
  border: 1.5px solid var(--border-warm);
  background: #FFFFFF;
  font-size: 14px;
  margin-bottom: 12px;
  outline: none;
}
.err-review-today-btn {
  width: 100%;
  padding: 13px;
  border-radius: 16px;
  border: none;
  background: linear-gradient(90deg, var(--huer-indigo) 0%, var(--huer-purple) 100%);
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-bottom: 14px;
}
.err-filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}
.err-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.err-f-tab {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-warm);
  background: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
}
.err-f-tab.active {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red);
}
.err-cards-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}
.err-char-card {
  background: #FFFFFF;
  border: 1.5px solid #FCA5A5;
  border-radius: 18px;
  padding: 12px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.14s;
}
.err-char-card:hover { transform: translateY(-2px); }
.err-char-card.selected-err {
  border-color: var(--huer-indigo);
  background: var(--huer-indigo-light);
}
.err-char-card .py { font-size: 12px; color: var(--text-sub); }
.err-char-card .hz { font-size: 36px; font-weight: 900; color: var(--red); margin: 3px 0; }
.err-char-card .src { font-size: 11px; color: var(--text-muted); margin-bottom: 4px; }
.err-char-card .st-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: #FEE2E2;
  color: #B91C1C;
  font-size: 11px;
  font-weight: 800;
}
.err-char-card .eb-stage { font-size: 10px; color: var(--text-muted); margin-top: 5px; }

/* 弹窗与关卡结算弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(30, 36, 51, 0.48);
  display: none;
  /* 弹窗有 max-height 兜底（见 .modal-box），容器不会被撑破，用 center 是安全的 */
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal-box {
  background: #FFFFFF;
  border-radius: 26px;
  max-width: 520px;
  width: 100%;
  /* 内容高的弹窗（复习本 / 伴学记录 / 结算）在手机横屏一屏放不下，
     限高 + 内部滚动，避免按钮被裁到屏幕外点不到 */
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 28px;
  box-shadow: 0 24px 56px rgba(0,0,0,0.22);
}
.settle-stars {
  font-size: 42px;
  text-align: center;
  letter-spacing: 8px;
  margin-bottom: 8px;
}
.settle-chars-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 14px 0;
}
.settle-char-chip {
  padding: 6px 12px;
  border-radius: 12px;
  background: var(--bg-warm);
  border: 1.5px solid var(--border-warm);
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
}
.settle-char-chip.in-err {
  background: var(--red-light);
  border-color: #FDA4AF;
  color: var(--red);
}

/* 移动端底部导航栏（仅 <1024px 显示） */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #FFFFFF;
  border-top: 1px solid var(--border-warm);
  padding: 6px 10px;
  z-index: 50;
  justify-content: space-around;
}
.m-nav-btn {
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: 12px;
}
.m-nav-btn.active {
  color: var(--huer-indigo);
  background: var(--huer-indigo-light);
}

@media (max-width: 1023px) {
  .huer-sidebar { display: none; }
  .mobile-bottom-nav { display: flex; }
  body.embed-mode .mobile-bottom-nav { display: none; }
  .huer-main { padding: 14px 16px 76px; }
  .grades-grid { grid-template-columns: repeat(2, 1fr); }
  .lessons-grid { grid-template-columns: repeat(2, 1fr); }
  .sms-grid { grid-template-columns: repeat(2, 1fr); }
  .err-cards-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 640px) {
  .home-cards-grid { grid-template-columns: 1fr; }
  .grades-grid, .lessons-grid { grid-template-columns: 1fr; }
  .err-cards-grid { grid-template-columns: repeat(2, 1fr); }
  .match-grid { grid-template-columns: repeat(3, 1fr); }
  .simple-card { padding: 24px 18px; }
}

/* =========================================================================
   方案 D 核心：Duolingo 风格 3D 触觉萌趣厚底按钮体系 (.btn-3d-playful)
   - 具备 5px 真实物理厚底与立体基座
   - :hover 悬浮微升 2px
   - :active 物理下压 3px，基座缩减为 1px，伴随高回弹弹簧阻尼微动效
   ========================================================================= */
.btn-3d-playful,
.btn-back,
.hero-continue-btn,
.err-review-today-btn,
.btn-demo-orange,
.btn-write-act,
.cand-btn,
.nav-circle-btn,
.w-tab-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 800;
  border-radius: 16px;
  cursor: pointer;
  user-select: none;
  transition: transform 0.08s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.08s cubic-bezier(0.34, 1.56, 0.64, 1), filter 0.08s ease;
}

.btn-3d-playful:hover,
.btn-back:hover,
.btn-demo-orange:hover,
.btn-write-act:hover {
  filter: brightness(1.04);
  transform: translateY(-2px);
}

.btn-3d-playful:active,
.btn-back:active,
.hero-continue-btn:active,
.err-review-today-btn:active,
.btn-demo-orange:active,
.btn-write-act:active,
.cand-btn:active,
.nav-circle-btn:active,
.w-tab-btn:active {
  transform: translateY(3px) !important;
}

/* 预设 3D 实体颜色主题 */
.btn-3d-playful.primary,
.btn-back.blue-pill {
  background: linear-gradient(180deg, #6366F1 0%, #4F46E5 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 5px 0 #3730A3, 0 8px 18px rgba(79, 70, 229, 0.28) !important;
}
.btn-3d-playful.primary:active,
.btn-back.blue-pill:active {
  box-shadow: 0 1px 0 #3730A3, 0 3px 6px rgba(79, 70, 229, 0.2) !important;
}

.btn-3d-playful.green,
.nav-circle-btn.next {
  background: linear-gradient(180deg, #22C55E 0%, #16A34A 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 5px 0 #15803D, 0 8px 18px rgba(22, 163, 74, 0.28) !important;
}
.btn-3d-playful.green:active,
.nav-circle-btn.next:active {
  box-shadow: 0 1px 0 #15803D, 0 3px 6px rgba(22, 163, 74, 0.2) !important;
}

.btn-3d-playful.orange,
.btn-demo-orange {
  background: linear-gradient(180deg, #FB923C 0%, #EA580C 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 5px 0 #C2410C, 0 8px 18px rgba(234, 88, 12, 0.28) !important;
}
.btn-3d-playful.orange:active,
.btn-demo-orange:active {
  box-shadow: 0 1px 0 #C2410C, 0 3px 6px rgba(234, 88, 12, 0.2) !important;
}

.btn-3d-playful.white,
.btn-back {
  background: #FFFFFF;
  color: #1E293B;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 4px 0 #CBD5E1, 0 6px 14px rgba(15, 23, 42, 0.04);
}
.btn-3d-playful.white:active,
.btn-back:active {
  box-shadow: 0 1px 0 #CBD5E1;
}

/* 结算弹窗增强 (Scheme D) */
.modal-box {
  background: #FFFFFF;
  border-radius: 30px;
  max-width: 540px;
  width: 100%;
  padding: 32px;
  box-shadow: 0 25px 60px -10px rgba(15, 23, 42, 0.28), 0 0 1px 1px rgba(226, 232, 240, 0.8);
  border: 1.5px solid rgba(226, 232, 240, 0.8);
  animation: modalPop 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes modalPop {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}


/* =========================================================================
   方案 D 高定升级：游戏交互卡片微拟物与 3D 浮雕交互增强
   ========================================================================= */

/* 1. 模式一：算式卡片与部件 3D 触觉 */
.simple-card {
  border: 1.5px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.08), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  border-radius: 32px;
}
.eq-part-box {
  border-radius: 24px;
  box-shadow: 0 6px 0 rgba(0, 0, 0, 0.06), 0 10px 20px rgba(0, 0, 0, 0.04);
  transition: transform 0.1s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.1s ease;
}
.eq-part-box:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 9px 0 rgba(0, 0, 0, 0.06), 0 14px 26px rgba(0, 0, 0, 0.06);
}
.eq-part-box:active {
  transform: translateY(3px) scale(0.98);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.06);
}
.eq-question-box {
  border-radius: 26px;
  box-shadow: 0 6px 0 #3730A3, 0 12px 24px rgba(79, 70, 229, 0.35);
  animation: questionPulse 2.4s infinite ease-in-out;
}
@keyframes questionPulse {
  0%, 100% { box-shadow: 0 6px 0 #3730A3, 0 12px 24px rgba(79, 70, 229, 0.35); }
  50% { box-shadow: 0 6px 0 #3730A3, 0 18px 36px rgba(99, 102, 241, 0.55); }
}

/* 2. 模式三：写字工坊双栏卡片微浮雕与高质感阴影 */
.char-anatomy-card,
.write-words-card,
.stroke-breakdown-card {
  border: 1px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.04), 0 1px 3px rgba(15, 23, 42, 0.02);
  border-radius: 22px;
  background: #FFFFFF;
}
.mizige-box {
  border-radius: 28px;
  border: 3px solid #FED7AA;
  box-shadow: 0 12px 32px -4px rgba(234, 88, 12, 0.12), 0 4px 12px rgba(0, 0, 0, 0.04);
}
.stroke-step-chip {
  border-radius: 12px;
  transition: all 0.12s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stroke-step-chip:active {
  transform: translateY(2px);
}

/* 3. 模式四：消消乐 3D 白瓷果冻卡与蓝宝石卡 */
.match-board-card {
  border: 1.5px solid rgba(226, 232, 240, 0.85);
  box-shadow: 0 16px 36px -8px rgba(15, 23, 42, 0.08);
  border-radius: 32px;
}
.match-tile.py-tile {
  background: #FFFFFF;
  border: 1.5px solid #E2E8F0;
  box-shadow: 0 4px 0 #CBD5E1, 0 6px 14px rgba(15, 23, 42, 0.04);
}
.match-tile.py-tile:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #CBD5E1 !important;
}
.match-tile.hz-tile {
  background: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);
  box-shadow: 0 5px 0 #3730A3, 0 8px 18px rgba(79, 70, 229, 0.3);
}
.match-tile.hz-tile:active {
  transform: translateY(3px) !important;
  box-shadow: 0 1px 0 #3730A3 !important;
}

/* 4. 年级与课文卡片微浮雕 */
.grade-card, .lesson-card {
  border: 1.5px solid rgba(226, 232, 240, 0.85);
  border-radius: 22px;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.04);
  transition: transform 0.16s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.16s ease, border-color 0.16s ease;
}
.grade-card:hover, .lesson-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px -4px rgba(79, 70, 229, 0.15), 0 4px 10px rgba(0, 0, 0, 0.04);
  border-color: #A5B4FC;
}

/* ============================================================
 * 沪儿睿 · 应用外壳 —— 漫画手绘风（Comic / Hand-drawn）
 * 与专项训练模块同一套视觉：纸感底 + 粗墨描边 + 硬投影 + 楷体标题
 * 只改颜色 / 边框 / 阴影 / 字体，不动任何布局与逻辑
 * ============================================================ */

:root {
  --ink: #1E1B3A;
  --paper: #F7F6FD;
  --paper-2: #FCFBFF;
  --brand: #5358AC;
  --coral: #5358AC;
  --rose: #FF6B6B;
  --sun: #FFE033;
  --sky: #3B82F6;
  --mint: #22B573;
  --grape: #7C5CFC;
  --ink-soft: #645F88;
  --bd: 1.5px solid #DBD9E6;
  --hard: 0 8px 20px -12px rgba(30, 27, 58, .26);
  --hard-sm: 0 4px 14px -9px rgba(30, 27, 58, .24);
  --f-disp: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", "SimSun", serif;
}

/* ---------- 纸感底 + 网点 ---------- */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(30, 27, 58, .5) 1px, transparent 1.3px),
    radial-gradient(1100px 460px at 104% -8%, rgba(83, 88, 172, .16) 0%, rgba(83, 88, 172, 0) 62%),
    radial-gradient(900px 420px at -10% 104%, rgba(255, 224, 51, .16) 0%, rgba(255, 224, 51, 0) 60%);
  background-size: 14px 14px, auto, auto;
  background-attachment: fixed;
  color: var(--ink);
}

/* ---------- 侧栏：奶油纸 + 右侧墨线 ---------- */
.huer-sidebar {
  background: var(--paper-2);
  background-image: radial-gradient(rgba(30, 27, 58, .45) 1px, transparent 1.2px);
  background-size: 12px 12px;
  border-right: var(--bd);
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}

.brand-logo {
  background: #fff;
  border: var(--bd);
  border-radius: 14px;
  box-shadow: var(--hard-sm);
  padding: 3px;
  overflow: hidden;
}
.brand-title {
  font-family: var(--f-disp);
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--ink);
}
.brand-sub { color: var(--ink-soft); font-weight: 700; }

.sidebar-title {
  font-family: var(--f-disp);
  color: var(--ink);
  letter-spacing: .12em;
}

.side-nav-item {
  color: var(--ink);
  border: 2.5px solid transparent;
  border-radius: 14px;
  transition: transform .12s ease, background .12s ease, box-shadow .12s ease;
}
.side-nav-item:hover {
  background: #fff;
  border-color: var(--line-hover);
  box-shadow: var(--hard-sm);
  transform: translate(-1px, -1px);
  color: var(--ink);
}
.side-nav-item.active {
  background: var(--sun);
  border: 1.5px solid #DBD9E6;
  color: var(--ink);
  box-shadow: var(--hard-sm);
  transform: translate(-1px, -1px);
}
.side-nav-item.active .side-nav-name { color: var(--ink); font-weight: 900; }
.side-nav-item.active .side-nav-desc { color: rgba(30, 27, 58, .68); }
.side-nav-icon {
  background: #fff;
  border: 1.5px solid #DBD9E6;
  border-radius: 11px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.side-nav-name { font-family: var(--f-disp); font-weight: 900; letter-spacing: .04em; }
.side-nav-desc { color: var(--ink-soft); font-weight: 600; }
.side-badge {
  background: var(--rose);
  border: 1.5px solid #DBD9E6;
  color: #fff;
}

.sidebar-growth {
  margin-top: auto;
  background: #fff;
  border: 1.5px solid #DBD9E6;
  border-radius: 16px;
  box-shadow: var(--hard-sm);
  padding: 12px 12px 11px;
}
.sg-head {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--f-disp); font-size: 14px; font-weight: 900; color: var(--ink);
  letter-spacing: .04em;
}
.sg-head b {
  font-family: var(--f-body); font-size: 15px; font-weight: 900; color: var(--ink);
  background: var(--sun); border: 1.5px solid #DBD9E6; border-radius: 99px;
  padding: 0 8px; line-height: 1.6;
}
.sg-bar {
  margin-top: 9px; height: 12px; border: 1.5px solid #DBD9E6; border-radius: 99px;
  background: var(--paper); overflow: hidden;
}
.sg-bar i {
  display: block; height: 100%; width: 0; background: var(--sun);
  border-right: 1.5px solid #DBD9E6; transition: width .25s ease;
}
.sg-foot { margin-top: 7px; font-size: 11.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.5; }

/* ---------- 顶栏：白色贴纸 ---------- */
.global-topbar {
  background: #fff;
  border: var(--bd);
  border-radius: 16px;
  box-shadow: var(--hard-sm);
}
.crumb-tag {
  background: var(--sun);
  border: 1.5px solid #DBD9E6;
  border-radius: 99px;
  color: var(--ink);
  font-weight: 800;
}
.reward-bar { gap: 8px; }
.reward-pill {
  background: var(--paper);
  border: 1.5px solid #DBD9E6;
  border-radius: 99px;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.reward-pill b { color: var(--ink); }

/* ---------- 首页主视觉 ---------- */
.hero-banner {
  background:
    radial-gradient(520px 240px at 88% 8%, rgba(255, 201, 60, .55) 0%, rgba(255, 201, 60, 0) 62%),
    linear-gradient(135deg, #FF8A6B 0%, #FFB15C 52%, #FFD166 100%);
  border: var(--bd);
  border-radius: 22px;
  box-shadow: var(--hard);
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background-image: radial-gradient(rgba(30, 27, 58, .5) 1.1px, transparent 1.4px);
  background-size: 10px 10px;
  opacity: .10;
}
.hero-title {
  font-family: var(--f-disp);
  font-weight: 900;
  letter-spacing: .03em;
  color: #fff;
  text-shadow:
    2px 0 var(--ink), -2px 0 var(--ink), 0 2px var(--ink), 0 -2px var(--ink),
    2px 2px var(--ink), -2px -2px var(--ink), 2px -2px var(--ink), -2px 2px var(--ink),
    0 5px 0 rgba(30, 27, 58, .25);
}
.hero-sub { color: rgba(30, 27, 58, .78); font-weight: 700; }
.hero-badge {
  background: #fff;
  border: 1.5px solid #DBD9E6;
  border-radius: 99px;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.hero-continue-btn {
  background: var(--ink);
  color: var(--paper);
  border: 1.5px solid #DBD9E6;
  border-radius: 99px;
  box-shadow: 3px 3px 0 rgba(255, 246, 228, .9);
  font-weight: 900;
}

/* ---------- 三张入口卡 ---------- */
.home-cards-grid { gap: 16px; }
.entry-card {
  background: #fff;
  border: var(--bd);
  border-radius: 20px;
  box-shadow: var(--hard);
  transition: transform .14s cubic-bezier(.3, 1.3, .5, 1), box-shadow .14s ease;
}
.entry-card:nth-child(1) { transform: rotate(-.7deg); }
.entry-card:nth-child(2) { transform: rotate(.5deg); }
.entry-card:nth-child(3) { transform: rotate(-.4deg); }
.entry-card:hover {
  transform: translate(-3px, -3px) rotate(0deg);
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.entry-icon-box {
  border: 1.5px solid #DBD9E6;
  border-radius: 16px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.entry-title { font-family: var(--f-disp); font-weight: 900; letter-spacing: .03em; color: var(--ink); }
.entry-desc { color: var(--ink-soft); font-weight: 600; }
.entry-tag {
  background: var(--paper);
  border: 1.5px solid #DBD9E6;
  border-radius: 99px;
  color: var(--ink);
  font-weight: 800;
}

/* ---------- 四大模式条 ---------- */
.sms-card {
  background: var(--paper-2);
  border: 1.5px solid #DBD9E6;
  border-radius: 18px;
  box-shadow: var(--hard-sm);
  transition: transform .12s cubic-bezier(.3, 1.3, .5, 1), box-shadow .12s ease;
}
.sms-card:hover { transform: translate(-2px, -2px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.sms-title { font-family: var(--f-disp); font-weight: 900; color: var(--ink); }
.sms-tip, .sms-name { color: var(--ink-soft); font-weight: 600; }
.sms-ico {
  background: #fff;
  border: 1.5px solid #DBD9E6;
  border-radius: 13px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}

/* ---------- 通用：标题、按钮、卡片 ---------- */
.page-title {
  font-family: var(--f-disp);
  font-weight: 900;
  letter-spacing: .04em;
  color: var(--ink);
}
.page-subtitle { color: var(--ink-soft); font-weight: 600; }
.kaiti { font-family: var(--f-disp); }

.btn-3d, .mode-btn, .sys-btn, .w-tab-btn, .nav-circle-btn, .btn-back {
  border: 1.5px solid #DBD9E6;
  border-radius: 14px;
  box-shadow: var(--hard-sm);
  font-weight: 800;
  transition: transform .1s ease, box-shadow .1s ease;
}
.btn-3d:active, .mode-btn:active, .sys-btn:active, .w-tab-btn:active,
.nav-circle-btn:active, .btn-back:active {
  transform: translate(3px, 3px);
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}

.grade-card, .lesson-card, .simple-card, .write-words-card, .match-board-card,
.char-anatomy-card, .blur-hint-card, .stroke-breakdown-card, .memory-banner,
.modal-box {
  border: 1.5px solid #DBD9E6;
  border-radius: 18px;
  box-shadow: var(--hard-sm);
}
.grade-name, .lesson-title, .modal-box h2, .modal-box h3 {
  font-family: var(--f-disp);
  font-weight: 900;
}
.modal-mask { background: rgba(30, 27, 58, .45); }

/* ---------- 手机底部导航 ---------- */
.mobile-bottom-nav {
  background: var(--paper-2);
  border-top: var(--bd);
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.m-nav-btn { color: var(--ink-soft); font-weight: 800; }
.m-nav-btn.active {
  color: var(--ink);
  background: var(--sun);
  border: 1.5px solid #DBD9E6;
  border-radius: 12px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}

/* ---------- 手机端压缩 ---------- */
@media (max-width: 760px) {
  .global-topbar { padding: 8px 10px; border-radius: 14px; margin-bottom: 12px; gap: 6px; }
  .crumb-tag { font-size: 11px; padding: 4px 8px; }
  .reward-pill { padding: 4px 9px; font-size: 11px; }
  .reward-pill b { font-size: 12px; }
  .hero-banner { border-radius: 18px; }
  .entry-card:nth-child(n) { transform: none; }
}

/* ---------- 文字颜色补强（基础样式里有大量白色文字） ---------- */
.side-nav-item, .side-nav-item .side-nav-name, .side-nav-item .side-nav-desc,
.sidebar-title, .sidebar-growth, .sidebar-growth *,
.side-nav-icon { color: var(--ink); }
.side-nav-item.active, .side-nav-item.active .side-nav-name { color: var(--ink); }
.side-nav-item.active .side-nav-desc { color: rgba(30, 27, 58, .72); }
.side-nav-desc { font-weight: 700; }
.side-nav-item:hover .side-nav-desc { color: rgba(30, 27, 58, .72); }
.side-nav-icon { font-size: 19px; }

/* 侧栏成长卡：纸卡 + 墨线，字色统一 */
.sidebar-growth {
  background: #FFFDF6;
  color: var(--ink);
}
.sidebar-growth .sg-foot { color: var(--ink-soft); }

/* 主视觉继续按钮：墨底奶油字，内部元素一起继承 */
.hero-continue-btn, .hero-continue-btn * {
  color: #FFF6E4;
}
.hero-continue-btn { font-weight: 900; }

/* 奖励胶囊：保留语义色，但统一贴纸边框 */
.reward-pill.star { background: #FFF3D0; color: var(--ink); border-color: var(--line-hover); }
.reward-pill.gem  { background: #E3EFFF; color: var(--ink); border-color: var(--line-hover); }
.reward-pill.flw  { background: #FFE6E2; color: var(--ink); border-color: var(--line-hover); }
.reward-pill, .reward-pill b { font-weight: 900; }

/* 入口卡右上角标签：贴纸化 */
.entry-tag {
  background: var(--coral);
  color: #fff;
  border: 1.5px solid #DBD9E6;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  letter-spacing: .04em;
}
.entry-tag.writing { background: var(--coral); }
.entry-tag.reading { background: var(--mint); }
.entry-tag.errorbook { background: var(--grape); }

/* 图标容器统一白底墨框 */
.side-nav-icon, .entry-icon-box, .sms-ico {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #DBD9E6;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.side-nav-item.active .side-nav-icon {
  background: #fff;
  color: var(--ink);
  border: 1.5px solid #DBD9E6;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.entry-icon-box { font-size: 32px; }


/* ============================================================
 * 布局改版（2026-10-29）：保留手绘观感，去掉点阵与网格，突出“先开始”
 * ============================================================ */

/* --- 去掉点阵，只留柔和的暖色光晕 --- */
body {
  background-image:
    radial-gradient(1100px 460px at 104% -8%, rgba(83, 88, 172, .16) 0%, rgba(83, 88, 172, 0) 62%),
    radial-gradient(900px 420px at -10% 104%, rgba(255, 224, 51, .16) 0%, rgba(255, 224, 51, 0) 60%) !important;
  background-size: auto, auto !important;
}
.huer-sidebar {
  background-image:
    radial-gradient(420px 300px at 16% -2%, rgba(83, 88, 172, .12) 0%, rgba(255, 201, 60, 0) 70%) !important;
  background-size: auto !important;
}

/* ---------- 首页 ---------- */
/* ---------- 首页 · 今日看板（横向三列） ---------- */
.home-today {
  background: #fff;
  border: 1.5px solid #DBD9E6; border-radius: 20px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  padding: 16px 18px 18px;
}
.ht-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ht-title {
  font-family: var(--f-disp); font-size: 19px; font-weight: 900;
  letter-spacing: .05em; color: var(--ink);
}
.ht-prog {
  font-family: var(--f-disp); font-size: 14px; font-weight: 900; color: var(--ink);
  background: var(--sun); border: 1.5px solid #DBD9E6; border-radius: 99px;
  padding: 1px 12px; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.ht-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* .ht-card 复用 .st-item 基础类，这里整体改写为贴纸卡 */
.ht-card {
  position: relative;
  display: flex; align-items: center; justify-content: flex-start; gap: 10px;
  padding: 11px 12px;
  background: var(--paper); border: 1.5px solid #DBD9E6; border-radius: 16px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-size: 13px; font-weight: 400; color: var(--ink); text-align: left;
}
.ht-card:nth-child(1) { transform: rotate(-.7deg); }
.ht-card:nth-child(2) { transform: rotate(.5deg); }
.ht-card:nth-child(3) { transform: rotate(-.4deg); }
.ht-ico {
  flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px;
  display: grid; place-items: center; font-size: 20px;
  background: #fff; border: 1.5px solid #DBD9E6; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.ht-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ht-name { font-family: var(--f-disp); font-size: 15px; font-weight: 900; color: var(--ink); line-height: 1.25; }
.ht-st { font-size: 12px; font-weight: 800; color: var(--ink-soft); }
/* 完成态：姜黄浅底 + 左上角打勾角标（覆盖 .st-item.done 的绿色字） */
.ht-card.done { background: #FFF6C9; color: var(--ink); }
.ht-card.done .ht-st { color: #6B5A00; }
.ht-card.done::after {
  content: "✓"; position: absolute; top: -9px; left: -9px;
  width: 24px; height: 24px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--mint); color: #fff; border: 1.5px solid #DBD9E6;
  font-size: 13px; font-weight: 900; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}

/* 继续练习：进度徽章 */
.hs-badge {
  display: inline-flex; align-items: center; margin-top: 7px;
  padding: 1px 10px;
  font-family: var(--f-body); font-size: 11.5px; font-weight: 800; color: var(--ink);
  background: var(--sun); border: 1.5px solid #DBD9E6; border-radius: 99px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.hs-badge[hidden] { display: none; }

.home-start {
  display: flex; align-items: center; gap: 16px; width: 100%;
  margin-top: 18px;
  padding: 20px 22px; cursor: pointer; text-align: left;
  background: linear-gradient(135deg, #5358AC 0%, #686ED2 100%); color: #fff;
  border: 1.5px solid #DBD9E6; border-radius: 20px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-start:hover { transform: translate(-2px, -2px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.home-start:active { transform: translate(3px, 3px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.hs-icon {
  width: 50px; height: 50px; border-radius: 14px; flex: 0 0 auto;
  display: grid; place-items: center; font-size: 20px;
  background: var(--sun); color: var(--ink); border: 1.5px solid #DBD9E6; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.hs-body { flex: 1; min-width: 0; }
.hs-main {
  display: block; font-family: var(--f-disp); font-size: 26px; font-weight: 900;
  letter-spacing: .04em; line-height: 1.2;
}
.hs-sub { display: block; margin-top: 4px; font-size: 13px; font-weight: 600; color: rgba(255, 255, 255, .9); }
.hs-go { font-size: 24px; font-weight: 900; }

.home-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 18px; }
.home-entry {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  padding: 18px 18px 16px; cursor: pointer; text-align: left;
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 20px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  transition: transform .12s ease, box-shadow .12s ease;
}
.home-entry:nth-child(1) { transform: rotate(-.7deg); }
.home-entry:nth-child(2) { transform: rotate(.6deg); }
.home-entry:hover { transform: translate(-2px, -2px) rotate(0); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.he-icon {
  width: 46px; height: 46px; border-radius: 13px;
  display: grid; place-items: center;
  font-family: var(--f-disp); font-size: 26px; font-weight: 900;
  color: var(--ink); border: 1.5px solid #DBD9E6;
  background: var(--sun);
}
.home-entry:nth-child(2) .he-icon { background: #BFE3FF; }
.he-t { font-family: var(--f-disp); font-size: 24px; font-weight: 900; margin-top: 6px; letter-spacing: .04em; }
.he-d { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }

/* ---------- 首页 · 全部练习（常驻宫格） ---------- */
.home-quick {
  margin-top: 20px;
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 20px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  padding: 16px 18px 18px;
}
.hq-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.hq-title { font-family: var(--f-disp); font-size: 19px; font-weight: 900; letter-spacing: .05em; color: var(--ink); }
.hq-sub { font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.hq-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hq-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-height: 94px; padding: 12px 14px; cursor: pointer; text-align: left;
  background: var(--paper-2); border: 1.5px solid #DBD9E6; border-radius: 16px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-family: var(--f-body); color: var(--ink);
  transition: transform .12s ease, box-shadow .12s ease;
}
.hq-item:nth-child(3n+1) { transform: rotate(-.6deg); }
.hq-item:nth-child(3n+2) { transform: rotate(.4deg); }
.hq-item:nth-child(3n)   { transform: rotate(-.3deg); }
.hq-item:hover { transform: translate(-2px, -2px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.hq-item:active { transform: translate(2px, 2px); box-shadow: none; }
.hq-item-accent { background: var(--sun); }
.hq-ico { font-size: 20px; line-height: 1.15; }
.hq-name { font-family: var(--f-disp); font-size: 17px; font-weight: 900; letter-spacing: .04em; color: var(--ink); }
.hq-desc { font-size: 11.5px; font-weight: 700; color: var(--ink-soft); line-height: 1.45; overflow-wrap: anywhere; }
.hq-item-accent .hq-desc { color: rgba(30, 27, 58, .72); }

/* 顶栏积分入口（替换原来的四个胶囊） */
.reward-enter {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 6px 14px; border-radius: 99px;
  background: #fff; border: 1.5px solid #DBD9E6;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-family: var(--f-disp); font-size: 15px; font-weight: 900; color: var(--ink);
}
.reward-enter:hover { background: var(--sun); }
.reward-enter .re-frag { color: var(--ink); }

/* ---------- 奖励与成长 ---------- */
.rewards-wrap { max-width: 860px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.rewards-head h2 { margin: 0; font-family: var(--f-disp); font-size: 26px; font-weight: 900; letter-spacing: .04em; }
.rewards-head p { margin: 4px 0 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.frag-card, .rules {
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 18px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  padding: 18px 20px;
}
.frag-top { display: flex; align-items: baseline; gap: 10px; }
.frag-num { font-family: var(--f-disp); font-size: 40px; font-weight: 900; color: var(--coral); line-height: 1; }
.frag-lab { font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.frag-next { margin-top: 12px; font-size: 13px; font-weight: 700; color: var(--ink); }
.frag-bar { margin-top: 8px; height: 12px; border-radius: 99px; background: var(--paper); border: 1.5px solid #DBD9E6; overflow: hidden; }
.frag-bar > i { display: block; height: 100%; background: var(--sun); border-radius: 99px; }
.reward-list, .badge-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.reward-item, .badge-item {
  display: flex; align-items: center; gap: 10px;
  border: 1.5px solid #DBD9E6; border-radius: 13px; padding: 12px 14px;
  background: #fff; font-size: 14px; font-weight: 700;
}
.reward-item.locked, .badge-item.locked { background: var(--paper); color: var(--ink-soft); }
.reward-item.unlocked { background: #FFF3D0; }
.reward-item .ri-ico { font-size: 18px; }
.reward-item .ri-t { flex: 1; }
.reward-item .ri-n { font-size: 12px; color: var(--ink-soft); }
.badge-item { flex-direction: column; text-align: center; gap: 4px; }
.badge-item .bi-ico { font-size: 26px; }
.badge-item .bi-t { font-family: var(--f-disp); font-weight: 900; font-size: 15px; }
.badge-item .bi-d { font-size: 12px; font-weight: 600; color: var(--ink-soft); line-height: 1.55; }
.badge-item.locked .bi-ico { filter: grayscale(1); opacity: .45; }
.rules h3 { margin: 0 0 6px; font-family: var(--f-disp); font-size: 16px; font-weight: 900; }
.rules ul { margin: 0; padding-left: 18px; font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.95; }
.rules .todo { margin-top: 8px; font-size: 12px; color: var(--ink-soft); }

/* ---------- 写字 / 默写：一屏一件事 ---------- */
.write-task {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 16px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  padding: 12px 16px; margin-bottom: 14px;
}
.write-task-t { font-family: var(--f-disp); font-size: 20px; font-weight: 900; letter-spacing: .03em; }
.write-task-d { font-size: 13px; font-weight: 600; color: var(--ink-soft); margin-top: 2px; }
.write-hints { display: none; gap: 14px; margin-bottom: 16px; grid-template-columns: repeat(3, 1fr); align-items: start; }
.write-hints.open { display: grid; }
.write-hints .sidebar-title { font-size: 12px; }
.write-hints .char-anatomy-card,
.write-hints .write-words-card,
.write-hints .stroke-breakdown-card { margin: 0; }
.write-meaning {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed rgba(30, 27, 58, .18);
  font-size: 13px; font-weight: 600; line-height: 1.6; color: var(--ink);
}
.write-poly {
  margin-top: 4px; font-size: 12px; font-weight: 700; line-height: 1.45;
  color: var(--ink-soft);
}
.write-poly[hidden] { display: none !important; }

.write-studio { display: block; }
.write-stage {
  width: min(64vh, 600px); max-width: 100%; margin: 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
}
.write-stage .mizige-box {
  width: 100%; height: auto; aspect-ratio: 1 / 1; position: relative;
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 18px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.write-stage .mizige-box svg line { stroke: #F0EADC !important; stroke-width: 4 !important; }
.write-bottom-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 4px; }
.write-bottom-actions .btn-write-act {
  min-width: 110px; padding: 12px 20px; font-size: 16px;
  font-family: var(--f-disp); font-weight: 900;
  border: 1.5px solid #DBD9E6; border-radius: 14px;
  background: #fff; color: var(--ink);
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.write-bottom-actions .btn-write-act:active { transform: translate(3px, 3px); box-shadow: none; }
.write-bottom-actions .btn-write-act.primary { background: var(--coral); color: #fff; }
.write-check-msg { margin-top: 6px; font-size: 13px; font-weight: 700; color: var(--ink-soft); text-align: center; min-height: 20px; }
.free-write-layout { display: none; }

/* ---------- 气泡拼字：分组平面卡片 ---------- */
.bubble-groups { display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 4px 0 0; }
.bubble-group {
  border: 1.5px solid #DBD9E6; border-radius: 18px; padding: 10px 14px 14px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.bubble-group[data-group="radical"] { background: #E9F2FF; }
.bubble-group[data-group="whole"] { background: #FDF4DE; }
.bg-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-family: var(--f-disp); font-size: 16px; font-weight: 900; letter-spacing: .06em; color: var(--ink);
}
.bg-head::before {
  content: ""; width: 10px; height: 10px; border-radius: 3px;
  background: var(--ink); opacity: .55;
}
.bg-body { display: flex; flex-wrap: wrap; gap: 14px; min-height: 100px; align-items: flex-start; }
.part-bubble {
  width: 96px; height: 96px; border-radius: 16px; cursor: grab;
  display: grid; place-items: center; position: relative;
  background: #fff; border: 1.5px solid #DBD9E6;
  color: var(--ink); font-family: var(--f-disp); font-size: 42px; font-weight: 900;
  box-shadow: none; user-select: none; touch-action: none;
}
.bubble-group[data-group="radical"] .part-bubble { background: #F7FAFF; }
.bubble-group[data-group="whole"] .part-bubble { background: #FFFBF0; }
.part-bubble::before, .part-bubble::after { display: none !important; }
.part-bubble:hover { transform: none; filter: none; box-shadow: none; border-color: var(--line-hover); background: #FFF3D0; }
.part-bubble.selected { outline: 3px solid var(--coral); transform: none; }
.part-bubble.drop-target { outline: 3px solid var(--green); background: #E7F7EC; }
.part-bubble.hint-glow { outline: 3px solid var(--green); box-shadow: none; }
.part-bubble.speaking { background: #FFF3D0; }
.part-bubble .pb-say { position: absolute; right: 5px; bottom: 3px; font-size: 11px; opacity: .5; }
.bubble-arena-card { padding: 16px 18px; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.bubble-footer-hint { margin-top: 12px; font-size: 12px; font-weight: 600; color: var(--ink-soft); text-align: center; }

/* 手机：首页两块并排改上下 */
@media (max-width: 760px) {
  .home-two { grid-template-columns: 1fr; gap: 12px; }
  .home-start { padding: 16px; gap: 12px; border-radius: 16px; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
  .hs-main { font-size: 21px; }
  .hs-icon { width: 42px; height: 42px; }
  .home-entry { padding: 14px; }
  .he-t { font-size: 20px; }
  .home-entry:nth-child(n) { transform: none; }
  .write-hints.open { grid-template-columns: 1fr; }
  .write-stage { width: 100%; }
  .write-bottom-actions .btn-write-act { min-width: 92px; padding: 10px 12px; font-size: 15px; }
  .part-bubble { width: 78px; height: 78px; font-size: 34px; }
  .frag-num { font-size: 32px; }
}

.part-bubble .pb-say { font-size: 12px; opacity: .62; }

/* 写字面板：单列，从上到下 */
/* 面板可能被 JS 设成 flex，这里只改方向，让任务行在上、书写区在下 */
#write-smart-panel, #write-free-panel {
  max-width: 100%;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 14px !important;
}
#write-smart-panel .write-task, #write-free-panel .write-task,
#write-smart-panel .write-hints, #write-free-panel .write-hints { width: 100%; box-sizing: border-box; }
#write-smart-panel .write-task, #write-free-panel .write-task { width: 100%; box-sizing: border-box; }
.write-stage { width: min(52vh, 480px) !important; }
.write-stage .mizige-box { box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }

@media (max-width: 760px) {
  .write-stage { width: 100% !important; }
}

/* 默写纸：只留极淡的中心十字，给书写定位 */
#write-free-panel .mizige-box {
  background-image:
    linear-gradient(to right, #F1EBDE 0 1px, transparent 1px),
    linear-gradient(to bottom, #F1EBDE 0 1px, transparent 1px);
  background-size: 50% 100%, 100% 50%;
  background-position: 50% 0, 0 50%;
  background-repeat: no-repeat;
}

@media (max-width: 760px) {
  .home-entry { min-height: 0; padding: 14px 16px 16px; }
  .he-icon { width: 38px; height: 38px; font-size: 21px; }
  .he-t { font-size: 19px; margin-top: 2px; }
  .he-d { font-size: 12.5px; }
}

.bubble-groups { align-items: stretch !important; }
.bubble-group { width: 100%; box-sizing: border-box; }
.bubble-group[hidden] { display: none !important; }

/* 拆字卡片左右翻页：圆形、贴边、不压题干 */
.simple-card { position: relative; padding-left: 64px; padding-right: 64px; }
.nav-circle-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50% !important;
  border: 1.5px solid #DBD9E6 !important; background: #fff !important;
  color: var(--ink) !important; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-size: 18px; font-weight: 900; line-height: 1;
  display: grid; place-items: center; cursor: pointer; z-index: 3;
}
.nav-circle-btn.prev { left: 8px; right: auto; }
.nav-circle-btn.next { right: 8px; left: auto; background: var(--sun) !important; }
.nav-circle-btn:active { transform: translateY(-50%) scale(.94) !important; }

@media (max-width: 760px) {
  .simple-card { padding: 20px 14px 70px !important; }
  .nav-circle-btn {
    top: auto; bottom: 12px; transform: none !important;
    width: 42px; height: 42px;
  }
  .nav-circle-btn.prev { left: calc(50% - 54px); }
  .nav-circle-btn.next { left: calc(50% + 12px); right: auto; }
  .nav-circle-btn:active { transform: scale(.94) !important; }
}

/* 气泡关：整课都是独体字时的友好提示 */
.bubble-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 10px; padding: 48px 20px; text-align: center;
}
.bubble-empty .be-t { font-family: var(--f-disp); font-size: 20px; font-weight: 900; }
.bubble-empty .be-d { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.bubble-empty .btn-back { margin-top: 6px; }

/* 独体字：整字卡 */
.solo-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 6px 10px;
}
.solo-py { font-size: 18px; font-weight: 700; color: var(--coral); letter-spacing: .06em; }
.solo-hz {
  font-family: var(--f-disp); font-size: 96px; line-height: 1.15; font-weight: 900;
  cursor: pointer;
}
.solo-words { font-size: 14px; font-weight: 600; color: var(--ink-soft); letter-spacing: .04em; }
.solo-say { margin-top: 6px; }

/* ============ 第三轮细节：统一颜色与尺寸 ============ */

/* 课次卡：1 主 + 3 次。主玩法通栏姜黄填充，次级白底细描边三连排 */
.mode-btns-grid { display: flex; flex-direction: column; gap: 8px; }
.mode-subs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mode-btn {
  background: #fff !important;
  color: var(--ink) !important;
  border: 1.5px solid #DBD9E6 !important;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-family: var(--f-disp);
  font-size: 14px !important;
  font-weight: 900 !important;
  padding: 10px 8px !important;
}
.mode-btn:hover { transform: translate(-1px, -1px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.mode-btn:active { transform: translate(2px, 2px); box-shadow: none; }
.mode-btn:disabled { opacity: .42; cursor: not-allowed; filter: grayscale(.45); transform: none !important; box-shadow: none !important; }
.mode-btn.m-simple { background: var(--coral) !important; color: #fff !important; }

/* 主按钮：通栏、姜黄底 + 深墨紫字（.mode-btn.mode-btn-main 压过 .m-simple 的填充） */
.mode-btn.mode-btn-main {
  width: 100%;
  background: var(--sun) !important;
  color: var(--ink) !important;
  border: 1.5px solid #DBD9E6 !important;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-size: 15px !important;
  padding: 11px 12px !important;
  letter-spacing: .03em;
}
/* 次级按钮：三个等宽横排，字号略小 */
.mode-btn.mode-btn-sub {
  font-size: 12.5px !important;
  padding: 8px 6px !important;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  white-space: nowrap;
}

/* 课次卡：字块与信息更紧凑 */
.lesson-card { padding: 16px 16px 14px !important; }
.lesson-title { font-size: 17px !important; margin-bottom: 8px !important; }
.lesson-badge { background: var(--paper) !important; color: var(--ink) !important; border: 1.5px solid #DBD9E6; }
.lesson-total-txt { color: var(--ink-soft) !important; }

/* 年级卡：等高、悬停统一 */
.grades-grid { align-items: stretch; }
.grade-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 118px; padding: 16px 12px !important;
  background: #fff !important; border-width: 2.5px !important;
}
.grade-card.preschool { background: #FFFDF4 !important; }
.grade-icon { font-size: 30px !important; margin-bottom: 6px !important; }
.grade-name { font-size: 17px !important; font-family: var(--f-disp); font-weight: 900 !important; }
.grade-meta { font-size: 11.5px !important; color: var(--ink-soft) !important; text-align: center; }

/* 拼音消消乐：去掉满屏色块，改成浅色卡 */
.match-tile {
  background: #fff !important;
  color: var(--ink) !important;
  border: 1.5px solid #DBD9E6 !important;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  font-family: var(--f-disp);
  font-weight: 900 !important;
}
.match-tile.hz-tile { background: #FFF7E4 !important; font-size: 26px !important; }
.match-tile.py-tile { background: #fff !important; font-family: var(--f-body); font-size: 18px !important; }
.match-tile.selected { background: var(--sun) !important; }
.match-tile.matched { background: #E7F7EC !important; color: var(--ok) !important; opacity: .75; }

/* 独体字卡片：不要固定 390 高 */
.simple-card.solo-mode { min-height: 300px !important; }

/* 结算页碎片提示 */
.mg-done-frag {
  margin-top: 6px; display: inline-block;
  padding: 5px 14px; border-radius: 999px;
  background: #FFF3D0; border: 1.5px solid #DBD9E6;
  font-size: 13px; font-weight: 800; color: var(--ink);
}

/* 复习本空态 */
.err-empty {
  grid-column: 1 / -1;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  min-height: 120px;
  padding: 44px 20px; text-align: center;
  font-size: 14px; font-weight: 700; line-height: 1.7; color: var(--ink-soft);
  background: #fff; border: 2.5px dashed var(--line); border-radius: 18px;
}
.err-empty .ee-t { font-family: var(--f-disp); font-size: 20px; font-weight: 900; }
.err-empty .ee-d { font-size: 13px; font-weight: 600; color: var(--ink-soft); max-width: 420px; line-height: 1.7; }

/* 顶部信息条：手机端可换行、不挤压 */
.top-nav { flex-wrap: wrap; }
@media (max-width: 760px) {
  .top-nav { gap: 8px; }
  .status-pills { gap: 6px; }
  .stat-pill { padding: 5px 10px; font-size: 12px; }
  .btn-back.blue-pill { padding: 6px 10px; font-size: 13px; }
}

/* 补齐：按钮等宽、消消乐去掉紫色光晕、隐藏计时 */
.mode-btn { width: 100%; }
.match-tile { box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.match-tile.matched { box-shadow: none !important; }
#match-timer { display: none !important; }
.err-cards-grid { align-items: start; }

/* ============ 沪儿睿品牌紫手绘贴纸精修 + 写字一屏自适应 (Subagent 2 & 3) ============ */
.home-entry:nth-child(1) .he-icon { background: #ECEEFF; color: #5358AC; }
.home-entry:nth-child(2) .he-icon { background: var(--sun); color: var(--ink); }

.bubble-group[data-group="radical"] { background: #EEF0FF; }
.bubble-group[data-group="whole"] { background: #FFFBEB; }
.bubble-group[data-group="radical"] .part-bubble { background: #F8F9FF; }
.bubble-group[data-group="whole"] .part-bubble { background: #FFFDF5; }
.part-bubble:hover { background: var(--sun) !important; transform: translate(-2px, -2px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.part-bubble.selected { outline: 3.5px solid #5358AC; background: #ECEEFF !important; }
.part-bubble .pb-say {
  font-size: 11px; font-weight: 800; color: #5358AC; opacity: .92;
  background: rgba(255, 255, 255, .88); padding: 1px 5px; border-radius: 6px;
}

.grade-card.preschool { background: #F5F6FF !important; }
.match-tile.hz-tile { background: #F4F5FF !important; font-size: 26px !important; }
.match-tile.selected { background: var(--sun) !important; transform: translate(-2px, -2px); }
.match-tile.matched { background: #E7F7EC !important; color: var(--mint) !important; opacity: .8; transform: none !important; }

.rewards-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}

/* 写字模式：紧凑顶栏与任务条，确保 1280×860 视口一屏完整露出米字格与底部三大按钮 */
#view-mode-write .write-header-bar {
  padding: 8px 14px !important;
  margin-bottom: 8px !important;
  border: 1.5px solid #DBD9E6 !important;
  border-radius: 16px !important;
  box-shadow: var(--hard-sm) !important;
  background: #fff !important;
}
#view-mode-write .write-py-center {
  flex-direction: row !important;
  align-items: center !important;
  gap: 10px !important;
}
#view-mode-write .write-py-text {
  font-size: 28px !important;
  line-height: 1 !important;
  color: #5358AC !important;
}
#write-smart-panel, #write-free-panel {
  gap: 8px !important;
}
#view-mode-write .write-task {
  padding: 8px 14px !important;
  margin-bottom: 2px !important;
}
#view-mode-write .write-task > div:first-child {
  display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap;
}
#view-mode-write .write-task-t { font-size: 18px !important; }
#view-mode-write .write-task-d { margin-top: 0 !important; }
#view-mode-write .write-stage {
  width: min(44vh, 390px) !important;
  gap: 8px !important;
}
/* 大号字体只放大上限，不得绕过横屏/底栏钳制。具体下限在下方媒体查询里统一给出。 */
body.large-font-mode #view-mode-write .write-stage {
  width: min(52vh, 450px, max(150px, calc(100vh - 360px))) !important;
}
body.large-font-mode .part-bubble {
  width: 112px !important; height: 112px !important; font-size: 48px !important;
}
#view-mode-write .write-bottom-actions { margin-top: 2px !important; }
#view-mode-write .write-bottom-actions .btn-write-act {
  padding: 9px 20px !important;
  font-size: 16px !important;
}

/* ===== 品牌色统一收口（复审补丁）：清除残留靛蓝 / 橙 / 红，统一沪儿睿品牌紫 #5358AC ===== */
:root {
  --huer-indigo: #5358AC;
  --huer-purple: #6A6FC4;
}
.btn-back.blue-pill,
.err-review-today-btn,
#btn-err-review-today {
  background: linear-gradient(180deg, #6A6FC4 0%, #5358AC 100%) !important;
  color: #fff !important;
  border: 3px solid #1E1B3A !important;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.stat-pill.score-pill {
  background: linear-gradient(135deg, #6A6FC4, #5358AC) !important;
  color: #fff !important;
  border-color: #1E1B3A !important;
}
.wave-tab-pill.active,
.sys-btn.active,
.w-tab-btn.active-trace,
.w-tab-btn.active-free,
.err-f-tab.active {
  background: #5358AC !important;
  border-color: #1E1B3A !important;
  color: #fff !important;
}
.struct-tag-pill { color: #363A7E !important; background: #ECEBFA !important; border-color: #C9CBEE !important; }
.eq-question-box {
  background: linear-gradient(135deg, #6A6FC4 0%, #5358AC 100%) !important;
  border-color: #1E1B3A !important;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
}
.btn-demo-orange {
  background: linear-gradient(180deg, #FFE033 0%, #F5C400 100%) !important;
  color: #1E1B3A !important;
  border: 3px solid #1E1B3A !important;
  box-shadow: 0 4px 0 #B8960A !important;
}
.crumb-tag { color: #363A7E !important; }
#view-errorbook .err-card, #view-errorbook .err-char-card { border-color: #C9CBEE !important; }
#view-errorbook .hz.kaiti { color: #363A7E !important; }
.err-badge-due, #view-errorbook .err-stage-pill { background: #ECEBFA !important; color: #363A7E !important; }

/* 复习本：卡片/状态胶囊/警示条去红去橙，改品牌紫 + 星光金 */
.err-char-card { border: 2.5px solid #1E1B3A !important; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); background: #fff !important; }
.err-char-card.selected-err { border-color: #5358AC !important; background: #ECEBFA !important; }
.err-char-card .hz { color: #363A7E !important; }
.err-char-card .st-pill, .err-char-card .st-pill.due { background: #FFF3B0 !important; color: #5A4A00 !important; border: 1.5px solid #E0C21A !important; }
.err-warn-banner { background: #FFF8D6 !important; border: 2.5px solid #1E1B3A !important; color: #3F3A66 !important; }

/* ============================================================
 * R3 · 模式一整字认读卡 / 先猜一猜 / 书写区放大
 * 只调信息布局与尺寸，品牌紫、手绘贴纸、硬投影、卡片姿态全部保留
 * ============================================================ */

/* 认读卡：拼音 · 整字 · 笔画数 + 顺次笔画名 · 字义 · 组词 · 听读 */
.simple-card .solo-card {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 4px 8px 2px; width: 100%; max-width: 520px; margin: 0 auto;
}
.simple-card .solo-py { font-size: 20px; font-weight: 800; color: var(--huer-indigo); letter-spacing: .08em; margin-bottom: -6px; }
.simple-card .solo-hz { font-size: 92px; line-height: 1.08; }
.solo-meta { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.solo-chip {
  font-size: 12.5px; font-weight: 800; color: #363A7E;
  background: #ECEBFA; border: 1.5px solid #C9CBEE; border-radius: 999px; padding: 2px 10px;
}
.solo-strokes { font-size: 13px; font-weight: 700; color: var(--ink-soft); letter-spacing: .05em; }
.solo-meaning {
  font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.5;
  max-width: 30em; text-align: center;
}
.solo-poly {
  font-size: 12px; font-weight: 700; color: var(--ink-soft);
  background: rgba(255, 255, 255, .7); border-radius: 99px; padding: 3px 10px;
}
.solo-actions { display: flex; width: 100%; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }
.solo-actions .btn-back {
  flex: 0 0 auto; min-width: 124px; margin: 0; padding: 8px 14px;
  white-space: nowrap; word-break: keep-all;
}
#simple-eq-row.is-solo { width: 100%; margin: 4px 0 10px; }

/* 先猜一猜：3 选 1 */
.simple-quiz-row { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 0 0 4px; }
.quiz-label { font-size: 13px; font-weight: 800; color: var(--ink-soft); letter-spacing: .03em; }
.quiz-btns { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.quiz-btn {
  min-width: 78px; height: 62px; padding: 0 16px;
  font-family: var(--f-disp); font-size: 34px; font-weight: 900; color: var(--ink);
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 16px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  cursor: pointer; transition: transform .12s, background .12s;
}
.quiz-btn:hover:not(:disabled) { transform: translateY(-2px); }
.quiz-btn:disabled { cursor: default; opacity: .5; }
.quiz-btn.ok { background: #E7F7EC; border-color: var(--green); color: #15803D; opacity: 1; }
.quiz-btn.bad { background: var(--red-light); border-color: var(--red); color: var(--red); text-decoration: line-through; }

/* 上一题按钮与首卡净距 ≥80px：算式/认读区左右各留 68px 安全内边距 */
@media (min-width: 761px) {
  .simple-card .equation-row { padding-left: 68px; padding-right: 68px; box-sizing: border-box; }
  .simple-card .solo-card { max-width: 520px; }
}

/* 书写区：米字格目标 min(56vh, 480px)，再用 calc(100vh - 360px) 兜底钳制，
 * 保证 1280×800 / 1366×768 不产生纵向滚动条且底部三按钮完整露出。
 * 仅桌面/横屏生效：≤760px 仍走「宽度 100% + 底部留白给移动导航」的老规则 */
@media (min-width: 761px) {
  /* max(150px, …) 下限：横屏手机（844×390）100vh-360 会算成负值，
     米字格被压成 0 宽，孩子没地方写字。 */
  #view-mode-write .write-stage { width: min(56vh, 480px, max(150px, calc(100vh - 360px))) !important; }
  body.large-font-mode #view-mode-write .write-stage {
    width: min(52vh, 450px, max(150px, calc(100vh - 360px))) !important;
  }
  #view-mode-write .write-header-bar { margin-bottom: 4px; }
  #view-mode-write .wave-switcher-bar { margin-bottom: 6px; }
  #view-mode-write .write-task { margin-bottom: 0 !important; }
}
/* 761–1023 仍显示底栏（.huer-main padding-bottom: 104px），钳制必须把底栏和安全区算进去 */
@media (min-width: 761px) and (max-width: 1023px) {
  #view-mode-write .write-stage {
    width: min(56vh, 480px, max(150px, calc(100vh - 360px - 104px - env(safe-area-inset-bottom, 0px)))) !important;
  }
  body.large-font-mode #view-mode-write .write-stage {
    width: min(52vh, 450px, max(150px, calc(100vh - 360px - 104px - env(safe-area-inset-bottom, 0px)))) !important;
  }
}
/* 底部导航在 ≤1023 一直存在，只有桌面才把底部留白清零 */
@media (min-width: 1024px) {
  body[data-view="view-mode-write"] .huer-main { padding-bottom: 0; }
}
/* 1024 档顶部状态条会换行，额外多占约 41px；单独收紧，避免挤掉底部按钮 */
@media (min-width: 1024px) and (max-width: 1100px) {
  #view-mode-write .write-stage { width: min(56vh, 480px, max(150px, calc(100vh - 410px))) !important; }
  body.large-font-mode #view-mode-write .write-stage {
    width: min(52vh, 450px, max(150px, calc(100vh - 410px))) !important;
  }
}
#view-mode-write .write-bottom-actions { margin-top: 0 !important; }
#view-mode-write .write-check-msg { min-height: 16px; }
/* 提示条：原来没有样式，作为普通块会撑高页面（1280×800 多出 21px 滚动），
 * 改成固定定位的手绘贴纸气泡，既不再影响滚动，也真的看得见 */
#toast-tip {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 10px);
  max-width: min(92vw, 560px); padding: 10px 18px; border-radius: 14px;
  background: #fff; border: 1.5px solid #DBD9E6; color: var(--ink);
  font-size: 14px; font-weight: 800; line-height: 1.45; text-align: center;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  opacity: 0; pointer-events: none; transition: opacity .18s ease, transform .18s ease; z-index: 60;
}
#toast-tip.show { opacity: 1; transform: translate(-50%, 0); }
@media (max-width: 1023px) {
  #toast-tip { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); }
}

/* =========================================================================
   R5：顶栏声音控件（紧凑双按钮）—— 390 宽窄屏不挤压「碎片 · Lv.」
   ========================================================================= */
.topbar-left { min-width: 0; flex: 1 1 auto; }
.crumb-tag { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.voice-ctl {
  display: inline-flex; align-items: center; gap: 6px;
  flex: 0 0 auto; order: 0;
}
.voice-btn {
  display: inline-grid; place-items: center;
  min-width: 34px; height: 32px; padding: 0 8px;
  border: 1.5px solid #DBD9E6; border-radius: 10px;
  background: #fff; color: var(--ink);
  font-family: var(--f-body); font-size: 13px; font-weight: 900; line-height: 1;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.voice-btn:active { transform: translate(1px, 1px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
.voice-btn.muted { background: #FEF2F2; color: #B91C1C; border-color: #FCA5A5; opacity: 1; }
.voice-btn.voice-rate { min-width: 44px; letter-spacing: .02em; }
.voice-btn.off { opacity: .55; }

@media (max-width: 430px) {
  .global-topbar { gap: 4px; padding: 7px 8px; }
  .crumb-tag { font-size: 10.5px; padding: 3px 7px; max-width: 116px; }
  .voice-ctl { gap: 4px; }
  .voice-btn { min-width: 28px; height: 28px; font-size: 12px; padding: 0 5px; border-radius: 9px; }
  .voice-btn.voice-rate { min-width: 34px; }
  .reward-enter { font-size: 11.5px; padding: 4px 8px; gap: 3px; }
}

/* =========================================================================
   R5：全屏加载层（解压字库两阶段进度 / 失败重试）
   ========================================================================= */
.huer-loading-mask {
  position: fixed; inset: 0; z-index: 999;
  display: grid; place-items: center;
  background: #FFF9EE;
  padding: 20px;
  transition: opacity .28s ease;
}
.huer-loading-mask.hide { opacity: 0; pointer-events: none; }
.hl-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  width: min(88vw, 340px); padding: 26px 26px 24px;
  background: #fff; border: 1.5px solid #DBD9E6; border-radius: 20px;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  text-align: center;
}
.hl-spinner {
  width: 42px; height: 42px; border-radius: 50%;
  border: 5px solid #E2E8F0; border-top-color: var(--coral);
  animation: hl-spin .9s linear infinite;
}
@keyframes hl-spin { to { transform: rotate(360deg); } }
.hl-title { font-family: var(--f-disp); font-size: 19px; font-weight: 900; color: var(--ink); }
.hl-sub { font-size: 13px; font-weight: 600; color: var(--ink-soft); line-height: 1.6; }
.hl-bar {
  width: 100%; height: 10px; border: 1.5px solid #DBD9E6;
  border-radius: 99px; background: var(--paper); overflow: hidden;
}
.hl-bar > i { display: block; height: 100%; width: 8%; background: var(--sun); transition: width .3s ease; }
.hl-retry {
  margin-top: 4px; padding: 9px 20px;
  border: 1.5px solid #DBD9E6; border-radius: 99px;
  background: var(--coral); color: #fff;
  font-family: var(--f-body); font-size: 14px; font-weight: 900;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); cursor: pointer;
}
.hl-retry:active { transform: translate(1px, 1px); box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }

/* =========================================================================
   S7b：首页今日看板 + 全部练习宫格的响应式收口
   ========================================================================= */
@media (max-width: 1000px) {
  .ht-grid { grid-template-columns: 1fr; gap: 10px; }
  .ht-card:nth-child(n) { transform: none; }
  .hq-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hq-item:nth-child(n) { transform: none; }
}
@media (max-width: 700px) {
  .hq-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .home-today, .home-quick { padding: 14px 14px 16px; border-radius: 18px; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26); }
}
@media (max-width: 640px) {
  .ht-title, .hq-title { font-size: 17px; }
  .ht-prog { font-size: 13px; padding: 0 10px; }
  .ht-card { padding: 10px 11px; }
  .ht-ico { width: 36px; height: 36px; font-size: 18px; border-radius: 10px; }
  .ht-name { font-size: 14px; }
  .hq-item { min-height: 84px; padding: 10px 11px; border-radius: 14px; }
  .hq-ico { font-size: 18px; }
  .hq-name { font-size: 15px; }
  .hq-desc { font-size: 11px; }
  .home-today { margin-bottom: 2px; }
}
@media (max-width: 420px) {
  .home-today, .home-quick { padding: 12px 11px 14px; }
  .hq-grid { gap: 8px; }
  .hq-item { min-height: 78px; padding: 9px 9px; }
  .hq-ico { font-size: 16px; }
  .hq-name { font-size: 14px; }
  .hq-desc { font-size: 10.5px; }
  .ht-card { gap: 8px; padding: 9px 10px; }
  .ht-ico { width: 32px; height: 32px; font-size: 16px; }
  .ht-name { font-size: 13.5px; }
}

/* =========================================================================
   S7c：手机首页紧凑化（看板一行三格 + 写字识字并排），桌面宫格加质感
   ========================================================================= */

/* 桌面：宫格卡片抬高，图标与标题加大，避免「一排小卡片」的单薄感 */
@media (min-width: 641px) {
  .hq-item { min-height: 104px; padding: 13px 15px; gap: 3px; }
  .hq-ico { font-size: 22px; }
  .hq-name { font-size: 18px; }
}

/* 手机：今日看板压成一行三格（原来单列 3 张占近半屏） */
@media (max-width: 640px) {
  .ht-grid { grid-template-columns: repeat(3, 1fr); gap: 7px; }
  .ht-card {
    flex-direction: column; align-items: center; justify-content: flex-start;
    text-align: center; gap: 3px; padding: 8px 5px 9px;
    border-radius: 13px; box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  }
  .ht-ico { width: 30px; height: 30px; font-size: 15px; border-radius: 9px; }
  .ht-name { font-size: 11px; line-height: 1.3; }
  .ht-st { font-size: 10px; }
  .ht-card.done::after { width: 19px; height: 19px; font-size: 11px; top: -7px; left: -7px; }
}

/* 手机：写字 / 识字恢复并排，把纵向空间还给「全部练习」 */
@media (max-width: 640px) {
  .home-two { grid-template-columns: 1fr 1fr; gap: 10px; }
  .home-entry {
    padding: 12px 12px 11px; border-radius: 15px;
    box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  }
  .he-icon { width: 36px; height: 36px; font-size: 20px; border-radius: 10px; }
  .he-t { font-size: 18px; margin-top: 4px; }
  .he-d { font-size: 11px; line-height: 1.45; }
}

/* =========================================================================
   品牌 v3 · 新 logo 与线性图标系统
   ========================================================================= */
:root {
  --brand: #6E74B8;        /* 取自 logo 标记主色 */
  --brand-deep: #565CA4;
  --brand-soft: #EDEFFA;
  --brand-star: #F5E129;
}

.huer-sprite {
  position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none;
}

.ico {
  width: 22px; height: 22px; display: block;
  fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.ico-tab { width: 23px; height: 23px; stroke-width: 1.85; }

/* ---------- 侧栏品牌块 ---------- */
.brand-box { padding: 2px 8px 16px; gap: 11px; }
.brand-logo {
  width: 46px; height: 46px; padding: 5px; border-radius: 15px;
  background: #fff; border: 1.5px solid #DBD9E6;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  overflow: visible;
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-title { font-size: 16.5px; line-height: 1.2; }
.brand-sub { font-size: 10.5px; line-height: 1.35; letter-spacing: .01em; }

.side-nav-icon { color: var(--ink); }
.side-nav-item.active .side-nav-icon { color: var(--ink); }
.side-nav-icon .ico { width: 21px; height: 21px; }

/* ---------- 手机 / 平板底部 Tab ---------- */
.m-nav-ico { display: flex; align-items: center; justify-content: center; }

@media (max-width: 1023px) {
  .mobile-bottom-nav {
    left: 10px; right: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    padding: 7px 9px;
    border: 1.5px solid #DBD9E6;
    border-radius: 19px;
    box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
    gap: 3px;
    justify-content: space-between;
    align-items: center; /* 不让子项撑满，选中胶囊四周留出均匀内边距 */
  }
  .m-nav-btn {
    flex: 1 1 0; min-width: 0;
    gap: 2px; padding: 5px 3px 4px;
    border: 2px solid transparent; border-radius: 12px;
    font-size: 11px; line-height: 1.25; letter-spacing: .02em;
    background: transparent;
    transition: color .15s ease, background .15s ease, transform .12s ease;
  }
  .m-nav-btn .ico { width: 23px; height: 23px; }
  .m-nav-btn.active {
    color: #fff;
    background: var(--brand);
    border-color: var(--line-hover);
    box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
    transform: none;
  }
  .m-nav-btn.active .ico { stroke-width: 2; }
  .m-nav-btn.active span:last-child { color: #fff; }
  .huer-main { padding-bottom: 104px; }
}

@media (max-width: 380px) {
  .m-nav-btn { font-size: 10px; padding: 5px 2px 4px; }
  .m-nav-btn .ico { width: 21px; height: 21px; }
}

/* ---------- 顶栏面包屑：品牌标记位 ---------- */
.crumb-tag { gap: 7px; }
.crumb-mark {
  width: 15px; height: 15px; flex: 0 0 15px;
  object-fit: contain; display: block;
}

/* =========================================================================
   响应式 v3 · 手机 / 平板断点统一打磨
   （追加式覆盖，不改原有规则）
   ========================================================================= */

/* ---------- 平板 641–1023：无侧栏，内容撑开，底栏居中不铺满 ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
  .huer-main { padding: 18px 24px 104px; max-width: 900px; }

  /* 今日看板：恢复一行三格（原来 ≤1000 会塌成三行） */
  .ht-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
  .ht-card { padding: 12px; }
  .ht-card:nth-child(n) { transform: none; }
  .ht-name { font-size: 14.5px; }

  /* 全部练习：三列 */
  .hq-grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
  .hq-item:nth-child(n) { transform: none; }

  /* 年级三列、课文两列 */
  .grades-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .lessons-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .sms-grid { grid-template-columns: repeat(3, 1fr); }
  .err-cards-grid { grid-template-columns: repeat(3, 1fr); }

  .mobile-bottom-nav {
    left: 50%; right: auto;
    transform: translateX(-50%);
    width: min(580px, calc(100% - 48px));
  }
  .m-nav-btn { font-size: 11.5px; }

  .home-two { gap: 16px; }
  .home-entry { padding: 16px 18px 15px; }
  .page-title { font-size: 22px; }
  .top-nav { margin-bottom: 14px; }
}

/* ---------- 手机 ≤ 640 ---------- */
@media (max-width: 640px) {
  .huer-main { padding: 12px 13px 102px; }

  /* 页头：返回/操作并排一行，标题独占下一行（原来三者挤在同一行会把标题压断） */
  .top-nav { gap: 8px; margin-bottom: 12px; }
  .page-title-wrap { order: 3; flex: 1 0 100%; text-align: left; }
  .page-title { font-size: 19px; line-height: 1.3; }
  .page-subtitle { font-size: 11.5px; margin-top: 2px; }
  .btn-back { padding: 7px 12px; font-size: 12.5px; }

  .grades-grid { gap: 10px; }
  .grade-card { padding: 13px 13px 12px; border-radius: 15px; }
  .lessons-grid { gap: 12px; }
  .lesson-card { padding: 13px 13px 12px; border-radius: 16px; }

  .global-topbar { padding: 7px 9px; }
  .crumb-tag { font-size: 10.5px; padding: 3px 8px; }
}

/* ---------- 小屏 ≤ 380 ---------- */
@media (max-width: 380px) {
  .huer-main { padding: 10px 10px 98px; }
  .page-title { font-size: 17.5px; }
  .m-nav-btn { font-size: 10px; letter-spacing: 0; }
  .crumb-tag { max-width: 54vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- 宽屏 ≥ 1440 ---------- */
@media (min-width: 1440px) {
  .huer-main { padding: 26px 40px 56px; max-width: 1320px; }
}

/* ---------- 顶栏：窄屏单行放下（只留品牌标记，位置由底栏高亮表达） ---------- */
@media (max-width: 430px) {
  .global-topbar { gap: 7px; flex-wrap: nowrap; }
  .topbar-left { flex: 0 0 auto; }
  .crumb-tag {
    width: 32px; height: 32px; padding: 0;
    justify-content: center; border-radius: 10px;
  }
  .crumb-text { display: none; }
  .crumb-mark { width: 18px; height: 18px; flex: 0 0 18px; }
  .voice-ctl, .reward-bar { flex: 0 0 auto; }
  .voice-btn { padding: 0 8px; }
  .reward-enter { padding: 4px 9px; }
  .global-topbar { padding: 6px 10px; }
}

/* ---------- 平板：写字 / 识字卡改横向，避免右侧大片留白 ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
  .home-entry {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-areas: "ico t" "ico d";
    align-items: center;
    column-gap: 14px;
    row-gap: 3px;
    padding: 16px 18px;
  }
  .he-icon { grid-area: ico; width: 52px; height: 52px; font-size: 26px; }
  .he-t { grid-area: t; margin-top: 0; font-size: 22px; }
  .he-d { grid-area: d; font-size: 12.5px; }
}


/* ===== v4 图标（线性 SVG 取代 emoji）===== */
/* 图标只用 currentColor 描边，配色交给容器，所以深浅底都能直接复用 */
.ico-cell {
  width: 21px; height: 21px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico-cell-sm { width: 17px; height: 17px; }

/* 今日任务：40×40 浅色块 */
.ht-ico {
  color: var(--brand-deep);
  background: var(--brand-soft);
  border: 0; box-shadow: none;
}
.ht-ico .ico-cell { width: 20px; height: 20px; }
.st-item.done .ht-ico { color: #8A6B12; background: rgba(255, 224, 51, .34); }

/* 全部练习：26×26 小色块，不改变卡片最小高度 */
.hq-ico {
  display: grid; place-items: center;
  width: 26px; height: 26px; margin-bottom: 2px;
  border-radius: 8px;
  color: var(--brand-deep);
  background: var(--brand-soft);
}
.hq-ico .ico-cell { width: 16px; height: 16px; }
.hq-item-accent .hq-ico { color: var(--ink); background: rgba(30, 27, 58, .10); }

/* ===== v4 内容框皮肤 =====
/* 一、把全站卡片底色/边框收敛到同一档
      --border-warm 原本是 rgba(226,232,240,.85)（≈#E2E8F0），
      这里略压深一点并去掉透明度，避免半透明叠在彩色底上发灰。 */
:root {
  --border-warm: #DBD9E6;
  --line: #DBD9E6;
  --line-hover: #A8A1E6;
  --shadow-soft: 0 1px 2px rgba(30, 27, 58, .04), 0 8px 20px -10px rgba(30, 27, 58, .10);
}

/* 二、内容框：统一 1.5px 浅边 + 柔阴影，去掉硬投影与贴纸倾斜 */
.home-today,
.ht-card,
.home-entry,
.home-quick,
.hq-item,
.sms-card,
.modal-box,
.frag-card,
.rules,
.reward-item,
.badge-item,
.write-task,
.bubble-group,
.part-bubble,
.match-tile,
.quiz-btn,
.hl-card,
.mg-done-frag,
.err-char-card,
.entry-card,
.grade-card,
.lesson-card,
.simple-card,
.char-anatomy-card,
#view-mode-write .write-header-bar {
  border: 1.5px solid var(--line) !important;
  box-shadow: var(--shadow-soft) !important;
  transform: none !important;
}

/* 主 CTA 是实色块，不要描边，只留一层柔和投影 */
.home-start {
  border: 1.5px solid transparent !important;
  box-shadow: 0 10px 24px -12px rgba(83, 88, 172, .55) !important;
  transform: none !important;
}

/* 米字格：格子是自己的，外框跟着统一，但内线保持清晰 */
.write-stage .mizige-box {
  border: 1.5px solid var(--line) !important;
  box-shadow: var(--shadow-soft) !important;
}

/* 三、悬停：只有这一张框的边变淡紫，不位移、不放大、不影响相邻卡片 */
@media (hover: hover) {
  .ht-card:hover,
  .home-entry:hover,
  .hq-item:hover,
  .sms-card:hover,
  .entry-card:hover,
  .grade-card:hover,
  .lesson-card:hover,
  .simple-card:hover,
  .err-char-card:hover,
  .frag-card:hover,
  .hl-card:hover,
  .write-task:hover,
  .quiz-btn:hover,
  .match-tile:hover,
  .part-bubble:hover {
    border-color: var(--line-hover) !important;
    box-shadow: var(--shadow-soft) !important;
    transform: none !important;
  }
}

/* 四、过渡只留边框色，避免旧的 transform/box-shadow 过渡造成抖动 */
.ht-card,
.home-entry,
.hq-item,
.sms-card,
.entry-card,
.grade-card,
.lesson-card,
.simple-card,
.err-char-card,
.frag-card,
.hl-card,
.quiz-btn,
.match-tile,
.part-bubble {
  transition: border-color .18s ease;
}

/* 五、触屏没有 hover：给按下态一个明确反馈，替代悬停高亮 */
@media (hover: none) {
  .ht-card:active,
  .home-entry:active,
  .hq-item:active,
  .quiz-btn:active,
  .match-tile:active {
    border-color: var(--line-hover) !important;
  }
}

/* ===== v4 收口 =====
/* 顶栏胶囊、侧栏、底栏：跟内容框用同一档边与阴影，只保留各自的实色底 */
.crumb-tag,
.reward-enter,
.voice-btn,
.sidebar-growth,
.side-nav-item.active,
.side-nav-icon,
.entry-icon-box,
.sms-ico,
.mobile-bottom-nav,
.m-nav-btn.active,
.ht-prog,
.hs-badge,
.side-badge,
.he-icon,
.sg-head b,
.sg-bar {
  border-width: 1.5px !important;
  border-color: var(--line) !important;
  box-shadow: var(--shadow-soft) !important;
  transform: none !important;
}

/* 侧栏选中项是主营入口，保留品牌黄但不吃黑影 */
.side-nav-item.active {
  box-shadow: 0 6px 16px -10px rgba(30, 27, 58, .45) !important;
}

/* 底栏选中胶囊：品牌紫实心，去硬影 */
.m-nav-btn.active {
  box-shadow: 0 6px 14px -8px rgba(83, 88, 172, .55) !important;
  border-color: transparent !important;
}

/* 顶栏的碎片胶囊跟内容区同色系 */
.reward-enter { border-color: var(--line) !important; }


/* ===== v4 年级卡标识 ===== */
.grade-icon {
  width: 46px; height: 46px; border-radius: 14px;
  display: grid; place-items: center;
  margin-bottom: 10px; font-size: 0;
  color: #E08A12; background: #FDF3E3;
}
.grade-icon .grade-mark {
  width: 25px; height: 25px;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.gi-book { color: #1B9A62; background: #E6F7EF; }
.gi-tree { color: #2F7BD6; background: #E9F2FD; }
.gi-cap  { color: #6B4FD8; background: #F0ECFE; }


/* ===== v5 图标（立体激励图标 + 功能线性图标）===== */
/* 立体图标自带配色与切面，不走 currentColor；尺寸按 em 走，字号改了就跟着变 */
.ico3d {
  width: 1.16em; height: 1.16em;
  flex: 0 0 auto;
  vertical-align: -0.19em;
  overflow: visible;
}
.ico3d--lg { width: 30px; height: 30px; vertical-align: middle; }
.ico3d--xl { width: 38px; height: 38px; vertical-align: middle; }

/* 功能线性图标：跟着文字颜色走 */
.ico-line {
  width: 1.08em; height: 1.08em;
  flex: 0 0 auto;
  vertical-align: -0.16em;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}

/* 结算星级：三颗固定坑位，亮/暗只切透明度，不再用字符串拼 ⭐ */
.settle-stars {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 6px;
}
.settle-star {
  width: 46px; height: 46px;
  filter: drop-shadow(0 5px 7px rgba(217, 119, 6, .3));
  transition: opacity .18s ease, transform .18s ease;
}
.settle-star.off { opacity: .26; filter: saturate(.25); transform: scale(.88); }
@media (max-width: 420px) {
  .settle-star { width: 40px; height: 40px; }
  .settle-stars { gap: 8px; }
}


/* ===== v5 手机端：顶栏隐形化 =====
   客户反馈「手机版一打开，那条顶栏很碍事」。这里不删功能，只拆壳：
   横条本体不再显示，声音/语速变成底栏上方的两个浮动圆钮，
   碎片与等级并进首页「今天的小目标」卡头部。 */
.ht-frag { display: none; }

/* 结算弹窗的说明行 */
.settle-hint {
  font-size: 12.5px; line-height: 1.6;
  color: var(--text-sub); font-weight: 600;
  margin-bottom: 12px;
}

@media (max-width: 640px) {
  .huer-main { padding-top: 14px; }

  .global-topbar {
    position: fixed;
    left: auto; right: 12px; top: auto;
    bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    display: block; width: auto;
    padding: 0; margin: 0;
    background: none; border: 0; box-shadow: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    flex-wrap: nowrap;
  }
  .global-topbar .topbar-left,
  .global-topbar .reward-bar { display: none; }

  .voice-ctl {
    display: flex; flex-direction: column; gap: 8px; align-items: flex-end;
  }
  .voice-btn {
    width: 44px; height: 44px; padding: 0;
    display: grid; place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    border: 1.5px solid var(--line);
    box-shadow: 0 6px 16px -9px rgba(30, 27, 74, .34);
    color: var(--huer-indigo);
    opacity: .62;
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    transition: opacity .2s ease, transform .14s ease;
  }
  .voice-btn .ico3d { width: 24px; height: 24px; }
  /* 语速用得非常少，收成一个小字标签，别再占一个圆钮的位置 */
  .voice-btn.voice-rate {
    width: auto; height: auto;
    padding: 2px 7px 3px;
    border: 0; background: transparent;
    box-shadow: none; border-radius: 999px;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    font-size: 10px; font-weight: 800; letter-spacing: -.2px;
    color: var(--huer-indigo);
    opacity: .62;
  }
  .voice-btn.voice-rate:active { opacity: 1; }
  .voice-btn:active { transform: scale(.94); opacity: 1; }
  /* 滚动时自动降透明度，不压住卡片正文；但静音状态必须保持醒目 */
  .global-topbar.is-scrolling .voice-btn { opacity: .28; }
  .global-topbar.is-scrolling .voice-btn.muted { opacity: 1; }

  .ht-frag {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: auto; margin-right: 8px;
    padding: 3px 10px 3px 8px;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand-deep);
    font-size: 11.5px; font-weight: 800;
    line-height: 1;
  }
  .ht-frag .ico3d { width: 14px; height: 14px; }
  .ht-frag b { font-size: 12px; }
  .ht-frag i { font-style: normal; opacity: .45; padding: 0 1px; }
}

/* ===== v6 纸感贴纸（Paper Sticker）===== */
/* 层次三层：纸底（深半档） → 白卡（浮起） → 浅色厚度（贴纸侧壁）
   注意：厚度色 --sticker-wall 是浅紫灰，不是黑，客户端「去黑影」的前提不变 */

:root {
  --paper: #EFEDF9;
  --paper-2: #FFFFFF;
  --sticker-wall: #E7E3F4;
  --sticker-wall-lift: #DED9F0;
  --shadow-soft:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 2px 0 var(--sticker-wall),
    0 14px 26px -18px rgba(58, 52, 140, .32);
  --shadow-lift:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 3px 0 var(--sticker-wall-lift),
    0 22px 34px -20px rgba(58, 52, 140, .42);
}

/* ---------- 纸底：加深半档 + 网点可见 + 双色柔光 ---------- */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(rgba(83, 88, 172, .085) 1px, transparent 1.15px),
    radial-gradient(1100px 520px at 104% -10%, rgba(124, 92, 252, .22) 0%, rgba(124, 92, 252, 0) 62%),
    radial-gradient(900px 480px at -8% 104%, rgba(255, 224, 51, .24) 0%, rgba(255, 224, 51, 0) 60%);
  background-size: 16px 16px, auto, auto;
  background-attachment: fixed;
}

/* ---------- 侧栏：竖向渐变纸 + 右侧浅色厚度（不是墨线） ---------- */
.huer-sidebar {
  background-color: #FBFAFF;
  background-image:
    radial-gradient(rgba(83, 88, 172, .07) 1px, transparent 1.2px),
    linear-gradient(180deg, rgba(255, 255, 255, .9) 0%, rgba(247, 245, 254, .9) 100%);
  background-size: 14px 14px, auto;
  border-right: 1.5px solid var(--sticker-wall) !important;
  box-shadow: 2px 0 0 rgba(255, 255, 255, .9), 8px 0 22px -18px rgba(58, 52, 140, .45) !important;
}

/* ---------- 顶栏：玻璃纸（只在桌面端，手机端顶栏已被 v5 拆壳） ---------- */
@media (min-width: 641px) {
  .global-topbar {
    background: rgba(252, 251, 255, .76) !important;
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    backdrop-filter: blur(14px) saturate(1.15);
  }
}

/* ---------- 内容卡：白底 + 贴纸厚度 ---------- */
.home-today,
.home-quick,
.hq-item,
.ht-card,
.mode-card,
.entry-card,
.grade-card,
.lesson-card,
.simple-card,
.sms-card,
.err-char-card,
.frag-card {
  background-color: #FFFFFF;
}

/* ---------- 全部练习：彩色贴纸徽章 ---------- */
.hq-grid > .hq-item .hq-ico {
  width: 34px; height: 34px; margin-bottom: 7px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--tip-bg, #F3F0FE);
  border: 1.5px solid var(--tip-bd, #DFD6FC);
  color: var(--tip-fg, #6B4FD8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.hq-grid > .hq-item .hq-ico .ico-cell { width: 19px; height: 19px; }

.hq-grid > .hq-item:nth-child(1) { --tip-bg: #F3F0FE; --tip-bd: #DFD6FC; --tip-fg: #6B4FD8; }
.hq-grid > .hq-item:nth-child(2) { --tip-bg: #EAF2FE; --tip-bd: #CFE1FA; --tip-fg: #2F7BD6; }
.hq-grid > .hq-item:nth-child(3) { --tip-bg: #E7F7F4; --tip-bd: #C6EDE5; --tip-fg: #0E9384; }
.hq-grid > .hq-item:nth-child(4) { --tip-bg: #FDECF3; --tip-bd: #F8D3E3; --tip-fg: #D6427E; }
.hq-grid > .hq-item:nth-child(5) { --tip-bg: #EAF7EF; --tip-bd: #CBEBD8; --tip-fg: #1B9A62; }
/* 第 6 张是黄色实底卡，徽章反白，避免黄上叠黄 */
.hq-grid > .hq-item.hq-item-accent { --tip-bg: #FFFFFF; --tip-bd: #EBD79A; --tip-fg: #8A6410; }

/* ---------- 今日小目标：三个徽章同样是贴纸块 ---------- */
.st-item.ht-card .ht-ico {
  background: var(--tip-bg, #F3F0FE);
  border: 1.5px solid var(--tip-bd, #DFD6FC);
  color: var(--tip-fg, #6B4FD8);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
}
.ht-grid > .st-item:nth-child(1) { --tip-bg: #F3F0FE; --tip-bd: #DFD6FC; --tip-fg: #6B4FD8; }
.ht-grid > .st-item:nth-child(2) { --tip-bg: #EAF2FE; --tip-bd: #CFE1FA; --tip-fg: #2F7BD6; }
.ht-grid > .st-item:nth-child(3) { --tip-bg: #FDF1E0; --tip-bd: #F5DCB8; --tip-fg: #C2710C; }

/* 完成态保留姜黄，但换成浅底 + 金边，跟新徽章语言一致 */
.st-item.done .ht-ico {
  background: #FFF8DA !important;
  border-color: #F1DE9B !important;
  color: #8A6410 !important;
}

/* ---------- 悬停：仍然只改边框色（客户第 6 条），不为徽章加动效 ---------- */
@media (hover: hover) {
  /* 客户第 6 条：悬停时只让这一张框的边变淡紫，影与位置都不动 */
  .hq-item:hover,
  .ht-card:hover {
    box-shadow: var(--shadow-soft) !important;
  }
}

/* ---------- 按下：厚度收回，像真的把贴纸按下去 ---------- */
.hq-item:active,
.ht-card:active {
  transform: translateY(1px) !important;
  box-shadow: var(--shadow-soft) !important;
}

/* ---------- 小屏：徽章收一档，避免卡片被撑高 ---------- */
@media (max-width: 420px) {
  .hq-grid > .hq-item .hq-ico { width: 30px; height: 30px; margin-bottom: 6px; border-radius: 10px; }
  .hq-grid > .hq-item .hq-ico .ico-cell { width: 17px; height: 17px; }
}
/* ===== v6 收口 ===== */

/* ===== v6d 装饰层 ===== */

/* ---------- 1. 首页主卡：背后透出的光环 ---------- */
.home-start { position: relative; overflow: hidden; isolation: isolate; }
.home-start::before {
  content: "";
  position: absolute; right: -54px; bottom: -58px;
  width: 152px; height: 152px; border-radius: 50%;
  border: 19px solid rgba(255, 255, 255, .15);
  box-shadow: 0 0 0 26px rgba(255, 255, 255, .07);
  pointer-events: none; z-index: 0;
}
.home-start::after {
  content: "";
  position: absolute; right: 22px; top: -50px;
  width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle at 36% 32%,
    rgba(255, 232, 140, .62) 0%,
    rgba(255, 232, 140, .22) 46%,
    rgba(255, 232, 140, 0) 72%);
  pointer-events: none; z-index: 0;
}
/* 内容压在装饰之上 */
.home-start > * { position: relative; z-index: 1; }

/* ---------- 2. 结算弹窗：顶部柔光 + 散点 ---------- */
#settle-modal-mask .modal-box {
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
}
#settle-modal-mask .modal-box::before {
  content: "";
  position: absolute; left: 50%; top: -132px; transform: translateX(-50%);
  width: 340px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle,
    rgba(255, 226, 148, .40) 0%,
    rgba(255, 226, 148, .16) 44%,
    rgba(255, 226, 148, 0) 70%);
  pointer-events: none;
}
#settle-modal-mask .modal-box::after {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 110px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 240 110'%3E%3Ccircle cx='30' cy='22' r='2.6' fill='%23F5B301' opacity='.55'/%3E%3Ccircle cx='206' cy='16' r='3.2' fill='%23F5B301' opacity='.45'/%3E%3Ccircle cx='66' cy='52' r='2' fill='%237C5CFC' opacity='.38'/%3E%3Ccircle cx='176' cy='62' r='2.2' fill='%237C5CFC' opacity='.32'/%3E%3Ccircle cx='118' cy='14' r='1.8' fill='%23F5B301' opacity='.40'/%3E%3Ccircle cx='214' cy='84' r='1.8' fill='%237C5CFC' opacity='.30'/%3E%3Ccircle cx='22' cy='88' r='2' fill='%23F5B301' opacity='.32'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-size: 100% 110px;
  pointer-events: none;
}
/* 弹窗内容压在装饰之上 */
#settle-modal-mask .modal-box > * { position: relative; z-index: 1; }

/* 星级行再抬高一点，跟柔光形成呼应 */
#settle-modal-mask .settle-stars { position: relative; z-index: 2; }
/* ===== v6d 收口 ===== */

/* CSS:APP:END */


/* ===== v8 精致 UI (mesh) ===== */

/* ---------- 1. 背景：mesh gradient 取代网点纹理 ----------
   1px 点阵在低 DPI 下会糊成灰噪，是"模板感"的主要来源。
   改成 4 团大半径柔光，形成无边界流动的色彩氛围。 */
body {
  --bg-code:
    radial-gradient(78% 58% at 2% -12%, rgba(124, 96, 250, .19) 0%, rgba(124, 96, 250, 0) 62%),
    radial-gradient(70% 54% at 102% 0%, rgba(255, 191, 106, .21) 0%, rgba(255, 191, 106, 0) 62%),
    radial-gradient(66% 60% at 92% 106%, rgba(255, 158, 196, .16) 0%, rgba(255, 158, 196, 0) 62%),
    radial-gradient(64% 56% at 4% 102%, rgba(104, 214, 196, .17) 0%, rgba(104, 214, 196, 0) 62%);
  background-color: #F6F5FD !important;
  /* 三级回退：
     --gen-bg-app   ← 构建时若存在 art/v9/bg_app.jpg 才定义（AI 生成横版）
     --app-bg-image ← 手工指定用
     --bg-code      ← 代码绘制的 4 团柔光
     换背景只需要换图，不需要再动这条规则 */
  background-image: var(--gen-bg-app, var(--app-bg-image, var(--bg-code))) !important;
  background-size: cover !important;
  background-attachment: fixed !important;
}

/* 极淡 grain：消掉渐变色带，并给一点纸感颗粒 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxNjAnIGhlaWdodD0nMTYwJz48ZmlsdGVyIGlkPSduJz48ZmVUdXJidWxlbmNlIHR5cGU9J2ZyYWN0YWxOb2lzZScgYmFzZUZyZXF1ZW5jeT0nMC44MicgbnVtT2N0YXZlcz0nMycgc3RpdGNoVGlsZXM9J3N0aXRjaCcvPjxmZUNvbG9yTWF0cml4IHR5cGU9J3NhdHVyYXRlJyB2YWx1ZXM9JzAnLz48L2ZpbHRlcj48cmVjdCB3aWR0aD0nMTYwJyBoZWlnaHQ9JzE2MCcgZmlsdGVyPSd1cmwoI24pJy8+PC9zdmc+");
  background-size: 160px 160px;
  opacity: .042;
  mix-blend-mode: multiply;
}

/* 侧栏：半透明玻璃，让 mesh 透出来 */
.huer-sidebar {
  background-color: rgba(252, 251, 255, .72) !important;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .76) 0%, rgba(247, 245, 254, .64) 100%) !important;
  background-size: auto !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.1);
  backdrop-filter: blur(18px) saturate(1.1);
}

/* ---------- 2. 图标：渐变实底 + 白色图标 ---------- */
.hq-grid > .hq-item .hq-ico,
.ht-grid > .st-item .ht-ico {
  position: relative;
  border: 0 !important;
  color: #FFFFFF !important;
  background: linear-gradient(148deg, var(--ic-a, #A99BFF) 0%, var(--ic-b, #7C5CFC) 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .46),
    inset 0 -1px 0 rgba(0, 0, 0, .07),
    0 5px 13px -5px var(--ic-sh, rgba(124, 92, 252, .55)) !important;
}
.hq-grid > .hq-item .hq-ico .ico-cell,
.ht-grid > .st-item .ht-ico .ico-cell,
.he-icon .ico-cell {
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .16));
}

/* 6 个功能区：各自一个色相 */
.hq-grid > .hq-item:nth-child(1) { --ic-a: #B3A6FF; --ic-b: #7B5AF7; --ic-sh: rgba(123, 90, 247, .48); }
.hq-grid > .hq-item:nth-child(2) { --ic-a: #86C6FF; --ic-b: #3D82F0; --ic-sh: rgba(61, 130, 240, .46); }
.hq-grid > .hq-item:nth-child(3) { --ic-a: #6FE4D2; --ic-b: #16AC9B; --ic-sh: rgba(22, 172, 155, .44); }
.hq-grid > .hq-item:nth-child(4) { --ic-a: #FFAECB; --ic-b: #EE5C96; --ic-sh: rgba(238, 92, 150, .44); }
.hq-grid > .hq-item:nth-child(5) { --ic-a: #87E3B0; --ic-b: #2CA96B; --ic-sh: rgba(44, 169, 107, .44); }
.hq-grid > .hq-item.hq-item-accent { --ic-a: #FFDD7A; --ic-b: #F0A020; --ic-sh: rgba(240, 160, 32, .48); }

/* 今日小目标 3 个 */
.ht-grid > .st-item:nth-child(1) { --ic-a: #B3A6FF; --ic-b: #7B5AF7; --ic-sh: rgba(123, 90, 247, .48); }
.ht-grid > .st-item:nth-child(2) { --ic-a: #86C6FF; --ic-b: #3D82F0; --ic-sh: rgba(61, 130, 240, .46); }
.ht-grid > .st-item:nth-child(3) { --ic-a: #FFDD7A; --ic-b: #F0A020; --ic-sh: rgba(240, 160, 32, .48); }
.st-item.done .ht-ico {
  background: linear-gradient(148deg, #87E3B0 0%, #2CA96B 100%) !important;
  color: #FFFFFF !important;
  border: 0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .46),
    0 5px 13px -5px rgba(44, 169, 107, .48) !important;
}

/* ---------- 3. 卡片：微渐变 + 三层柔影 ---------- */
.home-today,
.home-quick,
.hq-item,
.ht-card,
.mode-card,
.entry-card,
.grade-card,
.lesson-card,
.simple-card,
.err-char-card,
.frag-card {
  background-image: linear-gradient(180deg, #FFFFFF 0%, #FCFBFE 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .98),
    0 1px 2px rgba(83, 88, 172, .05),
    0 12px 26px -18px rgba(83, 88, 172, .30) !important;
}
.hq-item.hq-item-accent {
  background-image: linear-gradient(180deg, #FFE86A 0%, #FFD93B 100%) !important;
}

/* 悬停：只改边框色，影与位置一律不动 */
@media (hover: hover) {
  .hq-item:hover,
  .ht-card:hover {
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .98),
      0 1px 2px rgba(83, 88, 172, .05),
      0 12px 26px -18px rgba(83, 88, 172, .30) !important;
  }
}

/* ---------- 4. 首页主卡：品牌渐变 + 玻璃高光 ---------- */
.home-start {
  background-image:
    radial-gradient(120% 140% at 12% 0%, rgba(255, 255, 255, .30) 0%, rgba(255, 255, 255, 0) 52%),
    linear-gradient(135deg, #7C5CFC 0%, #6A4BF2 52%, #5B3FD8 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .34),
    inset 0 -1px 0 rgba(0, 0, 0, .10),
    0 2px 3px rgba(64, 44, 160, .18),
    0 18px 34px -20px rgba(64, 44, 160, .60) !important;
}

/* ---------- 5. 顶栏积分胶囊 ---------- */
.reward-enter {
  background-image: linear-gradient(180deg, #FFFFFF 0%, #FBF9FF 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .98),
    0 1px 2px rgba(83, 88, 172, .05),
    0 10px 22px -16px rgba(83, 88, 172, .30);
}

/* ---------- 6. 首页「写字 / 识字」大卡：渐变立体图标 ---------- */
.he-icon {
  border: 0 !important;
  color: #FFFFFF !important;
  background: linear-gradient(148deg, #FFDD7A 0%, #F0A020 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .46),
    inset 0 -1px 0 rgba(0, 0, 0, .07),
    0 6px 15px -6px rgba(240, 160, 32, .55) !important;
}
.home-entry:nth-child(2) .he-icon {
  background: linear-gradient(148deg, #B3A6FF 0%, #7B5AF7 100%) !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .46),
    inset 0 -1px 0 rgba(0, 0, 0, .07),
    0 6px 15px -6px rgba(123, 90, 247, .55) !important;
}
.he-icon .ico-cell { width: 24px; height: 24px; }

/* ---------- 7. 手机端浮动声音控件：竖排改横排 ---------- */
@media (max-width: 640px) {
  .voice-ctl { flex-direction: row-reverse; align-items: center; gap: 4px; }
  .voice-btn {
    width: 38px; height: 38px;
    opacity: .34;
    box-shadow: 0 4px 12px -8px rgba(30, 27, 74, .30);
  }
  .voice-btn .ico3d { width: 21px; height: 21px; }
  .voice-btn.voice-rate { padding: 1px 6px 2px; font-size: 9.5px; opacity: .34; }
}

/* ---------- 8. 小屏收一档 ---------- */
@media (max-width: 420px) {
  .hq-grid > .hq-item .hq-ico { width: 31px; height: 31px; border-radius: 10px; }
  .hq-grid > .hq-item .hq-ico .ico-cell { width: 17px; height: 17px; }
}


/* ---------- 9. 首页底部留白：浮动声音控件是 fixed，必须给内容让位 ---------- */
@media (max-width: 640px) {
  /* 控件顶边在 y≈726（视口 844 时），留白必须大于 132，否则最后一行卡片
     会被压在控件下面——实测 84px 时「专项训练」黄卡正好被盖住一半。 */
  #view-home.active {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }
  #view-home.active,
  #view-minigames.active,
  #view-errors.active {
    padding-bottom: calc(132px + env(safe-area-inset-bottom, 0px));
  }
  /* 手机用竖版背景（--gen-bg-app-m）。横图在竖屏 cover 只会截到中间那片白。
     纯渐变拉伸失真看不出来，所以竖屏直接铺满。 */
  body {
    background-image: var(--gen-bg-app-m,
      var(--gen-bg-app, var(--app-bg-image, var(--bg-code)))) !important;
    background-size: 100% 100% !important;
    background-position: center !important;
  }
  /* 毛玻璃底：卡片滚到下方时，控件读作独立浮层而不是卡片的一部分 */
  .voice-btn {
    background: rgba(255, 255, 255, .72) !important;
    border: 1px solid rgba(255, 255, 255, .95) !important;
    color: #4B3FA0 !important;
    -webkit-backdrop-filter: blur(9px) saturate(1.1);
    backdrop-filter: blur(9px) saturate(1.1);
    opacity: .86;
  }
  /* 语速标签贴在圆形按钮旁边时，会让整个控件读成"卡片的一部分"。
     手机端收成单个圆钮，语速改在设置里调。 */
  .voice-btn.voice-rate { display: none !important; }
  .voice-btn { width: 36px; height: 36px; }
  .voice-btn.off {
    background: rgba(255, 255, 255, .6) !important;
    color: #8A86A8 !important;
  }
}


/* ---------- 10. 奖励页碎片卡：右上角装饰插图（生成图 --gen-art-start） ---------- */
.frag-card { position: relative; overflow: hidden; }
.frag-top::after {
  content: "";
  position: absolute; right: 8px; top: 2px;
  width: 96px; height: 96px;
  background: var(--gen-art-start, none) center / contain no-repeat;
  pointer-events: none; z-index: 0;
  filter: drop-shadow(0 8px 12px rgba(83, 88, 172, .16));
}
.frag-card .frag-top { position: relative; z-index: 1; }
.frag-card .frag-next,
.frag-card .frag-bar { position: relative; z-index: 1; }
@media (max-width: 640px) {
  .frag-top::after { width: 86px; height: 86px; right: 2px; top: 4px; }
  .frag-top { padding-right: 84px; }
}

/* ===== v8 end ===== */

/* ---------- 11. 空状态插图（生成图 --gen-art-empty） ----------
   只在「没有数据」的时候出现，不占用任何正常操作路径。
   尺寸刻意压小：它是安抚，不是主角，绝不能盖过按钮和文案。 */
.err-empty .ee-art,
.bubble-empty .be-art {
  background: var(--gen-art-empty, none) center / contain no-repeat;
  pointer-events: none;
  flex: 0 0 auto;
}
.err-empty .ee-art { width: 108px; height: 108px; }
.bubble-empty .be-art { width: 80px; height: 80px; }
@media (max-width: 640px) {
  .err-empty .ee-art { width: 92px; height: 92px; }
  .bubble-empty .be-art { width: 68px; height: 68px; }
}

/* 气泡空态：卡片贴着内容，不要留一大块白（min-height 是给拼字区留的，空态不需要） */
.bubble-arena-card.is-empty { min-height: 0; }
.bubble-arena-card.is-empty .bubble-empty { padding: 26px 20px 30px; }

/* 桌面空态：通栏虚线卡又扁又长，收成 560px 更聚焦（grid item 用 auto margin 居中） */
@media (min-width: 760px) {
  .err-empty { max-width: 560px; margin: 0 auto; padding: 34px 24px 38px; }
  .err-empty .ee-art { width: 120px; height: 120px; }
}

/* ==================== v11 排版打磨 ====================
   只做三件事，不加任何装饰：
   1. 年级卡从「竖排+居中」改成「横排+左对齐」，把 200px 的空卡压到 98px
   2. 首页练习卡补垂直节奏（原来 gap 只有 2px，三行字贴在一起）
   3. 小字收敛：手机端不再出现 10.5px 中文，行高全部显式给
   ==================================================== */

/* ---- 1. 年级卡：横排 ---- */
.grade-card {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 13px;
  min-height: 0 !important;
  padding: 13px 16px !important;
}
.grade-icon {
  margin-bottom: 0 !important;
  flex: 0 0 46px;
}
.grade-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.grade-name { text-align: left; }
.grade-meta {
  text-align: left !important;
  line-height: 1.45;
  letter-spacing: .01em;
}

/* 桌面 4 列时每列只有 205px，横排后文字被挤成两行；
   收成 3 列，卡片宽到 370px，meta 能稳稳占一行。 */
@media (min-width: 1024px) {
  .grades-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 14px; }
}
@media (min-width: 1600px) {
  .grades-grid { grid-template-columns: repeat(4, 1fr) !important; }
}

/* ---- 2. 首页练习卡：垂直节奏 ---- */
.hq-item { gap: 4px; }
.hq-name { margin-top: 1px; }
.hq-desc { line-height: 1.55; letter-spacing: .01em; }

/* ---- 3. 小字下限：中文不进 11px 以下 ---- */
@media (max-width: 640px) {
  .hq-desc { font-size: 11.5px !important; }
}
@media (max-width: 420px) {
  .hq-desc { font-size: 11px !important; }
  .ht-name { font-size: 14px !important; }
}

/* 横排后右侧留白过大，补一个极淡的层级箭头配平；
   它是导航语义（点进去看课文），不是装饰。纯 CSS 画的，不占体积。 */
.grade-card::after {
  content: "";
  flex: 0 0 auto;
  margin-left: auto;
  width: 7px; height: 7px;
  border-right: 2px solid rgba(60, 55, 110, .2);
  border-bottom: 2px solid rgba(60, 55, 110, .2);
  transform: rotate(-45deg);
  transition: border-color .18s, transform .18s;
}
.grade-card:hover::after {
  border-color: var(--huer-indigo);
  transform: rotate(-45deg) translate(1px, 1px);
}

/* 今日目标卡：窄卡里「拆字 / 拼字 1 关」会断在词中间，把「1 个」这种一个字挤到下一行。
   HTML 里已经在语义边界放了 <br>，宽屏隐藏（一行放得下），窄屏才生效。 */
.ht-name { line-height: 1.35; }
.ht-name br { display: none; }
@media (max-width: 640px) {
  .ht-name br { display: inline; }
}
/* 「待完成 / 0/3」原来是 10px，中文在 10px 下笔画糊，抬到 11px */
.ht-st { font-size: 11px !important; }

/* ---- 4. 页面副标题：11.5px 在手机上把 30 多个字挤成一行，读起来发糊 ---- */
.page-subtitle {
  font-size: 12.5px !important;
  line-height: 1.55 !important;
  letter-spacing: .01em;
}

/* ---- 5. 中文折行不要留孤字 ----
   「选部件组字 / 拆字，理解部件与整字」原本会把「件与整字」单独甩到下一行。
   pretty 让浏览器在折行时避免末行只剩一两个字；不支持的浏览器自动忽略，无副作用。 */
.hq-desc, .grade-meta, .mg-card-d, .ee-d, .be-d,
.frag-lab, .frag-next, .page-subtitle, .lesson-sub, .sg-foot {
  text-wrap: pretty;
}

/* 副标题只有两三行，pretty 在 CJK 上几乎不生效（「14 册）」照样孤零零一行）。
   balance 会把两行均分，短文本正是它的适用场景。 */
.page-subtitle { text-wrap: balance; }

/* ---- 6. 平板 3 列太窄 ----
   768px 三列时文字区只剩 125px，「幼小衔接 · 启蒙象形识字 · 8课（80字）」
   会被拆成「…象形识」/「字 · 8课（80字）」，正好断在「识字」中间。
   900px 以下改 2 列，每列 360px，meta 稳稳一行。 */
@media (min-width: 641px) and (max-width: 1023px) {
  .grades-grid { grid-template-columns: repeat(2, 1fr) !important; }
}

/* ---- 7. 桌面今日目标卡：三列拉满屏宽，内容全挤在左侧 ----
   宽屏时把「待完成 / 0/3」推到右端，卡片才不显空。 */
@media (min-width: 1000px) {
  .ht-card { justify-content: flex-start; }
  .ht-body {
    flex: 1;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .ht-name { margin: 0; }
}

/* ==================== v12 卡片重做 + 小字体系 ====================
   这一轮只解决三件事，不加装饰性元素：
   1. 年级卡回到「竖版 + 统一高度」，桌面一行 4 张、末行居中，不再出现左边缺一格的空洞
   2. 卡片说明从「六三/五四通用 · 结构进阶 · 29课（250字）」压到「29 课 · 250 字」
   3. 小字全部改用黑体、600 字重、同一深灰紫；标题也从楷体换成黑体 800
   ================================================================ */

:root {
  --f-ui: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ink-2: #4C4769;          /* 小字专用：比正文浅、比原来的灰紫深，不会糊 */
  --card-line: #E7E4F2;
}

/* ---- 1. 年级卡：竖版、等宽等高 ---- */
.grades-grid {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 12px !important;
}
.grade-card {
  flex: 0 0 calc((100% - 36px) / 4);
  max-width: 248px;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0 !important;
  min-height: 156px !important;
  padding: 20px 14px 18px !important;
  text-align: center !important;
  border-radius: 18px !important;
  border: 1px solid var(--card-line) !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFBFF 100%) !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),
              0 1px 2px rgba(30, 27, 58, .04),
              0 10px 22px -18px rgba(30, 27, 58, .30) !important;
  transition: transform .2s cubic-bezier(.2,.7,.3,1),
              box-shadow .2s ease, border-color .2s ease !important;
}
.grade-card:hover {
  transform: translateY(-2px) !important;
  border-color: #BFB4EE !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9),
              0 2px 4px rgba(30, 27, 58, .05),
              0 16px 28px -16px rgba(83, 88, 172, .34) !important;
}
/* 学前的米黄底打破统一，改回同款白 */
.grade-card.preschool {
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFBFF 100%) !important;
  border-color: var(--card-line) !important;
}
/* v11 横排时加的右侧箭头，竖版不需要 */
.grade-card::after { display: none !important; }
/* mg.css v6c 给每张卡左侧挂了 3px 学段色条（橙/绿/蓝/紫），
   12 张卡排在一起就是 12 条不同颜色的竖线，视觉上最碎。
   学段色改由图标底色承担，卡片本身保持干净。 */
.grade-card::before { display: none !important; }

.grade-icon {
  width: 50px !important; height: 50px !important;
  flex: 0 0 50px;
  border-radius: 15px !important;
  margin: 0 0 12px 0 !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 1px 2px rgba(30, 27, 58, .05);
}
.grade-icon .grade-mark { width: 25px; height: 25px; stroke-width: 1.8; }
.grade-icon { transition: transform .2s cubic-bezier(.2,.7,.3,1); }
.grade-card:hover .grade-icon { transform: translateY(-1px) scale(1.04); }

.grade-text { display: block !important; width: 100%; min-width: 0; }
.grade-name {
  font-family: var(--f-ui) !important;
  font-size: 16.5px !important;
  font-weight: 800 !important;
  line-height: 1.3;
  letter-spacing: .02em;
  color: var(--ink);
  text-align: center !important;
  margin: 0 0 6px 0 !important;
}
.grade-meta {
  font-family: var(--f-ui) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1.4;
  letter-spacing: .02em;
  color: var(--ink-2) !important;
  text-align: center !important;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 1024–1199 内容区只有 700 左右，4 列会变成 168px 的窄长条，改 3 列（228px） */
@media (min-width: 641px) and (max-width: 1199px) {
  .grade-card { flex-basis: calc((100% - 24px) / 3); }
}
/* 手机：2 列。比原来一列 88px 横条更整齐，一屏也能看 6 本 */
@media (max-width: 640px) {
  .grades-grid { gap: 12px !important; }
  .grade-card {
    flex-basis: calc((100% - 12px) / 2);
    max-width: none;
    min-height: 124px !important;
    padding: 16px 8px 14px !important;
    border-radius: 16px !important;
  }
  .grade-icon { width: 40px !important; height: 40px !important; flex-basis: 40px; margin-bottom: 9px !important; }
  .grade-icon .grade-mark { width: 20px; height: 20px; }
  .grade-name { font-size: 15px !important; }
  .grade-meta { font-size: 11px !important; letter-spacing: .03em; }
}

/* ---- 2. 小字体系：黑体 + 600 + 同一深灰紫 ----
   原来这里混着楷体标题和 -apple-system 细体小字，两种字体撞在卡片里最显乱。 */
.page-subtitle, .hq-desc, .lesson-sub, .mg-card-d,
.ee-d, .be-d, .frag-lab, .frag-next, .ht-st,
.sg-foot, .side-nav-sub, .lesson-meta, .err-meta,
.badge-item .bi-d, .rules p, .vol-hint {
  font-family: var(--f-ui) !important;
  font-weight: 600 !important;
  letter-spacing: .02em;
  color: var(--ink-2);
}

/* ==================== v13 侧栏：把导航项做足 + 左右对齐 ====================
   问题不是侧栏不够高（它已经 100vh 撑满），而是 5 个导航项各只有 58px，
   在 900px 高的屏幕上排完只占三分之一，下半段空出近 400px，看着就"短"。
   做法：项高 58 -> 72，图标 36 -> 40，文字提一档，间距 6 -> 8；
   同时把品牌区比导航项多出来的 8px 内边距去掉，左边缘对齐。
   ==================================================================== */

.huer-sidebar {
  width: 278px !important;
  padding: 20px 16px 18px !important;
}

/* 品牌区原本自带 8px 左右内边距，比导航项往右缩了一截 */
.brand-box { padding-left: 0 !important; padding-right: 0 !important; }

.sidebar-nav { gap: 8px !important; }

.side-nav-item {
  padding: 15px 14px !important;
  gap: 12px !important;
  border-radius: 16px !important;
}
.side-nav-icon {
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
}
.side-nav-icon .ico,
.side-nav-icon svg { width: 21px; height: 21px; }

.side-nav-name {
  font-size: 15px !important;
  line-height: 1.3 !important;
}
.side-nav-desc {
  font-size: 11px !important;
  line-height: 1.35 !important;
  margin-top: 3px !important;
}

/* 底部成长卡与导航项同一套内边距，视觉重量对得上 */
.sidebar-growth { padding: 14px 14px 13px !important; }

/* ---- 侧栏「继续练习」卡：复用首页 resumeLastStudy()，把导航下方的大块空白收成内容 ---- */
.sidebar-resume {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px 14px;
  border: 1.5px solid #DBD9E6;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 20px -12px rgba(30, 27, 58, .26);
  cursor: pointer;
  text-align: left;
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease;
}
.sidebar-resume:hover {
  transform: translate(-1px, -1px);
  border-color: #C9C2EE;
  box-shadow: 0 12px 24px -14px rgba(58, 52, 140, .38);
}
.sr-k {
  font-family: var(--f-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .16em;
  color: #6B62C9;
}
.sr-t {
  font-family: var(--f-ui);
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
  max-width: 100%;
  padding-right: 20px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sr-go {
  position: absolute;
  right: 11px;
  bottom: 11px;
  width: 19px; height: 19px;
  border-radius: 50%;
  background: rgba(83, 88, 172, .10);
  display: grid;
  place-items: center;
}
.sr-go svg {
  width: 12px; height: 12px;
  fill: none;
  stroke: #5358AC;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 高屏（1080p）下 5 个导航项仍只占上半段，再把每项抬到 84px，把空白收窄 */
.side-nav-item { min-height: 84px; }
.sidebar-resume { margin-top: 12px; }

/* ==================== v14 复习本：去黑框 + 字卡重排 ====================
   黑框来源全部是早期「墨线贴纸」的残留：
   .err-char-card 2.5px #1E1B3A、导出/导入/开始复习三个按钮 3px #1E1B3A、警示条 2.5px #1E1B3A。
   这一轮统一换成 1px 淡边 + 柔光投影，字卡内容从 5 层压到 3 层。
   ==================================================================== */

/* ---- 1. 卡片：细边、轻影、内容收紧 ---- */
#view-errorbook .err-char-card {
  border: 1px solid #EAE7F5 !important;
  border-radius: 18px !important;
  background: linear-gradient(180deg, #FFFFFF 0%, #FCFBFF 100%) !important;
  box-shadow: 0 1px 2px rgba(30, 27, 58, .04),
              0 10px 22px -18px rgba(30, 27, 58, .28) !important;
  padding: 15px 10px 14px !important;
  transition: transform .16s cubic-bezier(.2,.7,.3,1),
              box-shadow .16s ease, border-color .16s ease !important;
}
#view-errorbook .err-char-card:hover {
  transform: translateY(-2px) !important;
  border-color: #C9C2EE !important;
  box-shadow: 0 2px 4px rgba(30, 27, 58, .05),
              0 16px 26px -16px rgba(83, 88, 172, .32) !important;
}
#view-errorbook .err-char-card.selected-err {
  border-color: #5358AC !important;
  background: #F4F2FE !important;
  box-shadow: 0 0 0 3px rgba(83, 88, 172, .12) !important;
}

#view-errorbook .err-char-card .py {
  font-family: var(--f-ui);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: var(--ink-2);
}
#view-errorbook .err-char-card .hz.kaiti {
  font-size: 44px;
  line-height: 1.06;
  color: #2E2952 !important;
  margin: 2px 0 9px;
}
/* 「写字表」每张卡都一样，占一行小字不值当 */
#view-errorbook .err-char-card .src { display: none !important; }

/* 底部一行：状态胶囊 + 6 段阶段点 */
#view-errorbook .eb-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
#view-errorbook .err-char-card .st-pill,
#view-errorbook .err-char-card .st-pill.due {
  font-family: var(--f-ui);
  font-size: 10.5px !important;
  font-weight: 700 !important;
  letter-spacing: .02em;
  padding: 3px 8px !important;
  border-radius: 999px !important;
  background: #EFEDFB !important;
  color: #4F47A8 !important;
  border: 0 !important;
}
/* 圆点太小看不清，改 6 段小胶囊，一眼能数出在第几阶段 */
#view-errorbook .eb-dots { display: inline-flex; gap: 2px; }
#view-errorbook .eb-dots i {
  width: 6px; height: 3.5px;
  border-radius: 2px;
  background: #E4E0F2;
}
#view-errorbook .eb-dots i.on { background: #7C74D8; }

/* ---- 2. 网格：flex 居中，末行不再左边缺一格 ---- */
#err-cards-container {
  display: flex !important;
  flex-wrap: wrap;
  justify-content: center;
  align-content: flex-start;
  gap: 12px !important;
}
.err-char-card { flex: 0 0 calc((100% - 48px) / 5); max-width: 232px; }
@media (min-width: 641px) and (max-width: 1023px) {
  .err-char-card { flex-basis: calc((100% - 36px) / 4); }
}
@media (max-width: 640px) {
  .err-char-card { flex-basis: calc((100% - 12px) / 2); max-width: none; }
}

/* ---- 3. 按钮：3px 纯墨线换成柔光 ---- */
.btn-back.blue-pill,
.err-review-today-btn,
#btn-err-review-today {
  border: 0 !important;
  box-shadow: 0 8px 18px -10px rgba(83, 88, 172, .55),
              inset 0 1px 0 rgba(255, 255, 255, .18) !important;
}
/* 导出备份是次要操作：白底 + 细边，不再抢「开始复习」的主角位 */
.btn-demo-orange {
  border: 1px solid #E4E0F2 !important;
  background: #FFFFFF !important;
  color: #4A44A0 !important;
  box-shadow: 0 1px 2px rgba(30, 27, 58, .05),
              0 8px 18px -14px rgba(30, 27, 58, .30) !important;
}
.btn-demo-orange:hover {
  background: #FBFAFF !important;
  border-color: #C9C2EE !important;
}

/* ---- 4. 警示条：从 2.5px 黑框改成一整块淡米色 ---- */
.err-warn-banner {
  background: #FFFBF0 !important;
  border: 1px solid #F1E5C6 !important;
  color: #6B5A2E !important;
  border-radius: 14px !important;
  padding: 11px 14px !important;
  font-size: 12.5px !important;
  line-height: 1.65 !important;
}
.err-warn-banner b { color: #54441C; font-weight: 800; }
.err-warn-banner svg { color: #B98C1B; }

/* ---- 5. 筛选与搜索：统一细边 ---- */
.err-f-tab {
  border: 1px solid #E7E4F2 !important;
  font-family: var(--f-ui);
  font-weight: 600 !important;
  font-size: 12.5px !important;
}
.err-f-tab.active {
  border-color: transparent !important;
  box-shadow: 0 6px 14px -8px rgba(83, 88, 172, .6) !important;
}
.err-search-input {
  border: 1px solid #E7E4F2 !important;
  font-family: var(--f-ui);
}

/* ---- 6. 空态虚线框收轻 ---- */
#view-errorbook .err-empty {
  border: 1.5px dashed #DCD7EF !important;
  background: rgba(255, 255, 255, .62) !important;
}

/* 复习本顶栏：左 1 个按钮、右 2 个按钮，page-title-wrap 虽 flex:1 但居中点被两侧不等宽挤偏。
   绝对定位让标题真正落在可视中线，左右才对称。 */
@media (min-width: 761px) {
  #view-errorbook .top-nav { position: relative; }
  #view-errorbook .page-title-wrap {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    flex: 0 0 auto;
    width: max-content;
    max-width: 56%;
  }
}

/* ============================================================
   v15 纸墨 —— 对齐品牌站 huer.yeyiai.cn 的视觉语言
   参考站实测：背景 rgb(250,248,245)、标题粗黑深墨、金色小标签、
   紫色只出现在按钮上、卡片纯白柔影、大量留白。
   此前 14 轮在紫色系里调阴影，方向本身就不对，这一轮换底色与字体。

   注意：--f-disp 仍是楷体，因为 .kaiti 与它共用一个变量，
   汉字教学内容（字卡、米字格、笔顺）必须是楷体，不能改成黑体。
   UI 标题改用新增的 --f-ui-disp。
   ============================================================ */

:root {
  /* 暖纸与暖墨：从冷紫灰系整体转向暖色系 */
  --paper: #FAF8F5;
  --paper-2: #FFFFFF;
  --ink: #1C1B1A;
  --ink-soft: #6E6862;
  --ink-2: #57534E;
  --gold: #A8832F;
  --line: #ECE6DE;
  --border-warm: #ECE6DE;
  --card-line: #ECE6DE;

  /* 紫色降级为「行动色」：只管按钮、链接、选中态，不做大面积装饰 */
  --brand: #6D4FE0;
  --brand-deep: #5B3FD8;

  /* UI 标题：粗黑体。教学内容仍走 --f-disp（楷体） */
  --f-ui-disp: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei",
               system-ui, -apple-system, "Segoe UI", sans-serif;

  /* 阴影统一成暖棕，不再是紫灰 */
  --hard: 0 10px 24px -16px rgba(74, 60, 45, .28);
  --hard-sm: 0 4px 12px -8px rgba(74, 60, 45, .22);
}

/* ---------- 1. 背景：去掉紫黄 mesh 与网点，回到暖纸 ---------- */
body {
  background-color: #FAF8F5 !important;
  background-image:
    radial-gradient(1000px 520px at 100% -10%, rgba(168, 131, 47, .055) 0%, rgba(168, 131, 47, 0) 60%),
    radial-gradient(900px 480px at -8% 100%, rgba(109, 79, 224, .04) 0%, rgba(109, 79, 224, 0) 58%) !important;
  background-size: auto, auto !important;
  background-attachment: fixed !important;
  color: var(--ink);
}
.huer-sidebar {
  background-color: #FBF9F6 !important;
  background-image: none !important;
  border-right: 1px solid var(--line) !important;
}

/* ---------- 2. UI 标题：楷体 -> 粗黑（教学内容不受影响） ---------- */
.brand-title, .sidebar-title, .side-nav-name, .sg-head,
.hero-title, .entry-title, .sms-title, .page-title,
.ht-title, .ht-name, .hq-name, .he-title, .grade-name,
.lesson-title, .modal-box h2, .modal-box h3, .section-title,
.mg-title, .mg-sec-t, .card-title, .panel-title {
  font-family: var(--f-ui-disp) !important;
  font-weight: 800 !important;
  letter-spacing: .01em !important;
}
/* 标题用近黑的暖墨色，楷体时代的紫黑一并去掉 */
.page-title, .hero-title, .entry-title, .he-title,
.ht-title, .section-title, .mg-title {
  color: #1C1B1A !important;
}
/* 页面主标题加大一档，向参考站的大标题靠 */
@media (min-width: 761px) {
  .page-title { font-size: 26px !important; letter-spacing: -.01em !important; }
}

/* ---------- 3. 首页主卡：紫色渐变大横幅 -> 白卡 + 紫色行动钮 ----------
   参考站里紫色只出现在「预约评估」这种按钮上，从不铺满一整块。
   原来那一大块紫色渐变是页面最抢眼的元素，但它不是内容，只是入口。 */
.home-start {
  background: #FFFFFF !important;
  background-image: none !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 1px 2px rgba(74, 60, 45, .04),
              0 14px 28px -22px rgba(74, 60, 45, .35) !important;
}
.home-start .hs-main,
.home-start .hs-title,
.home-start .hero-title {
  color: #1C1B1A !important;
  -webkit-text-fill-color: #1C1B1A !important;
  text-shadow: none !important;
}
.home-start .hs-sub,
.home-start .hs-desc,
.home-start .hero-sub {
  color: var(--ink-soft) !important;
  -webkit-text-fill-color: var(--ink-soft) !important;
  text-shadow: none !important;
}
/* 播放钮保留紫色：这是全页唯一的行动点，紫色用在这里才对 */
.home-start .hs-play {
  background: linear-gradient(150deg, #7B5BEA 0%, #5B3FD8 100%) !important;
  color: #FFFFFF !important;
  border: 0 !important;
  box-shadow: 0 8px 18px -10px rgba(109, 79, 224, .65) !important;
}
.home-start:hover {
  background: #FFFFFF !important;
  border-color: #DCD2F2 !important;
  transform: translateY(-2px) !important;
}
/* 进度小胶囊从黄底改成暖灰，不再和紫色标题抢 */
.home-start .hs-prog,
.home-start .hs-badge {
  background: #F4F0E9 !important;
  color: #6E6862 !important;
  border: 0 !important;
}

/* ---------- 4. 图标：6 种彩色方块 -> 统一暖灰 ---------- */
.hq-grid > .hq-item .hq-ico,
.hq-grid > .hq-item:nth-child(n) .hq-ico {
  background: #F3EFE8 !important;
  border: 1px solid #E8E1D7 !important;
  color: #6B6157 !important;
  box-shadow: none !important;
}
.he-icon {
  background: #F3EFE8 !important;
  color: #6B6157 !important;
  border: 1px solid #E8E1D7 !important;
  box-shadow: none !important;
}
.ht-ico {
  background: #F3EFE8 !important;
  color: #6B6157 !important;
}
/* 专项训练那张黄底实卡：和其他卡统一，不再单独跳色 */
.hq-item-accent,
.hq-grid > .hq-item.hq-item-accent {
  background: #FFFFFF !important;
  border: 1px solid var(--line) !important;
  color: var(--ink) !important;
  box-shadow: 0 1px 2px rgba(74, 60, 45, .04),
              0 12px 24px -20px rgba(74, 60, 45, .30) !important;
}
.hq-item-accent .hq-name,
.hq-item-accent .hq-desc { color: inherit !important; }
.hq-item-accent .hq-desc { color: var(--ink-soft) !important; }

/* 侧栏选中态：黄底 -> 淡紫（行动色），和品牌站导航选中一致 */
.side-nav-item.active,
.side-nav-item[aria-current="page"] {
  background: #EFEAFB !important;
  color: #4C3A9E !important;
  border-color: transparent !important;
}
.side-nav-item.active .side-nav-name { color: #4C3A9E !important; }
.side-nav-item.active .side-nav-icon {
  background: #6D4FE0 !important;
  color: #FFFFFF !important;
}

/* ---------- 5. 卡片：统一纯白 + 暖灰细边 + 暖棕柔影 ---------- */
.grade-card, .lesson-card, .hq-item, .home-entry, .entry-card,
.sms-card, .simple-card, .frag-card, .hl-card, .sidebar-growth,
.sidebar-resume, .reward-enter, .home-today, .home-panel {
  background: #FFFFFF !important;
  border-color: var(--line) !important;
  box-shadow: 0 1px 2px rgba(74, 60, 45, .04),
              0 12px 24px -20px rgba(74, 60, 45, .30) !important;
}
.grade-card {
  background: #FFFFFF !important;
  background-image: none !important;
}
.grade-card.preschool { background: #FFFFFF !important; }
.grade-icon {
  background: #F3EFE8 !important;
  color: #6B6157 !important;
  box-shadow: none !important;
}

/* ---------- 6. 彩色残留清尾（v8 的渐变写在 background-image 上，必须单独清） ---------- */
.ht-ico, .he-icon, .home-entry .he-icon, .ht-card .ht-ico {
  background-color: #F3EFE8 !important;
  background-image: none !important;
  color: #6B6157 !important;
  border: 1px solid #E8E1D7 !important;
  box-shadow: none !important;
}
.ht-ico svg, .he-icon svg, .ht-ico .ico-cell, .he-icon .ico-cell {
  color: #6B6157 !important;
  stroke: currentColor !important;
}
/* 今日目标计数：黄底 -> 暖灰 */
.ht-prog {
  background: #F3EFE8 !important;
  color: #6B6157 !important;
  border: 0 !important;
}
/* 播放钮：这才是紫色该待的地方 */
.home-start .hs-icon {
  background: linear-gradient(150deg, #7B5BEA 0%, #5B3FD8 100%) !important;
  color: #FFFFFF !important;
  border: 0 !important;
  box-shadow: 0 8px 18px -10px rgba(109, 79, 224, .6) !important;
}
.home-start .hs-go { color: #9A9188 !important; }

/* ---------- 7. 顶部标签：黄底长条 -> 参考站的金色小标签 ---------- */
.global-topbar {
  background: rgba(250, 248, 245, .82) !important;
  border-bottom: 1px solid var(--line) !important;
  backdrop-filter: blur(8px);
}
.crumb-tag {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--gold) !important;
  font-family: var(--f-ui-disp) !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: .10em !important;
  padding: 4px 0 !important;
  position: relative;
  padding-left: 26px !important;
}
/* 参考站「— 服务 04」左侧那截短横线 */
.crumb-tag::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 18px; height: 1.5px;
  background: var(--gold);
  opacity: .65;
}
/* 顶栏积分胶囊统一白底 */
.reward-enter {
  background: #FFFFFF !important;
  background-image: none !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 1px 2px rgba(74, 60, 45, .05) !important;
}

/* ---------- 8. 用同优先级选择器再压一次（v8 的 .ht-grid>.st-item 优先级更高） ---------- */
.ht-grid > .st-item .ht-ico,
.hq-grid > .hq-item .hq-ico,
.home-entry:nth-child(1) .he-icon,
.home-entry:nth-child(2) .he-icon,
.home-entry .he-icon {
  background: #F3EFE8 !important;
  background-image: none !important;
  color: #6B6157 !important;
  border: 1px solid #E8E1D7 !important;
  box-shadow: none !important;
}
.ht-grid > .st-item .ht-ico .ico-cell,
.hq-grid > .hq-item .hq-ico .ico-cell,
.he-icon .ico-cell {
  filter: none !important;
  color: #6B6157 !important;
}
/* 完成态原来是黄底，改成淡绿，语义更准 */
.st-item.done .ht-ico {
  background: #E9F2EA !important;
  color: #4A7A52 !important;
  border-color: #D8E6DA !important;
}
/* 主卡右上角残留的装饰图与光晕，纸墨版不需要 */
.home-start::before, .home-start::after {
  background-image: none !important;
  opacity: 0 !important;
}
/* 侧栏成长卡的黄色数字与进度条 */
.sidebar-growth .sg-num,
.sidebar-growth .sg-count,
.sidebar-growth b {
  background: transparent !important;
  color: #1C1B1A !important;
}
.sidebar-growth .sg-bar,
.sidebar-growth .sg-track { background: #EFE9E0 !important; }
.sidebar-growth .sg-fill,
.sidebar-growth .sg-bar > i { background: #A8832F !important; }

/* 奖励页：内容限宽后偏左，右侧空一大片，居中 */
#view-rewards .view-inner,
#view-rewards .rewards-wrap,
#view-rewards .rw-wrap { margin-left: auto !important; margin-right: auto !important; }

/* ---------- 9. 标题回到书写体 ----------
   粗黑是品牌官网（To B 机构）的语言；这是孩子用的识字产品，
   暖纸 + 楷体才是同一件事的两半。只换变量，选择器全部不动。 */
:root {
  --f-ui-disp: "KaiTi", "STKaiti", "Kaiti SC", "FangSong", "SimSun", serif;
}
/* 楷体没有真粗字重，800 会触发合成加粗导致笔画发糊，收回到 700 */
.brand-title, .sidebar-title, .side-nav-name, .sg-head,
.hero-title, .entry-title, .sms-title, .page-title,
.ht-title, .ht-name, .hq-name, .he-title, .grade-name,
.lesson-title, .section-title, .mg-title, .mg-sec-t,
.mg-hero-t, .mg-cat-t {
  font-weight: 700 !important;
}
/* 楷体笔画细，标题略放大补足视觉分量 */
.hq-name, .he-title { font-size: 17px !important; }
.page-title { letter-spacing: .02em !important; }

/* ============================================================
   v16 卡片精化：在纸墨底子上加「工艺感」，不加颜色
   手段只有三种：更准的边框、更真的投影、以及汉字书写自己的米字格。
   ============================================================ */

/* ---- 1. 统一卡片皮肤：1px 暖边 + 内侧高光 + 三层暖棕投影 ----
   单层投影会让卡片像浮在半空；接触影 + 环境影 + 远影叠起来才像放在纸面上。 */
.grade-card, .lesson-card, .hq-item, .home-entry, .entry-card,
.sms-card, .simple-card, .frag-card, .hl-card,
.sidebar-growth, .sidebar-resume, .home-start, .reward-enter,
#view-errorbook .err-char-card {
  border: 1px solid #EBE4DA !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 1px 1px rgba(74, 60, 45, .03),
    0 2px 4px rgba(74, 60, 45, .035),
    0 14px 26px -20px rgba(74, 60, 45, .42) !important;
}
/* 悬停：只抬 2px、边转暖金，不变色不放大，避免整片跳动 */
.grade-card:hover, .lesson-card:hover, .hq-item:hover,
.home-entry:hover, .entry-card:hover, .sms-card:hover,
#view-errorbook .err-char-card:hover {
  transform: translateY(-2px) !important;
  border-color: #DCC9A6 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 1px 2px rgba(74, 60, 45, .04),
    0 4px 8px rgba(74, 60, 45, .05),
    0 20px 32px -20px rgba(74, 60, 45, .46) !important;
}

/* ---- 2. 图标：同一暖灰里做出一点厚度 ---- */
.hq-grid > .hq-item .hq-ico, .ht-grid > .st-item .ht-ico,
.home-entry .he-icon, .grade-icon, .mg-card .mg-ico, .mg-ico {
  background: linear-gradient(165deg, #F7F3EC 0%, #EFE8DD 100%) !important;
  border: 1px solid #E5DCCC !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .9),
    inset 0 -1px 0 rgba(74, 60, 45, .05),
    0 1px 2px rgba(74, 60, 45, .05) !important;
}

/* ---- 3. 主卡顶部一道极细的金色高光：唯一的装饰，且只给主卡 ---- */
.home-start { position: relative; overflow: hidden; }
.home-start::after {
  content: "" !important;
  display: block !important;
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 2px;
  opacity: 1 !important;
  background: linear-gradient(90deg,
    rgba(168, 131, 47, 0) 0%,
    rgba(168, 131, 47, .40) 28%,
    rgba(168, 131, 47, .40) 62%,
    rgba(168, 131, 47, 0) 100%) !important;
}

/* ---- 4. 复习本字卡：极淡米字格底纹 ----
   米字格是汉字书写自己的语言，不是外加的装饰。
   用线性渐变画，透明度压到 5%，只在你盯着字看时才察觉。 */
#view-errorbook .err-char-card { position: relative; overflow: hidden; }
#view-errorbook .err-char-card::before {
  content: "";
  position: absolute;
  left: 50%; top: 46%;
  width: 74px; height: 74px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: .5;
  background-image:
    linear-gradient(to right, rgba(168, 131, 47, .16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(168, 131, 47, .16) 1px, transparent 1px),
    linear-gradient(to right, rgba(168, 131, 47, .10) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(168, 131, 47, .10) 1px, transparent 1px);
  background-size: 74px 74px, 74px 74px, 37px 37px, 37px 37px;
  background-position: 0 0, 0 0, 0 0, 0 0;
  border: 1px solid rgba(168, 131, 47, .18);
  border-radius: 4px;
}
#view-errorbook .err-char-card > * { position: relative; z-index: 1; }

/* ============================================================
   v16b 生图素材接线（图不存在时自动回退到纯色/无图，不会留白洞）
   ============================================================ */

/* ---- 1. 纸质背景：AI 纸肌理优先，回退到暖纸渐变 ---- */
body {
  background-color: #FAF8F5 !important;
  background-image: var(--gen-bg-paper,
    radial-gradient(1000px 520px at 100% -10%, rgba(168, 131, 47, .055) 0%, rgba(168, 131, 47, 0) 60%)) !important;
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}
@media (max-width: 640px) {
  body {
    background-image: var(--gen-bg-paper-m,
      radial-gradient(700px 420px at 90% -6%, rgba(168, 131, 47, .06) 0%, rgba(168, 131, 47, 0) 60%)) !important;
    background-size: 100% 100% !important;
  }
}

/* ---- 2. 首页主卡右侧：书写主题插图 ---- */
.home-start::before {
  content: "" !important;
  display: block !important;
  position: absolute;
  right: 54px; top: 50%;
  width: 108px; height: 108px;
  transform: translateY(-50%);
  opacity: 1 !important;
  background: var(--gen-art-write, none) center / contain no-repeat !important;
  pointer-events: none;
}
/* 手机：插图缩小靠右，绝不挤压标题 */
@media (max-width: 640px) {
  .home-start::before { width: 68px; height: 68px; right: 34px; opacity: .92 !important; }
  .home-start .hs-body { padding-right: 76px; }
}

/* ---- 3. 空态插图换成暖陶版 ---- */
.err-empty .ee-art, .bubble-empty .be-art {
  background: var(--gen-art-box, var(--gen-art-empty, none)) center / contain no-repeat !important;
}

/* 手机主卡：插图垂直居中会挤压副标题导致折行，改挂右上角，文字区完整让出 */
@media (max-width: 640px) {
  .home-start::before {
    width: 54px; height: 54px;
    right: 14px; top: 18px;
    transform: none;
    opacity: .95 !important;
  }
  .home-start .hs-body { padding-right: 0 !important; }
}

/* ============================================================
   v17 暖紫：基调贴 logo #5058A8，往暖紫微调
   保留 v16 全部工艺（三层影、内高光、米字格、楷体、暖陶插图），只换底色与边色。
   关键克制：紫要淡到近乎白、暖到不发蓝，否则就退回 v8 的冷紫渐变。
   ============================================================ */
:root {
  --paper: #F5F3FA;
  --ink: #232030;
  --ink-soft: #6B6478;
  --ink-2: #554E66;
  --brand: #5A54A6;          /* logo #5058A8 略加红，暖一度 */
  --brand-deep: #4B4594;
  --line: #E7E2F0;
  --border-warm: #E7E2F0;
  --card-line: #E7E2F0;
  --gold: #A8832F;           /* 呼应 logo 上那颗黄星 */
}

/* 背景：AI 淡紫纸纹优先，回退淡紫柔光 */
body {
  background-color: #F5F3FA !important;
  background-image: var(--gen-bg-lilac,
    radial-gradient(1000px 540px at 100% -10%, rgba(90, 84, 166, .07) 0%, rgba(90, 84, 166, 0) 60%)) !important;
  background-size: cover !important;
  background-position: center top !important;
  background-attachment: fixed !important;
}
@media (max-width: 640px) {
  body {
    background-image: var(--gen-bg-lilac-m,
      radial-gradient(700px 420px at 90% -6%, rgba(90, 84, 166, .08) 0%, rgba(90, 84, 166, 0) 60%)) !important;
    background-size: 100% 100% !important;
  }
}

.huer-sidebar {
  background-color: #F8F6FC !important;
  border-right: 1px solid var(--line) !important;
}
.global-topbar { background: rgba(245, 243, 250, .82) !important; }

/* 卡片：白底偏一丝紫，边与影都转暖紫 */
.grade-card, .lesson-card, .hq-item, .home-entry, .entry-card,
.sms-card, .simple-card, .frag-card, .hl-card,
.sidebar-growth, .sidebar-resume, .home-start, .reward-enter,
#view-errorbook .err-char-card {
  background: #FEFDFF !important;
  border: 1px solid #E7E2F0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 1px 1px rgba(58, 48, 86, .03),
    0 2px 4px rgba(58, 48, 86, .035),
    0 14px 26px -20px rgba(58, 48, 86, .40) !important;
}
.grade-card:hover, .lesson-card:hover, .hq-item:hover,
.home-entry:hover, .entry-card:hover, .sms-card:hover,
#view-errorbook .err-char-card:hover {
  border-color: #C6BBE2 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .95),
    0 1px 2px rgba(58, 48, 86, .04),
    0 4px 8px rgba(58, 48, 86, .05),
    0 20px 32px -20px rgba(58, 48, 86, .44) !important;
}

/* 图标底：淡紫灰，与底色同族 */
.hq-grid > .hq-item .hq-ico, .ht-grid > .st-item .ht-ico,
.home-entry .he-icon, .grade-icon, .mg-card .mg-ico, .mg-ico,
.ht-ico, .he-icon {
  background: linear-gradient(165deg, #F5F2FB 0%, #EDE8F6 100%) !important;
  border: 1px solid #E2DBEF !important;
  color: #6A6390 !important;
}
.ht-prog, .home-start .hs-badge { background: #F1EDF8 !important; color: #6B6478 !important; }

/* 选中态与行动钮统一到 logo 紫 */
.side-nav-item.active, .side-nav-item[aria-current="page"] { background: #ECE8F8 !important; }
.side-nav-item.active .side-nav-icon { background: #5A54A6 !important; }
.home-start .hs-icon {
  background: linear-gradient(150deg, #6B63BC 0%, #4B4594 100%) !important;
  box-shadow: 0 8px 18px -10px rgba(90, 84, 166, .6) !important;
}

/* v17b 图标底色修正：v15 的 :nth-child(n) 优先级 (0,4,0) 高于普通类组合，
   必须用同样的选择器形式才压得回去。 */
.hq-grid > .hq-item:nth-child(n) .hq-ico,
.home-entry:nth-child(n) .he-icon,
.ht-grid > .st-item:nth-child(n) .ht-ico {
  background: linear-gradient(165deg, #F5F2FB 0%, #EDE8F6 100%) !important;
  background-image: linear-gradient(165deg, #F5F2FB 0%, #EDE8F6 100%) !important;
  background-color: #F1EDF8 !important;
  border: 1px solid #E2DBEF !important;
  color: #6A6390 !important;
}

/* 主卡是全页唯一视觉焦点：比其它卡多一层极淡的紫白渐变与紫色边光，
   成熟产品里 hero 卡本就该和普通卡拉开半档，但不能再回到整块浓紫。 */
.home-start {
  background: linear-gradient(135deg, #FFFFFF 0%, #FAF8FE 58%, #F4F0FC 100%) !important;
  border: 1px solid #E2DAF0 !important;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .98),
    0 1px 2px rgba(58, 48, 86, .04),
    0 18px 34px -22px rgba(90, 84, 166, .48) !important;
}
.home-start:hover {
  background: linear-gradient(135deg, #FFFFFF 0%, #FBF9FE 58%, #F6F2FD 100%) !important;
  border-color: #C9BCE6 !important;
}

/* =========================================================================
   v18 · 顶栏与今日目标再放大一档（客户：上面一排大一点）
   1) 顶栏面包屑 11.5 → 13.5px，品牌标记 15 → 20px，左侧短横线加长到 21px；
   2) 今日目标三张卡：标题 15 → 16.5px，徽章 40 → 44px，内边距各 +2；
   3) 侧栏品牌副标题改为「汉字读写科学训练」后只剩 8 字，字号 10.5 → 11.5，短句不空。
   全部限定 ≥431px：手机窄屏顶栏只留图标方块（crumb-text 已隐藏），
   在那里放大字号会把 32px 方块撑破。
   ========================================================================= */
@media (min-width: 431px) {
  .global-topbar {
    padding: 13px 20px !important;
    gap: 14px !important;
    margin-bottom: 22px !important;
  }
  .crumb-tag {
    font-size: 13.5px !important;
    letter-spacing: .07em !important;
    padding-left: 30px !important;
    gap: 9px !important;
  }
  .crumb-tag::before { width: 21px; height: 1.6px; }
  .crumb-mark { width: 20px; height: 20px; flex: 0 0 20px; }

  .ht-card {
    padding: 13px 14px !important;
    gap: 12px !important;
  }
  .ht-ico {
    width: 44px !important;
    height: 44px !important;
    border-radius: 13px !important;
  }
  .ht-ico .ico-cell { width: 22px !important; height: 22px !important; }
  .ht-name { font-size: 16.5px !important; }
  .ht-st { font-size: 12px !important; }
}

.brand-sub {
  font-size: 11.5px !important;
  letter-spacing: .02em !important;
}

/* =========================================================================
   v18b · 默写格改米字格（客户：默写模式的写字格改成米字格？）
   描红区本来就是米字格（SVG 里 4 条线），默写区之前只有中心十字。
   这里补齐两条对角线，让两个子模式是同一张纸：十字实一点用于定位，
   斜线淡一档，符合米字格「十字重、斜线轻」的书写习惯。
   ========================================================================= */
#write-free-panel .mizige-box {
  background-image:
    linear-gradient(to right, transparent calc(50% - .75px), #E7E0D1 calc(50% - .75px), #E7E0D1 calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(to bottom, transparent calc(50% - .75px), #E7E0D1 calc(50% - .75px), #E7E0D1 calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(45deg, transparent calc(50% - .75px), #EBE5D7 calc(50% - .75px), #EBE5D7 calc(50% + .75px), transparent calc(50% + .75px)),
    linear-gradient(135deg, transparent calc(50% - .75px), #EBE5D7 calc(50% - .75px), #EBE5D7 calc(50% + .75px), transparent calc(50% + .75px));
  background-size: 100% 100%;
  background-position: 0 0;
  background-repeat: no-repeat;
}

/* v18 · 默写「检查」现在会真的判一遍，提示要能一眼分清三种结果 */
.write-check-msg.ok { color: #0E8F63 !important; font-weight: 800 !important; }
.write-check-msg.bad { color: #C7402F !important; font-weight: 800 !important; }
.write-check-msg.warn { color: #9A7524 !important; font-weight: 800 !important; }

/* =========================================================================
   v19 · 珠光暖紫：更亮、更细腻，立体感来自材质与光影而非厚重色块
   保留书写体、信息层级、布局与全部业务交互；撤掉风格不统一的手绘装饰。
   ========================================================================= */
:root {
  --paper: #FAF8FC;
  --ink: #262231;
  --ink-soft: #6D6579;
  --ink-2: #514A60;
  --brand: #5953A3;
  --brand-deep: #49428C;
  --line: #E8E2EF;
  --border-warm: #E8E2EF;
  --card-line: #E8E2EF;
  --gold: #A17E35;
  --v19-card: linear-gradient(145deg, #FFFFFF 0%, #FFFFFF 64%, #FCFAFE 100%);
  --v19-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .98),
    0 1px 2px rgba(54, 43, 78, .035),
    0 10px 24px -18px rgba(69, 57, 105, .28),
    0 24px 48px -36px rgba(69, 57, 105, .24);
  --v19-shadow-hover:
    inset 0 1px 0 rgba(255, 255, 255, 1),
    0 2px 3px rgba(54, 43, 78, .04),
    0 16px 30px -18px rgba(75, 61, 117, .32),
    0 30px 54px -36px rgba(75, 61, 117, .24);
}

/* 背景图之上再罩一层极薄珠光，保证任何生图结果都不会影响文字对比度。 */
body {
  background-color: #FAF8FC !important;
  background-image:
    linear-gradient(115deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, .04)),
    var(--gen-bg-lilac-premium,
      radial-gradient(1000px 620px at 96% -8%, rgba(119, 99, 176, .09), transparent 62%)),
    radial-gradient(760px 520px at -8% 102%, rgba(226, 202, 164, .07), transparent 66%) !important;
  background-size: cover, cover, auto !important;
  background-position: center top, center top, left bottom !important;
  background-repeat: no-repeat !important;
  background-attachment: fixed !important;
}
@media (max-width: 640px) {
  body {
    background-image:
      linear-gradient(150deg, rgba(255, 255, 255, .20), rgba(255, 255, 255, .03)),
      var(--gen-bg-lilac-premium-m, var(--gen-bg-lilac-premium,
        radial-gradient(700px 500px at 96% -4%, rgba(119, 99, 176, .09), transparent 64%))) !important;
    background-size: 100% 100% !important;
    background-position: center top !important;
  }
}

/* 侧栏与顶栏：珍珠白玻璃，不做浓重紫色大面积铺底。 */
.huer-sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, .92), rgba(250, 248, 253, .94)) !important;
  border-right: 1px solid rgba(224, 216, 235, .86) !important;
  box-shadow: 8px 0 32px -28px rgba(68, 54, 99, .34) !important;
}
.global-topbar {
  background: rgba(255, 255, 255, .72) !important;
  border-bottom-color: rgba(228, 221, 237, .82) !important;
  -webkit-backdrop-filter: blur(18px) saturate(1.08);
  backdrop-filter: blur(18px) saturate(1.08);
}
.crumb-tag { color: #8E7038 !important; }

/* 卡片：顶缘高光 + 近处接触影 + 远处环境影，浮起但不笨重。 */
.home-today, .home-quick, .ht-card, .mode-card,
.grade-card, .lesson-card, .hq-item, .home-entry, .entry-card,
.sms-card, .simple-card, .frag-card, .hl-card,
.sidebar-growth, .sidebar-resume, .home-start, .reward-enter,
#view-errorbook .err-char-card {
  background: var(--v19-card) !important;
  border: 1px solid rgba(228, 221, 237, .94) !important;
  box-shadow: var(--v19-shadow) !important;
}
.grade-card:hover, .lesson-card:hover, .hq-item:hover,
.home-entry:hover, .entry-card:hover, .sms-card:hover,
#view-errorbook .err-char-card:hover {
  border-color: #CFC4E2 !important;
  box-shadow: var(--v19-shadow-hover) !important;
}

/* 主卡只比其它卡多半档品牌紫；移除旧宝箱、书堆和金色顶线。 */
.home-start {
  background: linear-gradient(128deg, #FFFFFF 0%, #FDFBFF 56%, #F6F2FB 100%) !important;
  border-color: #DED5EB !important;
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    0 2px 3px rgba(60, 47, 91, .035),
    0 18px 38px -24px rgba(83, 68, 125, .34) !important;
}
.home-start::before, .home-start::after, .frag-top::after {
  content: none !important;
  display: none !important;
  background: none !important;
}
.home-start .hs-body { padding-right: 0 !important; }
.home-start .hs-icon {
  background: linear-gradient(145deg, #766DBD 0%, #554D9D 58%, #474083 100%) !important;
  border: 1px solid rgba(255, 255, 255, .44) !important;
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, .34),
    inset 0 -2px 3px rgba(44, 35, 93, .18),
    0 9px 18px -9px rgba(75, 64, 139, .68) !important;
}

/* 图标容器：细腻磨砂底与内高光。接入位图后，SVG 会自动退出。 */
.hq-grid > .hq-item:nth-child(n) .hq-ico,
.home-entry:nth-child(n) .he-icon,
.ht-grid > .st-item:nth-child(n) .ht-ico,
.grade-icon {
  background: linear-gradient(145deg, #FFFFFF 0%, #F5F1F9 58%, #EEE8F4 100%) !important;
  border: 1px solid #E2DAEB !important;
  color: #625A91 !important;
  box-shadow:
    inset 0 1px 0 #FFFFFF,
    inset 0 -1px 2px rgba(74, 58, 105, .055),
    0 4px 10px -7px rgba(73, 59, 105, .42) !important;
}
.hq-grid > .hq-item .hq-ico {
  width: 42px; height: 42px;
  margin-bottom: 8px;
  border-radius: 13px;
}
.hq-grid > .hq-item .hq-ico .ico-cell {
  width: 21px; height: 21px;
  filter: drop-shadow(0 1px 0 rgba(255, 255, 255, .9));
}
.home-entry .he-icon { width: 48px; height: 48px; border-radius: 15px; }
.home-entry .he-icon .ico-cell { width: 23px; height: 23px; }
.ht-grid > .st-item .ht-ico { border-radius: 14px; }

/* 选中与完成态仍保持语义清晰，不为了美观牺牲辨识度。 */
.side-nav-item.active, .side-nav-item[aria-current="page"] {
  background: linear-gradient(135deg, #F1EDF9, #EBE5F5) !important;
  border-color: rgba(217, 207, 233, .72) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .72) !important;
}
.side-nav-item.active .side-nav-icon {
  background: linear-gradient(145deg, #6B63B2, #4E478F) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .24), 0 5px 12px -8px #554C96 !important;
}
.st-item.done .ht-ico {
  background: linear-gradient(145deg, #F2FAF4, #E6F1E9) !important;
  color: #487451 !important;
  border-color: #D4E5D8 !important;
}
.ht-prog, .home-start .hs-badge {
  background: #F3EFF7 !important;
  color: #655D72 !important;
}

@media (max-width: 420px) {
  .hq-grid > .hq-item .hq-ico { width: 38px; height: 38px; border-radius: 12px; margin-bottom: 6px; }
  .hq-grid > .hq-item .hq-ico .ico-cell { width: 19px; height: 19px; }
  .home-entry .he-icon { width: 44px; height: 44px; border-radius: 14px; }
}

/* v19b · pplx 立体图标：同一组光照、材质与留白，裁切后按角色复用。 */
.hq-grid > .hq-item:nth-child(1) { --v19-icon: var(--gen-icon-v19-split); }
.hq-grid > .hq-item:nth-child(2) { --v19-icon: var(--gen-icon-v19-spell); }
.hq-grid > .hq-item:nth-child(3) { --v19-icon: var(--gen-icon-v19-stroke); }
.hq-grid > .hq-item:nth-child(4) { --v19-icon: var(--gen-icon-v19-match); }
.hq-grid > .hq-item:nth-child(5) { --v19-icon: var(--gen-icon-v19-review); }
.hq-grid > .hq-item:nth-child(6) { --v19-icon: var(--gen-icon-v19-arcade); }
.home-entry:nth-child(1) { --v19-icon: var(--gen-icon-v19-stroke); }
.home-entry:nth-child(2) { --v19-icon: var(--gen-icon-v19-review); }
.ht-grid > .st-item:nth-child(1) { --v19-icon: var(--gen-icon-v19-split); }
.ht-grid > .st-item:nth-child(2) { --v19-icon: var(--gen-icon-v19-stroke); }
.ht-grid > .st-item:nth-child(3) { --v19-icon: var(--gen-icon-v19-arcade); }

.hq-grid > .hq-item:nth-child(n) .hq-ico,
.home-entry:nth-child(n) .he-icon,
.ht-grid > .st-item:nth-child(n) .ht-ico {
  background-image:
    var(--v19-icon),
    linear-gradient(145deg, #FFFFFF 0%, #F5F1F9 58%, #EEE8F4 100%) !important;
  background-position: center, center !important;
  background-repeat: no-repeat, no-repeat !important;
  background-size: 100% 100%, 100% 100% !important;
}
.hq-grid > .hq-item .hq-ico > svg,
.home-entry .he-icon > svg,
.ht-grid > .st-item .ht-ico > svg { display: none !important; }

/* v19c · 首页顶栏品牌标识：图标与名称一起放大，窄屏不挤压功能控件。 */
@media (min-width: 431px) {
  .crumb-tag {
    padding-left: 36px !important;
    gap: 11px !important;
    font-size: 16.5px !important;
    line-height: 1.35 !important;
    letter-spacing: .055em !important;
  }
  .crumb-tag::before { width: 25px; height: 2px; }
  .crumb-mark { width: 27px; height: 27px; flex-basis: 27px; }
}
@media (min-width: 1024px) {
  .global-topbar { padding-top: 14px !important; padding-bottom: 14px !important; }
}

/* 气泡部件卡：字形在上、名称在下，名称不再压住字形 */
.part-bubble {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; padding: 6px 4px; overflow: hidden;
}
.part-bubble .pb-ch { display: block; line-height: 1; max-width: 100%; }
.part-bubble .pb-say {
  position: static; inset: auto; display: inline-flex; align-items: center; justify-content: center;
  max-width: 100%; white-space: nowrap; font-size: 11px; line-height: 1.15;
  padding: 1px 4px; border-radius: 5px;
}
@media (max-width: 760px) {
  .bg-body { gap: 8px; justify-content: center; }
  .part-bubble { width: calc(50% - 4px); height: 80px; }
  .part-bubble .pb-say { font-size: 12px; }
}

/* 完成态优先级高于 v19 卡片底：今日看板完成卡必须回到姜黄浅底 */
.ht-card.done { background: #FFF6C9 !important; }

/* =========================================================================
   平板专注模式：写字 / 游戏视图默认收起左侧导览栏，顶栏按钮可随时唤回
   ========================================================================= */
.sidebar-toggle {
  display: none;
  width: 34px; height: 34px; flex: 0 0 34px;
  align-items: center; justify-content: center;
  border: 1.5px solid #DBD9E6; border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer;
  box-shadow: 0 2px 0 #E7E3F4;
}
.sidebar-toggle svg { width: 18px; height: 18px; display: block; }
.sidebar-toggle:active { transform: translateY(1px); box-shadow: none; }
@media (min-width: 761px) {
  .sidebar-toggle { display: inline-flex; }
}
body.sidebar-collapsed .huer-sidebar { display: none !important; }
body.sidebar-collapsed .huer-main { max-width: 1320px; }

/* 平板/桌面：写字页三个操作按钮保持一行，不再把「检查」挤到第二行 */
@media (min-width: 761px) {
  .write-bottom-actions { flex-wrap: nowrap; }
  .write-bottom-actions .btn-write-act {
    min-width: 0; flex: 1 1 0; padding-left: 12px; padding-right: 12px;
  }
}

/* 平板竖屏（641–1023）底栏居中：全局 hover 规则会写 transform:none !important，
   把 left:50% 的底栏推到右半屏。这里不再限定 hover，鼠标设备也恢复居中。 */
@media (min-width: 641px) and (max-width: 1023px) {
  .mobile-bottom-nav { transform: translateX(-50%) !important; }
}

/* ---------- 审核修复：家长记录入口 ---------- */
.voice-btn.parent-log-btn {
  width: auto;
  min-width: 56px;
  padding: 0 10px;
  font-size: 12px;
  white-space: nowrap;
}
/* 首页页内的家长入口只在手机出现，桌面/平板仍用顶栏那颗按钮 */
.home-parent-foot { display: none; }

/* ---------- 审核修复：刘海屏顶部安全区 ---------- */
@media (max-width: 1023px) {
  .huer-main { padding-top: calc(14px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 640px) {
  .huer-main { padding-top: calc(12px + env(safe-area-inset-top, 0px)); }
}

/* ---------- 审核修复：390px 常见触控目标 ≥40px，不影响桌面 ---------- */
@media (max-width: 640px) {
  .btn-back,
  .sys-btn,
  .err-f-tab,
  .w-tab-btn,
  .stat-pill.clickable,
  .btn-write-act,
  .mg-diff-btn,
  .err-review-today-btn,
  .btn-demo-orange,
  .nav-circle-btn {
    min-height: 40px;
  }
  .voice-btn {
    width: 40px;
    min-width: 40px;
    height: 40px;
  }
  .voice-btn.parent-log-btn {
    width: auto;
    min-width: 56px;
    height: 40px;
    padding: 0 10px;
    font-size: 11px;
    opacity: .8;
  }
  /* 家长记录是家长侧入口：手机端浮钮会压住气泡/画布/卡片，窄屏改为首页页内一栏 */
  .voice-btn.parent-log-btn { display: none !important; }
  .home-parent-foot {
    display: flex; align-items: center; justify-content: center;
    width: 100%; min-height: 48px; margin-top: 14px;
    border: 1.5px dashed rgba(86, 92, 164, .42); border-radius: 14px;
    background: rgba(255, 255, 255, .72);
    color: #565CA4; font-family: var(--f-body); font-size: 12.5px; font-weight: 800;
    letter-spacing: .01em; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .home-parent-foot:active { background: #F1EFFB; }
  .m-nav-btn { min-height: 40px; }
}

/* ---------- 审核修复：平板（641–1023）顶栏触控目标 ≥40px ---------- */
@media (min-width: 641px) and (max-width: 1023px) {
  .sidebar-toggle { width: 40px; height: 40px; flex: 0 0 40px; }
  .sidebar-toggle svg { width: 20px; height: 20px; }
  .voice-btn { min-width: 40px; height: 40px; font-size: 13px; }
  .voice-btn.voice-rate { min-width: 48px; }
  .voice-btn.parent-log-btn { width: auto; min-width: 64px; height: 40px; padding: 0 12px; font-size: 12px; }
  .reward-enter { min-height: 40px; }
}

/* ---------- 审核修复：触屏设备顶栏按钮 ≥40px（含 1024 横屏平板） ---------- */
@media (hover:none) and (pointer:coarse) {
  .sidebar-toggle { width: 40px; height: 40px; flex: 0 0 40px; }
  .sidebar-toggle svg { width: 20px; height: 20px; }
  .voice-btn { min-width: 40px; height: 40px; }
  .voice-btn.voice-rate { min-width: 48px; }
  .voice-btn.parent-log-btn { width: auto; min-width: 64px; height: 40px; padding: 0 12px; font-size: 12px; }
  .reward-enter { min-height: 40px; }
  .mg-diff-btn { min-height: 40px; }
}

/* ---------- 弹窗：手机端收紧内边距，把高度让给内容 ---------- */
@media (max-width: 760px) {
  .modal-mask { padding: 12px; }
  .modal-box {
    padding: 22px 16px;
    border-radius: 20px;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
  }
  .modal-box h2 { font-size: 19px; }
  .modal-box h3 { font-size: 16px; }
  /* 弹窗内部若自带横向排布的按钮组，窄屏改成整行，避免挤成两字一行 */
  .modal-box .modal-actions { flex-wrap: wrap; }
}

/* ---------- iOS 细节：刘海屏底部留白 + 去掉双击缩放延迟 ---------- */
@media (max-width: 1023px) {
  /* 底栏是 fixed，且 bottom 已经带上 safe-area；内容区 padding 也要跟着加，
     否则 iPhone 上最后一屏内容会被 home indicator 那 34px 压住。
     写字视图刻意 padding-bottom:0（要撑满一屏），embed 模式没有底栏，两者都排除。 */
  body:not(.embed-mode):not([data-view="view-mode-write"]) .huer-main {
    padding-bottom: calc(104px + env(safe-area-inset-bottom, 0px));
  }
}
html, body {
  /* 连续点字/连击时不要触发双击放大，同时保留滚动与双指缩放 */
  touch-action: manipulation;
}


/* ---------- 旧内核（iOS < 14 / 不支持 WebP）降级 ----------
   插画已外置为 .webp 文件，无法解码时这里把对应自定义属性重置为
   initial（等价于未定义），让各处的 var(--gen-*, fallback) 回退到
   设计稿原有的渐变/底色兜底，不额外下载任何 PNG。 */
.no-webp {
  --gen-art-box: initial;
  --gen-art-done: initial;
  --gen-art-empty: initial;
  --gen-art-hero: initial;
  --gen-art-play: initial;
  --gen-bg-app: initial;
  --gen-bg-app-m: initial;
  --gen-bg-hero: initial;
  --gen-bg-lilac-premium: initial;
  --gen-bg-lilac-premium-m: initial;
  --gen-bg-paper: initial;
  --gen-bg-paper-m: initial;
  --gen-icon-v19-arcade: initial;
  --gen-icon-v19-match: initial;
  --gen-icon-v19-review: initial;
  --gen-icon-v19-spell: initial;
  --gen-icon-v19-split: initial;
  --gen-icon-v19-stroke: initial;
}
