/* ===========================================================
   小橙陪读 · 小学数学
   设计基调：柔和薄荷 + 暖橙点缀，大圆角、大按钮、低对比阴影
   =========================================================== */

:root {
  --mint-50:  #f2fbf6;
  --mint-100: #e2f6ec;
  --mint-200: #c3ecd8;
  --mint-300: #93ddba;
  --mint-400: #57c795;
  --mint-500: #2fae7c;
  --mint-600: #21906a;
  --mint-700: #1a7257;

  --orange-100: #fff1e2;
  --orange-300: #ffc078;
  --orange-400: #ffa94d;
  --orange-500: #f78c1e;

  --sky-100: #e8f4ff;
  --sky-400: #5aa9e6;
  --rose-100: #ffecec;
  --rose-400: #ef6b6b;
  --rose-500: #d94a4a;
  --violet-100: #f1ecff;
  --violet-400: #9b7bea;

  --ink-900: #14322a;
  --ink-700: #2c4f45;
  --ink-500: #5c7d73;
  --ink-300: #93aea5;
  --line: #e3efe9;

  --bg: #f4fbf7;
  --surface: #ffffff;
  --surface-2: #f8fdfa;

  --r-xl: 26px;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;

  --sh-sm: 0 1px 2px rgba(20, 50, 42, .05), 0 2px 8px rgba(20, 50, 42, .04);
  --sh-md: 0 2px 6px rgba(20, 50, 42, .06), 0 8px 24px rgba(20, 50, 42, .06);
  --sh-lg: 0 8px 20px rgba(20, 50, 42, .08), 0 20px 48px rgba(20, 50, 42, .08);

  --tab-h: 62px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

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

html, body { margin: 0; padding: 0; height: 100%; }

body {
  background: var(--bg);
  color: var(--ink-900);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }

/* ---------- 骨架 ---------- */
.app {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  background: var(--bg);
}

.topbar {
  height: var(--top-h);
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: rgba(244, 251, 247, .88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.is-scrolled { border-bottom-color: var(--line); }

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: .3px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 12px;
  color: var(--ink-700);
  transition: background .15s, transform .15s;
}
.icon-btn:active { background: var(--mint-100); transform: scale(.94); }

.streak-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-500);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.view {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 16px calc(var(--tab-h) + var(--safe-b) + 24px);
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  z-index: 40;
}

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--ink-300);
  font-size: 11px;
  font-weight: 600;
  transition: color .18s;
  position: relative;
}
.tab svg { transition: transform .22s cubic-bezier(.34, 1.56, .64, 1); }
.tab.is-on { color: var(--mint-600); }
.tab.is-on svg { transform: translateY(-2px) scale(1.06); }
.tab.is-on::after {
  content: "";
  position: absolute;
  top: 6px;
  width: 26px; height: 3px;
  border-radius: 3px;
  background: var(--mint-400);
  opacity: .9;
}
.tab:active svg { transform: scale(.9); }

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: 18px;
  margin-bottom: 14px;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 22px 2px 12px;
}
.section-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .2px;
}
.section-head .more {
  font-size: 13px;
  color: var(--mint-600);
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 8px;
}
.section-head .more:active { background: var(--mint-100); }

.muted { color: var(--ink-500); }
.tiny { font-size: 12.5px; }

/* ---------- 首页 Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 18px 18px 16px;
  margin: 10px 0 4px;
  background: linear-gradient(135deg, #e8faf1 0%, #d7f4e6 52%, #cdefff 100%);
  box-shadow: var(--sh-md);
}
.hero-top {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.hero-main { flex: 1 1 auto; min-width: 0; }
.hero::before {
  content: "";
  position: absolute;
  right: -46px; top: -56px;
  width: 190px; height: 190px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.85), rgba(255,255,255,0) 68%);
  pointer-events: none;
}
.hero-greet {
  font-size: 13px;
  font-weight: 600;
  color: var(--mint-700);
  opacity: .8;
  margin-bottom: 2px;
}
.hero-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .2px;
  margin: 0 0 4px;
  color: var(--ink-900);
}
.hero-sub {
  font-size: 13.5px;
  color: var(--ink-500);
  margin-bottom: 16px;
}
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; position: relative; z-index: 1; }

.hero-pet {
  flex: 0 0 auto;
  width: 104px;
  height: 104px;
  margin: -4px -4px 0 0;
  pointer-events: none;
  filter: drop-shadow(0 6px 12px rgba(20, 50, 42, .12));
  animation: floaty 3.6s ease-in-out infinite;
}
.hero-pet svg { width: 100%; height: 100%; display: block; }
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 11px 20px;
  min-height: 44px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .2px;
  transition: transform .14s, box-shadow .14s, background .14s;
  white-space: nowrap;
}
.btn:active { transform: scale(.97); }

.btn-primary {
  background: linear-gradient(180deg, var(--mint-400), var(--mint-500));
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 174, 124, .3);
}
.btn-primary:active { box-shadow: 0 2px 6px rgba(47, 174, 124, .3); }

.btn-warm {
  background: linear-gradient(180deg, var(--orange-300), var(--orange-400));
  color: #7a3d00;
  box-shadow: 0 4px 12px rgba(247, 140, 30, .26);
}

.btn-ghost {
  background: rgba(255, 255, 255, .78);
  color: var(--ink-700);
  box-shadow: var(--sh-sm);
}

.btn-block { width: 100%; }
.btn-lg { padding: 14px 26px; font-size: 16px; border-radius: 16px; }
.btn-sm { padding: 7px 14px; font-size: 13.5px; border-radius: 11px; }

/* ---------- 统计小块 ---------- */
.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}
.stat {
  background: rgba(255, 255, 255, .72);
  border-radius: var(--r-md);
  padding: 10px 12px;
  text-align: center;
}
.stat b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  color: var(--mint-700);
  font-variant-numeric: tabular-nums;
  line-height: 1.25;
}
.stat span { font-size: 11.5px; color: var(--ink-500); }

/* ---------- 继续学习 ---------- */
.resume {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border-radius: var(--r-lg);
  background: linear-gradient(120deg, #ffffff, #f7fdfa);
  box-shadow: var(--sh-sm);
  border: 1px solid var(--line);
  margin-bottom: 14px;
  width: 100%;
  text-align: left;
  transition: transform .14s, box-shadow .14s;
}
.resume:active { transform: scale(.985); box-shadow: var(--sh-md); }
.resume-icon {
  width: 46px; height: 46px;
  flex: 0 0 auto;
  border-radius: 14px;
  display: grid; place-items: center;
  background: var(--mint-100);
  color: var(--mint-600);
  font-size: 20px;
}
.resume-body { flex: 1; min-width: 0; }
.resume-body b { display: block; font-size: 15px; font-weight: 700; }
.resume-body span { font-size: 12.5px; color: var(--ink-500); }
.resume-go { color: var(--mint-500); flex: 0 0 auto; }

/* ---------- 教材网格 ---------- */
.grade-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: none;
}
.grade-tabs::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 15px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-500);
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: var(--sh-sm);
  transition: all .16s;
  border: 1.5px solid transparent;
}
.chip.is-on {
  background: var(--mint-500);
  color: #fff;
  box-shadow: 0 4px 12px rgba(47, 174, 124, .28);
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.book-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  padding: 16px 14px 14px;
  background: var(--surface);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: transform .16s, box-shadow .16s;
  border: 1.5px solid transparent;
}
.book-card:active { transform: scale(.975); }
.book-card::after {
  content: "";
  position: absolute;
  right: -30px; bottom: -34px;
  width: 92px; height: 92px;
  border-radius: 50%;
  background: var(--mint-50);
  z-index: 0;
}
.book-card > * { position: relative; z-index: 1; }

.book-emoji { font-size: 26px; line-height: 1; margin-bottom: 8px; display: block; }
.book-name { font-size: 16px; font-weight: 800; letter-spacing: .2px; }
.book-meta { font-size: 12px; color: var(--ink-500); margin-top: 2px; }

.book-progress {
  margin-top: 12px;
  height: 6px;
  border-radius: 6px;
  background: var(--mint-100);
  overflow: hidden;
}
.book-progress i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--mint-300), var(--mint-500));
  transition: width .5s cubic-bezier(.2, .8, .3, 1);
}

/* ---------- 单元列表 ---------- */
.unit-list { display: flex; flex-direction: column; gap: 10px; }

.unit-item {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 15px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  text-align: left;
  width: 100%;
  transition: transform .14s, box-shadow .14s;
}
.unit-item:active { transform: scale(.985); box-shadow: var(--sh-md); }

.unit-no {
  flex: 0 0 auto;
  width: 38px; height: 38px;
  border-radius: 12px;
  display: grid; place-items: center;
  background: var(--mint-100);
  color: var(--mint-700);
  font-weight: 800;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}
.unit-body { flex: 1; min-width: 0; }
.unit-name {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unit-sub { font-size: 12px; color: var(--ink-500); margin-top: 1px; }
.unit-left { color: #178a52; font-weight: 700; }
.unit-left.all { color: var(--ink-400, #9aa4b2); font-weight: 600; }
.unit-ring { flex: 0 0 auto; }

.ring { transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 4; }
.ring .bg { stroke: var(--mint-100); }
.ring .fg { stroke: var(--mint-500); stroke-linecap: round; transition: stroke-dashoffset .6s cubic-bezier(.2,.8,.3,1); }

/* ---------- 练习页 ---------- */
.quiz-wrap { padding-top: 4px; }

.quiz-top {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.quiz-progress {
  flex: 1;
  height: 9px;
  border-radius: 9px;
  background: var(--mint-100);
  overflow: hidden;
}
.quiz-progress i {
  display: block;
  height: 100%;
  border-radius: 9px;
  background: linear-gradient(90deg, var(--mint-300), var(--mint-500));
  transition: width .38s cubic-bezier(.2,.8,.3,1);
  width: 0;
}
.quiz-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
  flex: 0 0 auto;
}

.qcard {
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-md);
  padding: 22px 20px;
  animation: qin .32s cubic-bezier(.2,.8,.3,1);
}
@keyframes qin {
  from { opacity: 0; transform: translateY(10px) scale(.99); }
  to { opacity: 1; transform: none; }
}

.q-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.q-tag {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mint-50);
  color: var(--mint-700);
}
.q-tag.type { background: var(--sky-100); color: #2f7fb8; }
.q-tag.fresh { background: #e6f9ee; color: #178a52; box-shadow: inset 0 0 0 1px #b8ebcd; }
.q-tag.fresh::before { content: '✦ '; }
.q-tag.reuse { background: #f1f0fb; color: #6b5bb5; }
.q-tag.reuse::before { content: '↻ '; }
.q-tag.d1 { background: var(--mint-50); color: var(--mint-700); }
.q-tag.d2 { background: var(--orange-100); color: #b96a00; }
.q-tag.d3 { background: var(--violet-100); color: #6b4fc0; }

.q-text {
  font-size: 19px;
  line-height: 1.75;
  font-weight: 600;
  letter-spacing: .2px;
  color: var(--ink-900);
  word-break: break-word;
}
.q-text .fx {
  font-family: "Cambria Math", "Latin Modern Math", Georgia, serif;
  font-style: normal;
  padding: 0 2px;
  white-space: nowrap;
}
.q-text .frac {
  display: inline-flex;
  flex-direction: column;
  vertical-align: middle;
  text-align: center;
  font-size: .82em;
  line-height: 1.15;
  margin: 0 3px;
  transform: translateY(-.08em);
}
.q-text .frac > span:first-child { border-bottom: 1.4px solid currentColor; padding: 0 3px; }
.q-text .frac > span:last-child { padding: 0 3px; }

.q-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
}

.opt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 2px solid var(--line);
  text-align: left;
  font-size: 16.5px;
  font-weight: 600;
  color: var(--ink-900);
  transition: all .16s;
  width: 100%;
}
.opt:active { transform: scale(.985); }
.opt-key {
  flex: 0 0 auto;
  width: 27px; height: 27px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: #fff;
  border: 1.5px solid var(--line);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-500);
  transition: all .16s;
}
.opt-body { flex: 1; min-width: 0; word-break: break-word; }

.opt.is-picked { border-color: var(--mint-400); background: var(--mint-50); }
.opt.is-picked .opt-key { background: var(--mint-500); border-color: var(--mint-500); color: #fff; }

.opt.is-right { border-color: var(--mint-400); background: var(--mint-50); }
.opt.is-right .opt-key { background: var(--mint-500); border-color: var(--mint-500); color: #fff; }

.opt.is-wrong { border-color: var(--rose-400); background: var(--rose-100); }
.opt.is-wrong .opt-key { background: var(--rose-400); border-color: var(--rose-400); color: #fff; }

.opt[disabled] { cursor: default; }
.opt[disabled]:active { transform: none; }

/* 判断题 */
.tf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
.tf-btn {
  padding: 20px 12px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 2px solid var(--line);
  font-size: 19px;
  font-weight: 800;
  color: var(--ink-700);
  transition: all .16s;
}
.tf-btn:active { transform: scale(.97); }
.tf-btn.is-right { border-color: var(--mint-400); background: var(--mint-50); color: var(--mint-700); }
.tf-btn.is-wrong { border-color: var(--rose-400); background: var(--rose-100); color: var(--rose-500); }

/* 填空 / 计算 */
.answer-box { margin-top: 20px; }
.answer-input {
  width: 100%;
  padding: 16px 18px;
  border-radius: var(--r-md);
  border: 2px solid var(--line);
  background: var(--surface-2);
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-900);
  outline: none;
  transition: border-color .16s, background .16s;
  letter-spacing: .5px;
}
.answer-input::placeholder { color: var(--ink-300); font-weight: 500; font-size: 16px; letter-spacing: 0; }
.answer-input:focus { border-color: var(--mint-400); background: #fff; }
.answer-input.is-right { border-color: var(--mint-400); background: var(--mint-50); }
.answer-input.is-wrong { border-color: var(--rose-400); background: var(--rose-100); }
.answer-hint { font-size: 12.5px; color: var(--ink-300); margin-top: 7px; padding-left: 4px; }

/* 反馈条 */
.feedback {
  margin-top: 18px;
  border-radius: var(--r-md);
  padding: 15px 16px;
  animation: qin .26s cubic-bezier(.2,.8,.3,1);
}
.feedback.ok { background: var(--mint-50); border: 1.5px solid var(--mint-200); }
.feedback.no { background: var(--rose-100); border: 1.5px solid #ffd4d4; }
.feedback-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 15.5px;
  margin-bottom: 6px;
}
.feedback.ok .feedback-head { color: var(--mint-700); }
.feedback.no .feedback-head { color: var(--rose-500); }
.feedback-ans {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-700);
  margin-bottom: 6px;
}
.feedback-sol {
  font-size: 14.5px;
  line-height: 1.72;
  color: var(--ink-700);
  word-break: break-word;
}
.feedback-sol .fx { font-family: "Cambria Math", Georgia, serif; }

.quiz-actions { margin-top: 18px; display: flex; gap: 10px; }
.quiz-actions .btn { flex: 1; }

/* 连击提示 */
.combo-pop {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -50%);
  z-index: 90;
  padding: 12px 26px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange-300), var(--orange-500));
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  box-shadow: 0 10px 30px rgba(247, 140, 30, .4);
  animation: comboIn .7s cubic-bezier(.2, 1.4, .4, 1) forwards;
  pointer-events: none;
}
@keyframes comboIn {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.5); }
  35% { opacity: 1; transform: translate(-50%, -50%) scale(1.08); }
  70% { opacity: 1; transform: translate(-50%, -60%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -90%) scale(.96); }
}

/* ---------- 结果页 ---------- */
.result-hero {
  text-align: center;
  padding: 30px 20px 24px;
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, #eafaf2, #ddf3ff);
  box-shadow: var(--sh-md);
  margin-bottom: 14px;
}
.result-score {
  font-size: 52px;
  font-weight: 900;
  line-height: 1;
  color: var(--mint-600);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.result-score small { font-size: 20px; font-weight: 700; color: var(--ink-300); }
.result-label { font-size: 14px; color: var(--ink-500); margin-top: 6px; }
.result-stars { font-size: 26px; letter-spacing: 4px; margin-top: 10px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 18px;
}
.result-cell {
  background: rgba(255, 255, 255, .75);
  border-radius: var(--r-md);
  padding: 11px 8px;
}
.result-cell b { display: block; font-size: 19px; font-weight: 800; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.result-cell span { font-size: 11.5px; color: var(--ink-500); }

/* ---------- 错题本 ---------- */
.wrong-item {
  background: var(--surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  padding: 15px 16px;
  margin-bottom: 10px;
}
.wrong-q {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 8px;
  word-break: break-word;
}
.wrong-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-500);
  margin-bottom: 10px;
}
.wrong-ans { font-size: 13.5px; color: var(--ink-700); }
.wrong-ans b { color: var(--mint-700); }
.wrong-ans del { color: var(--rose-400); text-decoration-thickness: 1.5px; }
.wrong-foot { display: flex; gap: 8px; margin-top: 12px; }

.due-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--orange-100);
  color: #b96a00;
}
.due-chip.now { background: var(--rose-100); color: var(--rose-500); }

/* ---------- 报告 ---------- */
.report-card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--sh-sm); padding: 18px; margin-bottom: 14px; }
.report-card h3 { margin: 0 0 14px; font-size: 15.5px; font-weight: 700; }

.trend {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 120px;
  padding-top: 8px;
}
.trend-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.trend-bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, var(--mint-300), var(--mint-500));
  min-height: 4px;
  transition: height .6s cubic-bezier(.2,.8,.3,1);
  position: relative;
}
.trend-bar span {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}
.trend-x { font-size: 10.5px; color: var(--ink-300); }

.kp-list { display: flex; flex-direction: column; gap: 12px; }
.kp-row { display: flex; align-items: center; gap: 10px; }
.kp-name {
  flex: 0 0 42%;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kp-bar { flex: 1; height: 8px; border-radius: 8px; background: var(--mint-100); overflow: hidden; }
.kp-bar i { display: block; height: 100%; border-radius: 8px; transition: width .6s; }
.kp-pct { flex: 0 0 40px; text-align: right; font-size: 12px; font-weight: 700; color: var(--ink-500); font-variant-numeric: tabular-nums; }

/* ---------- 宠物页 ---------- */
.name-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.name-label {
  flex: 0 0 auto;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-700);
}
.name-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  border: 2px solid var(--line);
  background: var(--surface-2);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-900);
  outline: none;
  transition: border-color .16s, background .16s;
}
.name-input::placeholder { color: var(--ink-300); font-weight: 500; }
.name-input:focus { border-color: var(--mint-400); background: #fff; }
.name-row .btn { flex: 0 0 auto; }

.pet-stage {
  position: relative;
  border-radius: var(--r-xl);
  padding: 22px 18px 18px;
  background: linear-gradient(160deg, #eefaf3, #e6f4ff 70%, #fff6ea);
  box-shadow: var(--sh-md);
  text-align: center;
  overflow: hidden;
  margin: 10px 0 14px;
}
.pet-stage::after {
  content: "";
  position: absolute;
  left: 50%; bottom: -60px;
  transform: translateX(-50%);
  width: 260px; height: 120px;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(47,174,124,.16), rgba(47,174,124,0) 70%);
}
.pet-svg-wrap {
  position: relative;
  z-index: 1;
  width: 190px;
  height: 190px;
  margin: 0 auto;
  animation: floaty 3.8s ease-in-out infinite;
}
.pet-svg-wrap svg { width: 100%; height: 100%; display: block; }

.pet-name { font-size: 19px; font-weight: 800; margin-top: 4px; position: relative; z-index: 1; }
.pet-lv {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  padding: 4px 13px;
  border-radius: 999px;
  background: rgba(255,255,255,.8);
  font-size: 13px;
  font-weight: 700;
  color: var(--mint-700);
  position: relative;
  z-index: 1;
}

.pet-exp {
  margin-top: 16px;
  position: relative;
  z-index: 1;
}
.pet-exp-bar {
  height: 11px;
  border-radius: 11px;
  background: rgba(255,255,255,.72);
  overflow: hidden;
  box-shadow: inset 0 1px 2px rgba(20,50,42,.06);
}
.pet-exp-bar i {
  display: block;
  height: 100%;
  border-radius: 11px;
  background: linear-gradient(90deg, var(--orange-300), var(--orange-500));
  transition: width .7s cubic-bezier(.2,.8,.3,1);
  width: 0;
}
.pet-exp-txt {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-500);
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}

.tier-list { display: flex; flex-direction: column; gap: 8px; }
.tier-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: 13.5px;
}
.tier-row.locked { opacity: .48; }
.tier-row.now { border: 1.5px solid var(--mint-300); background: var(--mint-50); }
.tier-lv {
  flex: 0 0 auto;
  width: 30px; height: 30px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--mint-100);
  color: var(--mint-700);
  font-weight: 800;
  font-size: 12.5px;
}
.tier-row.now .tier-lv { background: var(--mint-500); color: #fff; }
.tier-txt { flex: 1; min-width: 0; font-weight: 600; color: var(--ink-700); }
.tier-flag { flex: 0 0 auto; font-size: 11.5px; font-weight: 700; color: var(--mint-600); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + 26px);
  transform: translate(-50%, 14px);
  z-index: 120;
  max-width: 82vw;
  padding: 11px 20px;
  border-radius: 14px;
  background: rgba(20, 50, 42, .92);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .24s, transform .24s;
  box-shadow: 0 8px 24px rgba(20,50,42,.24);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 空状态 ---------- */
.empty {
  text-align: center;
  padding: 52px 24px;
  color: var(--ink-500);
}
.empty-emoji { font-size: 46px; line-height: 1; margin-bottom: 14px; opacity: .85; }
.empty b { display: block; font-size: 16px; color: var(--ink-700); margin-bottom: 6px; }
.empty p { margin: 0; font-size: 13.5px; line-height: 1.7; }

/* ---------- 分段控件 ---------- */
.seg {
  display: flex;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--mint-100);
  margin-bottom: 14px;
}
.seg button {
  flex: 1;
  padding: 8px 10px;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-500);
  transition: all .16s;
}
.seg button.is-on {
  background: #fff;
  color: var(--mint-700);
  box-shadow: var(--sh-sm);
}

/* ---------- 加载态 ---------- */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--ink-500);
  font-size: 13.5px;
}
.spin {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 3px solid var(--mint-100);
  border-top-color: var(--mint-500);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 响应式 ---------- */
@media (min-width: 620px) {
  .view { padding-left: 24px; padding-right: 24px; }
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .hero-pet { width: 128px; height: 128px; }
  .q-text { font-size: 20px; }
}

@media (max-width: 360px) {
  .q-text { font-size: 17.5px; }
  .btn { padding: 10px 16px; font-size: 14px; }
  .hero-title { font-size: 20px; }
  .hero-pet { width: 88px; height: 88px; opacity: .95; }
  .stat b { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===========================================================
   语文 / 游戏 / 金币 —— 新增模块
   =========================================================== */

/* ---------- 顶栏金币 ---------- */
.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  background: #fff7e6;
  color: #b06a00;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.coin-dot {
  width: 13px; height: 13px;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%, #ffe9a8, #ffc247 55%, #e8a01c);
  box-shadow: inset 0 -1px 1px rgba(160, 100, 0, .35);
  flex: 0 0 auto;
}

/* ---------- 学科切换 ---------- */
.subject-switch {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 2px 0 12px;
  border-radius: 999px;
  background: var(--mint-100);
  width: fit-content;
}
.subject-switch .subj {
  padding: 7px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-500);
  transition: all .18s;
}
.subject-switch .subj.is-on {
  background: var(--surface);
  color: var(--mint-700);
  box-shadow: var(--sh-sm);
}

/* ---------- 语文册卡 ---------- */
.cn-card { border-color: var(--violet-100); }
.cn-card::after { background: var(--violet-100); }
.cn-badge {
  flex: 0 0 auto;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--violet-100);
  color: #6a4dc4;
  font-size: 12px;
  font-weight: 800;
}

/* ---------- 游戏中心 ---------- */
.g-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 18px 16px;
  margin: 4px 0 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #e9f8f0 0%, #e6f2ff 55%, #f4ecff 100%);
}
.g-head-main { flex: 1; min-width: 0; }
.g-head h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: .2px; }
.g-head p { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-500); }
.g-coin-badge {
  flex: 0 0 auto;
  text-align: center;
  padding: 8px 14px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .78);
  box-shadow: var(--sh-sm);
}
.g-coin-badge b {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: #b06a00;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.g-coin-badge span { font-size: 11px; color: var(--ink-500); }

.g-list { display: flex; flex-direction: column; gap: 11px; }

.g-item {
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: transform .15s, box-shadow .15s;
}
.g-item:active { transform: scale(.98); box-shadow: var(--sh-md); }
.g-item-icon {
  flex: 0 0 auto;
  width: 48px; height: 48px;
  border-radius: 15px;
  display: grid; place-items: center;
  font-size: 25px;
  background: var(--mint-100);
}
.g-item.g-blue   .g-item-icon { background: var(--sky-100); }
.g-item.g-purple .g-item-icon { background: var(--violet-100); }
.g-item.g-amber  .g-item-icon { background: var(--orange-100); }
.g-item.g-green  .g-item-icon { background: var(--mint-100); }
.g-item.g-rose   .g-item-icon { background: var(--rose-100); }
.g-item-body { flex: 1; min-width: 0; }
.g-item-name { font-size: 15.5px; font-weight: 800; }
.g-item-desc {
  font-size: 12.5px;
  color: var(--ink-500);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.g-item-meta { font-size: 11.5px; color: var(--ink-300); margin-top: 3px; font-weight: 600; }
.g-item-go { flex: 0 0 auto; color: var(--ink-300); }

.g-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--ink-300);
}

/* ---------- 游戏 HUD ---------- */
.g-hud {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
  margin: 4px 0 14px;
}
.g-hud-item {
  text-align: center;
  padding: 9px 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
}
.g-hud-item b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  color: var(--ink-900);
}
.g-hud-item b.is-low { color: var(--rose-500); }
.g-hud-item span { font-size: 11px; color: var(--ink-500); }

.g-tip {
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-500);
  margin: 12px 0 0;
}

/* ---------- 算术泡泡 ---------- */
.g-stage {
  position: relative;
  height: 340px;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(180deg, #f0f9ff 0%, #f7fdff 60%, #ffffff 100%);
  box-shadow: var(--sh-sm) inset, var(--sh-sm);
}
.g-question {
  position: absolute;
  top: 18px; left: 0; right: 0;
  text-align: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #1c5f96;
  font-variant-numeric: tabular-nums;
}
.g-bubble {
  position: absolute;
  bottom: -74px;
  width: 64px; height: 64px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 19px;
  font-weight: 800;
  color: #14507f;
  background: radial-gradient(circle at 32% 26%, #ffffff, #e8f4ff 42%, #b9dcff);
  border: 2px solid #a6d2f7;
  box-shadow: 0 6px 16px rgba(90, 169, 230, .22);
  animation: bubbleUp 4.6s linear forwards;
  font-variant-numeric: tabular-nums;
}
.g-bubble.is-pop {
  animation: none;
  opacity: 0;
  transform: translateY(-150px) scale(1.55);
  transition: transform .26s ease-out, opacity .26s ease-out;
}
@keyframes bubbleUp {
  0%   { transform: translateY(0) scale(.86); opacity: 0; }
  12%  { opacity: 1; }
  82%  { opacity: 1; }
  100% { transform: translateY(-350px) scale(1.04); opacity: 0; }
}

/* ---------- 拼音翻翻乐 ---------- */
.g-board {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
  margin-top: 14px;
}
.g-card {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 16px;
  background: var(--mint-100);
  transition: background .18s;
}
.g-card-back {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  font-size: 22px;
  font-weight: 800;
  color: var(--mint-400);
}
.g-card-face {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: 23px;
  font-weight: 800;
  color: var(--ink-900);
  opacity: 0;
  transform: rotateY(90deg);
  transition: opacity .16s, transform .16s;
  padding: 4px;
  text-align: center;
  word-break: break-all;
}
.g-card.is-open .g-card-face,
.g-card.is-done .g-card-face { opacity: 1; transform: none; }
.g-card.is-done { background: var(--mint-200); }
.g-card.is-done .g-card-face { background: var(--mint-50); color: var(--mint-700); }

/* ---------- 四选一游戏 ---------- */
.g-quiz { margin-top: 6px; }
.g-qtext {
  font-size: 21px;
  font-weight: 800;
  line-height: 1.5;
  text-align: center;
  padding: 22px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  word-break: break-word;
}
.g-qtext.is-big { font-size: 30px; letter-spacing: 3px; }
.g-opts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.g-opts.is-single { grid-template-columns: repeat(4, 1fr); }
.g-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 14px 12px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: 15.5px;
  font-weight: 700;
  text-align: left;
  transition: transform .14s, background .18s, box-shadow .14s;
  min-height: 52px;
}
.g-opt:active { transform: scale(.97); }
.g-opt-key {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--mint-100);
  color: var(--mint-700);
  font-size: 12px;
  font-weight: 800;
}
.g-opt-txt { flex: 1; min-width: 0; word-break: break-word; }
.g-opts.is-single .g-opt { flex-direction: column; gap: 4px; padding: 12px 6px; text-align: center; }
.g-opts.is-single .g-opt-txt { font-size: 24px; font-weight: 800; }
.g-opt.is-right { background: var(--mint-100); box-shadow: 0 0 0 2px var(--mint-400) inset; }
.g-opt.is-right .g-opt-key { background: var(--mint-400); color: #fff; }
.g-opt.is-wrong { background: var(--rose-100); box-shadow: 0 0 0 2px var(--rose-400) inset; }
.g-opt.is-wrong .g-opt-key { background: var(--rose-400); color: #fff; }
.g-ex {
  margin-top: 12px;
  padding: 0 14px;
  border-radius: var(--r-md);
  background: var(--mint-50);
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--ink-700);
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: all .24s;
}
.g-ex.is-on { max-height: 160px; opacity: 1; padding: 12px 14px; }

/* ---------- 飘分 ---------- */
.g-float {
  position: fixed;
  left: 50%;
  top: 38%;
  transform: translateX(-50%);
  font-size: 26px;
  font-weight: 800;
  pointer-events: none;
  z-index: 60;
  animation: floatUp .9s ease-out forwards;
  color: var(--mint-600);
  text-shadow: 0 2px 8px rgba(255, 255, 255, .9);
}
.g-float.down { color: var(--rose-400); }
@keyframes floatUp {
  0%   { opacity: 0; transform: translate(-50%, 10px) scale(.8); }
  25%  { opacity: 1; transform: translate(-50%, -6px) scale(1.1); }
  100% { opacity: 0; transform: translate(-50%, -60px) scale(1); }
}

/* ---------- 游戏结算 ---------- */
.g-result {
  text-align: center;
  padding: 26px 18px 20px;
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--sh-md);
  margin-top: 8px;
}
.g-result-icon { font-size: 42px; line-height: 1; }
.g-result h2 { margin: 8px 0 2px; font-size: 17px; font-weight: 800; color: var(--ink-700); }
.g-result-score {
  font-size: 46px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--mint-600);
  font-variant-numeric: tabular-nums;
}
.g-result-score small { font-size: 16px; font-weight: 700; margin-left: 3px; color: var(--ink-500); }
.g-result-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 16px 0 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.g-result-grid b { display: block; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.g-result-grid span { font-size: 11px; color: var(--ink-500); }
.g-coin {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: #fff7e6;
  color: #b06a00;
  font-size: 13.5px;
  font-weight: 700;
}
.g-coin b { font-size: 17px; font-weight: 800; }
.g-best {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 800;
  color: var(--orange-500);
}
.g-result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}

/* ---------- 反馈条金币 ---------- */
.fb-coin {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: #fff2d6;
  color: #b06a00;
  font-size: 12px;
  font-weight: 800;
}

/* ---------- 伙伴页金币卡 ---------- */
.coin-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fffaf0 0%, #fff5e0 100%);
}
.coin-card-main { flex: 1; }
.coin-card-main b {
  display: block;
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #b06a00;
  font-variant-numeric: tabular-nums;
}
.coin-card-main span { font-size: 12px; color: var(--ink-500); }
.coin-card-side {
  flex: 0 0 auto;
  text-align: right;
  padding-left: 14px;
  border-left: 1px dashed rgba(176, 106, 0, .25);
}
.coin-card-side b { display: block; font-size: 18px; font-weight: 800; color: var(--mint-600); }
.coin-card-side span { font-size: 11.5px; color: var(--ink-500); }

/* ---------- 金币商店 ---------- */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
.shop-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 12px 6px 10px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  border: 1.5px solid transparent;
  transition: transform .14s, border-color .18s;
  min-height: 92px;
}
.shop-item:active { transform: scale(.96); }
.shop-ico { font-size: 24px; line-height: 1.1; }
.shop-name { font-size: 12.5px; font-weight: 700; color: var(--ink-700); }
.shop-price {
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-300);
  font-variant-numeric: tabular-nums;
}
.shop-item.is-buyable { border-color: var(--orange-300); }
.shop-item.is-buyable .shop-price { color: #b06a00; }
.shop-item.is-owned { background: var(--mint-50); box-shadow: none; }
.shop-item.is-owned .shop-name { color: var(--mint-700); }
.shop-item.is-owned .shop-price { color: var(--mint-500); }
.shop-item:disabled { cursor: default; }

/* ---------- 新增模块响应式 ---------- */
@media (min-width: 620px) {
  .g-board { grid-template-columns: repeat(4, 1fr); }
  .shop-grid { grid-template-columns: repeat(5, 1fr); }
  .g-stage { height: 400px; }
}

@media (max-width: 360px) {
  .tab { font-size: 10px; }
  .g-qtext.is-big { font-size: 26px; }
  .g-opts.is-single .g-opt-txt { font-size: 21px; }
  .shop-grid { grid-template-columns: repeat(3, 1fr); }
  .coin-chip { padding: 3px 8px 3px 6px; font-size: 12px; }
}

/* ===========================================================
   训练中心（hub.js）
   =========================================================== */
.tr-wrap { padding: 4px 0 24px; }

.tr-hero {
  padding: 20px 20px 18px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #eef8ff 0%, #f3f0ff 100%);
  border: 1px solid #e2ecfb;
}
.tr-hero-t { font-size: 19px; font-weight: 800; color: var(--ink-900); letter-spacing: .3px; }
.tr-hero-s { margin-top: 6px; font-size: 12.5px; color: var(--ink-500); line-height: 1.6; }

.tr-today {
  margin: 14px 0 18px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.tr-today > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 6px;
  text-align: center;
  box-shadow: var(--sh-sm);
}
.tr-today b { display: block; font-size: 19px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.tr-today span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-300); }

.tr-list { display: flex; flex-direction: column; gap: 10px; }

.tr-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 15px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: transform .14s ease, box-shadow .14s ease;
}
.tr-card:active { transform: scale(.985); }

.tr-ico {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  font-size: 23px;
  border-radius: 15px;
  background: var(--mint-100);
}
.tr-blue .tr-ico { background: var(--sky-100); }
.tr-amber .tr-ico { background: var(--orange-100); }
.tr-purple .tr-ico { background: var(--violet-100); }
.tr-rose .tr-ico { background: var(--rose-100); }

.tr-body { flex: 1; min-width: 0; }
.tr-name { display: block; font-size: 15px; font-weight: 700; color: var(--ink-900); }
.tr-desc { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-300); }
.tr-stat {
  flex: none;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--mint-600);
  background: var(--mint-50);
  border-radius: 999px;
  padding: 4px 9px;
}
.tr-go { flex: none; color: var(--ink-300); font-size: 20px; line-height: 1; }

.tr-wrong {
  width: 100%;
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--rose-100);
  color: var(--rose-500);
  border: 1px dashed #f6c4c4;
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
}

/* ===========================================================
   我的（hub.js）
   =========================================================== */
.me-wrap { padding: 4px 0 24px; }

.me-stats {
  margin: 12px 0 16px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.me-stats > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 6px;
  text-align: center;
  box-shadow: var(--sh-sm);
}
.me-stats b { display: block; font-size: 18px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.me-stats span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-300); }

.me-list { display: flex; flex-direction: column; gap: 8px; }

.me-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  text-align: left;
}
.me-row:active { transform: scale(.985); }
.me-ico {
  flex: none;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  font-size: 19px;
  border-radius: 13px;
  background: var(--surface-2);
}
.me-txt { flex: 1; min-width: 0; }
.me-txt b { display: block; font-size: 14.5px; color: var(--ink-900); }
.me-txt i { display: block; margin-top: 2px; font-size: 11.5px; color: var(--ink-300); font-style: normal; }
.me-go { flex: none; color: var(--ink-300); font-size: 20px; }

.me-about { margin-top: 22px; text-align: center; }
.me-about p { margin: 2px 0; font-size: 11.5px; color: var(--ink-300); }

/* ===========================================================
   专注番茄（focus.js）
   =========================================================== */
.f-wrap { padding: 6px 0 24px; }

.f-dial {
  position: relative;
  width: 236px;
  height: 236px;
  margin: 6px auto 16px;
}
.f-ring { width: 100%; height: 100%; display: block; }
.f-ring-bg { fill: none; stroke: #e8f2ee; stroke-width: 9; }
.f-ring-fg {
  fill: none;
  stroke: url(#none);
  stroke: var(--mint-500);
  stroke-width: 9;
  transition: stroke-dashoffset .9s linear;
}
.f-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.f-mode {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--mint-600);
  background: var(--mint-100);
  padding: 3px 10px;
  border-radius: 999px;
}
.f-mode.is-break { color: var(--sky-400); background: var(--sky-100); }
.f-time {
  font-size: 46px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.f-task-hint {
  max-width: 150px;
  text-align: center;
  font-size: 11px;
  color: var(--ink-300);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.f-presets { display: flex; gap: 8px; justify-content: center; margin-bottom: 12px; }
.f-preset {
  flex: 1;
  max-width: 92px;
  padding: 9px 0;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink-500);
}
.f-preset b { display: block; font-size: 16px; color: var(--ink-900); }
.f-preset span { display: block; font-size: 10px; color: var(--ink-300); }
.f-preset.is-on { border-color: var(--mint-400); background: var(--mint-50); }
.f-preset.is-on b { color: var(--mint-600); }

.f-task { margin-bottom: 12px; }
.f-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1.5px solid var(--line);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-900);
  outline: none;
}
.f-input:focus { border-color: var(--mint-400); }

.f-actions { display: flex; gap: 10px; margin-bottom: 18px; }
.f-btn-main {
  flex: 2;
  padding: 14px 0;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--mint-500), var(--mint-400));
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(47, 174, 124, .25);
}
.f-btn-main.is-run { background: linear-gradient(135deg, var(--orange-500), var(--orange-400)); box-shadow: 0 6px 16px rgba(247, 140, 30, .25); }
.f-btn-ghost {
  flex: 1;
  padding: 14px 0;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink-500);
  font-size: 14px;
  font-weight: 600;
}

.f-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.f-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 4px;
  text-align: center;
  box-shadow: var(--sh-sm);
}
.f-stat b { display: block; font-size: 17px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.f-stat span { display: block; margin-top: 2px; font-size: 10px; color: var(--ink-300); }

.f-week {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 14px 14px 10px;
  box-shadow: var(--sh-sm);
}
.f-week-title { font-size: 12px; font-weight: 700; color: var(--ink-700); margin-bottom: 10px; }
.f-bars { display: flex; align-items: flex-end; gap: 6px; height: 76px; }
.f-bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; }
.f-bar-box {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: var(--surface-2);
  border-radius: 6px;
  overflow: hidden;
}
.f-bar-box i {
  display: block;
  width: 100%;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--mint-400), var(--mint-500));
  transition: height .3s ease;
}
.f-bar-col span { margin-top: 5px; font-size: 10px; color: var(--ink-300); }

.f-tip {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px dashed var(--line);
}
.f-tip b { display: block; font-size: 12px; color: var(--ink-700); margin-bottom: 5px; }
.f-tip p { margin: 0; font-size: 11.5px; line-height: 1.7; color: var(--ink-500); }

/* ===========================================================
   口算冲刺（kousuan.js）
   =========================================================== */
.ks-home { padding: 4px 0 24px; }

.ks-hero {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #eaf6ff 0%, #eefaf3 100%);
  border: 1px solid #dceefa;
}
.ks-hero-main { flex: 1; }
.ks-hero-num {
  font-size: 40px;
  font-weight: 800;
  color: var(--sky-400);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.ks-hero-label { margin-top: 4px; font-size: 11.5px; color: var(--ink-500); }
.ks-hero-side { display: flex; gap: 14px; }
.ks-hero-side > div { text-align: center; }
.ks-hero-side b { display: block; font-size: 17px; color: var(--ink-900); }
.ks-hero-side span { display: block; font-size: 10px; color: var(--ink-300); }

.ks-sec-title {
  margin: 18px 0 9px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-700);
}

.ks-types { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.ks-type {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--line);
  box-shadow: var(--sh-sm);
  text-align: left;
}
.ks-type-ico { font-size: 19px; }
.ks-type-name { font-size: 13.5px; font-weight: 700; color: var(--ink-900); }
.ks-type-meta { font-size: 10.5px; color: var(--ink-300); }
.ks-type.is-on { border-color: var(--sky-400); background: #f4fbff; }

.ks-modes { display: flex; gap: 9px; }
.ks-mode {
  flex: 1;
  padding: 13px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--line);
  text-align: left;
  box-shadow: var(--sh-sm);
}
.ks-mode b { display: block; font-size: 13.5px; color: var(--ink-900); }
.ks-mode span { display: block; margin-top: 2px; font-size: 10.5px; color: var(--ink-300); }
.ks-mode.is-on { border-color: var(--mint-400); background: var(--mint-50); }

.ks-btn-main {
  width: 100%;
  padding: 14px 0;
  border-radius: var(--r-md);
  background: linear-gradient(135deg, var(--sky-400), #7cc4f0);
  color: #fff;
  font-size: 15.5px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(90, 169, 230, .28);
}
.ks-go { margin-top: 16px; }
.ks-btn-ghost {
  width: 100%;
  padding: 13px 0;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink-500);
  font-size: 14px;
  font-weight: 600;
}

.ks-wrongbook { margin-top: 4px; }
.ks-wrong-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 13px;
  margin-bottom: 6px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-700);
}
.ks-wrong-row b { color: var(--mint-600); font-variant-numeric: tabular-nums; }
.ks-clear {
  width: 100%;
  padding: 9px 0;
  font-size: 11.5px;
  color: var(--ink-300);
  background: none;
  text-decoration: underline;
}

/* 答题中 */
.ks-run { padding: 6px 0 24px; }
.ks-hud {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.ks-hud-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 9px 4px;
  text-align: center;
  box-shadow: var(--sh-sm);
}
.ks-hud-item b {
  display: block;
  font-size: 18px;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  min-height: 22px;
}
.ks-hud-item span { display: block; font-size: 10px; color: var(--ink-300); }
.ks-combo { color: var(--orange-500) !important; font-size: 14px !important; }
.ks-combo.is-on { animation: comboPop .3s ease; }
@keyframes comboPop { 0% { transform: scale(.7); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }

.ks-progress {
  height: 5px;
  border-radius: 999px;
  background: #e8f2ee;
  overflow: hidden;
  margin-bottom: 16px;
}
.ks-progress i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--mint-400), var(--sky-400));
  transition: width .3s linear;
}

.ks-no { text-align: center; font-size: 11.5px; color: var(--ink-300); }
.ks-q {
  margin: 10px 0 6px;
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  transition: color .15s ease, transform .15s ease;
}
.ks-q.is-ok { color: var(--mint-500); transform: scale(1.06); }
.ks-q.is-no { color: var(--rose-400); animation: shake .3s ease; }
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

.ks-buf {
  text-align: center;
  font-size: 26px;
  font-weight: 700;
  color: var(--sky-400);
  min-height: 34px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}

.ks-cmp { display: flex; gap: 10px; margin: 8px 0 4px; }
.ks-cmp button {
  flex: 1;
  padding: 18px 0;
  font-size: 26px;
  font-weight: 700;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1.5px solid var(--line);
  color: var(--ink-900);
  box-shadow: var(--sh-sm);
}
.ks-cmp button:active { background: var(--sky-100); }

.ks-pad {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ks-pad button {
  padding: 16px 0;
  font-size: 21px;
  font-weight: 700;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-900);
  box-shadow: var(--sh-sm);
  font-variant-numeric: tabular-nums;
}
.ks-pad button:active { background: var(--mint-100); transform: scale(.97); }
.ks-pad button.is-fn { color: var(--ink-300); font-size: 18px; }
.ks-pad button.is-ok {
  background: linear-gradient(135deg, var(--mint-500), var(--mint-400));
  color: #fff;
  border-color: transparent;
}

.ks-quit {
  width: 100%;
  margin-top: 14px;
  padding: 10px 0;
  font-size: 12px;
  color: var(--ink-300);
  background: none;
  text-decoration: underline;
}

/* 结算 */
.ks-result { padding: 20px 0 24px; text-align: center; }
.ksr-icon { font-size: 48px; line-height: 1; }
.ks-result h2 { margin: 10px 0 4px; font-size: 19px; color: var(--ink-900); }
.ksr-sub { font-size: 12px; color: var(--ink-300); }
.ksr-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 18px 0 12px;
}
.ksr-grid > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 4px;
  box-shadow: var(--sh-sm);
}
.ksr-grid b { display: block; font-size: 18px; color: var(--ink-900); font-variant-numeric: tabular-nums; }
.ksr-grid span { display: block; font-size: 10px; color: var(--ink-300); }
.ksr-coins {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-500);
  font-size: 13px;
  font-weight: 700;
}
.ksr-wrong {
  margin: 18px 0 0;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  text-align: left;
}
.ksr-wrong > b { display: block; font-size: 12px; color: var(--ink-700); margin-bottom: 8px; }
.ksr-wrong-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
}
.ksr-wrong-item span { flex: 1; color: var(--ink-700); }
.ksr-wrong-item em { font-style: normal; color: var(--rose-400); font-size: 11px; }
.ksr-wrong-item i { font-style: normal; color: var(--mint-600); font-weight: 700; font-size: 11.5px; }
.ksr-actions { display: flex; flex-direction: column; gap: 9px; margin-top: 18px; }

/* ===========================================================
   课文跟读（readalong.js）
   =========================================================== */
.rd-list { padding: 4px 0 24px; }

.rd-hero {
  padding: 18px 18px 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--violet-100), var(--mint-100));
  border: 1px solid var(--line);
  margin-bottom: 18px;
}
.rd-hero-t { font-size: 17px; font-weight: 700; color: var(--ink-900); letter-spacing: .3px; }
.rd-hero-s { margin-top: 5px; font-size: 12px; color: var(--ink-500); }

.rd-grade { margin-bottom: 16px; }
.rd-grade-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-500);
  letter-spacing: 1px;
  margin: 0 0 8px 2px;
}

.rd-item {
  position: relative;
  display: block;
  width: 100%;
  padding: 13px 15px;
  margin-bottom: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: transform .14s ease, box-shadow .14s ease;
}
.rd-item:active { transform: scale(.985); }
.rd-item-t { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink-900); }
.rd-item-a { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-500); }
.rd-item-badge {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--mint-700);
  font-size: 10.5px;
  font-weight: 700;
}

/* ---------- 跟读页 ---------- */
.rd-play { padding: 4px 0 28px; }

.rd-head { margin-bottom: 14px; }
.rd-title { font-size: 22px; font-weight: 700; color: var(--ink-900); letter-spacing: .5px; }
.rd-meta { margin-top: 4px; font-size: 12px; color: var(--ink-500); }
.rd-theme {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-500);
  font-size: 11px;
  font-weight: 700;
}

.rd-toolbar { display: flex; gap: 8px; margin-bottom: 14px; }
.rd-tool {
  flex: 1;
  padding: 9px 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  transition: transform .14s ease, background .14s ease;
}
.rd-tool:active { transform: scale(.96); }
.rd-tool b { font-weight: 700; color: var(--mint-600); }
.rd-tool.is-on {
  background: var(--mint-500);
  border-color: var(--mint-500);
  color: #fff;
}

.rd-body { margin-bottom: 12px; }

.rd-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 13px 14px;
  margin-bottom: 8px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .14s ease;
}
.rd-line:active { transform: scale(.99); }

.rd-line-no {
  flex: none;
  width: 20px;
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-300);
  text-align: center;
}
.rd-line-tx {
  font-size: 18px;
  line-height: 1.75;
  color: var(--ink-900);
  letter-spacing: 1.5px;
}

.rd-line.is-cur {
  background: var(--mint-50);
  border-color: var(--mint-300);
}
.rd-line.is-cur .rd-line-no { color: var(--mint-600); }
.rd-line.is-speak {
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px var(--mint-100);
}
.rd-line.is-done {
  background: var(--surface-2);
  border-color: var(--mint-200);
}
.rd-line.is-done .rd-line-no::after {
  content: '✓';
  display: block;
  font-size: 10px;
  color: var(--mint-500);
}

/* 背诵模式：只留首字 */
.rd-line-hint { display: none; }
.rd-body.is-recite .rd-line:not(.is-open) .rd-line-tx { display: none; }
.rd-body.is-recite .rd-line:not(.is-open) .rd-line-hint {
  display: inline;
  font-size: 19px;
  letter-spacing: 4px;
  color: var(--ink-300);
}

.rd-counter {
  text-align: center;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-300);
  letter-spacing: 1px;
  margin-bottom: 14px;
}

.rd-rec { display: flex; gap: 10px; margin-bottom: 14px; }
.rd-rec-btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--mint-500);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(47, 174, 124, .28);
  transition: transform .14s ease, background .14s ease;
}
.rd-rec-btn:active { transform: scale(.97); }
.rd-rec-btn.is-rec {
  background: var(--rose-500);
  box-shadow: 0 6px 16px rgba(217, 74, 74, .28);
  animation: recPulse 1.2s ease-in-out infinite;
}
@keyframes recPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .68; }
}
.rd-rec-play {
  flex: none;
  padding: 14px 18px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-700);
}

.rd-self {
  padding: 14px;
  border-radius: var(--r-lg);
  background: var(--surface-2);
  border: 1px dashed var(--line);
}
.rd-self-t {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-500);
  margin-bottom: 10px;
  letter-spacing: .5px;
}
.rd-self-btns { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rd-self-btns button {
  padding: 11px 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-700);
  transition: transform .14s ease;
}
.rd-self-btns button:active { transform: scale(.95); }
.rd-self-btns button.is-good {
  background: var(--mint-100);
  border-color: var(--mint-200);
  color: var(--mint-700);
}
.rd-self-btns button.is-again {
  background: var(--orange-100);
  border-color: var(--orange-300);
  color: var(--orange-500);
}

.rd-trans {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
}
.rd-trans summary {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-700);
  cursor: pointer;
  list-style: none;
}
.rd-trans summary::-webkit-details-marker { display: none; }
.rd-trans summary::before { content: '▸ '; color: var(--ink-300); }
.rd-trans[open] summary::before { content: '▾ '; }
.rd-trans p {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-700);
}
.rd-notes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.rd-notes span {
  padding: 4px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-500);
}
.rd-notes span b { color: var(--ink-900); margin-right: 4px; }

/* ===========================================================
   古诗讲堂（poemview.js）
   =========================================================== */
.pm-list { padding: 4px 0 24px; }

.pm-hero {
  padding: 18px 18px 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, var(--orange-100), #fff8ef);
  border: 1px solid #f6e3cc;
  margin-bottom: 16px;
}
.pm-hero-t { font-size: 17px; font-weight: 700; color: var(--ink-900); letter-spacing: .3px; }
.pm-hero-s { margin-top: 5px; font-size: 12px; color: var(--ink-500); }

.pm-filter {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 10px;
  scrollbar-width: none;
}
.pm-filter::-webkit-scrollbar { display: none; }
.pm-chip {
  flex: none;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-500);
  white-space: nowrap;
  transition: background .16s ease, color .16s ease;
}
.pm-chip.is-on {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #fff;
}

.pm-themes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.pm-tag {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--ink-500);
  transition: background .16s ease, color .16s ease;
}
.pm-tag.is-on {
  background: var(--mint-100);
  border-color: var(--mint-300);
  color: var(--mint-700);
  font-weight: 700;
}

.pm-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }

.pm-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 13px 12px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: transform .14s ease, box-shadow .14s ease;
}
.pm-card:active { transform: scale(.97); }
.pm-card-top { display: flex; align-items: center; gap: 6px; }
.pm-card-t { font-size: 15px; font-weight: 700; color: var(--ink-900); }
.pm-card-ok {
  flex: none;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--mint-700);
  font-size: 9.5px;
  font-weight: 700;
}
.pm-card-a { font-size: 10.5px; color: var(--ink-300); }
.pm-card-line {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-700);
  letter-spacing: .5px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.pm-card-theme {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 7px;
  border-radius: var(--r-sm);
  background: var(--orange-100);
  color: var(--orange-500);
  font-size: 10px;
  font-weight: 700;
}

.pm-empty {
  grid-column: 1 / -1;
  padding: 40px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-300);
}

/* ---------- 讲解页 ---------- */
.pm-detail { padding: 4px 0 28px; }

.pm-d-head { margin-bottom: 16px; }
.pm-d-title { font-size: 23px; font-weight: 700; color: var(--ink-900); letter-spacing: 1px; }
.pm-d-meta { margin-top: 5px; font-size: 12px; color: var(--ink-500); }

.pm-d-lines {
  padding: 20px 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(180deg, #fffdf8, var(--surface));
  border: 1px solid #f6e3cc;
  margin-bottom: 14px;
}
.pm-d-line {
  padding: 7px 0;
  font-size: 19px;
  line-height: 1.7;
  color: var(--ink-900);
  letter-spacing: 2px;
  text-align: center;
  cursor: pointer;
  transition: color .16s ease, transform .14s ease;
}
.pm-d-line:active { color: var(--orange-500); transform: scale(.98); }

.pm-d-actions { display: flex; gap: 8px; margin-bottom: 18px; }
.pm-act {
  flex: 1;
  padding: 12px 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  transition: transform .14s ease;
}
.pm-act:active { transform: scale(.96); }
.pm-act.is-main {
  background: var(--orange-500);
  border-color: var(--orange-500);
  color: #fff;
  box-shadow: 0 6px 16px rgba(247, 140, 30, .28);
}

.pm-d-block {
  padding: 15px 16px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  margin-bottom: 12px;
}
.pm-d-h {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-500);
  letter-spacing: 1px;
  margin-bottom: 9px;
}
.pm-d-h::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 11px;
  margin-right: 6px;
  border-radius: 2px;
  background: var(--orange-400);
  vertical-align: -1px;
}
.pm-trans {
  margin: 0;
  font-size: 14px;
  line-height: 1.9;
  color: var(--ink-700);
}

.pm-notes { display: flex; flex-direction: column; gap: 8px; }
.pm-note {
  display: flex;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  background: var(--surface-2);
}
.pm-note b {
  flex: none;
  min-width: 52px;
  font-size: 13px;
  color: var(--ink-900);
}
.pm-note span { font-size: 12.5px; line-height: 1.7; color: var(--ink-500); }

.pm-passed {
  padding: 11px 14px;
  border-radius: var(--r-md);
  background: var(--mint-100);
  border: 1px solid var(--mint-200);
  color: var(--mint-700);
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

/* ---------- 背诵闯关 ---------- */
.pm-quiz { padding: 4px 0 28px; }

.pm-q-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.pm-q-kind {
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-500);
  font-size: 11.5px;
  font-weight: 700;
}
.pm-q-step { font-size: 11.5px; font-weight: 700; color: var(--ink-300); letter-spacing: .5px; }

.pm-q-progress { display: flex; gap: 5px; margin-bottom: 20px; }
.pm-q-progress i {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  transition: background .2s ease;
}
.pm-q-progress i.is-done { background: var(--mint-400); }
.pm-q-progress i.is-cur { background: var(--orange-400); }

.pm-q-ask {
  padding: 20px 16px;
  margin-bottom: 16px;
  border-radius: var(--r-xl);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: 16px;
  line-height: 1.8;
  font-weight: 600;
  color: var(--ink-900);
  letter-spacing: .5px;
}

.pm-q-opts { display: flex; flex-direction: column; gap: 9px; }
.pm-q-opt {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 13px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  text-align: left;
  transition: transform .14s ease, background .16s ease, border-color .16s ease;
}
.pm-q-opt:active { transform: scale(.985); }
.pm-q-opt:disabled { cursor: default; }
.pm-q-key {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink-300);
}
.pm-q-tx {
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-900);
  letter-spacing: 1px;
}
.pm-q-opt.is-right {
  background: var(--mint-50);
  border-color: var(--mint-400);
}
.pm-q-opt.is-right .pm-q-key {
  background: var(--mint-500);
  border-color: var(--mint-500);
  color: #fff;
}
.pm-q-opt.is-wrong {
  background: var(--rose-100);
  border-color: var(--rose-400);
  animation: shake .32s ease;
}
.pm-q-opt.is-wrong .pm-q-key {
  background: var(--rose-500);
  border-color: var(--rose-500);
  color: #fff;
}

.pm-q-fb {
  margin-top: 16px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 700;
  text-align: center;
}
.pm-q-fb.is-ok { background: var(--mint-100); color: var(--mint-700); }
.pm-q-fb.is-no { background: var(--rose-100); color: var(--rose-500); }

/* ---------- 闯关结果 ---------- */
.pm-qresult {
  padding: 34px 18px 28px;
  text-align: center;
}
.pm-qr-icon { font-size: 56px; line-height: 1; margin-bottom: 14px; }
.pm-qresult h2 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink-900);
}
.pm-qr-sub { font-size: 13px; color: var(--ink-500); }
.pm-qr-coins {
  display: inline-block;
  margin-top: 14px;
  padding: 6px 16px;
  border-radius: 999px;
  background: var(--orange-100);
  color: var(--orange-500);
  font-size: 14px;
  font-weight: 700;
}
.pm-qr-actions { display: flex; gap: 9px; margin-top: 24px; }

/* hidden 兜底：部分按钮自身 display 会覆盖 UA 默认 */
[hidden] { display: none !important; }

/* 我的页金币卡（hub.js 用 div 结构，与商店页 b/span 结构并存） */
.coin-card-num {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.1;
  color: #b06a00;
  font-variant-numeric: tabular-nums;
}
.coin-card-label { font-size: 12px; color: var(--ink-500); }

/* ===========================================================
   拼音迷宫（maze.js）
   =========================================================== */
.mz-hero {
  padding: 20px 18px 16px;
  border-radius: var(--r-xl);
  background: linear-gradient(160deg, #e8f7ef 0%, #dff2fb 55%, #fdf3e4 100%);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
}
.mz-hero-t { font-size: 21px; font-weight: 800; color: var(--ink-900); letter-spacing: .5px; }
.mz-hero-s { margin-top: 4px; font-size: 13px; color: var(--ink-500); }
.mz-hero-stat {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
}
.mz-hero-stat > div {
  padding: 8px 6px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .72);
  text-align: center;
}
.mz-hero-stat b { display: block; font-size: 16px; font-weight: 800; color: var(--mint-600); }
.mz-hero-stat span { font-size: 11.5px; color: var(--ink-500); }

.mz-map {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}
.mz-lv {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 9px 0 7px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-sm);
  transition: transform .12s ease;
}
.mz-lv b { font-size: 15px; font-weight: 800; color: var(--ink-900); }
.mz-lv i { font-style: normal; font-size: 10px; letter-spacing: -.5px; color: var(--orange-400); }
.mz-lv.is-now { border-color: var(--mint-400); background: var(--mint-50); }
.mz-lv.is-lock { opacity: .45; box-shadow: none; }
.mz-lv:active:not([disabled]) { transform: scale(.94); }

/* ---- 走迷宫 ---- */
.mz-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.mz-top-l b { font-size: 17px; font-weight: 800; color: var(--ink-900); }
.mz-top-l span {
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--mint-100);
  color: var(--mint-600);
  font-size: 11.5px;
  font-weight: 700;
}
.mz-top-r { font-size: 12px; color: var(--ink-500); }
.mz-top-r b {
  margin-left: 5px;
  font-size: 17px;
  font-weight: 800;
  color: var(--rose-500);
  font-variant-numeric: tabular-nums;
}

.mz-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  margin-bottom: 12px;
  border-radius: var(--r-md);
  background: #fff8ec;
  border: 1px solid #f6e2c0;
  font-size: 14px;
  font-weight: 700;
  color: #8a5a12;
  line-height: 1.45;
}
.mz-rule i {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--orange-400);
  color: #fff;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.mz-grid {
  display: grid;
  grid-template-columns: repeat(var(--n, 5), 1fr);
  gap: 6px;
  padding: 8px;
  border-radius: var(--r-lg);
  background: linear-gradient(170deg, #eef8f2, #e6f3fb);
  border: 1px solid var(--line);
}
.mz-cell {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  aspect-ratio: 1 / 1;
  padding: 2px;
  border-radius: 11px;
  background: var(--surface);
  border: 1.5px solid #e3ece7;
  box-shadow: 0 1px 2px rgba(20, 50, 42, .05);
  transition: transform .12s ease, background .15s ease, border-color .15s ease;
  overflow: hidden;
}
.mz-cell .mz-ch {
  font-size: clamp(15px, 4.4vw, 20px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink-900);
}
.mz-cell .mz-py {
  font-size: clamp(8.5px, 2.5vw, 10.5px);
  line-height: 1.1;
  color: var(--ink-500);
  letter-spacing: -.2px;
  white-space: nowrap;
}
.mz-cell .mz-badge {
  position: absolute;
  top: 2px;
  left: 3px;
  font-style: normal;
  font-size: 9px;
  font-weight: 700;
  color: var(--mint-600);
  opacity: .85;
}
.mz-cell .mz-badge.is-end { color: var(--rose-500); }

.mz-cell.is-ok {
  background: #d8f3e5;
  border-color: #a9e2c6;
}
.mz-cell.is-ok .mz-py { color: #2c7a58; }
.mz-cell.is-cur {
  background: #fff;
  border-color: var(--mint-500);
  box-shadow: 0 0 0 3px rgba(47, 174, 124, .22), 0 4px 10px rgba(47, 174, 124, .18);
  transform: scale(1.05);
  z-index: 2;
}
.mz-cell.is-cur::after {
  content: '';
  position: absolute;
  bottom: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--mint-500);
  animation: mzDot 1.2s ease-in-out infinite;
}
.mz-cell.is-bad {
  background: #ffe9e9;
  border-color: #f3b6b6;
  opacity: .78;
}
.mz-cell.is-bad .mz-ch { color: #c25a5a; }
.mz-cell.is-bad::after {
  content: '✕';
  position: absolute;
  top: 1px;
  right: 3px;
  font-size: 9px;
  font-weight: 700;
  color: #d97070;
}
.mz-cell.is-hint {
  animation: mzHint 1.8s ease-in-out;
  border-color: var(--orange-400);
}
.mz-cell.is-shake { animation: mzShake .42s ease; }

@keyframes mzDot {
  0%, 100% { opacity: .35; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-2px); }
}
@keyframes mzHint {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 169, 92, 0); }
  30%, 70% { box-shadow: 0 0 0 4px rgba(255, 169, 92, .45); background: #fff6e8; }
}
@keyframes mzShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-4px); }
  45% { transform: translateX(4px); }
  70% { transform: translateX(-3px); }
}

.mz-tip {
  margin: 10px 2px 0;
  font-size: 12px;
  color: var(--ink-500);
  text-align: center;
}
.mz-acts {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 12px;
}
.mz-acts .btn { flex: 1 1 0; }

/* ---- 通关 ---- */
.mz-win {
  padding: 26px 18px 20px;
  border-radius: var(--r-xl);
  background: linear-gradient(170deg, #eafaf1, #e6f4fd 70%, #fdf4e6);
  border: 1px solid var(--line);
  box-shadow: var(--sh-md);
  text-align: center;
}
.mz-win-stars { display: flex; justify-content: center; gap: 6px; }
.mz-win-stars i {
  font-style: normal;
  font-size: 34px;
  line-height: 1;
  color: #dfe6e2;
  transition: transform .2s ease;
}
.mz-win-stars i.on {
  color: var(--orange-400);
  text-shadow: 0 3px 8px rgba(255, 169, 92, .35);
  animation: mzStar .5s ease both;
}
.mz-win-stars i.on:nth-child(2) { animation-delay: .12s; }
.mz-win-stars i.on:nth-child(3) { animation-delay: .24s; }
@keyframes mzStar {
  0% { transform: scale(.3) rotate(-25deg); opacity: 0; }
  70% { transform: scale(1.18) rotate(6deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); }
}
.mz-win h2 { margin: 10px 0 4px; font-size: 21px; font-weight: 800; color: var(--ink-900); }
.mz-win-sub { font-size: 13px; color: var(--ink-500); }
.mz-win-coin {
  display: inline-block;
  margin-top: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--orange-100);
  color: #b06a00;
  font-size: 13.5px;
  font-weight: 700;
}
.mz-win-coin b { font-size: 17px; }
.mz-win-acts { display: flex; flex-direction: column; gap: 9px; margin-top: 20px; }

/* ===========================================================
   伙伴「奥拉米拉」—— 动态形象与互动（pet.js / app2.js）
   =========================================================== */
.pet-svg { display: block; width: 100%; height: 100%; overflow: visible; }

/* 舞台换成设计稿的薄荷底 */
.pet-stage {
  background: linear-gradient(168deg, #dcf4e9 0%, #bfe5db 52%, #cfeedd 100%);
}

/* ---- 呼吸 ---- */
.pet-core {
  transform-box: fill-box;
  transform-origin: 50% 100%;
  animation: petBreath 3.6s ease-in-out infinite;
}
@keyframes petBreath {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.022, 1.032); }
}

/* ---- 眨眼 ---- */
.pet-eye {
  transform-box: fill-box;
  transform-origin: center;
  animation: petBlink 4.8s ease-in-out infinite;
}
@keyframes petBlink {
  0%, 91%, 100% { transform: scaleY(1); }
  94% { transform: scaleY(.12); }
  97% { transform: scaleY(1); }
}

/* ---- 耳朵抖 ---- */
.pet-ear-l, .pet-ear-r {
  transform-box: fill-box;
  transform-origin: 50% 85%;
}
.pet-ear-l { animation: petEarL 5.4s ease-in-out infinite; }
.pet-ear-r { animation: petEarR 5.4s ease-in-out infinite .5s; }
@keyframes petEarL {
  0%, 86%, 100% { transform: rotate(0); }
  90% { transform: rotate(-8deg); }
  94% { transform: rotate(3deg); }
}
@keyframes petEarR {
  0%, 86%, 100% { transform: rotate(0); }
  90% { transform: rotate(8deg); }
  94% { transform: rotate(-3deg); }
}

/* ---- 尾巴摆 ---- */
.pet-tail {
  transform-box: fill-box;
  transform-origin: 0% 60%;
  animation: petTail 2.6s ease-in-out infinite;
}
@keyframes petTail {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(9deg); }
}

/* ---- 嘴巴：按情绪切换 ---- */
.pet-mouth {
  opacity: 0;
  transition: opacity .16s ease;
  transform-box: fill-box;
  transform-origin: center;
}
.pet-svg.mood-idle .m-idle,
.pet-svg.mood-think .m-idle,
.pet-svg.mood-happy .m-happy,
.pet-svg.mood-eat .m-eat,
.pet-svg.mood-sleep .m-sleep { opacity: 1; }

/* ---- 情绪 ---- */
.pet-svg.mood-happy .pet-eye { animation: none; transform: scaleY(.34); }
.pet-svg.mood-happy .pet-blush { opacity: 1; }
.pet-svg.mood-happy .pet-core { animation-duration: 1.8s; }

.pet-svg.mood-sleep .pet-eye { animation: none; transform: scaleY(.1); }
.pet-svg.mood-sleep .pet-core { animation-duration: 5.4s; }
.pet-svg.mood-sleep .pet-ear-l { animation: none; }
.pet-svg.mood-sleep .pet-ear-r { animation: none; }

.pet-svg.mood-think .pet-eye { transform: translateY(-2.5px); animation: none; }
.pet-svg.mood-think .pet-tail { animation-duration: 1.4s; }

.pet-svg.mood-eat .m-eat { animation: petChew .42s ease-in-out infinite; }
@keyframes petChew {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(1.15, .62); }
}

/* ---- 睡觉的 Z ---- */
.pet-zzz { opacity: 0; transition: opacity .3s ease; }
.pet-svg.mood-sleep .pet-zzz { opacity: 1; }
.pet-svg.mood-sleep .pet-zzz text { animation: petZ 2.6s ease-in-out infinite; }
.pet-svg.mood-sleep .pet-zzz text:nth-child(2) { animation-delay: .45s; }
.pet-svg.mood-sleep .pet-zzz text:nth-child(3) { animation-delay: .9s; }
@keyframes petZ {
  0% { opacity: 0; transform: translate(0, 6px); }
  30% { opacity: .9; }
  100% { opacity: 0; transform: translate(8px, -14px); }
}

/* ---- 开心的爱心 ---- */
.pet-heart { opacity: 0; }
.pet-svg.mood-happy .pet-heart { animation: petHeart 1.7s ease-out infinite; }
.pet-svg.mood-happy .pet-heart.h1 { animation-delay: .38s; }
.pet-svg.mood-happy .pet-heart.h2 { animation-delay: .76s; }
@keyframes petHeart {
  0% { opacity: 0; transform: translateY(0) scale(.35); }
  22% { opacity: .95; }
  100% { opacity: 0; transform: translateY(-36px) scale(1); }
}

/* ---- 点一下跳一跳 ---- */
.pet-svg.is-hop .pet-core { animation: petHop .58s cubic-bezier(.3, 1.3, .5, 1); }
@keyframes petHop {
  0% { transform: translateY(0) scale(1, 1); }
  22% { transform: translateY(3px) scale(1.06, .93); }
  55% { transform: translateY(-15px) scale(.96, 1.06); }
  82% { transform: translateY(0) scale(1.04, .96); }
  100% { transform: translateY(0) scale(1, 1); }
}

/* ---- 互动区 ---- */
.pet-name-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 4px;
  position: relative;
  z-index: 1;
}
.pet-rename {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .82);
  font-size: 13px;
  line-height: 1;
  box-shadow: var(--sh-sm);
}
.pet-rename:active { transform: scale(.9); }

.pet-bubble {
  position: relative;
  z-index: 1;
  display: inline-block;
  max-width: 240px;
  margin: 8px auto 0;
  padding: 7px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .92);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-700);
  box-shadow: var(--sh-sm);
  opacity: 0;
  transform: translateY(4px) scale(.96);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
}
.pet-bubble.is-on { opacity: 1; transform: translateY(0) scale(1); }
.pet-bubble::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  width: 10px;
  height: 10px;
  margin-left: -5px;
  background: inherit;
  transform: rotate(45deg);
  border-radius: 2px;
}

.pet-acts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 14px;
  position: relative;
  z-index: 1;
}
.pet-act {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 9px 2px 8px;
  border-radius: var(--r-md);
  background: rgba(255, 255, 255, .82);
  box-shadow: var(--sh-sm);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-700);
  transition: transform .12s ease, background .15s ease;
}
.pet-act span { font-size: 19px; line-height: 1; }
.pet-act:active { transform: scale(.93); background: #fff; }
.pet-act.is-on { background: var(--mint-100); color: var(--mint-600); }

/* ===========================================================
   舒尔特方格（专注力）
   =========================================================== */
.sc-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 2px 12px;
}
.sc-bar-lv {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--mint-600);
  background: var(--mint-100);
  padding: 4px 11px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.sc-bar-clock {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-500);
  font-variant-numeric: tabular-nums;
}

.sc-grid {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), 1fr);
  gap: 8px;
  max-width: 360px;
  margin: 0 auto;
}
.sc-cell {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: clamp(18px, calc(130px / var(--n, 3)), 36px);
  font-weight: 800;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  transition: transform .1s ease, background .18s ease, color .18s ease, box-shadow .18s ease;
}
.sc-cell:active { transform: scale(.94); }
.sc-cell.is-done {
  background: var(--mint-100);
  color: var(--mint-300);
  box-shadow: none;
  transform: scale(.96);
}
.sc-cell.is-bad {
  background: var(--rose-100);
  color: var(--rose-500);
  animation: scBad .38s ease;
}
@keyframes scBad {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ===========================================================
   24 点
   =========================================================== */
.tf-goal {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 2px 2px 12px;
}
.tf-goal b { font-size: 17px; font-weight: 800; color: var(--ink-900); }
.tf-goal span { font-size: 11.5px; color: var(--ink-500); }

.tf-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
}
.tf-tile {
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 2px solid var(--line);
  box-shadow: var(--sh-sm);
  font-size: clamp(22px, 7vw, 30px);
  font-weight: 800;
  color: var(--ink-900);
  font-variant-numeric: tabular-nums;
  transition: transform .12s ease, border-color .15s ease, background .15s ease;
}
.tf-tile:active { transform: scale(.95); }
.tf-tile.is-sel {
  border-color: var(--mint-400);
  background: var(--mint-50);
  transform: translateY(-3px);
  box-shadow: var(--sh-md);
}
.tf-tile.is-win {
  border-color: var(--mint-400);
  background: var(--mint-100);
  color: var(--mint-700);
  animation: tfWin .5s ease;
}
@keyframes tfWin {
  0% { transform: scale(1); }
  45% { transform: scale(1.16); }
  100% { transform: scale(1); }
}

.tf-ops {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  margin-top: 12px;
}
.tf-op {
  height: 46px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: 22px;
  font-weight: 800;
  color: var(--ink-700);
  transition: transform .12s ease, background .15s ease, color .15s ease;
}
.tf-op:active { transform: scale(.94); }
.tf-op.is-on {
  background: var(--mint-400);
  color: #fff;
  box-shadow: var(--sh-md);
}

.tf-log {
  margin-top: 12px;
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-500);
  text-align: center;
  word-break: break-word;
}

.tf-acts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
}
.tf-btn {
  padding: 11px 4px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--sh-sm);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-700);
  transition: transform .12s ease, background .15s ease;
}
.tf-btn:active { transform: scale(.95); background: var(--mint-50); }

@media (max-width: 360px) {
  .tf-board, .tf-ops { gap: 7px; }
  .tf-btn { font-size: 11.5px; padding: 10px 2px; }
  .sc-grid { gap: 6px; }
}

@media (prefers-reduced-motion: reduce) {
  .sc-cell, .tf-tile, .tf-op, .tf-btn { transition: none; }
  .sc-cell.is-bad, .tf-tile.is-win { animation: none; }
}
