/* ============================================================
   📚 智能作业打卡助手 — 薄荷绿主题
   设计原则：极简 · 卡片化 · 呼吸感留白 · 单色主调+一个强调色
   ============================================================ */

:root {
  /* ============ v4 清新柔和设计令牌（方向 B：小猿口算式） ============
     原则：极浅薄荷底 + 柔和大圆角 + 大留白 + 学科彩色点缀 + 情感化吉祥物 */
  --mint: #2dd4a0;          /* 主色：薄荷绿 */
  --mint-deep: #10b981;
  --mint-soft: #d1fae5;
  --mint-pale: #ecfdf5;
  --peach: #ffb48a;         /* 蜜桃色：次强调（温暖鼓励） */
  --peach-soft: #ffedd5;
  --orange: #ff9f43;        /* 行动/拍照按钮 */
  --orange-soft: #ffedd5;
  --star: #ffc94d;          /* 奖励星星黄 */
  --star-soft: #fef3c7;
  --bg: #f6faf8;            /* 极浅薄荷白底（非冷灰） */
  --card: #ffffff;
  --text: #1f2937;
  --text-sub: #6b7280;
  --text-faint: #9ca3af;
  --red: #ff6b6b;           /* 柔和红：错误但不吓孩子 */
  --red-soft: #fee2e2;
  --yellow: #fbbf24;
  --yellow-soft: #fef3c7;
  --border: #e9f0ed;
  --radius: 20px;           /* 卡片大圆角：柔和感 */
  --radius-lg: 24px;        /* hero 卡 / 弹窗 */
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow: 0 2px 12px rgba(16, 185, 129, 0.08);
  --shadow-card: 0 2px 8px rgba(149, 157, 165, 0.08), 0 6px 20px rgba(149, 157, 165, 0.06);
  --shadow-soft: 0 1px 4px rgba(0, 0, 0, 0.05);
  --shadow-float: 0 8px 24px rgba(16, 185, 129, 0.28);  /* 主操作浮起 */
  --nav-h: 64px;
  --fab-size: 56px;
  /* 间距体系（v4 放宽呼吸感） */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 18px; --sp-5: 22px; --sp-6: 28px;
  /* 字号体系 */
  --fs-xs: 11px; --fs-sm: 13px; --fs-md: 15px; --fs-lg: 17px; --fs-xl: 21px; --fs-2xl: 28px;
  /* 动效体系 */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 0.15s;
  --dur-mid: 0.28s;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { height: 100%; }
html, body {
  /* body 必须是 min-height 而不是 height:100%：后者把 body 的盒子钉死成一个屏幕高，
     而做题页/古诗页那层暖色渐变挂在 body 上 —— 平板（>480px，两侧各有一列空白）往下滑，
     渐变随 body 一起在一屏处截断，露出来的就是 html 的近白底。手机视口不到 480px 看不出来。 */
  min-height: 100%;
  /* v4：优先国产手机系统字体（MiSans/HarmonyOS Sans），数字用等宽数位对齐 */
  font-family: "MiSans", "HarmonyOS Sans SC", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior: none;
}

.ring-num, .pn b, .shs-item b, .stat-value, .timer-num { font-feature-settings: "tnum"; font-variant-numeric: tabular-nums; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select { font-family: inherit; font-size: 15px; }
.hidden { display: none !important; }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: calc(var(--nav-h) + 24px);
  overflow-x: hidden; /* 防止子元素横向撑出页面宽度 */
}
/* 横屏：取消最大宽度限制，充分利用横向空间 */
@media (orientation: landscape) and (max-height: 500px) {
  .app { max-width: 100%; padding-bottom: calc(var(--nav-h) + 12px); }
}

/* v4：全屏彩带庆祝 */
.confetti-piece { position: fixed; top: -16px; width: 8px; height: 14px; border-radius: 2px; z-index: 9999; pointer-events: none; animation: confettiFall linear forwards; }
@keyframes confettiFall { to { transform: translateY(112vh) rotate(560deg); opacity: 0.85; } }

/* v4：家长报告单式仪表盘 */
.admin-report .admin-report-line { font-size: 15px; line-height: 1.7; color: var(--text-sub); margin: 10px 0 16px; }
.admin-report .admin-report-line b { color: var(--mint-deep); font-weight: 800; }

/* v4：继续学习悬浮大按钮 */
.resume-banner { display: flex; align-items: center; gap: 12px; background: linear-gradient(135deg, var(--mint), var(--mint-deep)); color: #fff; border-radius: var(--radius); padding: 14px 16px; margin-top: 14px; cursor: pointer; box-shadow: var(--shadow-float); animation: fadeIn 0.3s var(--ease-smooth); }
.resume-banner.hidden { display: none; }
.rb-ic { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.25); display: flex; align-items: center; justify-content: center; font-size: 15px; flex-shrink: 0; }
.rb-txt { flex: 1; min-width: 0; }
.rb-txt b { display: block; font-size: 14px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rb-txt span { font-size: 11px; opacity: 0.85; }
.rb-go { font-size: 13px; font-weight: 700; flex-shrink: 0; }
/* v4：空状态吉祥物插画 */
.empty-mascot { width: 120px; height: 120px; margin: 0 auto 8px; }
.empty-mascot svg { width: 100%; height: 100%; }

/* ---------------- 视图切换 ---------------- */
.view { display: none; padding: 20px 18px 12px; animation: fadeIn 0.22s ease; }
.view.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------------- 顶部 ---------------- */
.home-header, .page-header {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; row-gap: 8px;   /* 窄屏（手机/小平板）允许换行，按钮不被挤没 */
  margin-bottom: 18px;
}
/* AI 页头部工具区：窄屏自动换行，按钮全部可见 */
.ai-header-tools {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; justify-content: flex-end;
}
.date-main { font-size: 22px; font-weight: 700; }
.date-sub { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.page-title { font-size: 20px; font-weight: 700; }
.page-sub { font-size: 12px; color: var(--text-faint); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow-soft);
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease;
}
.icon-btn:active { transform: scale(0.92); }

/* ---------------- 横幅 ---------------- */
.banner {
  border-radius: 12px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px; animation: fadeIn 0.25s ease;
}
.banner-warn { background: var(--yellow-soft); color: #92400e; }
.banner-soft { background: var(--mint-pale); color: #065f46; }
.banner-red { background: var(--red-soft); color: #991b1b; }

/* ---------------- 总览卡片 + 进度环 ---------------- */
.overview-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px 16px;
  display: flex; align-items: center; gap: 20px;
  margin-bottom: 20px;
}
.ring-wrap { position: relative; width: 108px; height: 108px; flex-shrink: 0; }
.ring { width: 108px; height: 108px; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--mint-pale); stroke-width: 10; }
.ring-fg {
  fill: none; stroke: var(--mint); stroke-width: 10; stroke-linecap: round;
  stroke-dasharray: 326.7; stroke-dashoffset: 326.7;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.ring-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
}
.ring-num { font-size: 20px; font-weight: 800; color: var(--mint-deep); }
.ring-label { font-size: 11px; color: var(--text-faint); }
.overview-stats { flex: 1; display: flex; justify-content: space-around; }
.stat-item { text-align: center; }
.stat-value { font-size: 19px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ---------------- 作业卡片 ---------------- */
.section-title {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 6px 2px 10px; font-size: 15px; font-weight: 700;
}
.section-title-sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.hw-list { display: flex; flex-direction: column; gap: 12px; }

.hw-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow-soft);
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid transparent;
  cursor: pointer; user-select: none;
  transition: box-shadow 0.2s ease, transform 0.15s ease, background 0.3s ease;
  position: relative; overflow: hidden;
}
.hw-card:active { transform: scale(0.985); }
.hw-card.dragging { opacity: 0.6; transform: scale(0.98); }

.hw-card .dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  border: 2.5px solid var(--text-faint);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff; transition: all 0.25s ease;
}
.hw-card.status-pending { border-color: var(--border); }
.hw-card.status-pending .dot { border-color: #d1d5db; }

.hw-card.status-in_progress {
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.18);
  border-color: var(--mint);
}
.hw-card.status-in_progress .dot {
  border-color: var(--mint); border-style: dashed;
  animation: pulse-dot 1.6s ease-in-out infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.45); }
  50% { box-shadow: 0 0 0 7px rgba(52, 211, 153, 0); }
}

.hw-card.status-completed { background: var(--mint-pale); }
.hw-card.status-completed .dot {
  background: var(--mint); border-color: var(--mint);
  animation: pop-check 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes pop-check {
  0% { transform: scale(0.4); } 60% { transform: scale(1.25); } 100% { transform: scale(1); }
}

.hw-card.status-overdue { background: #fff7f7; border-color: var(--red-soft); }
.hw-card.status-overdue .dot { border-color: var(--red); }

.hw-main { flex: 1; min-width: 0; }
.hw-name {
  font-weight: 600; font-size: 15px;
  white-space: normal; word-break: break-word;   /* 长名字自动换行全部显示，不再单行截断 */
}
.hw-sub { font-size: 12px; color: var(--text-sub); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.hw-tag {
  font-size: 11px; padding: 1px 8px; border-radius: 999px;
  background: var(--mint-pale); color: var(--mint-deep);
}
.hw-tag.pri-high { background: var(--red-soft); color: #b91c1c; }
.hw-tag.pri-low { background: #f3f4f6; color: var(--text-sub); }
.hw-tag.overdue-tag { background: var(--red-soft); color: #b91c1c; }
.hw-timer { font-variant-numeric: tabular-nums; font-weight: 700; color: var(--mint-deep); font-size: 13px; }
.hw-timer.stopped { color: var(--text-faint); font-weight: 400; }

/* 卡片完成上弹动画 */
.hw-card.finish-pop { animation: finishPop 0.55s ease; }
@keyframes finishPop {
  0% { transform: translateY(0) scale(1); }
  35% { transform: translateY(-10px) scale(1.03); }
  100% { transform: translateY(0) scale(1); }
}

.empty-state { text-align: center; padding: 48px 0 24px; color: var(--text-faint); }
.empty-icon { font-size: 44px; margin-bottom: 10px; }
.empty-text { font-size: 14px; line-height: 1.8; }

/* ---------------- 底部导航 ---------------- */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; height: var(--nav-h);
  background: rgba(255, 255, 255, 0.96); backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  display: flex; align-items: stretch;
  z-index: 50;
}
/* 横屏：导航栏占满宽度 */
@media (orientation: landscape) and (max-height: 500px) {
  .bottom-nav { max-width: 100%; }
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-faint); transition: color 0.2s ease;
}
.nav-btn .nav-icon { font-size: 21px; transition: transform 0.25s var(--ease-bounce); }
.nav-btn .nav-label { font-size: 10.5px; }
.nav-btn.active { color: var(--mint-deep); }
.nav-btn.active .nav-icon { transform: scale(1.18) translateY(-1px); }   /* 活跃项弹跳放大 */
/* v4：悬浮加号只在首页显示（其它视图常驻悬浮会挡内容） */
.app[data-view]:not([data-view="home"]) .fab { display: none; }
.fab {
  position: fixed; bottom: calc(var(--nav-h) + 10px); left: 50%;
  transform: translateX(-50%);
  width: var(--fab-size); height: var(--fab-size); border-radius: 50%;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #fff; font-size: 26px; line-height: 1;
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
  z-index: 60; transition: transform 0.2s ease;
}
.fab:active { transform: translateX(-50%) scale(0.9); }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(2px); z-index: 100;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  background: #fff; width: 100%; max-width: 480px;
  border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  animation: slideUp 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  max-height: 88vh; overflow-y: auto;
  overscroll-behavior: contain; /* 弹窗内滚动到边界时不穿透到底层页面 */
}
/* 横屏：弹窗居中显示，不从底部滑出 */
@media (orientation: landscape) and (max-height: 500px) {
  .modal-mask { align-items: center; }
  .modal {
    border-radius: 22px; max-width: 560px; max-height: 90vh;
    margin: 0 auto;
  }
}
/* 弹窗打开时锁住底层页面滚动 */
body.modal-open { overflow: hidden; }
.modal-wide { border-radius: 22px; margin: 24px auto; align-self: center; }
@keyframes slideUp { from { transform: translateY(40px); opacity: 0.4; } to { transform: none; opacity: 1; } }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 16px; }

.field-label { display: block; font-size: 12.5px; color: var(--text-sub); margin: 12px 0 6px; }
.field-label b { color: var(--red); }
.input {
  width: 100%; padding: 11px 13px; border-radius: 12px;
  border: 1.5px solid var(--border); background: #fafafa;
  outline: none; transition: border-color 0.2s ease;
}
.input:focus { border-color: var(--mint); background: #fff; }
.field-row { display: flex; gap: 12px; }
.field-col { flex: 1; min-width: 0; }
.suggest-tip {
  margin-top: 14px; padding: 10px 12px; border-radius: 10px;
  background: var(--mint-pale); color: #065f46; font-size: 12.5px;
}
.modal-actions { display: flex; gap: 12px; margin-top: 20px; }
.btn {
  flex: 1; padding: 12px; border-radius: var(--radius-pill); font-size: 15px; font-weight: 600;
  transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--mint-deep); color: #fff; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.28); }
.btn.accent { background: var(--orange); color: #fff; box-shadow: 0 2px 8px rgba(255, 159, 67, 0.3); }
.btn.ghost { background: #f3f4f6; color: var(--text-sub); }
.btn.outline { background: #fff; color: var(--mint-deep); border: 1.5px solid var(--mint); }
.btn.small { flex: 0 0 auto; padding: 8px 14px; font-size: 13px; border-radius: var(--radius-pill); }

/* 状态标签（药丸 tag） */
.tag {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: var(--fs-xs); font-weight: 600; line-height: 1.5;
}
.tag.green { background: var(--mint-pale); color: #047857; }
.tag.orange { background: var(--orange-soft); color: #c2620a; }
.tag.red { background: var(--red-soft); color: #dc2626; }
.tag.yellow { background: var(--star-soft); color: #b45309; }
.tag.gray { background: #f3f4f6; color: var(--text-sub); }

/* 详情弹窗 */
.detail-meta { font-size: 13px; color: var(--text-sub); display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.timer-box {
  background: var(--mint-pale); border-radius: 14px; padding: 18px;
  text-align: center; margin: 4px 0 8px;
}
.timer-num { font-size: 42px; font-weight: 800; color: var(--mint-deep); font-variant-numeric: tabular-nums; letter-spacing: 1px; }
.timer-mode { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* ---------------- 覆盖层（鼓励/成就/引导） ---------------- */
.overlay {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.45);
  backdrop-filter: blur(3px); z-index: 200;
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.encourage-card, .achieve-card, .onboard-card {
  background: #fff; border-radius: 22px; padding: 30px 26px;
  width: min(88vw, 360px); text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}
.pop-in { animation: popIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes popIn { from { transform: scale(0.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.encourage-emoji { font-size: 52px; margin-bottom: 12px; animation: bounceEmoji 1.2s ease infinite; }
@keyframes bounceEmoji { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.encourage-text { font-size: 16px; line-height: 1.8; font-weight: 500; }
.encourage-stats { margin-top: 16px; font-size: 13px; color: var(--text-sub); background: var(--mint-pale); border-radius: 12px; padding: 10px; }
.encourage-hint { margin-top: 14px; font-size: 11px; color: var(--text-faint); }

.achieve-emoji { font-size: 56px; animation: bounceEmoji 1s ease infinite; }
.achieve-title { font-size: 18px; font-weight: 800; margin-top: 8px; color: var(--mint-deep); }
.achieve-name { font-size: 22px; font-weight: 700; margin: 8px 0 4px; }
.achieve-desc { font-size: 13px; color: var(--text-sub); }

.onboard-title { font-size: 19px; font-weight: 800; margin: 8px 0; }
.onboard-desc { font-size: 14px; color: var(--text-sub); line-height: 1.8; min-height: 76px; }
.onboard-step-dots { display: flex; justify-content: center; gap: 6px; margin-bottom: 6px; }
.ob-dot { width: 8px; height: 8px; border-radius: 50%; background: #d1d5db; transition: all 0.25s ease; }
.ob-dot.active { background: var(--mint); width: 20px; border-radius: 999px; }
.onboard-actions { display: flex; gap: 12px; margin-top: 18px; }

/* ---------------- 诊断层：错题与薄弱点 ---------------- */
.diagnosis-card {
  background: linear-gradient(135deg, #fff, #f0fdf9);
  border: 1.5px solid var(--mint-soft);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 16px;
}
.diagnosis-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.diagnosis-title { font-size: 15px; font-weight: 700; }
.diagnosis-sub { font-size: 12px; color: var(--text-faint); }
.kp-chip {
  display: inline-block; font-size: 12px; padding: 4px 12px; border-radius: 999px;
  background: var(--mint-pale); color: var(--mint-deep); margin: 3px 4px 3px 0; cursor: pointer;
  transition: transform 0.15s ease;
}
.kp-chip:active { transform: scale(0.95); }
.kp-chip .kp-count { opacity: 0.7; margin-left: 4px; }
.diagnosis-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.diagnosis-actions .btn.small { flex: 1; min-width: 90px; }
.type-legend { font-size: 11px; color: var(--text-faint); margin-top: 8px; }
.type-legend b { font-weight: 600; }

/* 错题本 */
.mistake-item {
  border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 10px; background: #fff;
}
.mistake-item .m-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.mistake-item .m-kp { font-size: 12px; font-weight: 700; color: var(--mint-deep); }
.mistake-item .m-type { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--yellow-soft); color: #92400e; }
.mistake-item .m-type.concept { background: var(--red-soft); color: #b91c1c; }
.mistake-item .m-type.sloppy { background: #e0f2fe; color: #0369a1; }
.mistake-item .m-content { font-size: 13px; line-height: 1.7; }
.mistake-item .m-answer { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.mistake-item .m-answer .ok { color: var(--mint-deep); font-weight: 600; }
.mistake-item .m-date { font-size: 10.5px; color: var(--text-faint); margin-top: 6px; }
.mistake-del { float: right; font-size: 12px; color: var(--text-faint); padding: 2px 8px; border-radius: 8px; background: #f3f4f6; }
.mistake-del:hover { color: var(--red); }

/* 练习 / 复习 */
.practice-item {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  margin-bottom: 12px; background: #fff;
}
.practice-item .p-kp { font-size: 11px; color: var(--mint-deep); background: var(--mint-pale); padding: 2px 10px; border-radius: 999px; display: inline-block; margin-bottom: 8px; }
.practice-item .p-q { font-size: 14px; line-height: 1.8; margin-bottom: 10px; font-weight: 500; }
.practice-item .p-feedback { margin-top: 10px; font-size: 13px; padding: 10px 12px; border-radius: 10px; display: none; line-height: 1.7; }
.practice-item .p-feedback.show { display: block; }
.practice-item .p-feedback.right { background: var(--mint-pale); color: #065f46; }
.practice-item .p-feedback.wrong { background: var(--yellow-soft); color: #92400e; }

.review-hero {
  text-align: center; padding: 18px 10px; background: var(--mint-pale);
  border-radius: 14px; margin-bottom: 14px;
}
.review-hero .r-kp { font-size: 16px; font-weight: 800; color: var(--mint-deep); }
.review-hero .r-context { font-size: 12.5px; color: #065f46; margin-top: 6px; line-height: 1.7; }
.review-hero .r-srs { font-size: 11px; color: var(--text-sub); margin-top: 6px; }
.review-done { text-align: center; padding: 24px 10px; }
.review-done .rd-emoji { font-size: 44px; }
.review-done .rd-title { font-size: 16px; font-weight: 800; margin-top: 8px; }

/* ---------------- 统计视图 ---------------- */
.stat-tabs {
  display: flex; background: var(--card); border-radius: 12px; padding: 4px;
  box-shadow: var(--shadow-soft); margin-bottom: 16px;
}
.stat-tab { flex: 1; padding: 8px; border-radius: 9px; font-size: 14px; color: var(--text-sub); font-weight: 600; transition: all 0.2s ease; }
.stat-tab.active { background: var(--mint-deep); color: #fff; }

.stats-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 18px 16px; margin-bottom: 14px;
}
.stats-card-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; justify-content: space-between; align-items: center; }
.stats-card-title .sub { font-size: 12px; color: var(--text-faint); font-weight: 400; }

.heatmap { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.hm-cell { aspect-ratio: 1; border-radius: 5px; background: #f0f4f2; position: relative; }
.hm-cell.l1 { background: #d1fae5; }
.hm-cell.l2 { background: #a8ecda; }
.hm-cell.l3 { background: #6ee0c2; }
.hm-cell.l4 { background: #34d399; }
.hm-cell.l5 { background: var(--mint); }
.hm-cell.today { outline: 2px solid var(--mint-deep); outline-offset: 1px; }
.hm-label { font-size: 10px; color: var(--text-faint); text-align: center; margin-bottom: 4px; }

.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-name { width: 46px; font-size: 13px; color: var(--text-sub); flex-shrink: 0; }
.bar-track { flex: 1; height: 10px; border-radius: 999px; background: #f0f4f2; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; background: var(--mint); transition: width 0.6s ease; }
.bar-val { width: 64px; font-size: 12px; color: var(--text-faint); text-align: right; flex-shrink: 0; }

.insight-box {
  background: linear-gradient(135deg, var(--mint-pale), #f0fdf9);
  border-radius: 14px; padding: 14px 16px; font-size: 13.5px; color: #065f46; line-height: 1.9;
}

/* ---------------- 统计页 v3 重排：大数字 hero 卡 ---------------- */
.stats-hero {
  background: linear-gradient(160deg, #ffffff, #f4fcf9);
  border-radius: 20px; box-shadow: var(--shadow-card);
  padding: 20px 20px 18px; margin-bottom: var(--sp-4);
}
.stats-hero-date { font-size: var(--fs-xs); color: var(--text-faint); margin-bottom: 14px; }
.stats-hero-main { display: flex; align-items: center; gap: 22px; }
.stats-hero-main .ring-num { font-size: 32px; font-weight: 800; color: var(--text); line-height: 1.1; }
.stats-hero-main .ring-denom { font-size: 17px; color: var(--text-faint); font-weight: 600; }
.stats-hero-main .ring-label { font-size: 11px; }
.stats-hero-side { flex: 1; display: flex; flex-direction: column; gap: 16px; }
.shs-item b { display: block; font-size: 24px; font-weight: 800; color: var(--text); line-height: 1.2; }
.shs-item span { font-size: 12px; color: var(--text-faint); }
.focus-goal { margin-top: 18px; }
.focus-goal-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-sub); margin-bottom: 6px; }
.focus-goal-track { height: 10px; background: #eef2f0; border-radius: 999px; overflow: hidden; }
.focus-goal-fill { height: 100%; background: linear-gradient(90deg, var(--mint), #5eead4); border-radius: 999px; transition: width 0.6s var(--ease-smooth); }
/* 庆祝态：今日全部完成 */
.stats-hero.celebrate { background: linear-gradient(160deg, #ffffff, #f0fdf4); }
.celebrate-tag { display: inline-flex; align-items: center; margin-left: 10px; background: var(--mint); color: #fff; font-size: 12px; font-weight: 700; padding: 3px 12px; border-radius: 999px; animation: mascotPop 0.5s var(--ease-bounce); }
/* 成就徽章条（鼓励体系） */
.achievement-strip { display: flex; gap: 10px; margin-top: 16px; }
.ach-chip { flex: 1; background: #fff; border-radius: 14px; padding: 10px 6px; text-align: center; box-shadow: 0 1px 2px rgba(17,24,39,0.04); }
.ach-chip .ic { font-size: 18px; line-height: 1; }
.ach-chip b { display: block; font-size: 17px; font-weight: 800; color: var(--text); margin: 3px 0 1px; }
.ach-chip span { font-size: 10px; color: var(--text-faint); }
/* 周/月汇总 hero（三列大数字） */
.period-nums { display: flex; gap: 12px; }
.pn { flex: 1; background: #fff; border-radius: 16px; padding: 16px 8px; text-align: center; box-shadow: 0 1px 2px rgba(17,24,39,0.04); }
.pn b { display: block; font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.2; }
.pn span { font-size: 11px; color: var(--text-faint); }
/* 学科分布粗条升级 */
#stats-content .stats-card { border-radius: 20px; padding: 18px; margin-bottom: var(--sp-4); box-shadow: var(--shadow-card); }
#stats-content .bar-row { margin-bottom: 16px; }
#stats-content .bar-track { height: 12px; }
#stats-content .bar-val { font-size: 13px; font-weight: 700; color: var(--text-sub); }
#stats-content .stats-card-title { font-size: 15px; font-weight: 700; }

/* ---------------- AI 助手（v5：微信式单行头部） ---------------- */
.chat-header-v5 { display: flex; align-items: center; gap: 4px; margin-bottom: 12px; min-height: 44px; }
.chat-top-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: transparent; border: none; color: var(--text-sub);
  font-size: 17px; display: flex; align-items: center; justify-content: center;
}
.chat-top-btn:active { background: rgba(0, 0, 0, 0.06); transform: scale(0.92); }
.ai-header-tools { display: flex; gap: 2px; flex-shrink: 0; margin-left: auto; }
.chat-brand { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.chat-brand-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--mint-soft); overflow: hidden;
  box-shadow: 0 0 0 2px #fff, 0 1px 6px rgba(16, 185, 129, 0.22);
}
.chat-brand-avatar svg { width: 100%; height: 100%; }
.chat-brand-txt { display: flex; flex-direction: column; min-width: 0; }
.chat-brand-txt b { font-size: 16.5px; font-weight: 800; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 状态行：小圆点 + 小灰字（不再用 pill chip） */
.chat-brand-status { display: flex; align-items: center; gap: 5px; font-size: 10.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; }
.chat-brand-status .st-dot { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; flex-shrink: 0; }
.chat-brand-status .st-dot.on { background: var(--mint); }
.chat-brand-status .st-txt { overflow: hidden; text-overflow: ellipsis; }
.chat-brand-status .st-txt.on { color: var(--mint-deep); font-weight: 600; }
.llm-status { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: #f3f4f6; color: var(--text-sub); white-space: nowrap; }
.llm-status.on { background: var(--mint-soft); color: var(--mint-deep); font-weight: 600; }
.llm-help {
  font-size: 12.5px; line-height: 1.9; color: #065f46;
  background: var(--mint-pale); border-radius: 12px; padding: 10px 12px; margin-bottom: 4px;
}
.llm-help code { background: #d1fae5; padding: 1px 6px; border-radius: 6px; font-size: 12px; }
.mic-btn.listening {
  background: var(--red-soft) !important; color: var(--red) !important;
  animation: pulse-dot 1.2s ease-in-out infinite;
}

/* 快捷指令：隐藏裸振荡滚动条，紧凑胶囊 */
.ai-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 10px; scrollbar-width: none; }
.ai-chips::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 6px 12px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border);
  font-size: 12px; color: var(--text-sub); transition: all 0.2s ease;
}
.chip.active { background: var(--mint-deep); color: #fff; border-color: var(--mint-deep); }

.chat-list { display: flex; flex-direction: column; gap: 14px; padding: 4px 0 12px; min-height: 200px; }

/* 消息行：AI（左，带头像） / 用户（右） */
.msg { display: flex; max-width: 100%; }
.msg.user { justify-content: flex-end; }
.msg.ai { justify-content: flex-start; gap: 8px; }

.msg-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;   /* v4：34px 更醒目 */
  background: var(--mint-soft); color: var(--mint-deep);
  display: flex; align-items: center; justify-content: center;
  margin-top: 2px;
  overflow: hidden;
}
.msg-avatar .mascot-svg { width: 100%; height: 100%; }
.msg-main { max-width: 82%; min-width: 0; }
.msg-head { display: flex; align-items: center; gap: 6px; margin: 0 0 3px 4px; }
.msg-name { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.msg-tts {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px; border-radius: 6px; color: var(--text-faint); transition: all 0.15s ease;
}
.msg-tts:hover { color: var(--mint-deep); background: var(--mint-pale); }

.msg-bubble {
  padding: 10px 14px; border-radius: 16px; font-size: 14px; line-height: 1.75;
  white-space: pre-wrap; word-break: break-word;
}
.msg.ai .msg-bubble {
  background: #f2f9f6;   /* v4：极浅薄荷底替代纯白，聊天区更柔和 */
  border-top-left-radius: 5px;
}
.msg.user .msg-bubble {
  background: var(--mint-deep); color: #fff;
  border-bottom-right-radius: 5px;
}
/* v4：批改报告卡片化（📋 开头的长文本套报告卡样式） */
.msg .msg-bubble.msg-report {
  background: linear-gradient(160deg, #ffffff, #f4fcf9);
  border: 1px solid var(--mint-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 14px 16px;
}
.msg .msg-bubble.msg-report .msg-body { font-size: 13.5px; }
.msg-time { font-size: 10px; color: var(--text-faint); margin: 3px 6px 0; }
.msg-time.right { text-align: right; }
.msg.typing { color: var(--text-faint); font-style: italic; align-items: center; }
.msg-more {
  display: inline-block; font-size: 12px; color: var(--mint-deep);
  padding: 0 4px; text-decoration: underline; cursor: pointer;
}

/* 伙伴栏 */
.assistant-bar {
  display: flex; align-items: center; gap: 8px;
  background: var(--card); border-radius: 12px; box-shadow: var(--shadow-soft);
  padding: 8px 12px; margin-bottom: 10px; font-size: 12.5px; color: var(--text-sub);
}
.assistant-avatar {
  width: 24px; height: 24px; border-radius: 50%; background: var(--mint-soft); color: var(--mint-deep);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.assistant-bar b { color: var(--text); }
.rename-btn {
  margin-left: auto; font-size: 11.5px; color: var(--mint-deep); padding: 4px 10px;
  border-radius: 999px; background: var(--mint-pale);
}
/* 取名 */
.name-suggestions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.name-chip {
  padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 600;
  background: var(--mint-pale); color: var(--mint-deep); transition: all 0.15s ease;
}
.name-chip:active { transform: scale(0.95); background: var(--mint-soft); }

/* ================= 微信式会话列表 ================= */
.ai-greeting {
  background: linear-gradient(160deg, var(--mint-pale), #f4fcf9); border-radius: var(--radius); padding: 16px 18px;
  font-size: 14px; line-height: 1.8; color: #065f46; margin-bottom: 16px;
  white-space: pre-wrap;
}
.session-list { display: flex; flex-direction: column; gap: 2px; }
.session-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); padding: 14px 16px; border-radius: 12px;
  cursor: pointer; transition: background 0.15s ease;
  margin-bottom: 8px; box-shadow: var(--shadow-soft);
}
.session-card:active { background: #f0fdf9; }
.session-avatar {
  width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
  background: var(--mint-soft); color: var(--mint-deep);
  display: flex; align-items: center; justify-content: center;
}
.session-body { flex: 1; min-width: 0; }
.session-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.session-title { font-size: 15px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.session-time { font-size: 11px; color: var(--text-faint); flex-shrink: 0; }
.session-preview {
  font-size: 13px; color: var(--text-sub); margin-top: 4px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.session-del {
  flex-shrink: 0; width: 28px; height: 28px; border-radius: 50%;
  font-size: 18px; color: var(--text-faint); display: flex;
  align-items: center; justify-content: center; transition: all 0.15s ease;
}
.session-del:hover { background: var(--red-soft); color: var(--red); }
.new-session-btn {
  display: block; margin: 20px auto 8px; padding: 12px 32px;
  border-radius: 999px; font-size: 15px; font-weight: 600;
}
/* 聊天视图导航栏：sticky 居中标题式 */
.chat-back-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  margin: 0 -18px 10px; padding: 8px 12px;
  background: rgba(246, 250, 248, 0.92); backdrop-filter: blur(8px);
}
.back-btn { font-size: 14px; color: var(--mint-deep); font-weight: 600; padding: 6px 12px; border-radius: 8px; transition: background 0.15s ease; }
.back-btn:hover { background: var(--mint-pale); }
.chat-session-title { flex: 1; font-size: 16px; font-weight: 700; color: var(--text); text-align: center; }
.icon-btn-small {
  width: 36px; height: 36px; border-radius: 50%; font-size: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); transition: all 0.15s ease;
}
.icon-btn-small:hover { background: var(--red-soft); color: var(--red); }

/* 输入栏：白底浮起胶囊（修复窄屏溢出：input 必须 flex:1 + min-width:0） */
.chat-input-bar {
  position: sticky; bottom: 0; display: flex; align-items: center; gap: 8px;
  background: var(--bg); padding: 10px 0 calc(10px + env(safe-area-inset-bottom));
  max-width: 100%;
}
.chat-input {
  flex: 1; min-width: 0; height: 42px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); padding: 0 16px; font-size: 14px; color: var(--text);
  outline: none; transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.chat-input:focus { border-color: var(--mint); box-shadow: 0 0 0 3px var(--mint-pale); }
.cir-btn {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: none;
  background: var(--mint-soft); color: var(--mint-deep);
  display: flex; align-items: center; justify-content: center;
  transition: transform var(--dur-fast) var(--ease-smooth);
}
.cir-btn:active { transform: scale(0.92); }
.send-btn-v4 {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: transform var(--dur-fast) var(--ease-smooth);
}
.send-btn-v4:active { transform: scale(0.92); }
.send-btn {
  flex-shrink: 0; padding: 0 18px; border-radius: 12px;
  background: var(--mint-deep); color: #fff;
  font-weight: 600; font-size: 15px;
}
.hidden-input { display: none; }

/* 数据备份栏（统计页底部） */
.backup-bar {
  margin: 18px 14px 8px; padding: 14px 16px;
  background: #fff; border: 1.5px solid var(--border); border-radius: 14px;
}
.backup-title { font-weight: 600; font-size: 14px; margin-bottom: 10px; }
.backup-actions { display: flex; gap: 10px; }
.backup-actions .btn.small { padding: 7px 14px; font-size: 13px; }
.backup-tip { margin-top: 8px; font-size: 12px; color: var(--text-dim, #888); line-height: 1.5; }

/* 选择题选项：独立卡片 + 字母徽章 */
.q-options { display: flex; flex-direction: column; gap: 8px; }
.q-opt {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 1.5px solid var(--border); border-radius: 12px; padding: 10px 12px;
  background: #fff; font-size: 14px; line-height: 1.6;
  transition: all 0.15s ease;
}
.q-opt:active { transform: scale(0.985); }
.q-opt:hover { border-color: var(--mint); }
.q-opt-letter {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: #f3f4f6; color: var(--text-sub); font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.q-opt-text { flex: 1; }
.q-opt-mark { font-weight: 700; }
/* 结果态 */
.q-options-readonly .q-opt { cursor: default; }
.q-options-readonly .q-opt.correct { border-color: var(--mint); background: var(--mint-pale); }
.q-options-readonly .q-opt.correct .q-opt-letter { background: var(--mint); color: #fff; }
.q-options-readonly .q-opt.correct .q-opt-mark { color: var(--mint-deep); }
.q-options-readonly .q-opt.wrong { border-color: var(--red); background: var(--red-soft); }
.q-options-readonly .q-opt.wrong .q-opt-letter { background: var(--red); color: #fff; }
.q-options-readonly .q-opt.wrong .q-opt-mark { color: var(--red); }
.q-options-readonly .q-opt.dim { opacity: 0.45; }

/* ---------------- 每日挑战 ---------------- */
.challenge-progress { display: flex; gap: 8px; margin-bottom: 16px; }
.ch-prog-item {
  flex: 1; text-align: center; padding: 8px 4px; border-radius: 12px;
  background: var(--card); box-shadow: var(--shadow-soft); font-size: 12px;
  color: var(--text-faint); transition: all 0.25s ease;
}
.ch-prog-item .ch-num { display: block; font-size: 15px; font-weight: 800; margin-bottom: 2px; }
.ch-prog-item.done { background: var(--mint-pale); color: var(--mint-deep); }
.ch-prog-item.current { border: 2px solid var(--mint); color: var(--mint-deep); }
.ch-prog-item.skipped { background: #f3f4f6; color: var(--text-faint); text-decoration: line-through; }

.q-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-soft);
  padding: 18px 16px; margin-bottom: 14px;
}
.q-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.q-type { font-size: 12px; background: var(--mint-pale); color: var(--mint-deep); padding: 2px 10px; border-radius: 999px; }
.q-diff { font-size: 11px; color: var(--text-faint); }
.q-text { font-size: 15px; line-height: 1.8; margin-bottom: 12px; font-weight: 500; }
.q-actions { display: flex; gap: 10px; }
.q-answer-input { flex: 1; }
.q-feedback { margin-top: 12px; padding: 12px 14px; border-radius: 12px; font-size: 13.5px; line-height: 1.8; display: none; }
.q-feedback.show { display: block; animation: fadeIn 0.3s ease; }
.q-feedback.right { background: var(--mint-pale); color: #065f46; }
.q-feedback.wrong { background: var(--yellow-soft); color: #92400e; }
.q-feedback .q-expl { margin-top: 8px; padding-top: 8px; border-top: 1px dashed rgba(0,0,0,0.12); color: #78350f; }
.q-skip-btn { flex-shrink: 0; padding: 8px 12px; border-radius: 10px; background: #f3f4f6; color: var(--text-sub); font-size: 12.5px; }

.challenge-summary {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px 18px; text-align: center;
}
.challenge-summary .cs-emoji { font-size: 44px; }
.challenge-summary .cs-title { font-size: 17px; font-weight: 800; margin: 8px 0; }
.challenge-summary .cs-detail { font-size: 13.5px; color: var(--text-sub); line-height: 1.9; }
.challenge-summary .cs-preview { margin-top: 14px; font-size: 13px; background: var(--mint-pale); color: #065f46; border-radius: 12px; padding: 10px 14px; }

/* ---------------- 徽章墙 ---------------- */
.badges-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
/* 横屏：徽章墙改为8列两行，利用横向空间 */
@media (orientation: landscape) and (max-height: 500px) {
  .badges-wall { grid-template-columns: repeat(8, 1fr); gap: 8px; }
  .badge-cell { padding: 8px 2px; }
  .badge-cell .b-emoji { font-size: 24px; }
}
.badge-cell { text-align: center; padding: 12px 4px; border-radius: 14px; background: #fafafa; }
.badge-cell.unlocked { background: var(--mint-pale); }
.badge-cell .b-emoji { font-size: 30px; }
.badge-cell .b-name { font-size: 11px; margin-top: 4px; font-weight: 600; }
.badge-cell .b-date { font-size: 9.5px; color: var(--text-faint); margin-top: 2px; }
.badge-cell.locked .b-emoji { filter: grayscale(1); opacity: 0.4; }

/* ---------------- 通用图标（内联 SVG） ---------------- */
.icon { display: inline-block; vertical-align: -0.18em; }
.icon-btn { display: flex; align-items: center; justify-content: center; }

/* 角色徽章 */
.role-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  background: var(--card); box-shadow: var(--shadow-soft); color: var(--mint-deep);
}
.role-badge.admin { background: linear-gradient(135deg, var(--yellow-soft), #fef9c3); color: #92400e; }
.role-caret { font-size: 9px; opacity: 0.7; }
.role-options { display: flex; flex-direction: column; gap: 10px; }
.role-card {
  display: flex; align-items: center; gap: 12px; text-align: left;
  border: 1.5px solid var(--border); border-radius: 14px; padding: 14px;
  background: #fff; transition: all 0.2s ease;
}
.role-card:hover { border-color: var(--mint); }
.role-card.active { border-color: var(--mint-deep); background: var(--mint-pale); }
.role-icon { width: 40px; height: 40px; border-radius: 50%; background: var(--mint-pale); color: var(--mint-deep); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-name { font-size: 15px; font-weight: 700; }
.role-desc { font-size: 12px; color: var(--text-sub); margin-top: 2px; display: block; line-height: 1.6; }

/* 星期选择器（自定义执行频率） */
.days-presets { display: flex; gap: 8px; margin-bottom: 8px; }
.day-preset {
  flex: 1; padding: 7px 0; border-radius: 10px; font-size: 13px;
  background: #f3f4f6; color: var(--text-sub); font-weight: 600;
  transition: all 0.2s ease;
}
.day-preset.active { background: var(--mint-deep); color: #fff; }
.days-picker { display: flex; gap: 6px; }
.day-chip {
  flex: 1; aspect-ratio: 1; border-radius: 10px; font-size: 13px;
  background: #f3f4f6; color: var(--text-sub); font-weight: 600;
  transition: all 0.15s ease;
}
.day-chip.active { background: var(--mint); color: #fff; }
.day-chip.today { outline: 2px solid var(--mint-deep); outline-offset: 1px; }

/* 摄像头 */
.camera-box {
  position: relative; background: #111827; border-radius: 16px;
  overflow: hidden; min-height: 240px; display: flex; align-items: center; justify-content: center;
}
.camera-box video, .camera-box canvas, .camera-box img { width: 100%; max-height: 380px; object-fit: contain; }
.camera-actions { flex-wrap: wrap; }
.camera-actions .btn { min-width: 30%; }

/* 底部导航图标尺寸 */
.nav-icon svg { width: 22px; height: 22px; }
.fab svg { width: 26px; height: 26px; }
.send-btn svg { width: 19px; height: 19px; }
.mic-btn svg, .cam-btn svg { width: 18px; height: 18px; }

.checkbox-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-sub); margin: 14px 0 4px; cursor: pointer;
}
.checkbox-row input { width: 16px; height: 16px; accent-color: var(--mint-deep); flex-shrink: 0; }
#llm-security-tip.warn { background: var(--yellow-soft); color: #92400e; }
#llm-security-tip.warn code { background: #fde68a; }

/* 管理员验证 */
.verify-intro { font-size: 13px; color: var(--text-sub); line-height: 1.8; margin-bottom: 12px; }
.verify-question {
  font-size: 26px; font-weight: 800; letter-spacing: 2px; text-align: center;
  background: var(--mint-pale); border-radius: 14px; padding: 20px 10px; margin-bottom: 14px;
  color: var(--mint-deep); font-variant-numeric: tabular-nums;
}
.verify-question .op { color: var(--text); margin: 0 8px; }
.shake { animation: shakeX 0.4s ease; }
@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); } 40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); } 80% { transform: translateX(5px); }
}

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; top: 44px; left: 50%; transform: translateX(-50%);
  background: rgba(31, 41, 55, 0.92); color: #fff; font-size: 13.5px;
  padding: 10px 20px; border-radius: 999px; z-index: 300;
  animation: toastIn 0.3s ease; max-width: 86vw; text-align: center;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* 滑动指示（长按提示） */
.hw-card .drag-hint { position: absolute; top: 8px; right: 10px; font-size: 10px; color: var(--text-faint); }

/* 滚动条美化 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 999px; }

/* ---------------- v1.3 卡片操作按钮 ---------------- */
.hw-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; flex-shrink: 0; }
.hw-action {
  width: 34px; height: 34px; border-radius: 50%; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint); color: #fff; box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s ease, opacity 0.15s ease; flex-shrink: 0;
}
.hw-action:active { transform: scale(0.9); }
.hw-action.pause { background: #f59e0b; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35); }
.hw-action.redo { background: #e5e7eb; color: var(--text-sub); box-shadow: none; }
.hw-card.dragging {
  opacity: 0.85; transform: scale(1.02) !important;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
  z-index: 50; background: #fff; border-color: var(--mint);
}

/* ---------------- v1.3 一键生成作业 ---------------- */
.gen-entry { margin-top: 12px; width: 100%; }
.gen-textarea { min-height: 110px; resize: vertical; font-size: 14px; line-height: 1.6; }
.gen-tools { display: flex; gap: 10px; margin-top: 10px; }
.gen-status { font-size: 13px; margin-top: 10px; min-height: 18px; color: var(--text-sub); }
.gen-status.working { color: var(--mint-deep); }
.gen-status.ok { color: var(--mint-deep); }
.gen-status.err { color: #b91c1c; }
.gen-result { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; max-height: 46vh; overflow-y: auto; }
.gen-empty { text-align: center; color: var(--text-faint); font-size: 13px; padding: 18px 0; }
.gen-item {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px;
}
.gen-check { margin-top: 8px; flex-shrink: 0; }
.gen-checkbox { width: 18px; height: 18px; accent-color: var(--mint); }
.gen-fields { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
.gen-name { font-size: 14px; }
.gen-meta { display: flex; gap: 8px; align-items: center; }
.gen-meta .gen-subject { width: 86px; font-size: 13px; padding: 6px 8px; }
.gen-meta .gen-min { width: 74px; font-size: 13px; padding: 6px 8px; }
.gen-meta .gen-date { flex: 1; min-width: 0; font-size: 12px; padding: 6px 8px; }
.gen-del { flex-shrink: 0; }

/* ---------------- v1.3 流式对话 ---------------- */
.msg.streaming .msg-bubble { min-height: 24px; }
.stream-cursor {
  display: inline-block; width: 2px; height: 1em; vertical-align: -0.15em;
  background: var(--mint-deep); margin-left: 2px;
  animation: cursorBlink 0.9s steps(1) infinite;
}
@keyframes cursorBlink { 0%, 60% { opacity: 1; } 61%, 100% { opacity: 0; } }

/* ---------------- v1.4 应用内更新 ---------------- */
.banner-update { background: #fff7ed; border-color: #fbbf24; cursor: pointer; }
.update-card .backup-title { display: flex; align-items: center; gap: 6px; }
.update-ver { font-size: 12px; color: var(--text-faint); font-weight: 400; }
.update-row { display: flex; gap: 8px; margin-top: 8px; }
.update-row .input { flex: 1; min-width: 0; }
.update-row .btn { flex-shrink: 0; }
.update-row .btn.download { background: var(--red); color: #fff; border-color: var(--red); }
.update-status { font-size: 13px; margin-top: 10px; line-height: 1.7; color: var(--text-sub); }
.update-status.working { color: var(--mint-deep); }
.update-status.ok { color: var(--mint-deep); }
.update-status.err { color: #b91c1c; }
.update-progress { height: 6px; background: #e5e7eb; border-radius: 999px; margin-top: 10px; overflow: hidden; }
.update-bar { height: 100%; width: 0%; background: var(--mint); border-radius: 999px; transition: width 0.3s ease; }

/* 倒计时结束：卡片红色闪烁提示 */
.time-up-flash { animation: flashRed 0.6s ease-in-out 3; border-color: var(--red) !important; }
@keyframes flashRed {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 12px 3px rgba(248, 113, 113, 0.5); }
}

/* ================= 专注模式全屏界面 ================= */
.focus-mode {
  position: fixed; inset: 0; z-index: 9999;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  display: flex; align-items: center; justify-content: center;
  animation: focusFadeIn 0.3s ease;
}
.focus-mode.hidden { display: none; }
@keyframes focusFadeIn { from { opacity: 0; } to { opacity: 1; } }
.focus-inner {
  text-align: center; width: 90%; max-width: 400px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
}
.focus-subject {
  font-size: 16px; color: rgba(255,255,255,0.5);
  letter-spacing: 2px; text-transform: uppercase;
}
.focus-name {
  font-size: 26px; font-weight: 700; color: #fff;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.focus-timer {
  font-size: 80px; font-weight: 200; color: #fff;
  font-variant-numeric: tabular-nums; letter-spacing: 4px;
  line-height: 1; margin: 12px 0;
  text-shadow: 0 0 40px rgba(16, 185, 129, 0.3);
}
/* 横屏：缩小计时器字号 */
@media (orientation: landscape) and (max-height: 500px) {
  .focus-timer { font-size: 56px; }
  .focus-name { font-size: 20px; }
  .focus-inner { gap: 10px; }
}
.focus-status {
  font-size: 15px; color: rgba(255,255,255,0.6);
  min-height: 22px;
}
.focus-status.paused { color: #fbbf24; }
.focus-progress-bar {
  width: 80%; height: 4px; background: rgba(255,255,255,0.1);
  border-radius: 999px; overflow: hidden;
}
.focus-progress-fill {
  height: 100%; width: 0%; background: var(--mint);
  border-radius: 999px; transition: width 1s linear;
}
.focus-actions {
  display: flex; gap: 20px; margin-top: 24px; width: 100%;
  justify-content: center;
}
.focus-btn {
  flex: 1; max-width: 160px; padding: 18px 0;
  border: none; border-radius: 50px; font-size: 18px; font-weight: 600;
  cursor: pointer; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.focus-btn:active { transform: scale(0.95); }
.focus-btn-pause {
  background: rgba(255,255,255,0.12); color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.focus-btn-finish {
  background: var(--mint); color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}
.focus-btn-pause.is-resume {
  background: var(--mint); color: #fff;
  box-shadow: 0 4px 20px rgba(16, 185, 129, 0.4);
}
.focus-hint {
  font-size: 12px; color: rgba(255,255,255,0.25);
  margin-top: 16px;
}
.focus-close {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.1); border: none;
  color: rgba(255,255,255,0.6); font-size: 24px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease;
  z-index: 1;
}
.focus-close:active { background: rgba(255,255,255,0.2); }

/* ================= 练习中心 ================= */
.practice-sec-title {
  font-size: 13px; font-weight: 600; color: var(--text-sub);
  margin: 16px 2px 8px; letter-spacing: 0.5px;
}
.practice-sec-title:first-child { margin-top: 4px; }
.practice-grid {
  display: flex; flex-direction: column; gap: 10px;
}
/* v4：关卡卡片网格（两列竖卡） */
.practice-grid.pgrid2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pcard { position: relative; background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-card); padding: 16px 12px 14px; text-align: center; cursor: pointer; transition: transform var(--dur-fast) var(--ease-smooth); }
.pcard:active { transform: scale(0.96); }
.pcard-icon { width: 54px; height: 54px; border-radius: 18px; display: inline-flex; align-items: center; justify-content: center; font-size: 27px; margin-bottom: 10px; }
.pcard-name { font-weight: 700; font-size: 15px; color: var(--text); }
.pcard-desc { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.pcard-badge { position: absolute; top: 10px; right: 10px; background: var(--orange); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); }
.practice-card {
  background: var(--card); border-radius: var(--radius);
  padding: 14px 16px; cursor: pointer;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.practice-card:active { transform: scale(0.98); box-shadow: var(--shadow-soft); }
.practice-bubble {
  width: 46px; height: 46px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.bub-daily  { background: var(--yellow-soft); }
.bub-math   { background: var(--mint-pale); }
.bub-vocab  { background: #e0f2fe; }
.bub-sudoku { background: #ede9fe; }
.bub-g2048  { background: #ffedd5; }
.bub-memory { background: #fce7f3; }
.practice-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.practice-name { font-size: 15px; font-weight: 600; color: var(--text); }
.practice-desc { font-size: 12px; color: var(--text-sub); }
.practice-arrow { color: var(--text-faint); font-size: 22px; line-height: 1; }
/* 年级徽章（练习页头部） */
.grade-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 13px; border-radius: 20px;
  background: var(--mint-pale); color: var(--mint-deep);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: transform 0.15s ease;
}
.grade-chip:active { transform: scale(0.95); }

/* ================= 年级选择器 ================= */
.grade-select {
  display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px;
}
.grade-btn {
  padding: 6px 14px; border-radius: 20px;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 13px; cursor: pointer; color: var(--text-sub);
  transition: all 0.15s ease;
}
.grade-btn.active { background: var(--mint-deep); color: #fff; border-color: var(--mint-deep); }

/* ================= 口算练习 ================= */
.math-problem {
  font-size: 32px; font-weight: 700; text-align: center;
  padding: 24px 0; color: var(--text); min-height: 80px;
  display: flex; align-items: center; justify-content: center;
}
.math-input-area {
  display: flex; gap: 10px; align-items: center; justify-content: center;
  margin-bottom: 12px;
}
.math-answer { width: 140px; text-align: center; font-size: 20px; font-weight: 600; }
.math-result {
  text-align: center; font-size: 18px; font-weight: 600;
  padding: 12px 0; border-radius: 12px; margin-bottom: 8px;
}
.math-result.correct { color: var(--mint); }
.math-result.wrong { color: var(--red); }
.math-score {
  text-align: center; font-size: 13px; color: var(--text-sub); padding: 4px 0;
}

/* ================= 单词练习 ================= */
.vocab-problem {
  text-align: center; padding: 20px 0 12px;
}
.vocab-word {
  font-size: 36px; font-weight: 700; color: var(--text); margin-bottom: 4px;
}
.vocab-phonetic { font-size: 14px; color: var(--text-sub); }
.vocab-options {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px;
}
.vocab-option {
  padding: 14px 12px; border-radius: 12px;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 15px; cursor: pointer; text-align: center;
  transition: all 0.15s ease; color: var(--text);
}
.vocab-option:active { transform: scale(0.96); }
.vocab-option.correct { background: var(--mint); color: #fff; border-color: var(--mint); }
.vocab-option.wrong { background: var(--red); color: #fff; border-color: var(--red); }
.vocab-option.disabled { pointer-events: none; opacity: 0.6; }

/* 剑桥词汇（v4 新增） */
.vocab-result { font-size: 14px; font-weight: 700; text-align: center; }
.vocab-result.correct { color: var(--mint-deep, #059669); }
.vocab-result.wrong { color: var(--red, #ef4444); }

/* ================= 数独 ================= */
.sudoku-setup { text-align: center; padding: 16px 0; }
.sudoku-board {
  display: grid; gap: 1px; margin: 0 auto 12px;
  background: var(--border); border-radius: 8px; overflow: hidden;
  width: fit-content;
}
.sudoku-board.size-4 { grid-template-columns: repeat(4, 44px); }
.sudoku-board.size-6 { grid-template-columns: repeat(6, 40px); }
.sudoku-board.size-9 { grid-template-columns: repeat(9, 36px); }
.sudoku-cell {
  width: 100%; aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; background: var(--card); cursor: pointer;
  color: var(--text); transition: background 0.1s ease;
}
.sudoku-cell.clue { color: var(--text-sub); background: #f8f9fa; }
.sudoku-cell.selected { background: rgba(16, 185, 129, 0.15); }
.sudoku-cell.error { color: var(--red); background: rgba(239, 68, 68, 0.08); }
.sudoku-cell.correct-fill { color: var(--mint); }
.sudoku-cell.highlight { background: rgba(16, 185, 129, 0.06); }
/* 对角线数独：对角线格子淡紫高亮 */
.sudoku-board.diagonal-mode .on-diag { background: rgba(139, 92, 246, 0.06); }
.sudoku-board.diagonal-mode .on-diag.clue { background: rgba(139, 92, 246, 0.1); }
.sudoku-board.diagonal-mode .on-diag.selected { background: rgba(139, 92, 246, 0.18); }
/* 宫格加粗线 */
.sudoku-board.size-9 .sudoku-cell:nth-child(3n) { border-right: 2px solid var(--border); }
.sudoku-board.size-9 .sudoku-cell:nth-child(n+19):nth-child(-n+27) { border-bottom: 2px solid var(--border); }
.sudoku-board.size-9 .sudoku-cell:nth-child(n+46):nth-child(-n+54) { border-bottom: 2px solid var(--border); }
.sudoku-board.size-6 .sudoku-cell:nth-child(3n) { border-right: 2px solid var(--border); }
.sudoku-board.size-6 .sudoku-cell:nth-child(n+13):nth-child(-n+18) { border-bottom: 2px solid var(--border); }
.sudoku-board.size-4 .sudoku-cell:nth-child(2n) { border-right: 2px solid var(--border); }
.sudoku-board.size-4 .sudoku-cell:nth-child(n+5):nth-child(-n+8) { border-bottom: 2px solid var(--border); }
.sudoku-keypad {
  display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 8px;
}
.sudoku-key {
  width: 40px; height: 40px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--card);
  font-size: 18px; font-weight: 600; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text); transition: all 0.1s ease;
}
.sudoku-key:active { background: var(--mint); color: #fff; }
.sudoku-key.erase { font-size: 14px; }

/* ================= 2048 ================= */
.g2048-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px; font-size: 16px;
}
.g2048-board {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; background: #bbada0; border-radius: 12px;
  padding: 8px; aspect-ratio: 1; max-width: 340px; margin: 0 auto;
  /* v4：手势专属区，阻止页面滚动劫持滑动（否则 touchend 被浏览器取消，左右划无效） */
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.g2048-tile {
  border-radius: 6px; display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  aspect-ratio: 1;
}
.g2048-tile.tile-new {
  animation: tileAppear 0.22s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.g2048-tile.tile-merged {
  animation: tileMerge 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes tileAppear {
  0% { transform: scale(0); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes tileMerge {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}
.g2048-hint {
  text-align: center; font-size: 12px; color: var(--text-sub); margin-top: 8px;
}

/* ================= 记忆翻牌 ================= */
.memory-board {
  display: grid; gap: 8px; margin: 0 auto 12px;
  max-width: 360px; justify-content: center;
}
.memory-board.cols-4 { grid-template-columns: repeat(4, 1fr); }
.memory-board.cols-3 { grid-template-columns: repeat(3, 1fr); }
.memory-board.cols-6 { grid-template-columns: repeat(6, 1fr); }
.memory-card {
  aspect-ratio: 1; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; cursor: pointer;
  background: var(--mint); color: #fff;
  transition: transform 0.25s ease, background 0.2s ease;
  user-select: none;
}
.memory-card.flipped { background: var(--card); transform: rotateY(0); }
.memory-card.matched { background: #d1fae5; pointer-events: none; }
.memory-card .card-back { font-size: 20px; }
.memory-card .card-face { display: none; }
.memory-card.flipped .card-back { display: none; }
.memory-card.flipped .card-face { display: block; }
.memory-card.matched .card-face { display: block; }
.memory-card.matched .card-back { display: none; }

/* ============================================================
   📐 思维训练课程
   ============================================================ */
.thinking-categories {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.thinking-cat-card {
  padding: 16px; border-radius: 14px; cursor: pointer;
  border: 2px solid transparent; transition: all 0.2s;
  display: flex; flex-direction: column; gap: 6px;
}
.thinking-cat-card:hover { border-color: var(--mint); transform: translateY(-2px); }
.thinking-cat-card .cat-icon { font-size: 28px; }
.thinking-cat-card .cat-name { font-size: 15px; font-weight: 700; color: var(--text); }
.thinking-cat-card .cat-desc { font-size: 12px; color: var(--text-sub); }
.thinking-lessons {
  display: flex; flex-direction: column; gap: 8px;
}
.thinking-lesson-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-radius: 12px;
  background: var(--card); cursor: pointer;
  transition: all 0.15s; border: 2px solid transparent;
}
.thinking-lesson-item:hover { border-color: var(--mint); }
.thinking-lesson-item .lesson-num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--mint-soft); color: var(--mint-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; flex-shrink: 0;
}
.thinking-lesson-item .lesson-title { font-size: 14px; font-weight: 600; }
.thinking-teach {
  background: var(--mint-pale); border-radius: 12px;
  padding: 16px; margin-bottom: 16px;
  font-size: 14px; line-height: 1.8; white-space: pre-line;
  color: var(--text); border-left: 4px solid var(--mint);
}
.thinking-practice { display: flex; flex-direction: column; gap: 10px; }
.thinking-q-card {
  background: var(--card); border-radius: 12px; padding: 14px;
}
.thinking-q-card .q-text { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.thinking-q-card .q-options { display: flex; flex-wrap: wrap; gap: 8px; }
.thinking-q-card .q-opt {
  padding: 6px 14px; border-radius: 8px; border: 2px solid #e5e7eb;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  background: #fff;
}
.thinking-q-card .q-opt:hover { border-color: var(--mint); }
.thinking-q-card .q-opt.correct { background: #d1fae5; border-color: var(--mint); color: var(--mint-deep); }
.thinking-q-card .q-opt.wrong { background: #fee2e2; border-color: #f87171; color: #dc2626; }
.thinking-q-card .q-result { margin-top: 8px; font-size: 13px; color: var(--text-sub); }

/* ============================================================
   🔟 数独 — 闯关模式 & 成就 & 模式标签
   ============================================================ */
.sudoku-mode-tabs {
  display: flex; gap: 6px; margin-bottom: 12px;
}
.sd-tab {
  flex: 1; padding: 8px 0; border-radius: 10px;
  border: 2px solid #e5e7eb; background: #fff;
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; color: var(--text-sub);
}
.sd-tab.active {
  background: var(--mint-soft); border-color: var(--mint); color: var(--mint-deep);
}
.sd-level-progress {
  margin-bottom: 12px;
}
.sd-level-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px;
  max-height: 320px; overflow-y: auto; padding: 4px;
}
.sd-level-btn {
  width: 100%; aspect-ratio: 1; border-radius: 10px;
  border: 2px solid #e5e7eb; background: #fff;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: all 0.15s; color: var(--text);
  display: flex; align-items: center; justify-content: center;
}
.sd-level-btn:hover:not(.locked) { border-color: var(--mint); background: var(--mint-pale); }
.sd-level-btn.locked {
  background: #f3f4f6; color: #d1d5db; cursor: not-allowed; border-color: #e5e7eb;
}
.sd-achieve-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
  max-height: 380px; overflow-y: auto;
}
.sd-achieve-card {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 14px 8px; border-radius: 12px;
  background: #f3f4f6; border: 2px solid transparent;
  transition: all 0.2s; text-align: center;
}
.sd-achieve-card.unlocked {
  background: var(--mint-pale); border-color: var(--mint-soft);
}
.ach-icon { font-size: 28px; }
.ach-name { font-size: 13px; font-weight: 700; color: var(--text); }
.ach-desc { font-size: 11px; color: var(--text-sub); }

/* ================= 实时语音对话 ================= */
.talk-entry-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 5px 10px; border-radius: 999px; border: none;
  background: linear-gradient(135deg, var(--mint) 0%, #38b2ac 100%);
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 2px 6px rgba(77, 196, 160, 0.35);
  cursor: pointer; white-space: nowrap;
}
.talk-entry-btn:active { transform: scale(0.96); }

/* 模式选择卡片 */
.talk-mode-list { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.talk-mode-card {
  display: grid; grid-template-columns: 40px 1fr; grid-template-rows: auto auto;
  column-gap: 12px; align-items: center; text-align: left;
  padding: 14px; border-radius: 14px; border: 2px solid #e5e7eb;
  background: #fff; cursor: pointer; transition: all 0.18s;
}
.talk-mode-card:active { border-color: var(--mint); background: var(--mint-pale); }
.talk-mode-icon { grid-row: span 2; font-size: 30px; text-align: center; }
.talk-mode-name { font-size: 15px; font-weight: 700; color: var(--text); }
.talk-mode-desc { font-size: 12px; color: var(--text-sub); }

/* 全屏对话覆盖层 */
.talk-overlay {
  position: fixed; inset: 0; z-index: 200;
  display: flex; flex-direction: column; align-items: center;
  background: linear-gradient(170deg, #0f2e2a 0%, #14463e 55%, #0d3350 100%);
  color: #fff; padding: 16px;
}
.talk-overlay.hidden { display: none; }
.talk-top {
  width: 100%; max-width: 520px;
  display: flex; align-items: center; justify-content: space-between;
}
.talk-mode-label {
  font-size: 14px; font-weight: 700; color: #d7fff3;
  background: rgba(255, 255, 255, 0.12); padding: 6px 14px; border-radius: 999px;
}

.talk-status {
  margin-top: 22px; font-size: 15px; color: #d7fff3;
  min-height: 22px; text-align: center;
}

/* 字幕区 */
.talk-captions {
  flex: 1; width: 100%; max-width: 520px;
  margin: 16px 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; justify-content: flex-end;
}
.talk-caption {
  padding: 8px 12px; border-radius: 12px; font-size: 13.5px; line-height: 1.5;
  background: rgba(255, 255, 255, 0.08); color: rgba(255, 255, 255, 0.75);
}
.talk-caption.me { background: rgba(255, 255, 255, 0.16); color: #fff; }
.talk-caption.ai:last-child { background: rgba(77, 196, 160, 0.25); color: #eafff8; }

/* 底部控制 */
.talk-bottom {
  width: 100%; max-width: 520px;
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding-bottom: max(12px, env(safe-area-inset-bottom));
}
.talk-mic-btn {
  width: 54px; height: 54px; border-radius: 50%; border: none;
  background: rgba(255, 255, 255, 0.15) url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11h-2z"/></svg>') center / 26px no-repeat;
  cursor: pointer;
}
.talk-mic-btn:active { background-color: rgba(255, 255, 255, 0.3); }
.talk-mic-btn.recording {
  background: #ef4444 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 14a3 3 0 0 0 3-3V6a3 3 0 0 0-6 0v5a3 3 0 0 0 3 3zm5-3a5 5 0 0 1-10 0H5a7 7 0 0 0 6 6.92V21h2v-3.08A7 7 0 0 0 19 11h-2z"/></svg>') center / 26px no-repeat;
  animation: pulse-mic 1s infinite;
}
@keyframes pulse-mic {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}
.talk-end-btn {
  background: #e05c5c !important; border-color: #e05c5c !important;
  padding: 12px 26px; border-radius: 999px;
}

/* 音色选择 */
.voice-list {
  max-height: 340px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px; margin: 10px 0;
}
.voice-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-radius: 12px; border: 2px solid #e5e7eb;
  background: #fff; cursor: pointer; transition: all 0.15s;
}
.voice-item.active { border-color: var(--mint); background: var(--mint-pale); }
.voice-name { font-size: 13px; color: var(--text); word-break: break-all; }

/* 家庭同步设置区 */
.sync-box {
  margin: 12px 0; padding: 12px; border-radius: 12px;
  background: #f8faf9; border: 1px solid #e5ece9;
  display: flex; flex-direction: column; gap: 8px;
}
.sync-box .input { margin: 0; }

/* 家庭成员行：360px 窄屏上名字+年级+状态+三个按钮一定放不下，
   宁可换行也不能把它们挤成一列（闯关页页签就是这么竖排坏掉的）。 */
#people-list { display: flex; flex-direction: column; gap: 6px; }
.people-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  padding: 6px 8px; border-radius: 10px; background: #fff;
  border: 1px solid #e5ece9;
}
.people-row.on { border-color: #2f8f6b; background: #f1faf5; }
.people-name {
  border: 0; background: none; padding: 0; margin: 0; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #23423a; text-align: left;
}
.people-tag {
  font-size: 12px; color: #5b6b66; background: #eef3f1;
  padding: 2px 7px; border-radius: 999px; white-space: nowrap;
}
.people-row .btn { font-size: 12px; padding: 4px 8px; }

/* 音色弹窗必须盖在对话覆盖层之上 */
#modal-voice { z-index: 300 !important; }

/* 家长布置标签 */
.cloud-tag {
  background: #fff3e0 !important; color: #e67e22 !important;
  border-color: #ffd8a8 !important;
}

/* 对话覆盖层内开关行 */
.talk-toggles {
  width: 100%; max-width: 520px;
  display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px;
}
.talk-toggle {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: rgba(255,255,255,0.75);
  cursor: pointer; user-select: none;
  padding: 4px 10px; border-radius: 16px;
  background: rgba(255,255,255,0.1); transition: all 0.15s;
}
.talk-toggle.on { background: rgba(255,255,255,0.25); color: #fff; }
.talk-toggle input { display: none; }

/* 隐私说明 */
.privacy-note {
  font-size: 11px; color: var(--text-sub); line-height: 1.6;
  padding: 10px 12px; border-radius: 10px;
  background: #f8faf9; border: 1px solid #e5ece9;
  margin-top: 8px;
}

/* ================= 课内单词练习 (vocab_ex) ================= */

/* 册选择网格 */
.book-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
.book-card {
  background: var(--mint-pale); border-radius: 14px; padding: 16px;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.book-card:active { transform: scale(0.97); border-color: var(--mint); }
.book-card-title { font-size: 15px; font-weight: 700; color: var(--text); }
.book-card-info { font-size: 12px; color: var(--text-sub); margin-top: 4px; }

/* 模式切换标签 */
.mode-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px;
  -webkit-overflow-scrolling: touch;
}
.mode-tab {
  padding: 7px 14px; border-radius: 20px; border: 1.5px solid var(--border);
  background: #fff; font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: pointer; transition: all 0.15s;
}
.mode-tab.active {
  background: var(--mint); color: #fff; border-color: var(--mint);
}

/* 单元列表 */
.unit-list { display: flex; flex-direction: column; gap: 2px; }
.module-header {
  font-size: 13px; font-weight: 700; color: var(--mint-deep);
  padding: 10px 4px 4px; border-bottom: 1px solid var(--border);
}
.unit-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s;
}
.unit-item:active { background: var(--mint-pale); }
.unit-name { flex: 1; font-size: 14px; color: var(--text); }
.unit-count { font-size: 12px; color: var(--text-sub); }
.unit-arrow { color: var(--text-faint); font-size: 18px; }

/* ================= 试卷刷题 (exam) ================= */

/* 试卷列表 */
.paper-list { display: flex; flex-direction: column; gap: 2px; }
.paper-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 8px; border-radius: 10px; cursor: pointer;
  transition: background 0.15s;
}
.paper-item:active { background: var(--mint-pale); }
.paper-name { flex: 1; font-size: 14px; color: var(--text); }
.paper-pages { font-size: 12px; color: var(--text-sub); }

/* 答题正文 */
.exam-body { display: flex; flex-direction: column; gap: 14px; }
.exam-section {
  background: #fff; border: 1px solid var(--border); border-radius: 12px;
  padding: 12px;
}
.section-title {
  font-size: 14px; font-weight: 700; color: var(--mint-deep);
  padding-bottom: 8px; margin-bottom: 8px;
  border-bottom: 1.5px dashed var(--border);
}

/* 题目卡片 */
.q-card {
  background: var(--bg-sub); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 8px; border: 1.5px solid transparent;
}
.q-card.q-right { border-color: #86efac; background: #f0fdf4; }
.q-card.q-wrong { border-color: #fca5a5; background: #fef2f2; }
.q-stem { font-size: 14px; line-height: 1.6; color: var(--text); margin-bottom: 6px; }
.q-answer-mark { margin-top: 6px; font-size: 13px; color: #16a34a; }

/* 选项 */
.opt-list { display: flex; flex-direction: column; gap: 6px; }
.opt-item {
  padding: 8px 12px; border-radius: 8px; font-size: 13.5px;
  background: #fff; border: 1.5px solid var(--border);
  cursor: pointer; transition: all 0.12s; color: var(--text);
}
.opt-item:active { transform: scale(0.98); }
.opt-item.opt-selected {
  background: var(--mint-pale); border-color: var(--mint); color: var(--mint-deep);
  font-weight: 600;
}

/* 判断按钮 */
.judge-row { display: flex; gap: 8px; }
.judge-btn {
  padding: 7px 18px; border-radius: 8px; font-size: 13.5px;
  background: #fff; border: 1.5px solid var(--border);
  cursor: pointer; color: var(--text);
}
.judge-btn.judge-on {
  background: var(--mint-pale); border-color: var(--mint);
  color: var(--mint-deep); font-weight: 600;
}

/* 填空输入 */
.fill-input {
  width: 100%; box-sizing: border-box; padding: 8px 12px;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 13.5px; background: #fff; color: var(--text);
}
.fill-input:focus { outline: none; border-color: var(--mint); }

/* 题目配图 */
.q-imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 6px; }
.q-img {
  max-width: 140px; max-height: 110px; object-fit: contain;
  border-radius: 8px; background: #fff; border: 1px solid var(--border);
}

/* 原文兜底块 */
.raw-block {
  background: var(--bg-sub); border-radius: 10px; padding: 10px 12px;
  margin-top: 6px;
}
.raw-line { font-size: 13px; line-height: 1.7; color: var(--text); }

/* 提交栏 */
.submit-bar { padding: 12px 0 4px; }
.submit-btn {
  width: 100%; padding: 13px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, var(--mint) 0%, var(--mint-deep) 100%);
  color: #fff; font-size: 15px; font-weight: 700; cursor: pointer;
}
.submit-btn:disabled { opacity: 0.7; }

/* 试卷查看器 */
.viewer-header {
  display: flex; align-items: center; gap: 12px; margin-bottom: 12px;
}
.viewer-header .btn-back {
  background: var(--mint-pale); border: none; border-radius: 8px;
  padding: 8px 14px; font-size: 14px; cursor: pointer;
  color: var(--mint-deep); font-weight: 500;
}
.viewer-title {
  flex: 1; font-size: 16px; font-weight: 700; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.viewer-content {
  background: #f5f5f5; border-radius: 12px; overflow: hidden;
}

/* AI操作按钮 */
.ai-actions {
  display: flex; gap: 12px; padding: 12px 16px;
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border-top: 1px solid var(--border);
}
.ai-btn {
  flex: 1; padding: 12px; border-radius: 10px;
  background: #fff; border: 1.5px solid var(--border);
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.15s; color: var(--text);
}
.ai-btn:active { background: var(--mint); color: #fff; transform: scale(0.95); }

/* 练习进度条 */
.practice-progress {
  height: 4px; background: #f0f0f0; border-radius: 2px; margin-bottom: 12px;
}
.progress-bar {
  height: 100%; background: var(--mint); border-radius: 2px;
  transition: width 0.3s ease;
}
.practice-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; color: var(--text-sub); margin-bottom: 16px;
}
.practice-score {
  display: flex; gap: 16px; justify-content: center;
  font-size: 14px; font-weight: 600; margin-top: 16px;
}

/* 题目区域 */
.practice-question { text-align: center; margin-bottom: 20px; }
.question-word {
  font-size: 32px; font-weight: 700; color: var(--text);
  letter-spacing: 1px; margin-bottom: 8px;
}
.question-word-cn {
  font-size: 22px; font-weight: 600; color: var(--text);
  margin-bottom: 8px;
}
.btn-speak {
  background: var(--mint-pale); border: none; border-radius: 20px;
  padding: 8px 16px; font-size: 14px; cursor: pointer;
  color: var(--mint-deep); transition: all 0.15s;
}
.btn-speak:active { background: var(--mint); color: #fff; }
.btn-speak-large {
  width: 80px; height: 80px; border-radius: 50%;
  font-size: 28px; margin: 16px auto; display: block;
}

/* 选项网格 */
.options-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.option-btn {
  padding: 14px 12px; border-radius: 12px; border: 2px solid var(--border);
  background: #fff; font-size: 15px; text-align: center;
  cursor: pointer; transition: all 0.15s; word-break: break-word;
}
.option-btn:active { border-color: var(--mint); background: var(--mint-pale); }
.option-btn.correct {
  border-color: var(--mint); background: var(--mint-pale); color: var(--mint-deep);
}
.option-btn.wrong {
  border-color: var(--red); background: var(--red-soft); color: #b91c1c;
}

/* 拼写/听写输入 */
.spell-input-area {
  display: flex; gap: 10px; margin: 16px 0;
}
.spell-input {
  flex: 1; padding: 12px 14px; border-radius: 12px;
  border: 2px solid var(--border); font-size: 16px;
  outline: none; transition: border-color 0.2s;
}
.spell-input:focus { border-color: var(--mint); }
.spell-input.correct { border-color: var(--mint); background: var(--mint-pale); }
.spell-input.wrong { border-color: var(--red); background: var(--red-soft); }
.btn-check-spell {
  padding: 12px 20px; border-radius: 12px; border: none;
  background: var(--mint); color: #fff; font-size: 15px;
  font-weight: 600; cursor: pointer;
}
.btn-check-spell:disabled { opacity: 0.5; cursor: default; }
.spell-feedback {
  text-align: center; font-size: 16px; font-weight: 600;
  min-height: 24px; margin-top: 8px;
}
.dictation-hint {
  font-size: 14px; color: var(--text-sub); margin-bottom: 8px;
}

/* 闪卡 */
.flashcard-area { perspective: 800px; margin: 20px 0; }
.flashcard {
  width: 100%; height: 200px; position: relative;
  transform-style: preserve-3d; transition: transform 0.5s;
  cursor: pointer;
}
.flashcard.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back {
  position: absolute; inset: 0; backface-visibility: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  border-radius: 16px; padding: 20px;
}
.flashcard-front {
  background: linear-gradient(135deg, var(--mint-pale), #e0f2fe);
}
.flashcard-back {
  background: linear-gradient(135deg, #fef3c7, #fce7f3);
  transform: rotateY(180deg);
}
.flashcard-word { font-size: 36px; font-weight: 700; color: var(--text); }
.flashcard-meaning { font-size: 24px; font-weight: 600; color: var(--text); text-align: center; }
.flashcard-hint {
  font-size: 12px; color: var(--text-sub); margin-top: 12px;
  opacity: 0.7;
}
.flashcard-buttons {
  display: flex; gap: 16px; justify-content: center; margin-top: 20px;
}
.btn-fc {
  padding: 12px 28px; border-radius: 12px; border: none;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.btn-fc-wrong { background: var(--red-soft); color: #b91c1c; }
.btn-fc-correct { background: var(--mint-pale); color: var(--mint-deep); }

/* 结果页 */
.vocab-ex-result { text-align: center; padding: 30px 0; }
.result-emoji { font-size: 64px; margin-bottom: 12px; }
.result-msg { font-size: 20px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.result-score { font-size: 36px; font-weight: 800; color: var(--mint-deep); margin-bottom: 4px; }

/* ================= 管理员/家长模式样式 ================= */

/* 管理员仪表盘 */
.admin-dashboard {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px; padding: 20px; margin-bottom: 16px; color: #fff;
}
.admin-greeting {
  font-size: 18px; font-weight: 700; margin-bottom: 16px;
}
.admin-progress-row {
  display: flex; align-items: center; gap: 20px;
}
.admin-progress-row .ring-wrap { flex-shrink: 0; width: 96px; height: 96px; }
.admin-progress-row .ring { width: 96px; height: 96px; }
.admin-progress-row .ring-center { color: #fff; }
.admin-progress-row .ring-num { color: #fff; font-size: 20px; font-weight: 700; }
.admin-progress-row .ring-label { color: rgba(255,255,255,0.8); font-size: 11px; }
.admin-progress-row .ring-bg { stroke: rgba(255,255,255,0.2); }
.admin-progress-row .ring-fg { stroke: #fff; }
.admin-stat-cards {
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.admin-stat {
  display: flex; justify-content: space-between; align-items: center;
  background: rgba(255,255,255,0.15); border-radius: 10px; padding: 8px 14px;
}
.admin-stat-label { font-size: 13px; opacity: 0.9; }
.admin-stat-value { font-size: 18px; font-weight: 700; }

/* 管理员作业列表（只读） */
.admin-hw-list { display: flex; flex-direction: column; gap: 10px; }
.admin-hw-item {
  background: var(--card); border-radius: 14px; padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.admin-hw-info { flex: 1; min-width: 0; }
.admin-hw-name { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; word-break: break-word; }
.admin-hw-meta { font-size: 12px; color: var(--text-sub); }
.admin-hw-status {
  font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 999px;
  white-space: nowrap;
}
.admin-hw-status.status-completed { background: var(--mint-pale); color: var(--mint-deep); }
.admin-hw-actions { display: flex; gap: 4px; flex-shrink: 0; }
.admin-hw-btn {
  background: none; border: none; font-size: 17px; cursor: pointer;
  padding: 6px; border-radius: 8px; line-height: 1; user-select: none;
}
.admin-hw-btn:active { background: rgba(0,0,0,0.06); }
.admin-hw-status.status-in_progress { background: #fef3c7; color: #92400e; }
.admin-hw-status.status-pending { background: #e5e7eb; color: #6b7280; }
.admin-hw-status.status-overdue { background: var(--red-soft); color: #b91c1c; }

/* 管理员设置页 */
.parent-settings-body { padding: 0 4px; }
.parent-settings-body .sync-box { margin-bottom: 16px; }

/* 管理员统计页加载状态 */
.parent-stats-loading {
  text-align: center; padding: 40px 20px; color: var(--text-sub); font-size: 14px;
}
.result-pct { font-size: 14px; color: var(--text-sub); margin-bottom: 24px; }
.result-buttons { display: flex; gap: 12px; justify-content: center; }

/* ================= AI 每日练习 ================= */
.daily-dashboard { padding: 8px 0; }
.daily-header-card {
  border-radius: 16px; padding: 20px; text-align: center; margin-bottom: 16px;
}
.daily-week-label { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }
.daily-day-label { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.daily-day-desc { font-size: 13px; color: var(--text-sub); }
.daily-stats-row {
  display: flex; justify-content: space-around; margin-bottom: 16px;
  background: var(--card); border-radius: 12px; padding: 12px 0;
  box-shadow: var(--shadow-soft);
}
.daily-stat { text-align: center; }
.daily-stat-val { font-size: 20px; font-weight: 700; color: var(--mint-deep); }
.daily-stat-lbl { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.daily-today-card {
  background: var(--card); border-radius: 12px; padding: 16px;
  box-shadow: var(--shadow-soft); margin-bottom: 12px;
}
.daily-today-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.daily-today-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.daily-today-row:last-child { margin-bottom: 0; }
.daily-today-icon { font-size: 28px; }
.daily-today-subject { font-size: 14px; font-weight: 600; }
.daily-today-detail { font-size: 12px; color: var(--text-sub); }
.daily-ai-badge {
  background: var(--mint-pale); border-radius: 10px; padding: 10px; margin-bottom: 16px;
}
.daily-start-btn { width: 100%; font-size: 16px; padding: 14px; }

/* 做题界面 */
.daily-q-wrap { padding: 4px 0; }
.daily-q-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.daily-q-subject {
  font-size: 12px; font-weight: 600; padding: 4px 10px;
  border-radius: 8px;
}
.daily-q-progress { font-size: 12px; color: var(--text-sub); }
.daily-q-progress-bar {
  background: #e5e7eb; border-radius: 4px; height: 6px; margin-bottom: 16px; overflow: hidden;
}
.daily-q-progress-fill {
  background: var(--mint); height: 100%; border-radius: 4px; transition: width 0.3s;
}
.daily-q-text {
  font-size: 16px; font-weight: 600; line-height: 1.6;
  margin-bottom: 20px; white-space: pre-line;
}
.daily-options { display: flex; flex-direction: column; gap: 10px; }
.daily-opt-btn {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--border);
  border-radius: 12px; padding: 14px 16px;
  font-size: 15px; cursor: pointer; transition: all 0.15s;
  line-height: 1.4;
}
.daily-opt-btn:active { transform: scale(0.98); }
.daily-opt-btn.correct { border-color: var(--mint); background: var(--mint-pale); color: var(--mint-deep); }
.daily-opt-btn.wrong { border-color: var(--red); background: var(--red-soft); color: #b91c1c; }
.daily-opt-btn.disabled { pointer-events: none; opacity: 0.7; }
.daily-input-area { margin-top: 4px; }
.daily-answer-input { font-size: 18px; text-align: center; padding: 12px; }
.daily-q-feedback { margin-top: 16px; }
.daily-fb-correct {
  background: var(--mint-pale); color: var(--mint-deep);
  padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 600; text-align: center;
}
.daily-fb-wrong {
  background: var(--red-soft); color: #b91c1c;
  padding: 12px; border-radius: 10px; font-size: 15px; font-weight: 600; text-align: center;
}
.daily-fb-hint {
  margin-top: 8px; padding: 10px; background: #fef3c7;
  border-radius: 8px; font-size: 13px; color: #92400e;
}

/* 总结页 */
.daily-summary { text-align: center; padding: 20px 0; }
.daily-summary-emoji { font-size: 48px; margin-bottom: 8px; }
.daily-summary-msg { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.daily-summary-score {
  font-size: 40px; font-weight: 800; color: var(--mint-deep); margin: 12px 0;
}
.daily-summary-detail {
  background: var(--card); border-radius: 12px; padding: 14px;
  box-shadow: var(--shadow-soft); margin-bottom: 16px; text-align: left;
}
.daily-summary-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; font-size: 14px;
}
.daily-summary-row + .daily-summary-row { border-top: 1px solid var(--border); }
.daily-summary-next {
  background: var(--mint-pale); border-radius: 10px; padding: 12px;
  font-size: 13px; color: var(--text-sub); margin-bottom: 16px;
}

/* ================= 全屏做题页面（考试系统风格） ================= */
#practice-view {
  min-height: calc(100vh - var(--nav-h) - 60px);
  display: flex; flex-direction: column;
}
.pv-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; margin-bottom: 4px;
  position: sticky; top: 0; background: var(--bg); z-index: 10;
}
.pv-title {
  flex: 1; font-size: 15px; font-weight: 700;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-progress {
  font-size: 12px; color: var(--text-sub); white-space: nowrap;
}
.pv-progress-bar {
  background: #e5e7eb; border-radius: 3px; height: 4px;
  margin-bottom: 12px; overflow: hidden;
}
.pv-progress-fill {
  background: linear-gradient(90deg, var(--mint), var(--mint-deep));
  height: 100%; border-radius: 3px; transition: width 0.3s ease;
  width: 0;
}
.pv-body {
  flex: 1; padding: 4px 0 80px; /* 底部留空给 footer */
}
.pv-footer {
  position: fixed; bottom: var(--nav-h); left: 0; right: 0;
  background: var(--card); border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  display: flex; gap: 10px; align-items: center; justify-content: center;
  z-index: 10;
}
.pv-footer:empty { display: none; }

/* 全屏做题内的题目样式 */
.pv-q-subject {
  display: inline-block; font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 8px; margin-bottom: 8px;
}
.pv-q-text {
  font-size: 17px; font-weight: 600; line-height: 1.7;
  margin-bottom: 20px; white-space: pre-line;
}
.pv-options { display: flex; flex-direction: column; gap: 10px; }
.pv-opt-btn {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--border);
  border-radius: 14px; padding: 14px 16px;
  font-size: 15px; cursor: pointer; transition: all 0.15s;
  line-height: 1.4;
}
.pv-opt-btn:active { transform: scale(0.98); }
.pv-opt-btn.correct { border-color: var(--mint); background: var(--mint-pale); color: var(--mint-deep); }
.pv-opt-btn.wrong { border-color: var(--red); background: var(--red-soft); color: #b91c1c; }
.pv-opt-btn.disabled { pointer-events: none; opacity: 0.65; }
.pv-input-area { margin-top: 4px; }
.pv-answer-input { font-size: 18px; text-align: center; padding: 14px; }
.pv-feedback { margin-top: 16px; }
.pv-fb-correct {
  background: var(--mint-pale); color: var(--mint-deep);
  padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 600; text-align: center;
}
.pv-fb-wrong {
  background: var(--red-soft); color: #b91c1c;
  padding: 14px; border-radius: 12px; font-size: 15px; font-weight: 600; text-align: center;
}
.pv-fb-hint {
  margin-top: 8px; padding: 10px; background: #fef3c7;
  border-radius: 8px; font-size: 13px; color: #92400e;
}

/* ================= KT 掌握度迷你报告（仪表盘） ================= */
.kt-mini-report {
  background: var(--card); border-radius: 12px; padding: 12px 14px;
  margin-bottom: 12px; box-shadow: var(--shadow-soft);
}
.kt-mini-title {
  font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text);
}
.kt-mini-row {
  display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
}
.kt-mini-label {
  font-size: 12px; color: var(--text-sub); min-width: 60px;
}
.kt-mini-bar {
  flex: 1; height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden;
}
.kt-mini-fill {
  height: 100%; border-radius: 4px; transition: width 0.5s ease;
}
.kt-mini-val {
  font-size: 12px; font-weight: 700; min-width: 36px; text-align: right;
}
.kt-mini-detail {
  font-size: 11px; color: var(--text-sub); margin-top: 4px;
  padding-top: 6px; border-top: 1px solid var(--border);
}

/* ================= KT LLM 诊断结果（仪表盘） ================= */
.kt-diagnostic {
  background: linear-gradient(135deg, #ede9fe, #dbeafe); border-radius: 12px;
  padding: 14px; margin-bottom: 12px;
}
.kt-diag-title {
  font-size: 13px; font-weight: 700; margin-bottom: 10px;
}
.kt-diag-block { margin-bottom: 10px; }
.kt-diag-block:last-child { margin-bottom: 0; }
.kt-diag-date {
  font-size: 11px; color: var(--text-sub); margin-bottom: 4px;
}
.kt-diag-text {
  font-size: 13px; line-height: 1.6; color: var(--text);
}

/* ================= 诊断结果页（全屏） ================= */
.daily-diagnostic-result {
  padding: 16px;
}
.diag-header {
  font-size: 18px; font-weight: 700; text-align: center;
  margin-bottom: 20px; color: var(--text);
}
.diag-section {
  background: var(--card); border-radius: 12px; padding: 16px;
  margin-bottom: 12px; box-shadow: var(--shadow-soft);
}
.diag-subject {
  font-size: 14px; font-weight: 700; margin-bottom: 8px;
}
.diag-content {
  font-size: 14px; line-height: 1.7; color: var(--text);
}
.diag-empty {
  font-size: 13px; color: var(--text-sub); font-style: italic;
}
.daily-loading {
  text-align: center; padding: 60px 20px;
  font-size: 16px; font-weight: 600;
}
.loading-spinner {
  width: 36px; height: 36px; border: 3px solid var(--border);
  border-top-color: var(--mint); border-radius: 50%;
  animation: spin 0.8s linear infinite; margin: 0 auto 16px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 小结页 KT 报告 ================= */
.summary-kt-section {
  background: var(--mint-pale); border-radius: 12px; padding: 14px;
  margin: 16px 0; text-align: left;
}
.summary-kt-title {
  font-size: 13px; font-weight: 700; margin-bottom: 8px; color: var(--text);
}
.summary-kt-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; padding: 4px 0; color: var(--text);
}
.summary-kt-weak {
  font-size: 12px; color: #e67e22; margin-top: 8px;
  padding-top: 6px; border-top: 1px solid rgba(0,0,0,0.06);
}

/* ================= 吉祥物系统（v3 学龄版） ================= */
/* 默认给一个克制的尺寸：各场景都有更具体的选择器覆盖，
   万一漏掉也不会退化成 svg 的固有尺寸（约 300×150）把整行顶开 */
.mascot { display: inline-block; line-height: 0; flex: 0 0 auto; width: 40px; height: 40px; }
.mascot svg { display: block; width: 100%; height: 100%; }
.mascot-bounce { animation: mascotBounce 2.2s var(--ease-smooth) infinite; }
@keyframes mascotBounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.mascot-pop { animation: popIn 0.4s var(--ease-bounce); }

/* 首页吉祥物问候行：小尺寸克制出场 */
.encourage-mascot { width: 76px; height: 76px; margin: 0 auto var(--sp-1); }
.encourage-mascot .mascot-svg { width: 100%; height: 100%; animation: mascotPop 0.5s var(--ease-bounce); }
@keyframes mascotPop {
  0% { transform: scale(0.3); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.home-mascot-row {
  display: flex; align-items: center; gap: 10px;
  margin: 10px 0 2px; min-height: 52px;
}
.home-mascot-row .mascot { width: 52px; height: 52px; }
.mascot-speech {
  position: relative; background: #fff; border-radius: 14px;
  padding: 9px 13px; font-size: var(--fs-sm); color: var(--text);
  box-shadow: var(--shadow-card); line-height: 1.5; flex: 1;
}
.mascot-speech::before {
  content: ''; position: absolute; left: -5px; top: 50%; transform: translateY(-50%);
  border: 6px solid transparent; border-right-color: #fff; border-left: 0;
}

/* 选伙伴全屏覆盖层 */
.mp-overlay {
  position: fixed; inset: 0; background: var(--bg); z-index: 300;
  display: flex; flex-direction: column; align-items: center;
  padding: calc(24px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto; animation: fadeIn 0.25s ease;
}
.mp-title { font-size: var(--fs-xl); font-weight: 800; color: var(--text); margin-top: 8px; }
.mp-sub { font-size: var(--fs-sm); color: var(--text-sub); margin: 6px 0 18px; text-align: center; }
.mp-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
  width: 100%; max-width: 420px;
}
.mp-card {
  background: #fff; border-radius: var(--radius); border: 2.5px solid transparent;
  padding: 14px 10px 12px; text-align: center; cursor: pointer;
  box-shadow: var(--shadow-card);
  transition: transform 0.2s var(--ease-bounce), border-color 0.2s ease, background 0.2s ease;
}
.mp-card:active { transform: scale(0.96); }
.mp-card.selected {
  border-color: var(--mint); background: var(--mint-pale);
  transform: scale(1.03);
}
.mp-card .mascot { width: 76px; height: 76px; margin: 0 auto 6px; }
.mp-card.selected .mascot { animation: mascotBounce 1.4s var(--ease-smooth) infinite; }
.mp-name { font-size: var(--fs-md); font-weight: 700; color: var(--text); }
.mp-desc { font-size: var(--fs-xs); color: var(--text-sub); margin-top: 3px; line-height: 1.5; }
.mp-confirm {
  margin-top: 20px; width: 100%; max-width: 420px;
  padding: 14px; border-radius: var(--radius-pill);
  background: var(--mint-deep); color: #fff; font-size: 16px; font-weight: 700;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
  transition: transform var(--dur-fast) ease, opacity var(--dur-fast) ease;
}
.mp-confirm:disabled { opacity: 0.4; box-shadow: none; }
.mp-confirm:not(:disabled):active { transform: scale(0.97); }
.mp-skip { margin-top: 12px; font-size: var(--fs-sm); color: var(--text-faint); background: none; }

/* 设置页：我的伙伴入口 */
.mascot-setting-row {
  display: flex; align-items: center; gap: 12px;
  background: #fff; border-radius: var(--radius); padding: 12px 14px;
  box-shadow: var(--shadow-card); margin: 10px 0; cursor: pointer;
}
.mascot-setting-row .mascot { width: 44px; height: 44px; }
.mascot-setting-info { flex: 1; }
.mascot-setting-name { font-size: var(--fs-md); font-weight: 700; }
.mascot-setting-hint { font-size: var(--fs-xs); color: var(--text-faint); margin-top: 2px; }
.mascot-setting-arrow { color: var(--text-faint); font-size: 16px; }

/* ============ AI 智能建议卡片 (v1.23) ============ */
.suggestion-card {
  background: linear-gradient(135deg, #fffbeb, #ffffff);
  border: 1.5px solid #fde68a;
  border-radius: 18px;
  padding: 14px 14px 10px;
  margin: 12px 16px;
  box-shadow: var(--shadow-card);
}
.suggestion-head {
  display: flex; align-items: baseline; gap: 8px;
  font-size: var(--fs-md); font-weight: 700; color: #92400e;
  margin-bottom: 8px;
}
.suggestion-sub { font-size: var(--fs-xs); color: var(--text-faint); font-weight: 400; }
.suggestion-list { display: flex; flex-direction: column; gap: 8px; }
.suggestion-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-radius: 12px; padding: 8px 10px;
  transition: transform var(--dur-fast) ease;
}
.suggestion-item:active { transform: scale(0.98); }
.sug-icon { font-size: 22px; flex-shrink: 0; }
.sug-main { flex: 1; min-width: 0; }
.sug-title {
  font-size: var(--fs-sm); font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sug-bar {
  height: 6px; border-radius: 3px; background: #f1f5f9;
  margin-top: 5px; overflow: hidden;
}
.sug-bar i {
  display: block; height: 100%; border-radius: 3px;
  background: #f59e0b;
  transition: width 0.4s ease;
}
.sug-btn {
  flex-shrink: 0;
  padding: 7px 14px; border-radius: var(--radius-pill);
  background: var(--mint-deep); color: #fff;
  font-size: var(--fs-xs); font-weight: 700;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: transform var(--dur-fast) ease;
}
.sug-btn:active { transform: scale(0.94); }
.sug-gain {
  display: inline-block;
  color: #059669; font-size: 11px; font-weight: 700;
  background: #ecfdf5; border-radius: 6px;
  padding: 1px 5px; margin-left: 4px;
}

/* v1.24：每日练 AI 出题标记 */
.daily-ai-tag {
  display: inline-block; margin-left: 6px;
  font-size: 11px; font-weight: 700; color: #0369a1;
  background: #e0f2fe; border-radius: 6px; padding: 1px 6px;
  animation: aiTagPop 0.4s var(--ease-bounce);
}
@keyframes aiTagPop {
  0% { transform: scale(0.5); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

/* ---------- 先教后练：教学单元（一次只露一步） ---------- */
.teach-modal { max-width: 420px; }
.teach-head { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.teach-phase { font-size: 12px; font-weight: 700; color: var(--mint-deep); }
.teach-dots { display: flex; gap: 4px; margin-left: auto; }
.teach-dots i { width: 14px; height: 4px; border-radius: 2px; background: rgba(255, 255, 255, .22); }
.teach-dots i.on { background: var(--mint); }
.teach-body { min-height: 190px; margin-top: 6px; }
.teach-q { font-size: 16px; line-height: 1.6; padding: 12px 14px; border-radius: 12px; background: rgba(255, 255, 255, .07); }
.teach-qdim { font-size: 13px; line-height: 1.5; opacity: .6; margin-bottom: 10px; }
.teach-ask { font-size: 14px; margin: 14px 0 10px; color: var(--mint); }
.teach-h { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.teach-p { font-size: 14.5px; line-height: 1.75; opacity: .92; }
.teach-warn {
  font-size: 13px; line-height: 1.6; margin-top: 12px; padding: 9px 11px;
  border-left: 3px solid #f6c453; background: rgba(246, 196, 83, .12); border-radius: 0 8px 8px 0;
}
.teach-ok { font-size: 13.5px; color: var(--mint); margin-top: 10px; }
.teach-src { font-size: 12px; margin-top: 12px; opacity: .55; }
.teach-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.teach-opt {
  font: inherit; font-size: 14px; padding: 8px 13px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(255, 255, 255, .2); background: rgba(255, 255, 255, .06); color: inherit;
}
.teach-opt.right { border-color: var(--mint); background: rgba(77, 196, 160, .22); }
.teach-opt.miss { opacity: .45; border-color: rgba(230, 120, 120, .5); }
.teach-steps { display: flex; flex-direction: column; gap: 8px; }
.teach-step {
  font-size: 14.5px; line-height: 1.65; padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 255, 255, .07); animation: teachIn .22s ease-out;
}
.teach-step.why { border-left: 3px solid var(--mint); background: rgba(77, 196, 160, .1); }

/* ---- 一节课：消息流里的题卡（卡片在气泡外，孩子才分得清哪句是老师说的话） ---- */
.msg-pretty { white-space: pre-wrap; }
.msg-card { margin: 6px 0 2px 42px; }
.card-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.card-opt {
  font: inherit; font-size: 15px; padding: 10px 16px; border-radius: 12px; cursor: pointer;
  background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .18); color: inherit;
  min-width: 56px; min-height: 44px;                 /* 二年级的手指精度，别做小按钮 */
}
.card-opt:active { transform: scale(.97); background: rgba(255, 255, 255, .16); }
.card-fill { display: flex; gap: 8px; align-items: center; max-width: 320px; }
.card-answer {
  flex: 1; font: inherit; font-size: 17px; padding: 10px 12px; border-radius: 12px;
  background: rgba(255, 255, 255, .1); border: 1.5px solid rgba(255, 255, 255, .22); color: inherit;
  letter-spacing: 1px;
}
.card-send { flex: none; min-height: 44px; }
.card-done {
  display: inline-block; font-size: 15px; padding: 8px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, .06); border: 1.5px solid rgba(255, 255, 255, .14);
}
.card-done.ok { border-color: var(--mint); color: var(--mint); }
.card-done.no { border-color: rgba(230, 120, 120, .55); opacity: .85; }
.card-done.stale { opacity: .45; font-size: 13px; }
.card-await { font-size: 12.5px; opacity: .55; }
.card-voice { margin-top: 8px; display: block; }
.card-words { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.card-word {
  font: inherit; display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 10px 13px; border-radius: 10px; cursor: pointer; text-align: left;
  background: rgba(255, 255, 255, .08); border: 1.5px solid rgba(255, 255, 255, .18); color: inherit;
}
.card-word b { font-size: 16px; letter-spacing: .5px; }
.card-word span { font-size: 13px; opacity: .8; }
.card-invite-btn { min-height: 48px; font-size: 16px; padding: 12px 20px; }
.practice-gate-hint { font-size: 13px; line-height: 1.6; opacity: .8; margin: 6px 0 10px; padding: 10px 12px; border-radius: 10px; background: rgba(255,255,255,.06); }

/* ---- 家长端：今天这节课的汇报 ---- */
.admin-lesson { margin-top: 10px; padding-top: 10px; border-top: 1px dashed rgba(255, 255, 255, .18); }
.admin-lesson .al-line { font-size: 14px; line-height: 1.6; }
.admin-lesson .al-quote { font-size: 13px; opacity: .8; margin-top: 4px; line-height: 1.6; }
.admin-lesson .al-replay { margin-top: 8px; }
@keyframes teachIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---- 单词练习：先学后练（v1.35，KET 四环节） ---- */
.vocab-teach-head { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
.vocab-teach-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px;
  background: var(--card); border-radius: 12px; margin-bottom: 8px; box-shadow: var(--shadow-soft); }
.vocab-teach-spk { border: 0; background: var(--mint-soft); border-radius: 999px;
  width: 34px; height: 34px; font-size: 16px; cursor: pointer; flex: 0 0 auto; }
.vocab-teach-w { font-weight: 700; font-size: 16px; color: var(--text); }
.vocab-teach-t { margin-left: auto; font-size: 13px; color: var(--text-sub); }

/* 窄屏（<=360px）角标与图标会水平相撞（320px 实测重叠 5px）：
   把图标整体抬到角标垂直带之下，用垂直分离代替水平避让。 */
@media (max-width: 360px) {
  .pcard { padding-top: 34px; }
  .pcard-badge { top: 8px; right: 8px; }
}

/* ================= 知识闯关（knowledge-quest.js） ================= */
/* 关卡地图 */
.qk-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.qk-subtab {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--card); border: 2px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 4px; font-size: 14px; font-weight: 600; color: var(--text-sub); cursor: pointer;
  /* 360px 下三等分只剩约 110px，"图标+数学+0/30" 差几像素就竖排折成"数\n学" */
  white-space: nowrap;
}
@media (max-width: 380px) {
  .qk-subtab { font-size: 13px; gap: 3px; }
  .qk-subtab-ico { font-size: 14px; }
  .qk-subtab-cnt { font-size: 10px; }
}
.qk-subtab.active { border-color: var(--mint); color: var(--mint-deep); background: var(--mint-pale); }
.qk-subtab-ico { font-size: 16px; }
.qk-subtab-cnt { font-size: 11px; color: var(--text-faint); font-variant-numeric: tabular-nums; }

.qk-hero {
  display: flex; align-items: center; gap: 12px;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  border-radius: var(--radius); padding: 14px 16px; color: #fff;
  box-shadow: var(--shadow-float); margin-bottom: 10px;
}
.qk-hero-l { flex: 1; min-width: 0; }
.qk-hero-cur { font-size: 16px; font-weight: 700; margin-bottom: 3px; }
.qk-hero-meta { font-size: 12px; opacity: .9; white-space: nowrap; }
.qk-hero-go { background: rgba(255, 255, 255, .22); color: #fff; border: 1px solid rgba(255, 255, 255, .6); flex-shrink: 0; }

.qk-toolrow { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.qk-tool {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: 13px; color: var(--text); cursor: pointer;
}
.qk-tool-note { font-size: 11px; color: var(--text-faint); margin-left: auto; }

.qk-unit { margin-bottom: 16px; }
.qk-unit.is-locked { opacity: .5; }
.qk-unit-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 8px; font-size: 13px; }
.qk-unit-ico { color: var(--orange); font-size: 11px; }
.qk-unit-name { font-weight: 700; color: var(--text); }
.qk-unit-sub { font-size: 11px; color: var(--text-faint); margin-left: auto; }

/* 地图式蛇形路径：一行 3 关，虚线从节点底下穿过，行间在拐弯那一侧接上，
   所以视线是 → ↓ ← ↓ → 一路往下，不是一片密密麻麻的圆点。
   44px = 行内边距 14 + 半径 30，让拐弯那段虚线正好落在边上那个圆的圆心上。 */
.qk-path {
  position: relative; display: flex; align-items: flex-start; padding: 0 14px;
}
.qk-path.is-back { flex-direction: row-reverse; }
.qk-path::before {
  /* 虚线只画在首尾两个车道圆心之间，跨度由 JS 按实际占用的车道算出来塞进 --pl/--pr，
     写死百分比会在不满一行的那几行往空车道方向多伸出一截没头的路 */
  content: ''; position: absolute; top: 30px;
  left: var(--pl, 16.66%); right: var(--pr, 16.66%);
  border-top: 3px dashed var(--border); z-index: 0;
}
.qk-path.is-solo::before { display: none; }
.qk-path-pad { flex: 1 0 0; }
/* 拐弯那段竖虚线：左右边距和 .qk-path 的内边距对齐，
   再用 83.33% / 16.66% 定位到车道圆心上，这样任何屏宽都接得住（写死 px 在 320 屏就偏了） */
.qk-turn { position: relative; height: 30px; margin: 0 14px; }
.qk-turn::before {
  content: ''; position: absolute; top: 0; bottom: 0; width: 0;
  border-left: 3px dashed var(--border); transform: translateX(-50%);
}
.qk-turn::before { left: var(--lx, 83.33%); }
.qk-node {
  position: relative; z-index: 1; flex: 1 0 0;
  display: flex; flex-direction: column; align-items: center;
  background: none; border: 0; padding: 0; cursor: pointer;
}
.qk-node-n {
  width: 100%; max-width: 60px; aspect-ratio: 1; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums;
  background: var(--card); border: 2px solid var(--border); color: var(--text-faint);
  box-shadow: var(--shadow);
}
.qk-node-star { font-size: 10px; letter-spacing: -1px; color: var(--text-faint); margin-top: 4px; }
/* 释词题里被提问的那个字/词：加粗 + 下划红线，孩子要清楚知道问的是哪个字 */
.qk-hl { font-weight: 900; color: #ef4f2c; border-bottom: 3px solid #ef4f2c; padding-bottom: 1px; }
.qk-node.is-open .qk-node-n { border-color: var(--orange); color: var(--orange); background: #fff7ed; }
.qk-node.is-open .qk-node-star { color: var(--orange); font-weight: 700; letter-spacing: 0; }
.qk-node.is-done .qk-node-n {
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  border-color: var(--mint-deep); color: #fff;
}
.qk-node.is-done .qk-node-star { color: var(--star); letter-spacing: 0; }
.qk-node.is-lock { cursor: not-allowed; }
.qk-node.is-soon { cursor: not-allowed; }
.qk-node.is-soon .qk-node-n { background: repeating-linear-gradient(45deg, #f6f1e6, #f6f1e6 6px, #f1eadc 6px, #f1eadc 12px); border-style: dotted; color: #c9bda6; }
.qk-node.is-soon .qk-node-star { color: #b6a687; letter-spacing: 0; font-size: 9px; }
.qk-node.is-lock .qk-node-n { background: #f3f4f6; border-style: dashed; color: var(--text-faint); }
.qk-node.is-cur .qk-node-n { animation: qkPulse 1.6s ease-in-out infinite; }
.qk-fold {
  text-align: center; font-size: 12px; color: var(--text-faint);
  background: rgba(255, 255, 255, .55); border-radius: var(--radius-pill);
  padding: 7px 10px; margin: 6px 0;
}
.qk-node:not(:disabled):active .qk-node-n { transform: scale(.92); }
@keyframes qkPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 159, 67, .45); }
  50% { box-shadow: 0 0 0 7px rgba(255, 159, 67, 0); }
}

/* 答题进行中：顶部工具条 */
.qk-bar { display: flex; align-items: center; margin-bottom: 10px; min-height: 30px; }
.qk-skip {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 5px 14px; font-size: 13px; color: var(--text-sub); cursor: pointer;
}
.qk-streak {
  margin-left: auto; display: inline-flex; align-items: center; gap: 3px;
  background: var(--star-soft); color: #92400e; border-radius: var(--radius-pill);
  padding: 5px 12px; font-size: 13px; font-weight: 600;
}
.qk-streak b { font-size: 15px; font-variant-numeric: tabular-nums; }
.qk-streak.is-hot { background: linear-gradient(135deg, var(--star), var(--orange)); color: #fff; }

/* 题台：大字号 + 挖空，取自录屏的诗词排版 */
.qk-stage {
  background: var(--card); border-radius: var(--radius); padding: 22px 14px;
  text-align: center; box-shadow: var(--shadow-card); margin-bottom: 14px;
}
.qk-stage-main {
  /* 题目走 APP 默认黑体：宋体的衬线数字和英文对二年级太费眼，楷体只留给古诗正文 */
  font-size: 26px; font-weight: 700; line-height: 1.9; letter-spacing: 3px;
  color: var(--text); word-break: break-word; font-variant-numeric: tabular-nums;
}
.qk-stage-main.is-plain { font-size: 17px; font-weight: 600; letter-spacing: .5px; line-height: 1.7; }
.qk-stage-sub { font-size: 13px; color: var(--text-sub); margin-top: 6px; letter-spacing: 0; }
.qk-blank {
  display: inline-block; min-width: 34px; padding: 0 4px; margin: 0 2px;
  border-bottom: 3px solid var(--orange); color: var(--orange);
}
.qk-stage-listen { padding-bottom: 16px; }
.qk-play {
  width: 66px; height: 66px; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--mint), var(--mint-deep));
  color: #fff; font-size: 28px; box-shadow: var(--shadow-float); margin-bottom: 8px;
}
.qk-play:active { transform: scale(.94); }
.qk-listen-tip { font-size: 11px; color: var(--text-faint); text-align: center; margin-top: 10px; }

.qk-prompt { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.qk-opts { gap: 10px; }
.qk-opt { display: flex; align-items: center; gap: 10px; position: relative; }
.qk-opt-key {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--mint-pale); color: var(--mint-deep);
  font-size: 12px; font-weight: 800;
}
.qk-opt-txt { flex: 1; min-width: 0; }
.qk-opt-wide { justify-content: center; text-align: center; }
.qk-opt-wide .qk-opt-key { display: none; }
.qk-mark { position: absolute; right: 14px; font-size: 16px; font-weight: 800; }
.qk-opt.correct .qk-mark { color: var(--mint-deep); }
.qk-opt.wrong .qk-mark { color: var(--red); }

/* 底部解析抽屉（挂在 #pv-footer 里） */
.qk-sheet {
  width: 100%; border-radius: var(--radius-sm); padding: 12px 14px;
  background: var(--mint-pale); animation: qkRise .22s var(--ease-smooth);
}
.qk-sheet.is-bad { background: #fef2f2; }
.qk-sheet.is-ask { background: #fff7ed; }
.qk-sheet-ans { font-size: 14px; font-weight: 800; color: var(--mint-deep); margin-bottom: 4px; }
.qk-sheet.is-bad .qk-sheet-ans { color: #b91c1c; }
.qk-sheet.is-ask .qk-sheet-ans { color: #92400e; margin-bottom: 10px; }
.qk-sheet-expl {
  font-size: 12px; line-height: 1.6; color: var(--text-sub);
  max-height: 76px; overflow-y: auto; margin-bottom: 10px;
}
.qk-next { width: 100%; font-variant-numeric: tabular-nums; }
.qk-sheet-row { display: flex; gap: 10px; }
.qk-sheet-row .btn { flex: 1; }
@keyframes qkRise { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* 挂机召回 */
.qk-idle {
  margin-top: 18px; background: var(--card); border: 2px solid var(--mint-soft);
  border-radius: var(--radius); padding: 14px; text-align: center; box-shadow: var(--shadow-card);
}
.qk-idle-txt { font-size: 14px; color: var(--text); margin-bottom: 10px; }
.qk-idle-acts { display: flex; gap: 10px; justify-content: center; }

/* 结算卡 */
.qk-result { padding-top: 4px; }
.qk-card {
  position: relative; background: linear-gradient(180deg, #fff8ef, var(--card));
  border: 2px solid #ffe4c4; border-radius: var(--radius-lg); padding: 18px 16px;
  box-shadow: var(--shadow-card); overflow: hidden;
}
.qk-card-h { font-size: 18px; font-weight: 800; color: #b45309; }
.qk-coin {
  display: inline-block; margin-top: 6px; background: var(--star-soft); color: #92400e;
  border-radius: var(--radius-pill); padding: 3px 10px; font-size: 12px; font-weight: 700;
}
.qk-stars { text-align: center; margin: 6px 0 12px; }
.qk-star { font-size: 30px; color: #e5e7eb; margin: 0 4px; display: inline-block; }
.qk-star.on { color: var(--star); text-shadow: 0 2px 8px rgba(255, 201, 77, .5); animation: qkStar .4s var(--ease-bounce) backwards; }
.qk-star.on:nth-child(2) { animation-delay: .12s; }
.qk-star.on:nth-child(3) { animation-delay: .24s; }
@keyframes qkStar { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }
.qk-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px;
}
.qk-cell { text-align: center; }
.qk-cell b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; color: var(--text); }
.qk-cell span { font-size: 11px; color: var(--text-faint); }
.qk-extra { text-align: center; font-size: 11px; color: var(--text-faint); margin-top: 10px; }
.qk-hint {
  margin-top: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 600; text-align: center;
}
.qk-hint.is-pass { background: var(--mint-pale); color: var(--mint-deep); }
.qk-hint.is-fail { background: #fff7ed; color: #92400e; }
.qk-acts { display: flex; gap: 10px; margin-top: 14px; }
.qk-act { flex: 1; padding: 13px 10px; font-size: 15px; font-weight: 700; }

/* 拼词题：字母块 + 配图（录屏的"看图拼词"） */
.qk-stage-tiles { padding-bottom: 18px; }
/* 词图只有 4/292，取不到的时候不能留一块白盒子在那儿——解码成功才占位 */
.qk-word-img {
  display: none; width: 108px; height: 108px; object-fit: contain; border-radius: 16px;
  background: #fff; margin-bottom: 12px;
}
.qk-word-img.is-on { display: block; }
.qk-tiles { display: flex; gap: 7px; justify-content: center; flex-wrap: wrap; }
/* 拼词阶的主提示是中文释义（图多半还没有），给它题面级的字号 */
.qk-stage-tiles .qk-stage-sub { font-size: 19px; font-weight: 700; color: var(--text); margin-top: 12px; }
.qk-tile {
  width: 38px; height: 44px; border-radius: 9px; display: inline-flex;
  align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; text-transform: lowercase;
  background: var(--card); border: 2px dashed var(--border); color: var(--text);
  cursor: default; transition: transform .12s var(--ease-bounce), opacity .12s;
}
.qk-tile.is-filled { border-style: solid; border-color: var(--mint); background: var(--mint-pale); color: var(--mint-deep); }
.qk-tile.is-locked { border-color: var(--border); background: #f3f4f6; color: var(--text-faint); }
.qk-tile.is-bank { border-style: solid; border-color: var(--border); cursor: pointer; box-shadow: var(--shadow); }
.qk-tile.is-bank:active { transform: scale(.9); }
.qk-tile.is-used { opacity: .25; pointer-events: none; }
.qk-tile.is-ok { border-color: var(--mint); background: var(--mint-soft); }
.qk-tile.is-bad { border-color: var(--red); background: var(--red-soft); color: #b91c1c; }
.qk-tile.disabled { pointer-events: none; }
.qk-bank { display: flex; gap: 8px; justify-content: center; margin: 16px 0; min-height: 44px; }
.qk-submit { width: 100%; padding: 13px; font-size: 15px; font-weight: 700; }
.qk-submit[disabled] { opacity: .45; }

/* 奥数题型：天平（每架一张 SVG） */
.qk-bals { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.qk-svg { width: 168px; height: 80px; }

/* 奥数题型：方格计数 */
.qk-gridfig {
  display: grid; gap: 0; width: min(76%, 250px); margin: 0 auto;
  border: 2px solid var(--text); background: var(--text);
}
.qk-cellfig {
  aspect-ratio: 1; display: flex; align-items: center; justify-content: center;
  font-size: 17px; background: #fff; border: 1px solid var(--border);
}
.qk-cellfig.is-mark { background: var(--star-soft); }
/* 新增四类图形题的格子样式。区域色由行内 style 给（数独），这里只管读得清 */
.qk-cellfig.is-sd { font-size: 19px; font-weight: 700; color: var(--text); }
.qk-cellfig.is-area { background: var(--mint-pale); box-shadow: inset 0 0 0 1px var(--mint); }
/* 积木：空格整块透明 + 容器只留一条"地面"线，轮廓才是一堆而不是有洞的方格纸 */
.qk-gridfig.is-stack { background: transparent; border: 0; border-bottom: 3px solid var(--text); }
.qk-cellfig.is-empty { background: transparent; border-color: transparent; }
.qk-cellfig.is-block {
  background: #ffd9a0; border: 2px solid #c98a3e;
  box-shadow: inset 0 4px 0 rgba(255, 255, 255, .6);
}
.qk-cellfig.is-mx { font-size: 12px; line-height: 1.15; letter-spacing: -1px; }
.qk-gridfig.is-mx3 { width: min(84%, 270px); }
.qk-gridfig.is-sd4 { width: min(70%, 230px); }

/* ================= 古诗博览（poems.js） ================= */
.pm-pools { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 10px; overflow-x: auto; }
.pm-pooltab {
  position: relative; background: none; border: 0; padding: 8px 0 10px;
  font-size: 14px; font-weight: 600; color: var(--text-faint); white-space: nowrap; cursor: pointer;
}
.pm-pooltab i { font-style: normal; font-size: 11px; color: var(--text-faint); margin-left: 3px; }
.pm-pooltab.active { color: var(--text); font-weight: 800; }
.pm-pooltab.active::after {
  content: ''; position: absolute; left: 20%; right: 20%; bottom: 0; height: 3px;
  background: var(--red); border-radius: 3px;
}

.pm-grades { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.pm-grade {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 4px 12px; font-size: 12px; color: var(--text-sub); cursor: pointer;
}
.pm-grade.active { background: var(--mint-pale); border-color: var(--mint); color: var(--mint-deep); font-weight: 700; }

.pm-listen-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.pm-listen {
  background: #fff7ed; border: 1px solid #fed7aa; border-radius: var(--radius-pill);
  padding: 6px 14px; font-size: 13px; color: #9a3412; cursor: pointer;
}
.pm-listen-note { font-size: 11px; color: var(--text-faint); margin-left: auto; }

.pm-sec {
  display: flex; align-items: baseline; font-size: 12px; color: var(--text-faint);
  margin: 16px 0 8px;
}
.pm-sec-done { margin-left: auto; font-size: 11px; }

.pm-card {
  display: block; width: 100%; text-align: left; position: relative;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px; margin-bottom: 10px; cursor: pointer; box-shadow: var(--shadow);
}
.pm-card:active { transform: scale(.99); }
.pm-card-t { font-size: 17px; font-weight: 800; color: var(--text); }
.pm-card-a { font-size: 12px; color: var(--text-faint); margin: 4px 0 8px; }
.pm-card-fl { font-size: 14px; color: var(--text-sub); }
.pm-card.is-thin { opacity: .72; }
.pm-tag-thin {
  position: absolute; top: 14px; right: 14px; font-size: 10px;
  background: var(--star-soft); color: #92400e; border-radius: 6px; padding: 2px 6px;
}
.pm-empty { padding: 40px 16px; text-align: center; font-size: 13px; color: var(--text-faint); }

.pm-dtabs { display: flex; gap: 22px; border-bottom: 1px solid var(--border); margin-bottom: 14px; }
.pm-dtab {
  position: relative; background: none; border: 0; padding: 8px 0 10px;
  font-size: 15px; color: var(--text-faint); cursor: pointer;
}
.pm-dtab.active { color: var(--text); font-weight: 800; }
.pm-dtab.active::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: var(--red); border-radius: 3px;
}
.pm-dlisten { text-align: right; margin-bottom: 6px; }

/* 原文：逐字拼音 + 大字居中，照截图排版 */
.pm-poem { background: var(--card); border-radius: var(--radius); padding: 22px 12px 26px; box-shadow: var(--shadow-card); }
.pm-title-py, .pm-author-py, .pm-py { display: flex; justify-content: center; }
.pm-title-py span, .pm-py span {
  width: 34px; flex-shrink: 0; text-align: center;
  font-size: 11px; color: var(--text-faint); letter-spacing: 0;
}
.pm-author-py span { width: 22px; flex-shrink: 0; text-align: center; font-size: 10px; color: var(--text-faint); }
.pm-title {
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 24px; font-weight: 700; letter-spacing: 6px; text-indent: 6px;
  text-align: center; color: var(--text); margin-bottom: 2px;
}
.pm-author { font-size: 12px; color: var(--text-faint); text-align: center; letter-spacing: 2px; margin-bottom: 14px; }
.pm-line { margin-bottom: 6px; }
.pm-ch { display: flex; justify-content: center; }
.pm-ch span {
  width: 34px; flex-shrink: 0; text-align: center;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 21px; font-weight: 700; color: var(--text);
}
.pm-ch span.pm-punct { width: 18px; font-size: 16px; color: var(--text-sub); }
.pm-py span.pm-gap { width: 18px; }

.pm-block { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow-card); }
.pm-block-h { font-size: 15px; font-weight: 800; color: var(--text); text-align: center; margin-bottom: 12px; }
.pm-block-body { font-size: 15px; line-height: 1.9; color: var(--text); }
.pm-notes { margin: 0; padding-left: 20px; font-size: 14px; line-height: 2; color: var(--text); }
.pm-notes b { font-weight: 700; }

.pm-pending { background: var(--card); border-radius: var(--radius); padding: 22px 16px; text-align: center; box-shadow: var(--shadow-card); }
.pm-pending-t { font-family: "Songti SC", "STSong", "SimSun", serif; font-size: 22px; font-weight: 700; letter-spacing: 4px; }
.pm-pending-a { font-size: 12px; color: var(--text-faint); margin: 6px 0 14px; }
.pm-pending-fl { font-size: 15px; color: var(--text-sub); margin-bottom: 16px; }
/* ================= 暖色皮肤：知识闯关 + 古诗博览 =================
   录屏与截图是"宣纸暖米黄 + 橙红渐变 + 衬线大字"，和主 App 的薄荷绿是两套语言。
   做法是只在这两个模块打开时给 body 挂 .skin-warm，并在其作用域内覆写设计令牌：
   所有引用 --mint/--card/--border 的现成组件（进度条、选项正确态、主按钮）
   一次性转暖，不必逐条改规则，也不会污染主 App。 */
body.skin-warm,
body.skin-warm .app {
  /* 渐变必须也挂在 .app 上：.app 的高度是"内容有多高就多高"（实测英语关卡页
     1718 像素），而 body 只有视口那么高（720 像素）。只写 body 的话，往下拉
     越过 720 像素就没有任何东西在兜底，露出一片白——孩子一拉到底就看见"页面断了"。
     而 .app 在这套皮肤里是 background: var(--bg) = transparent，等于它自己不画。 */
  background: linear-gradient(180deg, #fff7ea 0%, #ffeeda 42%, #fbe6cf 100%);
}
body.skin-warm .app {
  --bg: transparent;
  --card: #fffdf8;
  --border: #f0ddc2;
  --text: #3f2d1c;
  --text-sub: #8b705a;
  --text-faint: #b49a80;
  /* 借主色令牌换肤：薄荷绿位换成橙红，绿色位换成金橙 */
  --mint: #f9a03f;
  --mint-deep: #e2622a;
  --mint-soft: #ffe2bd;
  --mint-pale: #fff2df;
  --star: #ffb43a;
  --star-soft: #fff0cf;
}
body.skin-warm .pv-header { background: transparent; }
body.skin-warm .pv-footer {
  background: rgba(255, 253, 248, .94); border-top-color: #f0ddc2;
  backdrop-filter: blur(4px);
}
body.skin-warm .btn.primary {
  background: linear-gradient(135deg, #ff9a3c, #ef4f2c);
  box-shadow: 0 6px 18px rgba(239, 79, 44, .34);
}
body.skin-warm .qk-opt, body.skin-warm .pv-opt-btn {
  font-size: 17px; letter-spacing: .5px;
  box-shadow: 0 2px 10px rgba(150, 100, 40, .08);
}
body.skin-warm .qk-opt-key { background: #fff0d8; color: #b96a1e; }
body.skin-warm .qk-stage, body.skin-warm .pm-poem, body.skin-warm .pm-block,
body.skin-warm .pm-card, body.skin-warm .qk-card {
  border: 1px solid #f2e0c4;
  box-shadow: 0 6px 22px rgba(158, 106, 42, .12);
}
body.skin-warm .qk-stage-main { color: #3a2a1a; }
body.skin-warm .qk-blank { border-bottom-color: #ef4f2c; color: #ef4f2c; }

/* 单元/分组标题做成录屏那种"绶带横幅" */
body.skin-warm .qk-unit-head, body.skin-warm .pm-sec {
  position: relative; display: block; text-align: center; margin: 18px 0 10px;
}
body.skin-warm .qk-unit-head::before, body.skin-warm .pm-sec::before {
  content: ''; position: absolute; left: 12%; right: 12%; top: 50%; height: 26px;
  transform: translateY(-50%); border-radius: 13px;
  background: linear-gradient(90deg, rgba(255, 208, 138, 0), #ffe0ad 22%, #ffd491 78%, rgba(255, 208, 138, 0));
  z-index: 0;
}
/* .pm-sec 的标题是裸文本节点（没有 span 包着），而定位元素即使 z-index:0 也会盖在普通文本之上，
   所以只有它这条要把绶带压到 -1。.qk-unit-head 不能跟着改：它自己不是层叠上下文，
   压到 -1 会连父级卡片底色一起盖住。 */
body.skin-warm .pm-sec::before { z-index: -1; }
body.skin-warm .qk-unit-name, body.skin-warm .pm-sec { position: relative; z-index: 1; font-weight: 800; }
body.skin-warm .qk-unit-sub, body.skin-warm .pm-sec-done { position: relative; z-index: 1; margin-left: 8px; }
/* 绶带底色偏浅，正文色沿用 --text-faint 会被冲淡到看不见，这里单独压深 */
body.skin-warm .pm-sec { color: #8a5a1f; font-size: 13px; }
body.skin-warm .pm-sec-done { color: #a9773d; font-weight: 600; }

/* 关卡节点：木质圆牌 + 藤蔓 */
body.skin-warm .qk-node-n {
  background: radial-gradient(circle at 34% 28%, #fffdf7, #f6e3c5);
  border: 2px solid #e6c48f; color: #8a6330;
  box-shadow: 0 4px 12px rgba(150, 100, 40, .18), inset 0 -3px 6px rgba(190, 140, 70, .16);
}
body.skin-warm .qk-node.is-open .qk-node-n {
  border-color: #ef4f2c; color: #ef4f2c;
  background: radial-gradient(circle at 34% 28%, #fff6ec, #ffd9b8);
}
body.skin-warm .qk-node.is-done .qk-node-n {
  background: linear-gradient(135deg, #ffb347, #ef6a2c);
  border-color: #d9531f; color: #fff;
}
body.skin-warm .qk-path::before { border-top-color: #d9b483; }
body.skin-warm .qk-turn::before { border-left-color: #d9b483; }
body.skin-warm .qk-hero {
  background: linear-gradient(135deg, #ff9d3d, #e8452a);
  box-shadow: 0 8px 24px rgba(232, 69, 42, .32);
}
body.skin-warm .qk-subtab.active {
  border-color: #ef4f2c; color: #c9421c; background: #fff2df;
}
body.skin-warm .pm-pooltab.active::after, body.skin-warm .pm-dtab.active::after { background: #ef4f2c; }
body.skin-warm .qk-sheet { background: #fff2df; }
body.skin-warm .qk-sheet.is-ok { background: #eaf7e6; }
body.skin-warm .qk-sheet.is-bad { background: #ffeae4; }
body.skin-warm .qk-sheet.is-bad .qk-sheet-ans { color: #c9372a; }
body.skin-warm .qk-hint.is-pass { background: #eaf7e6; color: #2f7a42; }

.pm-pending-note { font-size: 12px; color: var(--text-faint); line-height: 1.8; background: var(--bg); border-radius: 10px; padding: 12px; }




/* ---------- CN group tests and term tests ----------
   Same paper-card language as the level map, but on the mint side so it reads as
   "checking what you learned", not "another level to grind". */
.qk-test {
  margin: 4px 0 18px; padding: 14px 14px 6px;
  background: linear-gradient(180deg, var(--mint-pale), var(--card));
  border: 2px solid var(--mint-soft); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.qk-test-head { font-size: 15px; font-weight: 800; color: var(--mint-deep); }
.qk-test-note { font-size: 11px; color: var(--text-sub); line-height: 1.5; margin: 4px 0 10px; }
.qk-test-row {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 0; border-top: 1px dashed var(--mint-soft);
}
.qk-test-row:first-of-type { border-top: 0; }
.qk-test-l { flex: 1; min-width: 0; }
.qk-test-name { font-size: 13px; font-weight: 700; color: var(--text); }
.qk-test-meta { font-size: 11px; color: var(--text-faint); margin-top: 2px; }
.qk-test-state {
  flex: none; font-size: 11px; padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--border); color: var(--text-faint);
}
.qk-test-state.is-ok { background: var(--mint-soft); color: var(--mint-deep); font-weight: 700; }
.qk-test-state.is-warn { background: var(--yellow-soft); color: #92400e; font-weight: 700; }
.qk-test-row.is-term {
  margin-top: 6px; padding: 11px 10px; border: 1px solid var(--mint-soft);
  border-radius: var(--radius); background: linear-gradient(90deg, var(--mint-soft), transparent);
}
.qk-test-row.is-term .qk-test-name { color: var(--mint-deep); font-size: 14px; }
.qk-test-go { flex: none; }

/* ---------- wrong-answer report after a test ---------- */
.qk-rep-poems {
  margin: 12px 0 6px; padding: 8px 10px; font-size: 12px; line-height: 1.6;
  background: var(--peach-soft); border-radius: var(--radius); color: #7c2d12;
}
.qk-report { margin-top: 6px; }
.qk-rep-item {
  background: var(--card); border-left: 3px solid var(--mint);
  border-radius: var(--radius-sm); padding: 9px 11px; margin-bottom: 8px;
  box-shadow: var(--shadow-soft);
}
.qk-rep-q { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.5; }
.qk-rep-a { font-size: 12px; color: var(--red); margin-top: 4px; text-decoration: line-through; }
.qk-rep-b { font-size: 12px; color: var(--mint-deep); font-weight: 700; margin-top: 2px; }
.qk-rep-e { font-size: 11px; color: var(--text-sub); line-height: 1.6; margin-top: 4px; }
.qk-rep-none { padding: 14px; text-align: center; font-size: 13px; color: var(--mint-deep); }

.qk-test-more {
  margin: 4px 0 8px; padding: 7px 10px; text-align: center;
  font-size: 11px; color: var(--text-faint);
  background: var(--mint-pale); border-radius: var(--radius-pill);
}

/* ============ 默写（dictation） ============ */
.dt-card {
  background: linear-gradient(180deg, #fffdf7, var(--card));
  border: 2px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 14px; margin-bottom: 12px; box-shadow: var(--shadow-card);
}
.dt-h { font-size: 17px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.dt-h2 { font-size: 14px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.dt-sub { font-size: 12px; font-weight: 700; color: var(--text-sub); margin: 12px 0 6px; }
.dt-mute { font-size: 11px; color: var(--text-faint); line-height: 1.6; margin: 6px 0; }
.dt-warn {
  font-size: 12px; line-height: 1.6; color: #92400e;
  background: var(--yellow-soft); border-radius: var(--radius); padding: 8px 10px; margin: 8px 0;
}
.dt-big {
  display: grid; grid-template-columns: 40px 1fr; gap: 2px 10px; width: 100%; text-align: left;
  background: linear-gradient(135deg, var(--mint-soft), var(--card));
  border: 2px solid var(--mint-pale); border-radius: var(--radius);
  padding: 12px 12px; margin-bottom: 10px; cursor: pointer;
}
.dt-big-ico {
  grid-row: span 2; align-self: center; justify-self: center;
  width: 40px; height: 40px; border-radius: 14px; display: grid; place-items: center;
  color: #0f766e; background: linear-gradient(135deg, #ccfbf1, #99f6e4);
}
.dt-big-name { font-size: 15px; font-weight: 800; color: var(--text); }
.dt-big-d { font-size: 11px; color: var(--text-faint); }
.dt-ta {
  width: 100%; min-height: 190px; font-size: 14px; line-height: 1.7; padding: 10px;
  border: 2px solid var(--border); border-radius: var(--radius); background: #fff; color: var(--text);
}
.dt-wide { display: block; width: 100%; margin-top: 10px; }
.dt-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dt-chip {
  font-size: 12px; padding: 7px 11px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: #fff; color: var(--text-sub); cursor: pointer;
}
.dt-chip.on { border-color: var(--mint-deep); background: var(--mint-soft); color: var(--mint-deep); font-weight: 800; }
.dt-check { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-sub); margin: 12px 0 4px; }
.dt-link { background: none; border: 0; color: var(--mint-deep); font-size: 12px; padding: 8px 0 0; cursor: pointer; }
.dt-list { display: flex; flex-direction: column; gap: 6px; }
.dt-li { display: grid; grid-template-columns: 26px 1fr 1fr 20px; align-items: center; gap: 6px; font-size: 13px; }
.dt-li-n { font-size: 11px; color: var(--text-faint); text-align: center; }
.dt-li-en { font-weight: 700; color: var(--text); word-break: break-word; }
.dt-li-cn { color: var(--text-sub); word-break: break-word; }
.dt-li-ok { color: var(--mint-deep); font-weight: 800; text-align: center; }
.dt-li-ok.is-miss { color: var(--yellow); }
.dt-run {
  text-align: center; padding: 22px 14px 16px; margin-bottom: 12px;
  background: linear-gradient(165deg, #ecfdf5, var(--card) 60%);
  border: 2px solid var(--mint-pale); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.dt-run-n { font-size: 56px; font-weight: 900; color: var(--mint-deep); line-height: 1; }
.dt-run-n span { font-size: 18px; color: var(--text-faint); font-weight: 700; }
.dt-wave { display: flex; align-items: center; justify-content: center; gap: 6px; height: 40px; margin: 10px 0 2px; }
.dt-wave i {
  width: 7px; height: 10px; border-radius: 4px;
  background: linear-gradient(180deg, #34d399, #0d9488);
  animation: dtWave 1.1s ease-in-out infinite;
}
.dt-wave i:nth-child(2) { animation-delay: .13s; }
.dt-wave i:nth-child(3) { animation-delay: .26s; }
.dt-wave i:nth-child(4) { animation-delay: .39s; }
.dt-wave i:nth-child(5) { animation-delay: .52s; }
.dt-wave.is-wait i { animation: none; height: 6px; background: #cbd5e1; }
@keyframes dtWave { 0%, 100% { height: 9px; } 50% { height: 32px; } }
@media (prefers-reduced-motion: reduce) { .dt-wave i { animation: none; height: 18px; } }
.dt-run-state { font-size: 13px; color: var(--text-sub); margin-top: 8px; }
.dt-run-state.is-wait { color: var(--orange); font-weight: 800; }
.dt-run-hint { font-size: 15px; color: var(--text); margin-top: 8px; }
.dt-bar { height: 6px; background: var(--mint-pale); border-radius: var(--radius-pill); margin: 16px 0 14px; overflow: hidden; }
.dt-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--mint), var(--mint-deep)); }
.dt-run-meta { font-size: 11px; color: var(--text-faint); margin: -6px 0 12px; }
.dt-run-acts { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; align-items: stretch; }
.dt-run-acts .btn { display: inline-flex; align-items: center; justify-content: center; gap: 5px; flex: 0 1 auto; line-height: 1.25; }
.dt-rev { border-bottom: 1px dashed var(--border); padding: 9px 0; }
.dt-rev-q { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--text); }
.dt-rev-a { font-size: 15px; color: var(--mint-deep); font-weight: 800; margin: 6px 0 6px 32px; }
.dt-rev-a.is-hidden { visibility: hidden; height: 0; margin: 0; overflow: hidden; }
.dt-rev-acts { display: flex; gap: 6px; margin-left: 32px; }
.dt-mini {
  font-size: 11px; padding: 5px 10px; border-radius: var(--radius-pill);
  border: 1.5px solid var(--border); background: #fff; color: var(--text-sub); cursor: pointer;
}
.dt-mini.is-r { border-color: var(--mint-deep); background: var(--mint-soft); color: var(--mint-deep); font-weight: 800; }
.dt-mini.is-w { border-color: var(--red); background: var(--red-soft); color: var(--red); font-weight: 800; }
.dt-input {
  width: 100%; font-size: 15px; padding: 9px 10px; margin-top: 6px;
  border: 2px solid var(--border); border-radius: var(--radius); background: #fff;
}
.dt-input.ok { border-color: var(--mint-deep); background: var(--mint-pale); }
.dt-input.bad { border-color: var(--red); background: var(--red-soft); }
.dt-center { text-align: center; }
.dt-score { font-size: 46px; font-weight: 900; color: var(--mint-deep); line-height: 1.1; }
.dt-score span { font-size: 17px; color: var(--text-faint); }
.dt-wrong { display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; justify-content: center; }
.dt-wrong-item {
  display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 64px;
  background: var(--card); border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  padding: 6px 12px;
}
.dt-wrong b { color: var(--text); }
.dt-wrong i { font-style: normal; color: var(--red); font-size: 11px; }
.dt-his-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 8px;
  font-size: 12px; padding: 7px 0; border-bottom: 1px dashed var(--border);
}
.dt-his-row b { color: var(--text); font-weight: 700; }
.dt-his-row span { color: var(--text-faint); }
.dt-his-row i { font-style: normal; color: var(--mint-deep); font-weight: 800; }

/* ================= 作业存档（存档层） ================= */
.msg-archive-bar { margin-top: 6px; }
.archive-mini { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.archive-item { position: relative; border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; cursor: pointer; background: var(--card, #fff); }
.archive-item:hover { border-color: var(--mint-deep); }
.archive-item-head { display: flex; align-items: center; gap: 6px; font-size: 13px; padding-right: 34px; }
.archive-subj { font-size: 11px; padding: 1px 6px; border-radius: 8px; background: var(--bell, #eef2ff); color: var(--text); flex: none; }
.archive-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-date { font-size: 11px; color: var(--text-faint); flex: none; }
.archive-excerpt { font-size: 12px; color: var(--text-sub, #6b7280); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.archive-meta { font-size: 11px; color: var(--text-faint); margin-top: 3px; }
.archive-del { position: absolute; top: 6px; right: 6px; padding: 2px 6px; font-size: 11px; }
.archive-list { max-height: 52vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.archive-detail { max-height: 60vh; overflow-y: auto; }
.archive-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.archive-report { white-space: pre-wrap; font-size: 13px; line-height: 1.7; background: var(--bell, #f8f9fb); border-radius: 10px; padding: 10px; max-height: 30vh; overflow-y: auto; }
.archive-atts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; }
.archive-mistake { font-size: 13px; border-left: 3px solid var(--danger, #e5484d); padding: 4px 8px; margin: 6px 0; background: var(--bell, #fff5f5); border-radius: 0 8px 8px 0; }
.archive-mistake-ans { font-size: 12px; color: var(--text-sub, #6b7280); }
.archive-analysis { white-space: pre-wrap; font-size: 13px; line-height: 1.7; background: var(--bell, #f0f7ff); border-radius: 10px; padding: 10px; }
