/* ============================================================
   通用 UI 组件 Components  v3.0
   风格：多邻国(Duolingo) 3D 糖果风 · 深浅双主题 · 细腻微交互
   ------------------------------------------------------------
   目录：
     1  重置与基础            10 弹窗 / 抽屉 / 轻提示
     2  图标系统（Lucide）      11 表单控件
     3  布局容器 / 网格          12 屏幕切换 / 反馈
     4  导航栏 / 品牌            13 学习路径（多邻国式）
     5  按钮                    14 单元卡 / 数据卡
     6  卡片 / 面板              15 特色块 / 步骤 / 问答 / CTA 条
     7  选项卡片 / 配对卡         16 课件页三屏（开始 / 游戏 / 结束）
     8  圆形播放按钮             17 动效与关键帧
     9  徽章 / 标签 / 芯片 / 进度条  18 工具类 / 响应式 / 无障碍
   ============================================================ */

/* ============================================================
   1. 重置与基础
   ============================================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  touch-action: manipulation;
  -webkit-touch-callout: none;
}

/* [hidden] 必须真的隐藏
   作者样式里的 display:flex 会盖掉浏览器默认的 [hidden]{display:none}，
   曾导致首页「本节课报告」的空状态和真实报告同时显示。这里做兜底。 */
[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 104px;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--leading-base);
  background-color: var(--bg-base);
  background-image: var(--bg-app);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}

img,
svg {
  max-width: 100%;
  display: block;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

h1, h2, h3, h4 {
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: var(--font-weight-extrabold);
}

a {
  color: var(--c-green-dark);
  text-decoration: none;
}
html[data-theme="dark"] a { color: var(--c-green-light); }

::selection {
  background: var(--c-green-light);
  color: #1d2b18;
}

/* 焦点可见性：键盘用户友好 */
:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* 滚动条 */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--color-gray-300);
  border: 3px solid transparent;
  background-clip: content-box;
  border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-400); background-clip: content-box; }

/* 背景颗粒质感（可选，挂 .grain 的容器生效） */
.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .5;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.32'/%3E%3C/svg%3E");
}
html[data-theme="dark"] .grain::after { opacity: .32; mix-blend-mode: overlay; }

/* ============================================================
   2. 图标系统（Lucide 内联 SVG）
   ------------------------------------------------------------
   用法：<i data-lucide="flame" class="ico"></i>
   icons.js 会把占位元素就地替换为 <svg class="lucide lucide-flame ico">，
   因此下面所有规则同时作用于「渲染前的 <i>」与「渲染后的 <svg>」。
   颜色一律走 currentColor，随文字色自动适配深浅色主题。
   ============================================================ */
.ico {
  width: var(--ico-size);
  height: var(--ico-size);
  flex: 0 0 auto;
  display: inline-block;
  vertical-align: -.16em;
  stroke-width: var(--ico-stroke);
  transition: transform var(--dur-base) var(--ease-spring), color var(--dur-base) var(--ease-out);
}

/* 相对尺寸（跟随字号） */
.ico--xs { --ico-size: .85em; }
.ico--sm { --ico-size: 1em; }
.ico--md { --ico-size: 1.35em; }
.ico--lg { --ico-size: 1.75em; }
.ico--xl { --ico-size: 2.35em; }
.ico--2xl { --ico-size: 3em; }

/* 绝对尺寸 */
.ico--14 { --ico-size: 14px; }
.ico--16 { --ico-size: 16px; }
.ico--18 { --ico-size: 18px; }
.ico--20 { --ico-size: 20px; }
.ico--22 { --ico-size: 22px; }
.ico--24 { --ico-size: 24px; }
.ico--26 { --ico-size: 26px; }
.ico--28 { --ico-size: 28px; }
.ico--32 { --ico-size: 32px; }
.ico--40 { --ico-size: 40px; }

/* 描边粗细 */
.ico--thin { stroke-width: 1.6; }
.ico--bold { stroke-width: 2.6; }
.ico--black { stroke-width: 3.1; }

/* 图标色板（快捷上色） */
.ico-green  { color: var(--c-green); }
.ico-blue   { color: var(--c-blue); }
.ico-teal   { color: var(--c-teal); }
.ico-yellow { color: var(--c-yellow); }
.ico-orange { color: var(--c-orange); }
.ico-red    { color: var(--c-red); }
.ico-pink   { color: var(--c-pink); }
.ico-purple { color: var(--c-purple); }
.ico-indigo { color: var(--c-indigo); }

/* 图标底板：Duolingo 式彩色圆角方块 */
.icon-tile {
  --tile-size: 52px;
  --tile-radius: 17px;
  --tile-grad: var(--grad-brand);
  --tile-deep: var(--c-green-deep);
  position: relative;
  width: var(--tile-size);
  height: var(--tile-size);
  flex: 0 0 var(--tile-size);
  display: grid;
  place-items: center;
  border-radius: var(--tile-radius);
  color: #fff;
  background-image: var(--tile-grad);
  box-shadow: 0 4px 0 var(--tile-deep),
              inset 0 1px 0 rgba(255, 255, 255, .42),
              var(--elev-1);
  overflow: hidden;
  transition: transform var(--dur-slow) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
}
.icon-tile::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 58%);
  pointer-events: none;
}
.icon-tile > * { position: relative; z-index: 1; }
.icon-tile--sm { --tile-size: 42px; --tile-radius: 14px; }
.icon-tile--lg { --tile-size: 64px; --tile-radius: 21px; }
.icon-tile--xl { --tile-size: 88px; --tile-radius: 28px; }
.icon-tile--cyan   { --tile-grad: var(--grad-ocean);  --tile-deep: var(--c-blue-deep); }
.icon-tile--mint   { --tile-grad: var(--grad-mint);   --tile-deep: var(--c-teal-deep); }
.icon-tile--orange { --tile-grad: var(--grad-flame);  --tile-deep: var(--c-orange-deep); }
.icon-tile--sun    { --tile-grad: var(--grad-sunset); --tile-deep: var(--c-yellow-deep); }
.icon-tile--berry  { --tile-grad: var(--grad-berry);  --tile-deep: var(--c-purple-deep); }
.icon-tile--night  { --tile-grad: var(--grad-night);  --tile-deep: var(--c-indigo-deep); }
.icon-tile--sky    { --tile-grad: var(--grad-sky);    --tile-deep: var(--c-indigo-deep); }
.icon-tile--candy  { --tile-grad: var(--grad-candy);  --tile-deep: var(--c-pink-deep); }

/* 品牌 Logo 图形（内联 SVG，非图标库） */
.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  color: #fff;
  background-image: var(--grad-brand);
  box-shadow: 0 4px 0 var(--c-green-deep), var(--glow-green);
  overflow: hidden;
}
.brand-mark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 60%);
}
.brand-mark svg { position: relative; z-index: 1; width: 58%; height: 58%; }

/* ============================================================
   3. 布局容器 / 网格
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.container--narrow { max-width: var(--container-narrow); }
.container--wide { max-width: var(--container-wide); }

.stack { display: flex; flex-direction: column; gap: var(--space-md); }
.stack--sm { gap: var(--space-sm); }
.stack--lg { gap: var(--space-xl); }
.row { display: flex; align-items: center; gap: var(--space-sm); }
.row--between { justify-content: space-between; }
.row--center { justify-content: center; }
.row--wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.grid { display: grid; gap: var(--space-lg); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

/* 区块标题（首页 / 课件通用） */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.section-head h2 {
  font-family: var(--font-family-display);
  font-size: var(--font-size-xl);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -.4px;
}
.section-head__hint,
.section__hint {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-tertiary);
}
.section-head__hint b,
.section__hint b { color: var(--c-green-deep); }
html[data-theme="dark"] .section-head__hint b,
html[data-theme="dark"] .section__hint b { color: var(--c-green-light); }

/* 眉标 */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 2px solid var(--border);
  font-size: 13px;
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
  box-shadow: var(--elev-1);
}
.eyebrow b { color: var(--c-green-dark); }
html[data-theme="dark"] .eyebrow b { color: var(--c-green-light); }

/* ============================================================
   4. 导航栏 / 品牌
   ============================================================ */
.navbar {
  position: sticky;
  top: 0;
  z-index: var(--z-nav);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 12px var(--space-lg);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 2px solid var(--border);
  transition: box-shadow var(--dur-base) var(--ease-out),
              padding var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.navbar.is-scrolled {
  box-shadow: var(--elev-2);
  padding-top: 7px;
  padding-bottom: 7px;
}
.navbar__actions { display: flex; align-items: center; gap: var(--space-sm); margin-left: auto; }

/* 品牌标识 */
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--text);
  flex: 0 0 auto;
}
.brand__logo {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-size: 25px;
  line-height: 1;
  transition: transform var(--dur-slow) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
}
.brand:hover .brand__logo { transform: rotate(-10deg) scale(1.08); }
.brand:active .brand__logo { transform: rotate(0) scale(.96); }
.brand__text { display: flex; flex-direction: column; line-height: 1.16; }
.brand__name {
  font-family: var(--font-family-display);
  font-size: 20px;
  font-weight: var(--font-weight-black);
  letter-spacing: -.3px;
  white-space: nowrap;
}
.brand__tag {
  /* 10px → 16px：这是正文口径的标语，不是徽章，上限按 --font-size-sm（M-21） */
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: var(--tracking-wide);
  color: var(--text-tertiary);
  text-transform: uppercase;
  white-space: nowrap;
}

/* 导航链接 */
.nav-links { display: flex; align-items: center; gap: 2px; }
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 15px;
  min-height: 48px;                       /* 触屏目标：撑热区，不动图形（M-15） */
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.nav-link .ico { --ico-size: 17px; opacity: .85; }
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link:hover .ico { transform: translateY(-2px) scale(1.08); opacity: 1; }
/* 选中态用 -deep：--c-green-dark 压 --c-green-soft 只有 2.93:1 */
.nav-link.is-active { color: var(--c-green-deep); background: var(--c-green-soft); }
.nav-link.is-active .ico { opacity: 1; }
html[data-theme="dark"] .nav-link.is-active { color: var(--c-green-light); background: var(--c-green-dense); }
.nav-link::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 0;
  height: 3px;
  border-radius: 2px;
  background: var(--c-green);
  transform: translateX(-50%);
  transition: width var(--dur-base) var(--ease-spring);
}
.nav-link.is-active::after { width: 16px; }

/* 汉堡按钮（小屏） */
.nav-burger {
  display: none;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  place-items: center;
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}
.nav-burger:hover { background: var(--surface-2); }
.nav-burger:active { transform: translateY(2px); border-bottom-width: 2px; }

/* 连续天数 / 用户胶囊 */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
  white-space: nowrap;
  transition: transform var(--dur-base) var(--ease-spring), border-color var(--dur-fast), box-shadow var(--dur-base);
}
.pill:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.pill b { font-size: 17px; }   /* 比 .pill 正文大一档，不能反过来比它小 */
.pill--flame { background: var(--c-orange-soft); border-color: transparent; color: var(--c-orange-deep); }
.pill--flame .ico { color: var(--c-orange); }
.pill--flame b { color: var(--c-orange); }
html[data-theme="dark"] .pill--flame { background: var(--c-orange-dense); color: var(--c-orange-light); }
.pill--xp { background: var(--c-yellow-soft); border-color: transparent; color: var(--c-yellow-deep); }
.pill--xp .ico { color: var(--c-yellow-dark); }
.pill--xp b { color: var(--c-yellow-deep); }
html[data-theme="dark"] .pill--xp { background: var(--c-yellow-dense); color: var(--c-yellow-light); }
html[data-theme="dark"] .pill--xp .ico { color: var(--c-yellow-light); }
html[data-theme="dark"] .pill--xp b { color: var(--c-yellow-light); }
/* 兼容：老模板胶囊里的 emoji / 文字图标容器 */
.pill__icon { font-size: 16px; line-height: 1; }

/* 主题切换开关 */
.theme-toggle {
  position: relative;
  width: 68px;
  height: 48px;                           /* 触屏目标 48（M-15） */
  flex: 0 0 68px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface-2);
  cursor: pointer;
  padding: 0;
  overflow: hidden;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.theme-toggle:hover { border-color: var(--c-green-light); }
.theme-toggle__thumb {
  position: absolute;
  top: 7px;                               /* 48 高里竖直居中：padding box 44，(44-30)/2 */
  left: 2px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #6a4c00;
  background: var(--grad-sunset);
  box-shadow: 0 2px 6px var(--shadow-color), inset 0 1px 0 rgba(255, 255, 255, .5);
  transition: transform var(--dur-slow) var(--ease-spring), background var(--dur-base) var(--ease-out), color var(--dur-base) var(--ease-out);
}
html[data-theme="dark"] .theme-toggle__thumb {
  color: #e8edff;
  transform: translateX(30px);
  background: var(--grad-night);
  box-shadow: 0 2px 8px rgba(91, 110, 245, .55), inset 0 1px 0 rgba(255, 255, 255, .32);
}
.theme-toggle__icon {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.theme-toggle__icon .ico { --ico-size: 17px; --ico-stroke: 2.6; }
.theme-toggle__icon--sun { opacity: 1; transform: scale(1) rotate(0); }
.theme-toggle__icon--moon { opacity: 0; transform: scale(.4) rotate(-45deg); }
html[data-theme="dark"] .theme-toggle__icon--sun { opacity: 0; transform: scale(.4) rotate(45deg); }
html[data-theme="dark"] .theme-toggle__icon--moon { opacity: 1; transform: scale(1) rotate(0); }

/* 音效开关：与主题开关同尺寸的图标按钮，静音时划一道斜杠 */
.sound-toggle {
  position: relative;
  width: 48px;
  height: 48px;                           /* 触屏目标 48（M-15） */
  flex: 0 0 48px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              transform var(--dur-base) var(--ease-spring);
}
.sound-toggle:hover { border-color: var(--c-green-light); transform: translateY(-2px); }
.sound-toggle:active { transform: translateY(0) scale(.94); }
.sound-toggle .ico { --ico-size: 18px; --ico-stroke: 2.4; }
.sound-toggle__slash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--c-red-dark);
  transform: translate(-50%, -50%) rotate(-45deg) scaleX(0);
  transition: transform var(--dur-base) var(--ease-spring);
}
.sound-toggle.is-off .sound-toggle__slash { transform: translate(-50%, -50%) rotate(-45deg) scaleX(1); }
.sound-toggle.is-off { color: var(--text-tertiary); }
html[data-theme="dark"] .sound-toggle__slash { background: var(--c-red-light); }

/* ============================================================
   5. 按钮（3D：底部厚边框 + 按压下沉）
   ============================================================ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 32px;
  font-family: var(--font-family);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-extrabold);
  line-height: 1.15;
  color: var(--text-on-color);
  /* 品牌色按钮面走 -dark 档：base 档白字只有 2.09:1，-dark 档 3.2:1 过大字线；
     3D 底边换 -deep 档，保证底边仍是「比面更深」的那一档（M-14） */
  background-color: var(--c-green-dark);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .18), rgba(255, 255, 255, 0) 55%);
  border: none;
  border-bottom: var(--btn-border-bottom) solid var(--c-green-deep);
  border-radius: var(--radius-xl);
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  user-select: none;
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              border-bottom-width var(--dur-fast) var(--ease-out),
              filter var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              margin var(--dur-fast) var(--ease-out);
}
.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: var(--grad-sheen);
  transform: translateX(-130%);
  transition: transform var(--dur-slower) var(--ease-out);
}
.btn .ico { --ico-stroke: 2.6; }
.btn:hover { filter: brightness(1.06); transform: translateY(-2px); box-shadow: var(--elev-2); }
.btn:hover::before { transform: translateX(130%); }
.btn:hover .ico { transform: scale(1.12); }
.btn:active {
  filter: brightness(.96);
  transform: translateY(var(--btn-border-bottom));
  border-bottom-width: 0;
  margin-top: var(--btn-border-bottom);
  box-shadow: none;
}
.btn:disabled,
.btn.is-disabled {
  filter: grayscale(.75);
  opacity: .55;
  pointer-events: none;
}

/* 尺寸 */
.btn--sm { padding: 9px 18px; min-height: 48px; font-size: var(--font-size-sm); border-radius: var(--radius-lg); --btn-border-bottom: 4px; }
.btn--lg { padding: 18px 42px; font-size: var(--font-size-xl); border-radius: var(--radius-2xl); --btn-border-bottom: 6px; }
.btn--block { width: 100%; }
.btn--icon {
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 16px;
  font-size: 20px;
}
.btn--ghost-icon {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--border);
  border-bottom-width: var(--btn-border-bottom);
  border-bottom-color: var(--border-strong);
}

/* 配色变体：面 = -dark（白字 ≥3.0:1），底边 = -deep（比面深一档） */
.btn-primary { background-color: var(--c-green-dark); border-bottom-color: var(--c-green-deep); }
.btn-blue    { background-color: var(--c-blue-dark); border-bottom-color: var(--c-blue-deep); }
.btn-teal    { background-color: var(--c-teal-dark); border-bottom-color: var(--c-teal-deep); }
.btn-yellow  { background-color: var(--c-yellow); border-bottom-color: var(--c-yellow-dark); color: #4a3a00; }
.btn-orange  { background-color: var(--c-orange-dark); border-bottom-color: var(--c-orange-deep); }
.btn-red     { background-color: var(--c-red-dark); border-bottom-color: var(--c-red-deep); }
.btn-pink    { background-color: var(--c-pink-dark); border-bottom-color: var(--c-pink-deep); }
.btn-purple  { background-color: var(--c-purple-dark); border-bottom-color: var(--c-purple-deep); }
.btn-indigo  { background-color: var(--c-indigo-dark); border-bottom-color: var(--c-indigo-deep); }

/* 幽灵 / 线框 */
.btn-ghost {
  background-color: var(--surface);
  background-image: none;
  color: var(--text);
  border: 2px solid var(--border);
  border-bottom-width: var(--btn-border-bottom);
  border-bottom-color: var(--border-strong);
}
.btn-ghost:hover { background-color: var(--surface-2); }

.btn-outline {
  background-color: transparent;
  background-image: none;
  color: var(--c-green-dark);
  border: 2px solid var(--c-green);
  border-bottom-width: var(--btn-border-bottom);
  border-bottom-color: var(--c-green);
}
html[data-theme="dark"] .btn-outline { color: var(--c-green-light); }

/* 水波纹（由 fx.js 注入） */
.ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .45);
  transform: scale(0);
  pointer-events: none;
  animation: rippleGo 620ms var(--ease-out) forwards;
}
.btn-ghost .ripple,
.chip .ripple,
.card .ripple { background: rgba(88, 204, 2, .22); }

/* ============================================================
   6. 卡片 / 面板
   ============================================================ */
.card {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--elev-1);
  transition: transform var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.card--pad-lg { padding: var(--space-2xl); }
.card--glass {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}
.card--flat { box-shadow: none; border-bottom-width: 2px; }
.card--hover { cursor: pointer; }
.card--hover:hover {
  transform: translateY(-5px);
  box-shadow: var(--elev-3);
  border-color: var(--c-green-light);
}
.card--accent::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 6px;
  border-radius: var(--radius-2xl) 0 0 var(--radius-2xl);
  background: var(--grad-brand);
}

/* 面板（首页分区容器） */
.panel {
  position: relative;
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--elev-1);
}
.panel--glass {
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(18px) saturate(170%);
  backdrop-filter: blur(18px) saturate(170%);
}
.panel__head {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-lg);
}
.panel__head h2 {
  font-size: var(--font-size-xl);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.panel__hint {
  font-size: var(--font-size-sm);
  color: var(--text-tertiary);
  font-weight: var(--font-weight-medium);
}

/* ============================================================
   7. 选项卡片 / 配对卡
   ============================================================ */
.option-card {
  position: relative;
  background: var(--surface);
  border: 3px solid var(--border);
  border-bottom: 6px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  padding: var(--space-md);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              border-bottom-width var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out);
}
.option-card:hover {
  transform: translateY(-3px);
  border-color: var(--c-green-light);
  border-bottom-color: var(--c-green-dark);
  box-shadow: var(--glow-green);
}
.option-card:active {
  transform: translateY(3px);
  border-bottom-width: 2px;
}
.option-card.correct {
  border-color: var(--c-green);
  border-bottom-color: var(--c-green-dark);
  background: var(--correct-soft);
  animation: pop 420ms var(--ease-spring);
}
.option-card.wrong {
  border-color: var(--c-red);
  border-bottom-color: var(--c-red-dark);
  background: var(--wrong-soft);
  animation: shake 420ms var(--ease-out);
}
.option-card.disabled { pointer-events: none; opacity: .5; }

/* 配对游戏用卡 */
.match-item {
  background: var(--surface);
  border: 3px solid var(--border);
  border-bottom: 5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  cursor: pointer;
  text-align: center;
  font-weight: var(--font-weight-extrabold);
  font-size: var(--font-size-lg);
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.match-item:hover { transform: translateY(-2px); border-color: var(--c-purple); border-bottom-color: var(--c-purple-dark); }
.match-item.selected {
  border-color: var(--c-purple);
  border-bottom-color: var(--c-purple-dark);
  background: var(--c-purple-soft);
  animation: pulseSoft 1.4s var(--ease-in-out) infinite;
}
html[data-theme="dark"] .match-item.selected { background: var(--c-purple-dense); }
.match-item.matched {
  border-color: var(--c-green);
  background: var(--correct-soft);
  opacity: .55;
  pointer-events: none;
  animation: pop 380ms var(--ease-spring);
}

/* ============================================================
   8. 圆形播放按钮
   ============================================================ */
.play-btn {
  position: relative;
  width: 132px;
  height: 132px;
  margin: 0 auto;
  border-radius: 50%;
  background: var(--surface);
  border: 4px solid var(--c-green);
  border-bottom: 8px solid var(--c-green-dark);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: transform var(--dur-fast) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.play-btn::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--c-green);
  opacity: 0;
  animation: ripplePulse 2.4s var(--ease-out) infinite;
}
.play-btn:hover {
  background: var(--c-green);
  border-color: var(--c-green-dark);
  transform: translateY(-3px);
  box-shadow: var(--glow-green);
  color: #fff;
}
.play-btn:hover .play-text { color: #fff; }
.play-btn:active { transform: translateY(4px); border-bottom-width: 2px; }
.play-btn.is-playing { animation: pulseSoft 1s var(--ease-in-out) infinite; }

/* 播放按钮里的图标：可能是 emoji（.speaker-icon）也可能是 Lucide svg */
.speaker-icon { font-size: 44px; line-height: 1; }
.play-btn svg { width: 46px; height: 46px; stroke-width: 2; }
.play-btn:hover svg { transform: scale(1.06); }
.play-text {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--c-green-deep);   /* -dark 压在白底上只有 3.23:1，正文档不够 */
  transition: color var(--dur-base) var(--ease-out);
}
html[data-theme="dark"] .play-text { color: var(--c-green-light); }

/* 双人分屏里的小号播放按钮 */
.play-btn--sm { width: 92px; height: 92px; margin: 0 auto 2px; border-width: 3px; border-bottom-width: 6px; }
.play-btn--sm svg { width: 30px; height: 30px; }
.play-btn--sm .speaker-icon { font-size: 30px; }
.play-btn--sm .play-text { font-size: 11px; }

/* 双人分屏里的小号题干图片（看图选词） */
.question-area--mini { gap: var(--space-2xs); }
.question-img--mini { width: 120px; height: 120px; padding: 2px; }

/* 双人拼写：迷你中文提示 */
.question-chinese--mini { font-size: var(--font-size-base); margin: 0; }
.duel__board .answer-slots { gap: var(--space-2xs); }
.duel__board .letter-slot { width: 34px; height: 46px; }
.duel__board .letter-pool { gap: var(--space-2xs); }
.duel__board .letter-tile { width: 38px; height: 42px; }

/* ============================================================
   9. 徽章 / 标签 / 芯片 / 进度条 / 进度环 / 连续条
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 13px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-extrabold);
  background: var(--surface-3);
  color: var(--text-secondary);
  white-space: nowrap;
}
.badge .ico { --ico-size: 14px; --ico-stroke: 2.6; }
/* 实底白字徽章：原 --c-green / --c-red 底白字 2.09 / 3.30:1，改 -deep 底（5.03 / 5.72:1）。
   深色主题底色不随主题变，白字对比度相同；成对写出便于以后单独调 */
.badge-correct { background: var(--c-green-deep); color: var(--text-on-color); }
.badge-wrong   { background: var(--c-red-deep);   color: var(--text-on-color); }
html[data-theme="dark"] .badge-correct { background: var(--c-green-deep); color: var(--text-on-color); }
html[data-theme="dark"] .badge-wrong   { background: var(--c-red-deep);   color: var(--text-on-color); }
.badge-green   { background: var(--c-green-soft);   color: var(--c-green-deep); }
.badge-yellow  { background: var(--c-yellow-soft);  color: var(--c-yellow-deep); }
.badge-blue    { background: var(--c-blue-soft);    color: var(--c-blue-deep); }
.badge-purple  { background: var(--c-purple-soft);  color: var(--c-purple-deep); }
.badge-orange  { background: var(--c-orange-soft);  color: var(--c-orange-deep); }
.badge-teal    { background: var(--c-teal-soft);    color: var(--c-teal-deep); }
.badge-pink    { background: var(--c-pink-soft);    color: var(--c-pink-deep); }
.badge-indigo  { background: var(--c-indigo-soft);  color: var(--c-indigo-deep); }
html[data-theme="dark"] .badge-green  { background: var(--c-green-dense);  color: var(--c-green-light); }
html[data-theme="dark"] .badge-yellow { background: var(--c-yellow-dense); color: var(--c-yellow-light); }
html[data-theme="dark"] .badge-blue   { background: var(--c-blue-dense);   color: var(--c-blue-light); }
html[data-theme="dark"] .badge-purple { background: var(--c-purple-dense); color: var(--c-purple-light); }
html[data-theme="dark"] .badge-orange { background: var(--c-orange-dense); color: var(--c-orange-light); }
html[data-theme="dark"] .badge-teal   { background: var(--c-teal-dense);   color: var(--c-teal-light); }
html[data-theme="dark"] .badge-pink   { background: var(--c-pink-dense);   color: var(--c-pink-light); }
html[data-theme="dark"] .badge-indigo { background: var(--c-indigo-dense); color: var(--c-indigo-light); }

/* 前置小圆点（用当前色描一圈柔光）
   color-mix 在 Chromium<111 不支持，整条声明会失效 → 先给 rgba 兜底再覆盖 */
.badge--dot::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px rgba(120, 120, 120, .22);
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  white-space: nowrap;
}
.tag .ico { --ico-size: 14px; --ico-stroke: 2.8; }
.tag-ready { background: var(--c-green-soft); color: var(--c-green-deep); }
.tag-soon  { background: var(--c-orange-soft); color: var(--c-orange-deep); }
html[data-theme="dark"] .tag-ready { background: var(--c-green-dense); color: var(--c-green-light); }
html[data-theme="dark"] .tag-soon  { background: var(--c-orange-dense); color: var(--c-orange-light); }

/* 选择芯片 */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-full);
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-strong);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out);
}
.chip:hover { transform: translateY(-2px); color: var(--text); border-color: var(--c-green-light); }
.chip:active { transform: translateY(2px); border-bottom-width: 2px; }
.chip.is-active {
  background: var(--grad-brand);
  background-color: var(--c-green);
  border-color: transparent;
  border-bottom-color: var(--c-green-deep);
  color: #fff;
  box-shadow: var(--glow-green);
}
.chip__num {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--surface-3);
  font-size: 12px;
  color: var(--text-tertiary);
}
.chip.is-active .chip__num { background: rgba(255, 255, 255, .26); color: #fff; }

/* ---- 进度条 ---- */
.progress-bar {
  width: 100%;
  height: 16px;
  background: var(--surface-sunken);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-bar-fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background-color: var(--c-green);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .3), rgba(255, 255, 255, 0) 60%);
  overflow: hidden;
  transition: width var(--dur-slower) var(--ease-out);
}
.progress-bar-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  transform: translateX(-100%);
  animation: shimmer 1.8s var(--ease-in-out) infinite;
}
.progress-bar--thin { height: 10px; }
.progress-bar--thick { height: 22px; }
.progress-bar--blue .progress-bar-fill { background-color: var(--c-blue); }
.progress-bar--purple .progress-bar-fill { background-color: var(--c-purple); }
.progress-bar--orange .progress-bar-fill { background-color: var(--c-orange); }
.progress-bar--grad .progress-bar-fill { background-image: var(--grad-brand); background-color: var(--c-green); }

/* 环形进度 */
.ring {
  --ring-size: 120px;
  --ring-value: 0;
  --ring-color: var(--c-green);
  position: relative;
  width: var(--ring-size);
  height: var(--ring-size);
  flex: 0 0 var(--ring-size);
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: conic-gradient(var(--ring-color) calc(var(--ring-value) * 1%), var(--surface-sunken) 0);
  transition: background var(--dur-slower) var(--ease-out);
}
.ring::after {
  content: '';
  position: absolute;
  inset: 11px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  box-shadow: inset 0 2px 6px -3px var(--shadow-color);
}
.ring__label {
  position: relative;
  z-index: 1;
  text-align: center;
  line-height: 1.1;
}
.ring__value { font-size: var(--font-size-2xl); font-weight: var(--font-weight-black); color: var(--c-green-dark); }
html[data-theme="dark"] .ring__value { color: var(--c-green-light); }
.ring__unit { display: block; font-size: 12px; font-weight: var(--font-weight-bold); color: var(--text-tertiary); }
.ring--blue { --ring-color: var(--c-blue); }
.ring--blue .ring__value { color: var(--c-blue-dark); }
html[data-theme="dark"] .ring--blue .ring__value { color: var(--c-blue-light); }
.ring--orange { --ring-color: var(--c-orange); }
.ring--orange .ring__value { color: var(--c-orange-dark); }
html[data-theme="dark"] .ring--orange .ring__value { color: var(--c-orange-light); }
.ring--purple { --ring-color: var(--c-purple); }

/* 一周连续条 */
.streak { display: flex; gap: 8px; flex-wrap: wrap; }
.streak__day {
  flex: 1 1 46px;
  min-width: 42px;
  text-align: center;
  padding: 9px 4px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 2px solid var(--border);
  font-size: 11px;
  font-weight: var(--font-weight-extrabold);
  color: var(--text-tertiary);
  transition: transform var(--dur-base) var(--ease-spring), background-color var(--dur-base), color var(--dur-base), border-color var(--dur-base);
}
.streak__day span { display: grid; place-items: center; margin-top: 3px; min-height: 20px; }
.streak__day .ico { --ico-size: 17px; --ico-stroke: 3; }
.streak__day:hover { transform: translateY(-3px); }
.streak__day.is-done {
  background: var(--grad-sunset);
  border-color: transparent;
  color: var(--c-amber-ink);
  box-shadow: var(--glow-orange);
}
.streak__day.is-today {
  background: var(--c-green-soft);
  border-color: var(--c-green);
  color: var(--c-green-dark);
  animation: pulseSoft 2s var(--ease-in-out) infinite;
}
html[data-theme="dark"] .streak__day.is-today { background: var(--c-green-dense); color: var(--c-green-light); }

/* ============================================================
   10. 弹窗 / 抽屉 / 轻提示
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  background: var(--overlay);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  animation: fadeIn var(--dur-base) var(--ease-out);
}
.modal {
  width: 100%;
  max-width: 560px;
  max-height: 90%;
  overflow-y: auto;
  background: var(--surface);
  border: 3px solid var(--border);
  border-bottom: 6px solid var(--border-strong);
  border-radius: var(--radius-2xl);
  padding: var(--space-xl);
  box-shadow: var(--elev-4);
  animation: modalIn var(--dur-slow) var(--ease-spring);
}
.modal--wide { max-width: 760px; }

/* 轻提示 */
.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
  pointer-events: none;
  padding: 0 var(--space-md);
  width: max-content;
  max-width: 92vw;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 22px;
  border-radius: var(--radius-full);
  background: var(--surface-inverse);
  color: var(--text-inverse);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  box-shadow: var(--elev-3);
  pointer-events: auto;
  animation: toastIn var(--dur-slow) var(--ease-spring);
}
.toast.is-leaving { animation: toastOut var(--dur-base) var(--ease-in-out) forwards; }
/* 轻提示是正文小字：原白字压品牌亮色仅 2.2–3.3:1，统一换 -deep 档（5.0–5.7:1），深浅主题通用 */
.toast--success { background: var(--c-green-deep); color: var(--text-on-color); }
.toast--warn    { background: var(--c-orange-deep); color: var(--text-on-color); }
.toast--error   { background: var(--c-red-deep); color: var(--text-on-color); }
.toast--info    { background: var(--c-blue-deep); color: var(--text-on-color); }
.toast__icon { display: grid; place-items: center; }
.toast__icon .ico { --ico-size: 19px; --ico-stroke: 2.6; }
.toast__icon:empty { display: none; }

/* ============================================================
   11. 表单控件
   ============================================================ */
.input {
  width: 100%;
  padding: 13px 18px;
  border-radius: var(--radius-lg);
  border: 2px solid var(--border);
  border-bottom-width: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  transition: border-color var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out);
}
.input::placeholder { color: var(--text-tertiary); }
.input:focus {
  outline: none;
  border-color: var(--c-green);
  background: var(--surface);
  box-shadow: 0 0 0 4px var(--ring);
}

.switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
  font-weight: var(--font-weight-bold);
  font-size: var(--font-size-sm);
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track {
  width: 52px;
  height: 30px;
  border-radius: var(--radius-full);
  background: var(--color-gray-200);
  border: 2px solid var(--border);
  transition: background-color var(--dur-base) var(--ease-out);
  flex: 0 0 52px;
  position: relative;
}
.switch__track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 2px 4px var(--shadow-color);
  transition: transform var(--dur-slow) var(--ease-spring);
}
.switch input:checked + .switch__track { background: var(--c-green); border-color: var(--c-green-dark); }
.switch input:checked + .switch__track::after { transform: translateX(22px); }

/* 骨架屏 */
.skeleton {
  border-radius: var(--radius-md);
  background: linear-gradient(90deg, var(--skeleton-a) 25%, var(--skeleton-b) 37%, var(--skeleton-a) 63%);
  background-size: 400% 100%;
  animation: skeletonMove 1.4s var(--ease-in-out) infinite;
}

/* ============================================================
   12. 屏幕切换 / 反馈
   ============================================================ */
.screen { display: none; width: 100%; }
.screen.active { display: block; animation: screenIn var(--dur-slow) var(--ease-out); }

.feedback {
  text-align: center;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-extrabold);
  min-height: 40px;
  margin-top: var(--space-lg);
}
.feedback.correct { color: var(--c-green-dark); animation: pop 400ms var(--ease-spring); }
.feedback.wrong   { color: var(--c-red-dark);   animation: shake 440ms var(--ease-out); }
html[data-theme="dark"] .feedback.correct { color: var(--c-green-light); }
html[data-theme="dark"] .feedback.wrong { color: var(--c-red-light); }

/* 水印 */
.watermark {
  position: fixed;
  right: 16px;
  bottom: 4px;
  z-index: 2147482200;
  font-size: 14px;
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
  background: var(--surface);
  border-radius: 4px;
  padding: 1px 6px;
  opacity: .8;
  max-width: calc(100vw - 24px);
  pointer-events: none;
  user-select: none;
}

/* ============================================================
   13. 学习路径（多邻国式）
   ------------------------------------------------------------
   用「左文本 | 节点 | 右文本」三列网格实现：
     · 中间列宽 = 节点直径，所以节点圆心永远压在 50% 处的主线上
     · 奇数项文字排左列（右对齐），偶数项排右列 —— 天然蛇形交错
   注意：用 :nth-of-type 而不是 :nth-child —— 只对 <li> 计数，
        将来若在 <ol> 里插入别的元素也不会打乱左右交错。
   ============================================================ */
.path {
  position: relative;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 0;
}
/* 承载主线的画布：与 .path 同尺寸，让进度线可以独立于 <ol> 定位。
   --path-node 必须声明在这里 —— .path__fill 是它的子元素，
   若只在 .path 上声明，进度线取不到该变量会导致 left 退化成 auto。 */
.path-canvas { --path-node: 84px; position: relative; }
/* 中央虚线主线（未解锁部分） */
.path::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 16px;
  bottom: 16px;
  border-left: 4px dashed var(--color-gray-300);
  transform: translateX(-2px);
}
/* 已解锁的进度主线（高度由 data-value 控制，由 fx.js 过渡） */
.path__fill {
  position: absolute;
  left: 50%;
  top: 16px;
  width: 4px;
  transform: translateX(-2px);
  border-radius: var(--radius-full);
  background: var(--grad-forest);
  height: 0;
  transition: height var(--dur-glacial) var(--ease-out);
  box-shadow: var(--glow-green);
}

.path__item {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr var(--path-node) 1fr;
  column-gap: 20px;
  align-items: center;
  min-height: calc(var(--path-node) + 14px);
}

/* 节点（圆形按钮）—— 永远落在中间列 */
.path-node {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  width: var(--path-node);
  height: var(--path-node);
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: #fff;
  background-color: var(--c-green);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .26), rgba(255, 255, 255, 0) 58%);
  box-shadow: 0 6px 0 var(--c-green-dark), var(--glow-green);
  transition: transform var(--dur-slow) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out), filter var(--dur-base);
}
.path-node .ico { --ico-size: calc(var(--path-node) * .45); --ico-stroke: 2.4; }
.path-node:hover { transform: translateY(-4px) scale(1.04); }
.path-node:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--c-green-dark); }

/* 状态：已完成 / 进行中 / 未解锁 */
.path-node.is-done {
  color: var(--c-amber-ink);          /* 金底上必须用深琥珀，白字只有 1.5:1 */
  background-color: var(--c-yellow);
  box-shadow: 0 6px 0 var(--c-yellow-dark), var(--glow-orange);
}
.path-node.is-current {
  background-color: var(--c-green);
  animation: nodePulse 2.4s var(--ease-in-out) infinite;
}
.path-node.is-current::after {
  content: '';
  position: absolute;
  inset: -9px;
  border-radius: 50%;
  border: 3px solid var(--c-green);
  animation: ripplePulse 2.2s var(--ease-out) infinite;
  pointer-events: none;
}
.path-node.is-locked {
  background-color: var(--surface-3);
  color: var(--text-tertiary);
  box-shadow: 0 6px 0 var(--border-strong);
  filter: saturate(.45);
}
.path-node.is-locked:hover { transform: translateY(-2px); }

/* 节点旁的说明 */
.path-node__body {
  grid-row: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
/* 奇数项：文字靠左列、右对齐（节点在右侧） */
.path__item:nth-of-type(odd) .path-node__body {
  grid-column: 1;
  align-items: flex-end;
  text-align: right;
}
/* 偶数项：文字靠右列、左对齐（节点在左侧） */
.path__item:nth-of-type(even) .path-node__body {
  grid-column: 3;
  align-items: flex-start;
}

.path-node__title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  letter-spacing: -.2px;
}
.path-node__meta { font-size: 12.5px; font-weight: var(--font-weight-bold); color: var(--text-tertiary); }
.path-node__badge {
  align-self: flex-start;
  margin-top: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: var(--font-weight-extrabold);
  letter-spacing: .02em;
  background: var(--surface-3);
  color: var(--text-tertiary);
}
.path__item:nth-of-type(odd) .path-node__badge { align-self: flex-end; }
.path-node__badge.is-done { background: var(--c-yellow-soft); color: var(--c-yellow-deep); }
.path-node__badge.is-current { background: var(--c-green); color: #fff; }
html[data-theme="dark"] .path-node__badge.is-done { background: var(--c-yellow-dense); color: var(--c-yellow-light); }
html[data-theme="dark"] .path-node__badge.is-current { background: var(--c-green); color: #fff; }

/* ============================================================
   14. 单元卡 / 数据卡
   ============================================================ */
.unit-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--space-md);
  width: 100%;
  text-align: left;
  padding: var(--space-md) var(--space-md) var(--space-md) var(--space-md);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 5px solid var(--border-strong);
  box-shadow: var(--elev-1);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.unit-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px 120px at 0% 0%, var(--uc-soft, transparent), transparent 70%);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-out);
  pointer-events: none;
}
.unit-card:hover { transform: translateY(-4px); border-color: var(--uc, var(--c-green)); box-shadow: var(--elev-3); }
.unit-card:hover::after { opacity: 1; }
.unit-card:hover .icon-tile { transform: rotate(-7deg) scale(1.06); }
.unit-card.is-active {
  border-color: var(--uc, var(--c-green));
  background: var(--surface);
  /* color-mix 不支持时不能让整条声明失效，否则连 elev-2 一起丢 */
  box-shadow: 0 0 0 3px rgba(88, 204, 2, .26), var(--elev-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--uc, var(--c-green)) 26%, transparent), var(--elev-2);
}
.unit-card.is-active::before {
  content: '';
  position: absolute;
  top: 10px;
  right: 10px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--uc, var(--c-green)) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center/14px no-repeat;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .16);
  animation: pop 380ms var(--ease-spring);
}
.unit-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.unit-card__idx {
  font-size: 11px;
  font-weight: var(--font-weight-black);
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--uc, var(--c-green));
}
.unit-card__name {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  letter-spacing: -.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unit-card__en {
  font-size: 12.5px;
  font-weight: var(--font-weight-bold);
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.unit-card__count {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 5px;
  font-size: 12px;
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
}
.unit-card__count .ico { --ico-size: 14px; --ico-stroke: 2.6; color: var(--uc, var(--c-green)); }

/* 强调色（走 token，深浅色自动适配） */
.uc-green  { --uc: var(--c-green);  --uc-soft: rgba(88, 204, 2, .16); }
.uc-blue   { --uc: var(--c-blue);   --uc-soft: rgba(28, 176, 246, .16); }
.uc-teal   { --uc: var(--c-teal);   --uc-soft: rgba(0, 194, 168, .16); }
.uc-orange { --uc: var(--c-orange); --uc-soft: rgba(255, 150, 0, .16); }
.uc-purple { --uc: var(--c-purple); --uc-soft: rgba(206, 130, 255, .16); }
.uc-indigo { --uc: var(--c-indigo); --uc-soft: rgba(91, 110, 245, .16); }
.uc-pink   { --uc: var(--c-pink);   --uc-soft: rgba(255, 107, 157, .16); }
.uc-yellow { --uc: var(--c-yellow); --uc-soft: rgba(255, 200, 0, .18); }

/* 数据卡 */
.stat-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  background: var(--surface);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-strong);
  box-shadow: var(--elev-1);
  overflow: hidden;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.stat-card:hover { transform: translateY(-4px); box-shadow: var(--elev-3); }
.stat-card__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stat-card__label { font-size: 13px; font-weight: var(--font-weight-extrabold); color: var(--text-tertiary); }
.stat-card__value {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  line-height: 1;
  letter-spacing: -1px;
  /* 数字滚动时逐帧改字宽会让整块左右抖，等宽数字钉住宽度 */
  font-variant-numeric: tabular-nums;
  color: var(--sc, var(--c-green-dark));
}
.stat-card__value i { font-size: var(--font-size-base); font-style: normal; }
html[data-theme="dark"] .stat-card__value { color: var(--sc-dark, var(--c-green-light)); }
.stat-card__delta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: var(--font-weight-extrabold);
  color: var(--c-green-dark);
}
html[data-theme="dark"] .stat-card__delta { color: var(--c-green-light); }
.stat-card--green  { --sc: var(--c-green-dark);  --sc-dark: var(--c-green-light); }
.stat-card--blue   { --sc: var(--c-blue-dark);   --sc-dark: var(--c-blue-light); }
.stat-card--orange { --sc: var(--c-orange-dark); --sc-dark: var(--c-orange-light); }
.stat-card--purple { --sc: var(--c-purple-deep); --sc-dark: var(--c-purple-light); }

/* 迷你柱状图 */
.spark {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 90px;
  padding-top: var(--space-xs);
}
.spark__col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.spark__bar {
  width: 100%;
  max-width: 34px;
  border-radius: 8px 8px 4px 4px;
  background: var(--surface-3);
  height: 0;
  transition: height var(--dur-slower) var(--ease-out);
  position: relative;
  overflow: hidden;
}
.spark__bar::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, .3), transparent 60%);
}
.spark__col.is-on .spark__bar { background: var(--grad-forest); }
.spark__col.is-today .spark__bar { background: var(--grad-brand); box-shadow: var(--glow-green); }
.spark__label { font-size: 11px; font-weight: var(--font-weight-extrabold); color: var(--text-tertiary); }

/* 列表条目（排行榜 / 清单） */
.list-row {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 11px 14px;
  border-radius: var(--radius-lg);
  border: 2px solid transparent;
  transition: background-color var(--dur-base) var(--ease-out), border-color var(--dur-base) var(--ease-out);
}
.list-row:hover { background: var(--surface-2); border-color: var(--border); }
.list-row__rank {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 13px;
  font-weight: var(--font-weight-black);
  background: var(--surface-3);
  color: var(--text-secondary);
}
.list-row__rank.is-gold   { background: var(--grad-sunset); color: var(--c-amber-ink); }
.list-row__main { flex: 1; min-width: 0; }
.list-row__title { font-size: var(--font-size-sm); font-weight: var(--font-weight-extrabold); }
.list-row__sub { font-size: 12.5px; font-weight: var(--font-weight-bold); color: var(--text-tertiary); }

/* ============================================================
   15. 特色块 / 步骤 / 问答 / CTA 条
   ============================================================ */
.feature-tile {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-lg);
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 2px solid var(--border);
  transition: transform var(--dur-base) var(--ease-out),
              background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.feature-tile:hover {
  transform: translateY(-5px);
  background: var(--surface);
  border-color: var(--border-strong);
}
.feature-tile:hover .icon-tile { transform: rotate(-8deg) scale(1.08); }
.feature-tile__title { font-size: var(--font-size-base); font-weight: var(--font-weight-black); letter-spacing: -.2px; }
.feature-tile__desc { font-size: 14.5px; color: var(--text-secondary); line-height: var(--leading-snug); }

/* 横向特色条（旧版 .feature 保留） */
.feature {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 2px solid var(--border);
  transition: transform var(--dur-base) var(--ease-out), background-color var(--dur-base);
}
.feature:hover { transform: translateY(-4px); background: var(--surface); }
.feature__icon { font-size: 26px; line-height: 1.2; }
.feature__title { font-size: var(--font-size-sm); font-weight: var(--font-weight-extrabold); margin-bottom: 2px; }
.feature__desc { font-size: 13px; color: var(--text-tertiary); line-height: var(--leading-snug); }

/* 步骤 */
.steps { display: grid; gap: var(--space-lg); counter-reset: step; }
.step { position: relative; display: flex; gap: var(--space-md); }
.step__num {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-family: var(--font-family-display);
  font-size: 20px;
  font-weight: var(--font-weight-black);
  color: #fff;
  background-image: var(--grad-brand);
  box-shadow: 0 4px 0 var(--c-green-deep);
}
.step__title { font-size: var(--font-size-base); font-weight: var(--font-weight-black); margin-bottom: 3px; }
.step__desc { font-size: 14.5px; color: var(--text-secondary); line-height: var(--leading-snug); }

/* 问答折叠 */
.faq { display: flex; flex-direction: column; gap: 10px; }
.faq__item {
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 2px solid var(--border);
  overflow: hidden;
  transition: border-color var(--dur-base) var(--ease-out), background-color var(--dur-base) var(--ease-out);
}
.faq__item[open] { background: var(--surface); border-color: var(--border-strong); }
.faq__q {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  cursor: pointer;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  list-style: none;
  user-select: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q .ico--chev { margin-left: auto; color: var(--text-tertiary); transition: transform var(--dur-base) var(--ease-spring); }
.faq__item[open] .faq__q .ico--chev { transform: rotate(180deg); color: var(--c-green); }
.faq__a {
  padding: 0 18px 17px 18px;
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: var(--leading-base);
  animation: screenIn var(--dur-base) var(--ease-out);
}

/* CTA 条 */
.cta-band {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-xl);
  flex-wrap: wrap;
  padding: var(--space-2xl);
  border-radius: var(--radius-3xl);
  color: #fff;
  background-image: var(--grad-aurora);
  background-size: 220% 220%;
  animation: auroraShift 14s var(--ease-in-out) infinite;
  box-shadow: var(--elev-3);
  overflow: hidden;
}
/* 极光渐变上的文字区加一层暗压。
   白字对极光紫端只有 ~2.5:1，直接放正文过不了 AA；
   只在文字侧压暗、右侧保持鲜亮，既可读又不失视觉冲击。 */
.cta-band::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, rgba(6, 12, 24, .46) 0%, rgba(6, 12, 24, .34) 42%, rgba(6, 12, 24, 0) 74%);
  pointer-events: none;
}
.cta-band::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 300px at 88% 120%, rgba(255, 255, 255, .3), transparent 62%);
  pointer-events: none;
}
.cta-band > * { position: relative; z-index: 1; }
.cta-band__title {
  font-family: var(--font-family-display);
  font-size: clamp(24px, 3vw, 34px);
  font-weight: var(--font-weight-black);
  letter-spacing: -.6px;
  line-height: 1.15;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .18);
}
.cta-band__desc { margin-top: 8px; font-size: var(--font-size-sm); font-weight: var(--font-weight-bold); opacity: .95; }
.cta-band .btn {
  background-color: rgba(255, 255, 255, .96);
  color: var(--c-green-deep);
  border-bottom-color: rgba(0, 0, 0, .18);
}
.cta-band .btn:hover { background-color: #fff; }

/* 页脚 */
.footer {
  position: relative;
  border-top: 2px solid var(--border);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(14px) saturate(170%);
  backdrop-filter: blur(14px) saturate(170%);
  padding: var(--space-2xl) 0 var(--space-xl);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(120px, 1fr));
  gap: var(--space-xl);
  margin-bottom: var(--space-xl);
}
.footer__col h4 {
  font-size: 13px;
  font-weight: var(--font-weight-black);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--text-tertiary);
  margin-bottom: var(--space-sm);
}
.footer__col a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
  font-size: 14.5px;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  transition: color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.footer__col a:hover { color: var(--c-green-dark); transform: translateX(3px); }
html[data-theme="dark"] .footer__col a:hover { color: var(--c-green-light); }
.footer__bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  flex-wrap: wrap;
  padding-top: var(--space-lg);
  border-top: 2px solid var(--border);
}
.footer__copy { font-size: var(--font-size-sm); color: var(--text-tertiary); }

/* ============================================================
   16. 课件页三屏通用（开始 / 游戏 / 结束）
   ------------------------------------------------------------
   四个游戏模板（listen-img / img-word / match / spell）结构完全一致：
   顶部悬浮条 → 开始屏 → 游戏屏 → 结束屏。
   这套组件让它们共用同一版式，模板自己的 style.css 里
   只留真正特有的样式（如拼写字母块、配对双栏）。
   玩法主色通过 .app 上的 --gt* 变量切换，见下方 .app--* 。
   ============================================================ */

/* ---- 壳体 ---- */
.app {
  --gt: var(--c-green);
  --gt-dark: var(--c-green-dark);
  --gt-light: var(--c-green-light);
  --gt-deep: var(--c-green-deep);
  --gt-grad: var(--grad-forest);
  width: 100%;
  max-width: min(1560px, calc(100vw - 32px));
  margin: 0 auto;
}
.app--green  { --gt: var(--c-green);  --gt-dark: var(--c-green-dark);  --gt-light: var(--c-green-light);  --gt-deep: var(--c-green-deep);  --gt-grad: var(--grad-forest); }
.app--blue   { --gt: var(--c-blue);   --gt-dark: var(--c-blue-dark);   --gt-light: var(--c-blue-light);   --gt-deep: var(--c-blue-deep);   --gt-grad: var(--grad-ocean); }
.app--purple { --gt: var(--c-purple); --gt-dark: var(--c-purple-dark); --gt-light: var(--c-purple-light); --gt-deep: var(--c-purple-deep); --gt-grad: var(--grad-berry); }
.app--orange { --gt: var(--c-orange); --gt-dark: var(--c-orange-dark); --gt-light: var(--c-orange-light); --gt-deep: var(--c-orange-deep); --gt-grad: var(--grad-flame); }

/* ---- 开始屏 / 结算屏：设置卡片保持适中居中，游戏屏全面占满大屏 ---- */
.card--center,
#start-screen .card,
#end-screen .card {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}
.card--center { text-align: center; }

.start-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}
/* 开始屏插画：与首页活动卡同一套手绘贴纸插画（assets/ui/sticker/cards/）。
   图源变量 --start-art 由各模板 style.css 指定（相对路径要能被构建内联），
   这里只管尺寸与缩放方式，避免六份模板各写一遍排版。 */
.start-art {
  --start-art: none;
  flex: 0 0 auto;
  width: 130px;
  height: 101px;
  background: var(--start-art) center / contain no-repeat;
}
@keyframes momo-sticker-bob {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-5px) rotate(-2deg); }
}
@media (prefers-reduced-motion: no-preference) {
  .start-art, .lesson-reward-art { animation: momo-sticker-bob 3.2s ease-in-out infinite; }
}

/* 开始屏小标签：与首页卡片同一个分类名（如「听力小冒险」），
   让老师从首页点进来后看到的名称层级与原来一致 */
.game-eyebrow {
  margin-bottom: 2px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  letter-spacing: .08em;
  color: var(--gt-dark);
}
html[data-theme="dark"] .game-eyebrow { color: var(--gt-light); }
.game-title {
  font-family: var(--font-family-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  letter-spacing: -1px;
  line-height: 1.15;
  /* -deep 而非 -dark：橙档 -dark 压白底只有 2.77:1，够不到大字线 3.0:1 */
  color: var(--gt-deep);
}
html[data-theme="dark"] .game-title { color: var(--gt-light); }
.game-subtitle {
  margin-top: 4px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
}
.game-desc {
  font-size: var(--font-size-lg);
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
}
/* 开始屏的三个要点：题量 / 玩法 / 时长 */
.game-facts {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.game-facts li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 15px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
}
.game-facts .ico { --ico-size: 17px; --ico-stroke: 2.5; color: var(--gt-dark); }
html[data-theme="dark"] .game-facts .ico { color: var(--gt-light); }
.game-facts b { color: var(--text); }

/* ---- 游戏屏顶部：题号 / 得分 / 进度条 ---- */
.game-header {
  width: 100%;
  margin-bottom: var(--space-lg);
}
.game-header__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 10px;
}
.game-header__stat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
}
.game-header__stat .ico { --ico-size: 19px; --ico-stroke: 2.5; color: var(--gt-dark); }
html[data-theme="dark"] .game-header__stat .ico { color: var(--gt-light); }
.game-header__stat b { font-family: var(--font-family-display); font-size: var(--font-size-lg); color: var(--text); }
.game-header__stat--score .ico { color: var(--c-yellow-dark); }
html[data-theme="dark"] .game-header__stat--score .ico { color: var(--c-yellow-light); }
.game-header__meta-right { display: inline-flex; align-items: center; gap: 10px; }
.game-header .progress-bar-fill { background-color: var(--gt); }

/* ---- 题干区 ---- */
.question-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}
.question-tip {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
}
.question-img {
  width: clamp(220px, 30vh, 360px);
  height: clamp(220px, 30vh, 360px);
  object-fit: contain;
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 2px solid var(--border);
  padding: var(--space-sm);
}
.question-chinese {
  font-size: clamp(26px, 2.6vw, 42px);
  font-weight: var(--font-weight-black);
  color: var(--text);
}

/* ---- 选项网格 ---- */
.options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  max-width: min(1360px, calc(100vw - 32px));
  width: 100%;
  margin: 0 auto;
}
/* 作答场地感：底板用玩法主色淡化 + 点阵纹理，牌面仍是白底深字（只作用于单人 #options-grid） */
#options-grid {
  padding: 12px;
  border: 2px solid var(--gt-light);
  border-radius: var(--radius-2xl);
  background: var(--surface-2);
  background: color-mix(in srgb, var(--gt) 8%, var(--surface));
  background-image: radial-gradient(circle at 1px 1px, rgba(0, 0, 0, .06) 1px, transparent 0);
  background-size: 22px 22px;
}
html[data-theme="dark"] #options-grid {
  background: color-mix(in srgb, var(--gt) 10%, var(--surface));
  background-image: radial-gradient(circle at 1px 1px, rgba(255, 255, 255, .05) 1px, transparent 0);
  background-size: 22px 22px;
}
.option-img {
  width: 100%;
  max-width: 320px;
  height: clamp(140px, 22vh, 260px);
  object-fit: contain;
}
/* 选项里放单词（看图选词用） */
.option-card__word {
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-black);
  letter-spacing: -.5px;
  line-height: 1.2;
  text-align: center;
  padding: var(--space-md) var(--space-sm);
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
}
.option-card__word small {
  display: block;
  margin-top: 3px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-tertiary);
}
.option-card.correct .option-card__word small { color: var(--gt-deep); }
/* 选项序号（键盘 1-4 可选，给个小角标提示） */
.option-card__key {
  position: absolute;
  top: 8px;
  left: 10px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  color: var(--text-tertiary);
}

/* ---- 结束屏 ---- */
.result {
  display: flex;
  justify-content: center;
  gap: var(--space-xl);
  flex-wrap: wrap;
  margin-bottom: var(--space-xl);
}
.result-item { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 96px; }
.result-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-tertiary);
}
.result-label .ico { --ico-size: 16px; --ico-stroke: 2.5; }
.result-value {
  font-family: var(--font-family-display);
  font-size: var(--font-size-3xl);
  font-weight: var(--font-weight-black);
  line-height: 1;
  color: var(--gt-dark);
}
html[data-theme="dark"] .result-value { color: var(--gt-light); }
.result-value i { font-size: var(--font-size-lg); font-style: normal; }

/* 星级评价（结束屏） */
.stars { display: flex; justify-content: center; gap: var(--space-xs); margin-bottom: var(--space-lg); }
.stars .ico { --ico-size: 40px; --ico-stroke: 2.2; color: var(--color-gray-300); }
.stars .is-on { color: var(--c-yellow); filter: drop-shadow(0 3px 6px rgba(255, 200, 0, .45)); animation: pop 420ms var(--ease-spring); }

/* 结束屏按钮行 */
.end-actions { display: flex; gap: var(--space-sm); justify-content: center; flex-wrap: wrap; }

@media (max-width: 600px) {
  .game-title { font-size: var(--font-size-2xl); }
  .start-art { width: 104px; height: 81px; }
  .options-grid { gap: var(--space-sm); }
  .option-img { height: 120px; }
  .question-img { width: 170px; height: 170px; }
  .result { gap: var(--space-lg); }
  .game-facts li { font-size: var(--font-size-sm); padding: 6px 12px; }
}

/* ============================================================
   16.1 色相工具类（.tone-*）
   ------------------------------------------------------------
   给元素挂一组 --accent* 变量，深浅色自动适配。
   玩法卡片、「换个玩法」按钮等靠它上色 —— 新增玩法只要在
   config.json 里写 tone，不需要新增一行 CSS。
   ============================================================ */
.tone-green  { --accent: var(--c-green);  --accent-deep: var(--c-green-deep);  --accent-light: var(--c-green-light);  --accent-grad: var(--grad-forest); }
.tone-blue   { --accent: var(--c-blue);   --accent-deep: var(--c-blue-deep);   --accent-light: var(--c-blue-light);   --accent-grad: var(--grad-ocean); }
.tone-teal   { --accent: var(--c-teal);   --accent-deep: var(--c-teal-deep);   --accent-light: var(--c-teal-light);   --accent-grad: var(--grad-mint); }
.tone-yellow { --accent: var(--c-yellow); --accent-deep: var(--c-yellow-deep); --accent-light: var(--c-yellow-light); --accent-grad: var(--grad-sunset); }
.tone-orange { --accent: var(--c-orange); --accent-deep: var(--c-orange-deep); --accent-light: var(--c-orange-light); --accent-grad: var(--grad-flame); }
.tone-red    { --accent: var(--c-red);    --accent-deep: var(--c-red-deep);    --accent-light: var(--c-red-light);    --accent-grad: var(--grad-flame); }
.tone-pink   { --accent: var(--c-pink);   --accent-deep: var(--c-pink-deep);   --accent-light: var(--c-pink-light);   --accent-grad: var(--grad-candy); }
.tone-purple { --accent: var(--c-purple); --accent-deep: var(--c-purple-deep); --accent-light: var(--c-purple-light); --accent-grad: var(--grad-berry); }
.tone-indigo { --accent: var(--c-indigo); --accent-deep: var(--c-indigo-deep); --accent-light: var(--c-indigo-light); --accent-grad: var(--grad-sky); }

/* ============================================================
   16.2 换个玩法（结束屏 · 由 lesson.js 自动注入，模板无需写）
   ------------------------------------------------------------
   结束屏原本只有「再玩一次 / 返回首页」，想换个玩法练同一个
   单元必须回首页重选。这里统一列出该单元其它可玩的玩法。
   数据源见 src/common/js/games.js（构建时自动生成）。
   ============================================================ */
.game-switch {
  margin-top: var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 2px dashed var(--border);
}
.game-switch__label {
  margin: 0 0 var(--space-md);
  font-size: var(--font-size-xs);
  color: var(--text-tertiary);
  text-align: center;
}
.game-switch__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
}
.game-switch__item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-bottom: 4px solid var(--border-strong);
  color: var(--text);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.game-switch__item:hover {
  transform: translateY(-2px);
  border-color: var(--accent, var(--c-green));
  box-shadow: var(--elev-2);
}
.game-switch__item:active { transform: translateY(1px); }
.game-switch__item:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }

/* 图标：浅色主题用 -deep 档，深色主题换 -light 档（成对写，见 DESIGN_SYSTEM） */
.game-switch__ico { display: inline-flex; color: var(--accent-deep, var(--c-green-deep)); }
html[data-theme="dark"] .game-switch__ico { color: var(--accent-light, var(--c-green-light)); }
.game-switch__name { white-space: nowrap; }

/* ============================================================
   16.3 练习范围选择（开始屏 · 由 MomoLesson.scope() 注入）
   ------------------------------------------------------------
   整册 / 指定单元。不选单元就是整册混练（期末复习场景）。
   主色跟随课件玩法的 --gt，不写死。
   ============================================================ */
.scope { margin: 0 0 var(--space-lg); }
.scope__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  justify-content: center;
}
.scope__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  min-height: 48px;                       /* 触屏目标 48（M-15） */
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out);
}
.scope__item:hover { transform: translateY(-2px); border-color: var(--gt, var(--c-green)); color: var(--text); }
.scope__item:active { transform: translateY(1px); }
.scope__item:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
/* 选中态：品牌色底 + 白字。底色必须走 -deep 档 ——
   --gt 原色白字只有 2.09:1（蓝 2.41 / 紫 2.5 / 橙 2.16），-deep 档四色都 ≥5.0:1（M-14） */
.scope__item.is-active {
  background: var(--gt-deep, var(--c-green-deep));
  border-color: var(--gt-deep, var(--c-green-deep));
  color: #fff;
}
.scope__count {
  /* 辅助档（数量角标）：11px 提到 14px；同时去掉 .85 透明度 ——
     半透明白压在 -deep 上会把 5.0:1 拉回 4.1:1 */
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}

/* ---- 练习范围行：下拉菜单（替代整排单元大按钮） ---- */
.scope__range { align-items: center; }
.scope__select {
  appearance: none;
  -webkit-appearance: none;
  min-height: 48px;                          /* 与数量按钮同高，触屏目标 48（M-15） */
  max-width: min(340px, 78vw);
  padding: 8px 42px 8px 16px;
  border-radius: var(--radius-lg);
  background-color: var(--surface-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  border: 2px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease-out);
}
.scope__select:hover { border-color: var(--gt, var(--c-green)); }
.scope__select:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
/* 深色主题把箭头换成浅灰，否则 #6b7280 在深底上看不清 */
html[data-theme="dark"] .scope__select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

/* ---- 玩法选择行（由 MomoLesson.playMode() 注入） ---- */
.scope__mode-row {
  margin-top: 4px;
  align-items: center;
  justify-content: center;
}
.scope__mode-picker {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- 题目数量行（第二行）+ 双人模式切换 ---- */
.scope__counts {
  margin-top: 2px;
  align-items: center;
}
.scope__qty-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  margin-right: 4px;
}
.scope__item--qty { min-width: 56px; justify-content: center; }

.duo-toggle {
  margin-top: var(--space-2xs);
  align-items: center;
}
.duo-toggle__btns {
  display: inline-flex;
  gap: var(--space-2xs);
}

/* ---- 难度行（开始屏）：与游戏模式三连按钮同款，切档即时生效 ---- */
.scope__level {
  margin-top: var(--space-2xs);
  align-items: center;
}
.scope__item--lv { min-width: 64px; justify-content: center; }

/* ---- 开始屏底部两块并排：游戏模式 + 难度 ----
   投影常见 1280×720，竖着堆会多占一行把「开始」按钮顶出屏幕；
   并排后只有一行，窄屏放不下时仍会自然换行回两行。 */
.setup-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-xs) var(--space-lg);
  margin-bottom: var(--space-md);
}
.setup-row > .scope { margin-bottom: 0; }
.setup-row .scope__level { margin-top: 0; }

/* ---- 双人分屏：左右各一名玩家，同时作答 ---- */
.duel {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: var(--space-md);
  width: 100%;
  align-items: stretch;
}
.duel__side {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-sm);
  border-radius: var(--radius-xl);
  /* 队伍氛围：底色向队伍色偏移、顶边用纯队伍色。color-mix 需先写兜底声明（旧一体机 Chromium < 111） */
  background: var(--surface-2);
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--duo-c) 12%, var(--surface)) 0%,
    var(--surface-2) 45%);
  border: 2px solid var(--border);
  border-color: color-mix(in srgb, var(--duo-c) 35%, var(--border));
  border-top: 5px solid var(--duo-c);
}
.duel__side--p1 { --duo-c: var(--c-blue, #1cb0f6); }
.duel__side--p2 { --duo-c: var(--c-orange, #ff9600); }
/* 深色主题：同一公式提高混合比例，不用彩色阴影 */
html[data-theme="dark"] .duel__side {
  background: var(--surface-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--duo-c) 26%, var(--surface-2)) 0%, var(--surface-2) 45%);
}
.duel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 4px 6px 8px;
  border-bottom: 2px solid var(--border);
}
.duel__name {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-extrabold);
  color: var(--text);
}
.duel__head b {
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--duo-c);
}
/* 比分放大到后排可见；只取直接子元素，pop-word 的 .duel__stat-line 统计行不跟着放大 */
.duel__head > b[data-duo-score] {
  font-size: var(--font-size-2xl);
}
.duel__vs {
  align-self: center;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--border);
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
  color: var(--text);
  box-shadow: var(--elev-2);
}
.duel__board {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  justify-content: center;
}
.duel .feedback { margin-top: auto; }

/* 双人分屏里的选项/拼写区用更矮的图片，避免太高溢出 */
.duel .option-img { height: 120px; }
.duel .duel__board .question-tip { font-size: 12px; }
@media (max-width: 900px) {
  .duel { grid-template-columns: 1fr 1fr; }
  .duel__vs { display: none; }
}
@media (max-width: 600px) {
  .duel { grid-template-columns: 1fr; }
  .duel__board .option-img { height: 96px; }
}

/* ---- 游戏屏「退出」按钮 ---- */
.exit-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  min-height: 48px;                       /* 触屏目标 48（M-15） */
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.exit-btn:hover { transform: translateY(-2px); border-color: var(--c-red, #ff5a5a); color: var(--c-red, #ff5a5a); }
.exit-btn:active { transform: translateY(1px); }
.exit-btn .ico { --ico-size: 16px; --ico-stroke: 2.6; }

/* ---- 双人结束屏胜负 ---- */
.duo-result {
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  border: 2px solid var(--border);
  text-align: center;
}
.duo-result__grid {
  display: grid;
  grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}
.duo-result__col {
  padding: var(--space-sm);
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
}
.duo-result__col--p1 { --duo-c: var(--c-blue, #1cb0f6); }
.duo-result__col--p2 { --duo-c: var(--c-orange, #ff9600); }
.duo-result__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  padding-bottom: 6px;
  margin-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
.duo-result__head > span {
  font-family: var(--font-family-display);
  font-size: var(--font-size-lg);
  color: var(--duo-c);
}
.duo-result__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 3px 0;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}
.duo-result__row span:first-child { font-weight: var(--font-weight-bold); }
.duo-result__row b {
  font-family: var(--font-family-display);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  color: var(--text);
}
.duo-result__note {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--gt, var(--c-green));
}
.duo-result__col--p3 { --duo-c: var(--c-pink, #ff6b9d); }
.duo-result__col--p4 { --duo-c: var(--c-purple, #ce82ff); }
.duo-result__col.is-winner { box-shadow: inset 0 0 0 3px var(--duo-c); }
.duo-result__head em {
  font-style: normal;
  margin-right: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.duo-result__head .duo-avatar { width: 28px; height: 34px; flex: none; }
.duo-result__head > span { flex: none; white-space: nowrap; }
.duo-result__place {
  margin-bottom: 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  color: var(--duo-c);
}

/* ---- 多人同屏：开始屏座位 ---- */
.duo-avatar { width: 30px; height: 36px; flex: none; }
.duo-seats { align-items: center; flex-wrap: wrap; }
.duo-seats__list { display: inline-flex; flex-wrap: wrap; gap: var(--space-2xs); }
.duo-seat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 4px 14px 4px 8px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  border-color: color-mix(in srgb, var(--duo-c) 55%, var(--border));
  border-bottom-width: 4px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}
.duo-seat span { max-width: 8em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-seat:hover { border-color: var(--duo-c); }
.duo-seats__tools { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.duo-seats__tool {
  min-height: 40px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  border: 2px dashed var(--border);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}
.duo-seats__tool:hover:not(:disabled) { border-color: var(--c-blue); color: var(--text); }
.duo-seats__tool:disabled { opacity: .45; cursor: not-allowed; }

/* ---- 多人同屏：座位命名弹窗 ---- */
.duo-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(15, 23, 42, .45);
}
.duo-dialog__panel {
  width: min(640px, 100%);
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: var(--space-md);
  border-radius: var(--radius-xl);
  border-top: 6px solid var(--duo-c);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--elev-2);
}
.duo-dialog__head { display: flex; align-items: center; gap: 8px; font-size: var(--font-size-lg); }
.duo-dialog__close {
  margin-left: auto;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-secondary);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.duo-dialog__form { display: flex; gap: 8px; margin: var(--space-sm) 0; }
.duo-dialog__form input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-size: var(--font-size-base);
}
.duo-dialog__form input:focus { outline: none; border-color: var(--duo-c); }
.duo-dialog__title {
  margin: var(--space-sm) 0 6px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  color: var(--text-secondary);
}
.duo-dialog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 6px;
  max-height: 260px;
  overflow: auto;
}
.duo-dialog__grid--groups { grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); max-height: none; }
.duo-dialog__pick,
.duo-dialog__default {
  min-height: 44px;
  padding: 4px 8px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}
.duo-dialog__pick:hover:not(:disabled), .duo-dialog__pick.is-active { border-color: var(--duo-c); }
.duo-dialog__pick:disabled { opacity: .4; cursor: not-allowed; }
.duo-dialog__default { width: 100%; margin-top: var(--space-sm); border-style: dashed; background: transparent; color: var(--text-secondary); }
.duo-dialog__tip { margin: var(--space-sm) 0 0; font-size: var(--font-size-xs); color: var(--text-secondary); }

/* ---- 多人同屏：游戏屏分列（每人一列，--n 列平分） ---- */
.lanes {
  display: grid;
  grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr));
  gap: clamp(12px, 1.2vw, 20px);
  width: 100%;
  align-items: stretch;
}
.lane {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: var(--space-xs);
  padding: var(--space-xs);
  border-radius: var(--radius-xl);
  background: var(--surface-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--duo-c) 14%, var(--surface)) 0%, var(--surface-2) 40%);
  border: 2px solid var(--border);
  border-color: color-mix(in srgb, var(--duo-c) 40%, var(--border));
  border-top: 6px solid var(--duo-c);
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
html[data-theme="dark"] .lane {
  background: var(--surface-2);
  background: linear-gradient(180deg, color-mix(in srgb, var(--duo-c) 26%, var(--surface-2)) 0%, var(--surface-2) 40%);
}
.lane.is-finished { box-shadow: inset 0 0 0 3px var(--duo-c); }
.lane__head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 4px 6px;
  border-bottom: 2px solid var(--border);
}
.lane__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
}
.lane__place {
  flex: none;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--duo-c);
  color: #fff;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
}
.lane__head > b[data-duo-score] {
  flex: none;
  font-family: var(--font-family-display);
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--duo-c);
}
.lane__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  min-height: 0;
}
.lane__body .feedback { margin-top: auto; }
@media (max-width: 760px) {
  .lanes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ============================================================
   17. 动效与关键帧
   ============================================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes screenIn {
  from { opacity: 0; transform: translateY(14px) scale(.985); }
  to   { opacity: 1; transform: none; }
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(24px) scale(.94); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(24px) scale(.9); }
  to   { opacity: 1; transform: none; }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(16px) scale(.94); }
}
@keyframes pop {
  0%   { transform: scale(.82); }
  55%  { transform: scale(1.09); }
  100% { transform: scale(1); }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(.7); }
  60%  { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-9px) rotate(-1.5deg); }
  46% { transform: translateX(8px) rotate(1.5deg); }
  74% { transform: translateX(-4px); }
}
@keyframes bounceY {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-12px); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(2deg); }
}
@keyframes floatSoft {
  0%, 100% { transform: translateY(0) rotate(-2deg); }
  50%      { transform: translateY(-9px) rotate(2deg); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
@keyframes skeletonMove {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}
@keyframes rippleGo {
  to { transform: scale(2.8); opacity: 0; }
}
@keyframes ripplePulse {
  0%   { opacity: .55; transform: scale(.94); }
  70%  { opacity: 0;   transform: scale(1.16); }
  100% { opacity: 0;   transform: scale(1.16); }
}
@keyframes pulseSoft {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.035); }
}
@keyframes nodePulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.045); }
}
@keyframes auroraShift {
  0%, 100% { background-position: 0% 50%; }
  50%      { background-position: 100% 50%; }
}
@keyframes confettiFall {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(1); }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(.5); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-9deg); }
  75% { transform: rotate(9deg); }
}

/* ---- 庆祝动效（confettiRain / kaleidoscope / flash / comboBadge）---- */
@keyframes fxRainFall {
  0%   { opacity: 0; transform: translate(0, -12vh) rotate(0deg); }
  8%   { opacity: 1; }
  100% { opacity: .95; transform: translate(var(--drift, 0), 108vh) rotate(var(--spin, 360deg)); }
}
@keyframes fxRayGrow {
  0%   { opacity: 0; transform-origin: 50% 100%; height: 0; }
  35%  { opacity: 1; }
  100% { opacity: 0; transform-origin: 50% 100%; height: 190px; }
}
@keyframes fxRingOut {
  0%   { opacity: .85; transform: translate(-50%, -50%) scale(.15); }
  100% { opacity: 0;   transform: translate(-50%, -50%) scale(1.6); }
}
@keyframes fxFlashIn {
  0%   { opacity: 0; }
  28%  { opacity: 1; }
  100% { opacity: 0; }
}
@keyframes fxComboIn {
  0%   { opacity: 0; transform: translate(-50%, -50%) scale(.5) rotate(-6deg); }
  55%  { opacity: 1; transform: translate(-50%, -50%) scale(1.12) rotate(2deg); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(0deg); }
}
@keyframes fxComboOut {
  to { opacity: 0; transform: translate(-50%, -78%) scale(.86); }
}

/* ============================================================
   17b. 庆祝层（fx.js 动态插入，用完即删）
   ============================================================ */
/* 满屏飘落彩带 */
.fx-rain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: var(--z-toast);
}
.fx-rain > span {
  position: absolute;
  top: 0;
  display: block;
  animation-name: fxRainFall;
  animation-timing-function: cubic-bezier(.25, .7, .45, 1);
  animation-fill-mode: forwards;
  will-change: transform, opacity;
}

/* 万花筒放射光芒（以命中点为原点） */
.fx-burst {
  position: fixed;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: var(--z-toast);
}
.fx-burst__ray {
  position: absolute;
  left: -3px;
  bottom: 0;
  width: 6px;
  height: 0;
  border-radius: 999px;
  opacity: 0;
  transform-origin: 50% 100%;
  animation: fxRayGrow 720ms var(--ease-out) forwards;
}
.fx-burst__ring {
  position: absolute;
  left: 0;
  top: 0;
  width: 260px;
  height: 260px;
  margin: 0;
  border-radius: 50%;
  border: 3px solid var(--c-green);
  box-shadow: 0 0 34px 10px var(--glow-green);
  animation: fxRingOut 760ms var(--ease-out) forwards;
}

/* 屏幕边缘光晕：高分连对时「全屏呼吸一下」 */
.fx-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: var(--z-toast);
  background: radial-gradient(120% 90% at 50% 50%, transparent 42%, var(--glow-green) 130%);
  animation: fxFlashIn 820ms var(--ease-out) forwards;
}

/* 连对气泡 */
.fx-combo {
  position: fixed;
  pointer-events: none;
  z-index: var(--z-toast);
  padding: 8px 20px;
  border-radius: var(--radius-full);
  font-size: 20px;
  font-weight: var(--font-weight-black);
  color: #fff;
  background: var(--grad-brand);
  box-shadow: var(--glow-green), var(--elev-2);
  white-space: nowrap;
  animation: fxComboIn 420ms var(--ease-spring) forwards;
}
.fx-combo.is-out { animation: fxComboOut 460ms var(--ease-out) forwards; }

/* 减弱动画偏好：庆祝层整体不参与 */
@media (prefers-reduced-motion: reduce) {
  .fx-rain, .fx-burst, .fx-flash, .fx-combo { display: none; }
}

/* ============================================================
   18. 工具类
   ============================================================ */

/* 滚动进场（由 fx.js 加 .is-visible） */
[data-reveal] {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity var(--dur-slower) var(--ease-out), transform var(--dur-slower) var(--ease-out);
  will-change: opacity, transform;
}
[data-reveal].is-visible { opacity: 1; transform: none; }
[data-reveal="left"]  { transform: translateX(-28px); }
[data-reveal="right"] { transform: translateX(28px); }
[data-reveal="zoom"]  { transform: scale(.92); }
[data-reveal="pop"]   { transform: scale(.8); transition-timing-function: var(--ease-spring); }
[data-reveal-delay="1"] { transition-delay: .07s; }
[data-reveal-delay="2"] { transition-delay: .14s; }
[data-reveal-delay="3"] { transition-delay: .21s; }
[data-reveal-delay="4"] { transition-delay: .28s; }
[data-reveal-delay="5"] { transition-delay: .35s; }
[data-reveal-delay="6"] { transition-delay: .42s; }
[data-reveal-delay="7"] { transition-delay: .49s; }
[data-reveal-delay="8"] { transition-delay: .56s; }

.anim-float { animation: floaty 4.5s var(--ease-in-out) infinite; }
.anim-float-soft { animation: floatSoft 5.5s var(--ease-in-out) infinite; }
.anim-bounce { animation: bounceY 2.2s var(--ease-in-out) infinite; }
.anim-spin { animation: spin 1.1s linear infinite; }
.anim-pop { animation: pop 400ms var(--ease-spring); }

.text-center { text-align: center; }
.text-gradient {
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.muted { color: var(--text-secondary); }
.tertiary { color: var(--text-tertiary); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 课件页顶部悬浮条：品牌出口 + 主题开关 */
body.page-lesson {
  padding-top: 92px;
  align-items: flex-start;
  overflow-y: auto;
}
.lesson-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  pointer-events: none;
}
.lesson-topbar > * { pointer-events: auto; }
.lesson-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px 6px 8px;
  border-radius: var(--radius-full);
  background: var(--surface-glass);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  border: 2px solid var(--border);
  box-shadow: var(--elev-1);
  color: var(--text);
  text-decoration: none;
  transition: transform var(--dur-base) var(--ease-spring), box-shadow var(--dur-base) var(--ease-out);
}
.lesson-brand:hover { transform: translateY(-2px); box-shadow: var(--elev-2); }
.lesson-brand__logo {
  width: 32px; height: 32px;
  flex: 0 0 32px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  font-size: 17px;
}
.lesson-brand__name {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  letter-spacing: -.2px;
  white-space: nowrap;
}
.lesson-topbar__actions { display: flex; align-items: center; gap: 8px; }

/* 顶栏「返回首页」显式按钮：不再只靠点 logo 返回 */
.topbar-home {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 48px;                       /* 触屏目标 48（M-15） */
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -.2px;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.topbar-home:hover { transform: translateY(-2px); border-color: var(--gt, var(--c-green)); background-color: var(--surface-hover); }
.topbar-home:active { transform: translateY(1px); }
.topbar-home .ico { --ico-size: 17px; --ico-stroke: 2.6; color: var(--gt-dark, var(--c-green-dark)); }
html[data-theme="dark"] .topbar-home .ico { color: var(--gt-light, var(--c-green-light)); }
@media (max-width: 600px) {
  .topbar-home span { display: none; }   /* 窄屏只留图标 */
}

@media (max-width: 600px) {
  .page-lesson { padding-top: 84px; }
  .lesson-brand__name { display: none; }
  .lesson-topbar { padding: 10px var(--space-md); }
}

/* 主题切换瞬间的全局平滑过渡（由 theme.js 短暂挂载） */
html.is-theme-animating,
html.is-theme-animating *,
html.is-theme-animating *::before,
html.is-theme-animating *::after {
  transition: background-color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              fill var(--dur-base) var(--ease-out),
              stroke var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out) !important;
}

/* 3D 倾斜容器（由 fx.js 驱动） */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform var(--dur-base) var(--ease-out);
}
[data-tilt] .tilt-layer { transform: translateZ(28px); }

/* ============================================================
   响应式
   ============================================================ */

/* 导航操作区按宽度逐级收纳，避免小屏横向溢出 */
@media (max-width: 1180px) {
  .pill--xp { display: none; }
}

@media (max-width: 1080px) {
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-links { display: none; }
  .navbar.is-open .nav-links {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: var(--space-md);
    background: var(--surface);
    border-bottom: 2px solid var(--border);
    box-shadow: var(--elev-3);
    animation: screenIn var(--dur-base) var(--ease-out);
  }
  .navbar.is-open .nav-link { justify-content: flex-start; }
  .navbar.is-open .nav-link .ico { --ico-size: 19px; }
  .nav-burger { display: grid; margin-left: auto; }
  .navbar__actions { margin-left: 0; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 学习路径切成左对齐单列：节点固定在最左侧，主线跟着节点圆心走 */
  .path-canvas { --path-node: 76px; }
  .path::before,
  .path__fill { left: calc(var(--path-node) / 2); }
  .path__item { grid-template-columns: var(--path-node) 1fr; column-gap: 18px; min-height: calc(var(--path-node) + 22px); }
  .path-node { grid-column: 1; }
  .path__item:nth-of-type(odd) .path-node__body,
  .path__item:nth-of-type(even) .path-node__body {
    grid-column: 2;
    align-items: flex-start;
    text-align: left;
  }
  .path__item:nth-of-type(odd) .path-node__badge { align-self: flex-start; }
}

@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr; gap: var(--space-lg); }
}

@media (max-width: 700px) {
  .pill--flame { display: none; }
}

@media (max-width: 620px) {
  .nav-cta { display: none; }
}

@media (max-width: 600px) {
  body { padding: var(--space-sm); }
  .container { padding: 0 var(--space-md); }
  .btn { padding: 12px 24px; font-size: var(--font-size-base); }
  .btn--lg { padding: 15px 30px; font-size: var(--font-size-lg); }
  .card, .panel { padding: var(--space-lg); border-radius: var(--radius-xl); }
  .navbar { padding: 8px 12px; }
  .brand__logo { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 13px; }
  .brand__name { font-size: 16.5px; }
  .brand__tag { display: none; }
  .navbar__actions { gap: 8px; }
  .theme-toggle { width: 58px; flex: 0 0 58px; height: 44px; }
  .theme-toggle__thumb { width: 26px; height: 26px; }
  html[data-theme="dark"] .theme-toggle__thumb { transform: translateX(24px); }
  .nav-burger { width: 48px; height: 48px; }
  .streak__day { flex: 1 1 34px; min-width: 34px; font-size: 10px; }
  .cta-band { padding: var(--space-xl) var(--space-lg); border-radius: var(--radius-2xl); }
  .path-canvas { --path-node: 64px; }
  .path__item { min-height: calc(var(--path-node) + 36px); }
}

/* ============================================================
   无障碍：尊重「减少动态效果」
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* 打印：去掉装饰 */
@media print {
  .navbar, .toast-wrap { display: none !important; }
  .watermark { display: block !important; position: fixed; bottom: 0; }
  body { background: #fff; }
}
/* 窄屏优先保留首页、主题与音效操作，册次仍显示在开始页。 */
@media (max-width: 600px) {
  .lesson-topbar__actions .pill { display: none; }
}

/* 游戏乐园：共享奖励与课堂页，保留各玩法独立主题。 */
.stars { position: relative; gap: 12px; padding: 8px 0 30px; min-height: 100px; align-items: center; }
.stars .ico { --ico-size: 52px; --ico-stroke: 1.8; color: var(--border-strong); fill: var(--surface-sunken); }
.stars .is-on { color: var(--c-yellow-deep); fill: var(--c-yellow); filter: drop-shadow(0 4px 0 var(--c-yellow-dark)); animation: reward-star 560ms var(--ease-spring) both; }
.stars .is-on:nth-child(2) { animation-delay: 160ms; --ico-size: 64px; }
.stars .is-on:nth-child(3) { animation-delay: 320ms; }
.stars[data-rating]::after { content: '获得 ' attr(data-rating) ' 颗星'; position: absolute; bottom: 0; left: 0; right: 0; text-align: center; color: var(--text-secondary); font-size: 15px; font-weight: 750; }
@keyframes reward-star { from { opacity: 0; transform: translateY(12px) scale(.45) rotate(-18deg); } to { opacity: 1; transform: translateY(0) scale(1) rotate(0); } }
.lesson-reward-art { display: block; width: 150px; height: 116px; background-position: center; background-size: contain; background-repeat: no-repeat; }
.page-lesson #start-screen .card--center { border-top: 6px solid var(--gt); }
.page-lesson #start-screen .start-hero { flex-direction: row; justify-content: center; text-align: left; gap: 18px; margin-bottom: 18px; }
.page-lesson #start-screen .game-facts { margin-bottom: 20px; }
.page-lesson #start-screen .game-desc { margin-bottom: 18px; }
.page-lesson #start-btn { min-width: 220px; }
.page-lesson #end-screen .start-hero { gap: 8px; margin-bottom: 12px; }
.page-lesson #end-screen .result { gap: 12px; margin-bottom: 24px; }
.page-lesson #end-screen .result-item { flex: 1; max-width: 200px; padding: 16px 10px; gap: 10px; border: 2px solid var(--border); border-bottom: 5px solid var(--gt); border-radius: 18px; background: var(--surface-2); }
.page-lesson #end-screen .result-item:nth-child(1) { border-bottom-color: var(--c-yellow); }
.page-lesson #end-screen .result-item:nth-child(2) { border-bottom-color: var(--c-blue); }
.page-lesson #end-screen .result-value { color: var(--gt-deep); }
html[data-theme="dark"] .page-lesson #end-screen .result-value { color: var(--gt-light); }
.page-lesson .game-header { padding: 12px 16px; background: var(--surface); border: 2px solid var(--border); border-radius: 20px; }
.page-lesson .duel__name { font-size: 16px; }
.page-lesson .option-card.correct, .page-lesson .option-card.wrong { opacity: 1; }
@media (max-width: 600px) {
  .page-lesson #start-screen .start-hero { gap: 10px; }
  .page-lesson #start-screen .start-art { width: 88px; height: 76px; }
  .page-lesson #end-screen .result { gap: 6px; }
  .page-lesson #end-screen .result-item { min-width: 0; padding: 14px 5px; }
  .page-lesson #end-screen .result-value { font-size: 28px; }
  .page-lesson #end-screen .end-actions > .btn { min-height: 48px; }
  .lesson-reward-art { width: 125px; height: 98px; }
}
@media (prefers-reduced-motion: reduce) { .stars .is-on { animation: none; } }
@media (min-width: 601px) and (max-height: 850px) {
 .page-lesson #end-screen .card--center { padding: 24px; }
 .page-lesson #end-screen .start-hero { flex-direction: row; justify-content: center; text-align: left; }
 .page-lesson #end-screen .lesson-reward-art, .page-lesson #end-screen .treasure-reward { width: 130px; height: 100px; }
 .page-lesson #end-screen .stars { margin-bottom: 14px; }
}
/* 课堂大屏基础操作尺寸；手机沿用独立布局。 */
@media (min-width: 901px) {
 .page-lesson .game-header__stat { font-size: 20px; }
 .page-lesson .game-header__stat b { font-size: 28px; }
 .page-lesson .exit-btn { min-height: 52px; font-size: 18px; padding: 8px 18px; }
 .page-lesson .scope__item, .page-lesson .scope__select { min-height: 52px; font-size: 18px; }
 .page-lesson .duel__name { font-size: 22px; }
 .page-lesson .duel__stat-line b { font-size: 28px; }
 .page-lesson #game-screen .btn--sm { min-height: 52px; font-size: 18px; }
}

/* Shared round break: large classroom controls, theme-aware surfaces. */
.continuous-screen { padding:24px; }
.continuous-card { width:min(850px,100%); margin:20px auto; padding:clamp(20px,3vw,40px); border:3px solid var(--border); border-radius:28px; background:var(--surface); box-shadow:0 8px 0 var(--border); text-align:center; }
.continuous-badge,.continuous-round-label { color:var(--text-secondary); font-size:20px; font-weight:800; text-align:center; }
.continuous-card h1 { font-size:clamp(30px,4vw,46px); margin:14px 0; }
.continuous-card p { font-size:clamp(18px,2vw,24px); line-height:1.6; overflow-wrap:anywhere; }
.continuous-actions { display:grid; grid-template-columns:1fr 1fr; gap:16px; margin:22px 0; }
.continuous-actions .btn { min-height:64px; font-size:22px; white-space:normal; }
.continuous-detail { max-width:760px; margin:12px auto; color:var(--text-secondary); font-size:17px; line-height:1.6; }
@media(max-width:600px){ .continuous-actions { grid-template-columns:1fr; } .continuous-screen {padding:12px;} }

.continuous-badge { display:inline-block; padding:6px 18px; border-radius:99px; background:var(--c-yellow); color:var(--c-amber-ink); }
.continuous-round-label { margin:0 0 8px; font-size:18px; }
.continuous-round-label:empty { display:none; }

.game-header__meta .continuous-round-label { margin:0; order:0; }
.game-header__meta.continuous-header { flex-wrap:wrap; gap:8px 16px; }
/* Route framing only appears when a validated adventure context is present. */
.adventure-ribbon { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; padding:10px 18px; background:var(--surface); border:2px solid var(--c-yellow); border-radius:20px; font-size:21px; }
.adventure-ribbon .btn { min-height:48px; padding:8px 18px; }
.adventure-end { padding:24px; margin-bottom:22px; background:var(--surface); border:3px solid var(--c-yellow); border-radius:26px; text-align:center; }
.adventure-end h2 { font-size:32px; margin-bottom:8px; }.adventure-end p {font-size:20px; margin-bottom:16px;}
.adventure-end .btn { margin:8px; min-height:58px; font-size:21px; white-space:normal; }
.adventure-message { padding:32px; text-align:center; background:var(--surface); border-radius:24px; }
/* 探险模式自带出题与计分，开始屏这些设置项一条都不生效 —— 一律藏掉，
   别让老师点了一个没反应的开关（#level-picker 只有拼写模板有，其他模板无此节点）。 */
.is-adventure #scope-picker,.is-adventure #duo-toggle,.is-adventure #level-picker,.is-adventure #continuous-setup-help,.is-adventure #continuous-setup-next,.is-adventure #practice-help,.is-adventure #restart-btn,.is-adventure #retry-wrong-btn { display:none !important; }
.is-adventure .continuous-round-label {display:none;}
@media(max-width:600px){.adventure-ribbon{font-size:17px;padding:8px;}.adventure-ribbon .btn{font-size:16px;padding:8px;}.adventure-end{padding:16px;}.adventure-end .btn{display:block;}}
.is-adventure .game-header__meta {flex-wrap:wrap;gap:8px 16px;}
.is-adventure .adventure-ribbon {margin:0;padding:0;border:0;background:none;font-size:18px;flex-wrap:wrap;}
.is-adventure .adventure-ribbon .btn {min-height:44px;padding:6px 12px;font-size:17px;}
.adventure-batch-hint {display:block;font-size:14px;line-height:1.4;color:var(--text-secondary);font-weight:600;}

/* ============================================================
   14. 教师课堂教学助手（顶栏胶囊 / 抽号器 / Eyes on Me 定屏 / 计时器）
   ============================================================ */
.topbar-teacher-tools {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  min-height: 48px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  letter-spacing: -.2px;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              background-color var(--dur-fast) var(--ease-out);
}
.topbar-teacher-tools:hover { transform: translateY(-2px); border-color: var(--c-purple); background-color: var(--surface-hover); }
.topbar-teacher-tools:active { transform: translateY(1px); }
.topbar-teacher-tools .ico { --ico-size: 17px; --ico-stroke: 2.6; color: var(--c-purple); }
html[data-theme="dark"] .topbar-teacher-tools .ico { color: var(--c-purple-light); }
@media (max-width: 720px) {
  .topbar-teacher-tools span { display: none; }
}

.teacher-tools-backdrop {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 10);
  background: rgba(0, 0, 0, .45);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--dur-base) var(--ease-out);
}
.teacher-tools-backdrop.is-open {
  opacity: 1;
  pointer-events: auto;
}
.teacher-tools-card {
  width: min(650px, 94vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 28px;
  box-shadow: 0 24px 60px -12px rgba(22, 46, 16, .22), 0 6px 0 var(--border);
  padding: 22px 24px;
  transform: translateY(20px) scale(.96);
  transition: transform var(--dur-base) var(--ease-spring), opacity var(--dur-base);
}
html[data-theme="dark"] .teacher-tools-card {
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, .6), 0 6px 0 #0d1527;
}
.teacher-tools-backdrop.is-open .teacher-tools-card {
  transform: none;
}
.teacher-tools-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--border);
}
.teacher-tools-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}
.teacher-tools-brand-badge {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--grad-berry);
  display: grid;
  place-items: center;
  color: #fff;
  box-shadow: 0 6px 14px -3px rgba(206, 130, 255, .4);
}
.teacher-tools-brand-badge .ico { --ico-size: 22px; }
.teacher-tools-title-group {
  display: flex;
  flex-direction: column;
}
.teacher-tools-title {
  font-size: 20px;
  font-weight: var(--font-weight-black);
  color: var(--text);
  margin: 0;
  line-height: 1.25;
}
.teacher-tools-subtitle {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-tertiary);
  margin-top: 1px;
}
.teacher-tools-back {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text);
  transition: all var(--dur-fast) var(--ease-out);
}
.teacher-tools-back:hover {
  background: var(--surface-hover);
  border-color: var(--c-purple);
  color: var(--c-purple);
  transform: scale(1.05);
}
.teacher-tools-close {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: var(--radius-full);
  width: 44px; height: 44px; /* 一体机触屏：点击区不小于 44px */
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--dur-fast) var(--ease-out);
}
.teacher-tools-close:hover {
  background: var(--wrong-soft);
  color: var(--c-red);
  border-color: var(--c-red);
  transform: rotate(90deg) scale(1.06);
}

/* 课堂即时控场面板（对称双胶囊） */
.teacher-quick-panel {
  padding: 12px 14px;
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 20px;
  margin-bottom: 14px;
}
.teacher-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.teacher-quick-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: var(--font-weight-black);
  color: var(--c-orange-deep);
}
html[data-theme="dark"] .teacher-quick-badge {
  color: var(--c-orange-light);
}
.teacher-quick-hint {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-tertiary);
}
.teacher-quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.teacher-quick-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}
.teacher-quick-btn:hover {
  transform: translateY(-2px);
}
.teacher-quick-btn:active {
  transform: translateY(2px);
}
.teacher-quick-btn--freeze {
  background: linear-gradient(135deg, #ff9600 0%, #ff5e3a 100%);
  color: #fff;
  box-shadow: 0 4px 0 #cc5000, 0 8px 16px -4px rgba(255, 150, 0, .4);
}
.teacher-quick-btn--bell {
  background: linear-gradient(135deg, #ffc800 0%, #ffaa00 100%);
  color: var(--c-amber-ink);
  box-shadow: 0 4px 0 #cc8800, 0 8px 16px -4px rgba(255, 200, 0, .4);
}
.teacher-quick-btn__icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, .25);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.teacher-quick-btn__icon .ico { --ico-size: 18px; }
.teacher-quick-btn__info {
  display: flex;
  flex-direction: column;
}
.teacher-quick-btn__title {
  font-size: 14px;
  font-weight: var(--font-weight-black);
  line-height: 1.2;
}
.teacher-quick-btn__desc {
  font-size: 11px;
  opacity: .9;
  margin-top: 1px;
  white-space: nowrap;
}

/* 九宫格（3×3）随堂工具 */
.teacher-app-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 14px;
}
.teacher-app-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 4px 0 var(--border);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.teacher-app-card:hover {
  transform: translateY(-4px);
  border-color: var(--c-purple);
  box-shadow: 0 8px 20px -4px var(--shadow-color), 0 4px 0 var(--c-purple);
}
.teacher-app-card:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--c-purple);
}
.teacher-app-card__icon {
  width: 48px;
  height: 48px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  color: #fff;
  margin-bottom: 10px;
  box-shadow: 0 6px 12px -2px rgba(0, 0, 0, .14);
}
.teacher-app-card__icon .ico { --ico-size: 24px; }
.teacher-app-card__icon--purple { background: var(--grad-berry); }
.teacher-app-card__icon--green  { background: var(--grad-brand); }
.teacher-app-card__icon--orange { background: var(--grad-flame); }
.teacher-app-card__icon--blue   { background: var(--grad-ocean); }
.teacher-app-card__icon--pink   { background: var(--grad-candy); }
.teacher-app-card__icon--sun    { background: var(--grad-sunset); }

.teacher-app-card__title {
  font-size: 15px;
  font-weight: var(--font-weight-black);
  color: var(--text);
  margin-bottom: 3px;
}
.teacher-app-card__desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  line-height: 1.35;
}
.teacher-app-card__badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: var(--font-weight-black);
  border-radius: var(--radius-full);
}
.teacher-app-card__badge--purple { background: var(--c-purple-soft); color: var(--c-purple-deep); }
.teacher-app-card__badge--orange { background: var(--c-orange-soft); color: var(--c-orange-deep); }
.teacher-app-card__badge--blue   { background: var(--c-blue-soft); color: var(--c-blue-deep); }
.teacher-app-card__badge--pink   { background: var(--c-pink-soft); color: var(--c-pink-deep); }
.teacher-app-card__badge--green  { background: var(--c-green-soft); color: var(--c-green-deep); }
html[data-theme="dark"] .teacher-app-card__badge--purple { background: var(--c-purple-dense); color: var(--c-purple-light); }
html[data-theme="dark"] .teacher-app-card__badge--orange { background: var(--c-orange-dense); color: var(--c-orange-light); }
html[data-theme="dark"] .teacher-app-card__badge--blue   { background: var(--c-blue-dense); color: var(--c-blue-light); }
html[data-theme="dark"] .teacher-app-card__badge--pink   { background: var(--c-pink-dense); color: var(--c-pink-light); }
html[data-theme="dark"] .teacher-app-card__badge--green  { background: var(--c-green-dense); color: var(--c-green-light); }

/* 底部专属大屏应用横幅 */
.teacher-bigscreen-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.08) 0%, rgba(28, 176, 246, 0.08) 100%);
  border: 2px solid var(--border-strong);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-spring), border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.teacher-bigscreen-banner:hover {
  transform: translateY(-2px);
  border-color: var(--c-green);
  box-shadow: 0 8px 18px -4px var(--shadow-color);
  background: linear-gradient(135deg, rgba(88, 204, 2, 0.14) 0%, rgba(28, 176, 246, 0.14) 100%);
}
.teacher-bigscreen-banner__icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--grad-brand);
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(88, 204, 2, .3);
}
.teacher-bigscreen-banner__icon .ico { --ico-size: 22px; }
/* 多张整页工具横幅上下排列（打卡榜、扭蛋抽奖） */
.teacher-bigscreen-banner + .teacher-bigscreen-banner { margin-top: 10px; }
.teacher-bigscreen-banner__icon--pink { background: var(--grad-candy); box-shadow: 0 4px 10px rgba(255, 107, 157, .3); }
.teacher-bigscreen-banner__main {
  flex: 1;
  min-width: 0;
}
.teacher-bigscreen-banner__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 2px;
}
.teacher-bigscreen-banner__title {
  font-size: 15px;
  font-weight: var(--font-weight-black);
  color: var(--text);
}
.teacher-bigscreen-banner__desc {
  font-size: 11.5px;
  color: var(--text-tertiary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.teacher-bigscreen-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: var(--font-weight-black);
  border-radius: var(--radius-full);
  background: var(--c-green-soft);
  color: var(--c-green-deep);
}
html[data-theme="dark"] .teacher-bigscreen-tag {
  background: var(--c-green-dense);
  color: var(--c-green-light);
}
.teacher-bigscreen-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 7px 16px;
  /* 原 12px 白字压 --c-green（2.09:1）→ 14px 白字压 --c-green-deep（5.03:1） */
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  border-radius: var(--radius-full);
  border: none;
  background: var(--c-green-deep);
  color: var(--text-on-color);
  box-shadow: 0 3px 0 var(--c-green-dense);
  cursor: pointer;
  flex-shrink: 0;
}
html[data-theme="dark"] .teacher-bigscreen-banner__btn {
  background: var(--c-green-deep);
  color: var(--text-on-color);
  box-shadow: 0 3px 0 #0d1527;
}

/* 抽号器卡片与展示舞台 */
.lucky-pick-box {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}
.lucky-pick-modes-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  width: 100%;
}
.lucky-source-banner {
  margin-top: 10px;
  width: 100%;
  padding: 8px 14px;
  font-size: 12.5px;
  color: var(--text-secondary);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  text-align: center;
}
.lucky-source-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: var(--font-weight-black);
  border-radius: var(--radius-full);
  background: var(--c-blue-soft);
  color: var(--c-blue-deep);
  margin-right: 4px;
}
.lucky-source-tag--green  { background: var(--c-green-soft); color: var(--c-green-deep); }
.lucky-source-tag--purple { background: var(--c-purple-soft); color: var(--c-purple-deep); }
html[data-theme="dark"] .lucky-source-tag { background: var(--c-blue-dense); color: var(--c-blue-light); }
html[data-theme="dark"] .lucky-source-tag--green { background: var(--c-green-dense); color: var(--c-green-light); }
html[data-theme="dark"] .lucky-source-tag--purple { background: var(--c-purple-dense); color: var(--c-purple-light); }

.lucky-pick-input {
  width: 72px;
  padding: 5px 8px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  text-align: center;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
}
.lucky-pick-mode {
  display: flex;
  gap: 4px;
  background: var(--surface);
  padding: 4px;
  border-radius: 14px;
  border: 2px solid var(--border);
}
.lucky-pick-mode-btn {
  padding: 6px 12px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-extrabold);
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all var(--dur-fast);
}
.lucky-pick-mode-btn .ico { --ico-size: 14px; }
.lucky-pick-mode-btn.is-active {
  background: var(--c-purple);
  color: #fff;
  box-shadow: 0 2px 6px rgba(206, 130, 255, .4);
}
.lucky-pick-display {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  padding: 24px 16px;
  min-height: 120px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 20px;
  margin: 14px 0;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .04);
}
.lucky-pick-target {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.lucky-pick-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}
.lucky-pick-label--red { background: var(--wrong-soft); color: var(--c-red-dark); }
.lucky-pick-label--blue { background: var(--c-blue-soft); color: var(--c-blue-deep); }
.lucky-pick-label--solo { background: var(--c-purple-soft); color: var(--c-purple-deep); }
html[data-theme="dark"] .lucky-pick-label--red { background: var(--c-red-dense); color: var(--c-red-light); }
html[data-theme="dark"] .lucky-pick-label--blue { background: var(--c-blue-dense); color: var(--c-blue-light); }
html[data-theme="dark"] .lucky-pick-label--solo { background: var(--c-purple-dense); color: var(--c-purple-light); }
.lucky-pick-num {
  font-size: 44px;
  font-weight: var(--font-weight-black);
  font-family: var(--font-display);
  color: var(--text);
  min-width: 120px;
  text-align: center;
  white-space: nowrap;
}
.lucky-pick-num.is-rolling {
  color: var(--c-purple);
  animation: pulseSoft .3s infinite;
}
.lucky-pick-num.is-hit {
  animation: pop .5s var(--ease-spring);
  color: var(--c-green-dark);
}
html[data-theme="dark"] .lucky-pick-num.is-hit {
  color: var(--c-green-light);
}
.lucky-main-roll-btn {
  flex: 1;
  min-width: 180px;
  font-size: 16px;
  padding: 12px;
}

/* 计时器按键立体升级 */
.teacher-timer-btn {
  min-width: 100px;
  font-weight: var(--font-weight-black);
  border-radius: 16px;
  box-shadow: 0 4px 0 var(--border);
}
.teacher-timer-btn:hover {
  border-color: var(--c-green);
  color: var(--c-green-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--c-green-dark);
}

/* 互动骰子舞台与 3D 点数 */
.teacher-dice-box {
  text-align: center;
}
.dice-sum-badge {
  font-size: 13px;
  font-weight: var(--font-weight-black);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  background: var(--c-yellow-soft);
  color: var(--c-amber-ink);
  border: 1.5px solid var(--c-yellow);
}
html[data-theme="dark"] .dice-sum-badge {
  background: var(--c-yellow-dense);
  color: var(--c-yellow-light);
}
.teacher-dice-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  min-height: 130px;
  padding: 16px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .04);
}
.momo-dice-cube {
  width: 68px;
  height: 68px;
  background: #ffffff;
  border: 2.5px solid #d5e2cd;
  border-radius: 18px;
  box-shadow: 0 6px 0 #b8caa9, 0 12px 20px rgba(0, 0, 0, .08);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  padding: 8px;
  position: relative;
  transition: transform .2s var(--ease-spring);
}
html[data-theme="dark"] .momo-dice-cube {
  background: #1f2c4a;
  border-color: #314470;
  box-shadow: 0 6px 0 #141e33, 0 12px 20px rgba(0, 0, 0, .4);
}
.momo-dice-cube.is-rolling {
  animation: diceRoll .3s infinite;
}
@keyframes diceRoll {
  0%   { transform: translateY(0) rotate(0deg) scale(1); }
  25%  { transform: translateY(-8px) rotate(-15deg) scale(1.06); }
  50%  { transform: translateY(-12px) rotate(15deg) scale(1.08); }
  75%  { transform: translateY(-4px) rotate(-10deg) scale(1.04); }
  100% { transform: translateY(0) rotate(0deg) scale(1); }
}
.dice-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #1c2b46;
  place-self: center;
}
html[data-theme="dark"] .dice-dot {
  background: #89e219;
}
/* 红心一点 */
.momo-dice-cube--v1 .dice-dot {
  width: 20px;
  height: 20px;
  background: #ff4b4b;
}
/* 九宫格点位映射 */
.dice-dot.dot-c  { grid-area: 2 / 2; }
.dice-dot.dot-tl { grid-area: 1 / 1; }
.dice-dot.dot-tr { grid-area: 1 / 3; }
.dice-dot.dot-ml { grid-area: 2 / 1; }
.dice-dot.dot-mr { grid-area: 2 / 3; }
.dice-dot.dot-bl { grid-area: 3 / 1; }
.dice-dot.dot-br { grid-area: 3 / 3; }

/* 课堂喝彩盒子（4 大糖果按键） */
.teacher-cheer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.teacher-cheer-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 14px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--border);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  transition: transform var(--dur-fast) var(--ease-spring), box-shadow var(--dur-fast);
}
.teacher-cheer-btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px -4px var(--shadow-color);
}
.teacher-cheer-btn:active,
.teacher-cheer-btn.is-active {
  transform: translateY(2px) scale(.97);
}
.teacher-cheer-btn--applause:hover { border-color: var(--c-orange); box-shadow: 0 8px 20px -4px var(--shadow-color), 0 4px 0 var(--c-orange); }
.teacher-cheer-btn--fanfare:hover  { border-color: var(--c-purple); box-shadow: 0 8px 20px -4px var(--shadow-color), 0 4px 0 var(--c-purple); }
.teacher-cheer-btn--drum:hover     { border-color: var(--c-blue); box-shadow: 0 8px 20px -4px var(--shadow-color), 0 4px 0 var(--c-blue); }
.teacher-cheer-btn--ding:hover     { border-color: var(--c-green); box-shadow: 0 8px 20px -4px var(--shadow-color), 0 4px 0 var(--c-green); }

.teacher-cheer-btn__icon {
  font-size: 34px;
  line-height: 1;
  margin-bottom: 8px;
}
.teacher-cheer-btn__title {
  font-size: 16px;
  font-weight: var(--font-weight-black);
  color: var(--text);
  margin-bottom: 3px;
}
.teacher-cheer-btn__sub {
  font-size: 11.5px;
  color: var(--text-tertiary);
}

/* 小组积分榜 */
.group-points-box {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: var(--space-md);
}
.group-teams-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 14px 0;
}
.group-team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 14px;
  border-radius: 18px;
  border: 2px solid var(--border);
  background: var(--surface);
  box-shadow: 0 4px 0 var(--border);
}
.group-team-card--red { border-top: 6px solid var(--c-red); }
.group-team-card--blue { border-top: 6px solid var(--c-blue); }
.group-team-score {
  font-size: 44px;
  font-weight: var(--font-weight-black);
  font-family: var(--font-display);
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}
.group-team-score .ico { color: var(--c-yellow); }

/* 说课教案速查卡片 */
.lesson-plan-card {
  background: var(--surface-2);
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: var(--space-md);
  font-size: var(--font-size-sm);
  line-height: 1.6;
}
.lesson-plan-block {
  background: var(--surface);
  border-left: 4px solid var(--c-purple);
  padding: 12px 16px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: 10px 0 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.03);
}

/* 九宫格顶部提示行（原「课堂即时控场」双胶囊已并入九宫格：定屏、铃铛成为普通卡片） */
.teacher-grid-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
/* 说课速查：备课用，放九宫格最后并降为中性色 */
.teacher-app-card__badge--neutral { background: var(--surface-3); color: var(--text-secondary); }
html[data-theme="dark"] .teacher-app-card__badge--neutral { background: var(--surface-3); color: var(--text-secondary); }
.teacher-app-card__icon--slate { background: var(--surface-3); color: var(--text-secondary); box-shadow: none; }
html[data-theme="dark"] .teacher-app-card__icon--slate { background: var(--surface-3); color: var(--text-secondary); }

/* 九宫格三行 + 打卡横幅：768 高投影下收紧卡片内边距，保证一屏放下不用滚 */
@media (max-height: 820px) {
  .teacher-tools-card { padding: 16px 22px; }
  .teacher-tools-header { margin-bottom: 10px; padding-bottom: 10px; }
  .teacher-app-grid { gap: 10px; margin-bottom: 10px; }
  .teacher-app-card { padding: 10px 14px; }
  .teacher-app-card__icon { width: 40px; height: 40px; border-radius: 13px; margin-bottom: 6px; }
  .teacher-app-card__icon .ico { --ico-size: 21px; }
}

/* ---- 全班跟读（view-readaloud）：投影大字，英文 ≥64px（大屏） ---- */
.teacher-tools-card.is-wide { width: min(1120px, 96vw); max-height: 94vh; }
.readaloud-box { display: flex; flex-direction: column; gap: 14px; }
.readaloud-box [hidden] { display: none !important; }
.readaloud-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.readaloud-progress {
  padding: 4px 16px;
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--font-weight-black);
  font-variant-numeric: tabular-nums;
  background: var(--c-blue-soft);
  color: var(--c-blue-deep);
}
html[data-theme="dark"] .readaloud-progress { background: var(--c-blue-dense); color: var(--c-blue-light); }
.readaloud-scope {
  flex: 1;
  min-width: 0;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
}
.readaloud-order .lucky-pick-mode-btn { font-size: var(--font-size-sm); min-height: 44px; padding: 6px 14px; }
.readaloud-stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "text" "count";
  align-items: center;
  justify-items: center;
  gap: 12px 28px;
  min-height: clamp(280px, 44vh, 480px);
  padding: 24px 28px;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  border-radius: 24px;
  box-shadow: inset 0 3px 8px rgba(0, 0, 0, .04);
  text-align: center;
}
.readaloud-stage.has-img {
  grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr);
  grid-template-areas: "img text" "img count";
}
.readaloud-img {
  grid-area: img;
  width: 100%;
  max-width: 380px;
  max-height: 40vh;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  border-radius: 18px;
}
.readaloud-text { grid-area: text; min-width: 0; max-width: 100%; }
.readaloud-word {
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 132px);
  font-weight: var(--font-weight-black);
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--text);
  overflow-wrap: anywhere;
}
.readaloud-stage.has-img .readaloud-word { font-size: clamp(64px, 6.4vw, 112px); }
.readaloud-word.is-long,
.readaloud-stage.has-img .readaloud-word.is-long { font-size: clamp(64px, 5.4vw, 96px); }
.readaloud-cn {
  margin-top: 10px;
  font-size: clamp(28px, 3vw, 46px);
  font-weight: var(--font-weight-extrabold);
  color: var(--text-secondary);
}
.readaloud-stage.is-done .readaloud-word { color: var(--c-green-deep); }
html[data-theme="dark"] .readaloud-stage.is-done .readaloud-word { color: var(--c-green-light); }
/* 倒数牌：常驻占位（is-idle 只隐藏不收起），播放时不跳版 */
.readaloud-count {
  grid-area: count;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 8px 22px;
  border-radius: var(--radius-full);
  border: 3px solid var(--c-orange);
  background: var(--c-orange-soft);
  color: var(--c-orange-deep);
}
html[data-theme="dark"] .readaloud-count { background: var(--c-orange-dense); color: var(--c-orange-light); border-color: var(--c-orange-deep); }
.readaloud-count.is-idle { visibility: hidden; }
.readaloud-count__num {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: var(--font-weight-black);
  line-height: 1;
  min-width: 1.4em;
  font-variant-numeric: tabular-nums;
}
.readaloud-count__label { font-size: 24px; font-weight: var(--font-weight-black); }
.readaloud-count.is-go {
  border-color: var(--c-green);
  background: var(--c-green-soft);
  color: var(--c-green-deep);
  animation: pop .45s var(--ease-spring);
}
html[data-theme="dark"] .readaloud-count.is-go { background: var(--c-green-dense); color: var(--c-green-light); border-color: var(--c-green-deep); }
.readaloud-actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.readaloud-actions .btn { min-width: 180px; min-height: 60px; font-size: 20px; }
.readaloud-tip {
  margin: 0;
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--text-secondary);
}
.readaloud-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 28px 18px;
  border-radius: 20px;
  background: var(--c-blue-soft);
  color: var(--c-blue-deep);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-extrabold);
  text-align: center;
}
.readaloud-empty .ico { --ico-size: 24px; flex-shrink: 0; }
html[data-theme="dark"] .readaloud-empty { background: var(--c-blue-dense); color: var(--c-blue-light); }
@media (max-width: 600px) {
  .readaloud-stage, .readaloud-stage.has-img {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "img" "text" "count";
    min-height: 0;
    padding: 16px;
  }
  .readaloud-img { max-width: 220px; max-height: 26vh; }
  .readaloud-order { margin-left: auto; }
  .readaloud-scope { order: 3; flex-basis: 100%; }
  /* 手机不是投影场景：64px 放不下 grandmother，按屏宽缩 */
  .readaloud-word, .readaloud-stage.has-img .readaloud-word,
  .readaloud-word.is-long, .readaloud-stage.has-img .readaloud-word.is-long { font-size: clamp(36px, 11vw, 56px); }
  .readaloud-cn { font-size: 24px; }
  .readaloud-count__num { font-size: 40px; }
  .readaloud-count__label { font-size: 20px; }
  .readaloud-actions .btn { flex: 1 1 100%; min-width: 0; min-height: 52px; font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .readaloud-count.is-go { animation: none; }
}

.momo-freeze-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(15, 17, 21, .88);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl);
  color: #fff;
  cursor: pointer;
  animation: fadeIn .25s var(--ease-out);
}
.momo-freeze-card {
  background: rgba(255, 255, 255, .1);
  border: 3px solid rgba(255, 255, 255, .25);
  border-radius: var(--radius-2xl);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .4);
  transform: scale(1);
  transition: transform .2s var(--ease-spring);
}
.momo-freeze-card:hover {
  transform: scale(1.02);
}
.momo-freeze-icon {
  width: 88px; height: 88px;
  border-radius: var(--radius-full);
  background: var(--c-yellow);
  color: var(--c-yellow-deep);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 28px rgba(255, 193, 7, .4);
}
.momo-freeze-icon .ico { --ico-size: 48px; }
.momo-freeze-title {
  font-size: 38px;
  font-weight: 900;
  margin: 0;
  letter-spacing: -.5px;
  color: #fff;
}
.momo-freeze-sub {
  font-size: 22px;
  font-weight: 700;
  color: rgba(255, 255, 255, .85);
  margin: 0;
}
.momo-freeze-tip {
  margin-top: 12px;
  font-size: 15px;
  color: rgba(255, 255, 255, .6);
  background: rgba(255, 255, 255, .12);
  padding: 6px 16px;
  border-radius: var(--radius-full);
}

.momo-mini-timer {
  position: fixed;
  top: 72px;
  right: var(--space-lg);
  z-index: var(--z-sticky);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  background: var(--surface);
  border: 3px solid var(--c-purple);
  border-radius: var(--radius-full);
  box-shadow: var(--elev-3), var(--glow-purple);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  color: var(--text);
  animation: pop .3s var(--ease-spring);
}
.momo-mini-timer.is-done {
  border-color: var(--c-green);
  box-shadow: var(--elev-3), var(--glow-green);
  animation: bounceY 1.2s infinite;
}
.momo-mini-timer-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  display: grid;
  place-items: center;
  padding: 2px;
}

/* ============================================================
   15. 小组打卡 PK 榜（教学百宝箱应用，全屏大屏模式）
   说明：班级名单来自 MomoClassRoster，打卡状态单独存，
        所以改名单不会冲掉当天的记录。
   ============================================================ */
body.ckb-open { overflow: hidden; }

.ckb-root {
  position: fixed;
  inset: 0;
  z-index: 999998;
  /* --bg-app 只是几层半透明光斑，必须叠在 --bg-base 底色之上，
     否则整块浮层是透视的（首页/课件会从底下透出来）。 */
  background-color: var(--bg-base);
  background-image: var(--bg-app);
  color: var(--text);
  display: flex;
  flex-direction: column;
  animation: fadeIn .2s var(--ease-out);
}

/* ---- 顶栏 ---- */
.ckb-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 尽量一行放下（1366/1280 投影），实在放不下才折行 */
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px var(--space-md);
  background: var(--surface);
  border-bottom: 3px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.ckb-top__left,
.ckb-top__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ckb-title {
  margin: 0;
  font-size: clamp(17px, 1.5vw, 22px);
  font-weight: var(--font-weight-black);
  color: var(--text);
  letter-spacing: var(--tracking-tight);
  white-space: nowrap;
}
.ckb-date {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  /* 原白字压 --c-green 2.09:1 → --c-green-deep 5.03:1；字号 14px（--font-size-xs） */
  background: var(--c-green-deep);
  color: var(--text-on-color);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
}
html[data-theme="dark"] .ckb-date {
  background: var(--c-green-deep);
  color: var(--text-on-color);
}
.ckb-badge {
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--c-orange-soft);
  color: var(--c-orange-deep);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
}
html[data-theme="dark"] .ckb-badge {
  background: var(--c-orange-dense);
  color: var(--c-orange-light);
}

/* ---- 通用按钮 ---- */
.ckb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-extrabold);
  cursor: pointer;
  box-shadow: 0 3px 0 var(--btn-border-bottom);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast);
}
.ckb-btn:hover { background: var(--surface-hover); }
.ckb-btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-border-bottom); }
.ckb-btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.ckb-btn--green { background: var(--c-green); border-color: var(--c-green-dark); color: var(--text-on-color); box-shadow: 0 3px 0 var(--c-green-dark); }
.ckb-btn--green:hover { background: var(--c-green-hover); }
.ckb-btn--yellow { background: var(--c-yellow); border-color: var(--c-yellow-dark); color: var(--c-amber-ink); box-shadow: 0 3px 0 var(--c-yellow-dark); }
.ckb-btn--yellow:hover { background: var(--c-yellow-hover); }
.ckb-btn--red { background: var(--c-red); border-color: var(--c-red-dark); color: var(--text-on-color); box-shadow: 0 3px 0 var(--c-red-dark); }
.ckb-btn--gray { color: var(--text-secondary); }
.ckb-btn--ghost { background: transparent; }
.ckb-btn--wide { width: 100%; justify-content: center; margin-top: 10px; }
.ckb-icon-btn {
  width: 40px; height: 40px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.ckb-icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.ckb-mini {
  width: 22px; height: 22px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  padding: 0;
}
.ckb-mini:hover { color: var(--c-purple); background: var(--surface-hover); }
.ckb-mini .ico { --ico-size: 15px; }

/* ---- 顶栏统计 ---- */
.ckb-stat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  white-space: nowrap;
}
@media (max-width: 1400px) {
  /* 矮屏投影：统计条只留数字，标签让位给按钮 */
  .ckb-stat__label { display: none; }
  .ckb-bar { width: 72px; }
}
@media (max-width: 1240px) {
  /* 更窄的窗口：顶栏按钮只留图标（tooltip 仍在），保证顶栏始终一行 */
  .ckb-top .ckb-btn span { display: none; }
  .ckb-top .ckb-btn { padding: 8px 10px; }
}
.ckb-stat__label { font-size: var(--font-size-xs); font-weight: var(--font-weight-black); color: var(--text-tertiary); }
.ckb-stat__num { font-size: var(--font-size-sm); font-weight: var(--font-weight-black); color: var(--text-secondary); }
.ckb-stat__num b { font-size: var(--font-size-lg); color: var(--c-green-deep); }
html[data-theme="dark"] .ckb-stat__num b { color: var(--c-green-light); }
.ckb-bar {
  display: block;
  width: 90px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--surface-sunken);
  overflow: hidden;
}
.ckb-bar i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: var(--radius-full);
  background: var(--c-green);
  transition: width var(--dur-base) var(--ease-out);
}
.ckb-bar--group { width: 100%; height: 8px; margin-top: 6px; }
.ckb-streak {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--c-yellow-dark);
  background: var(--c-yellow-soft);
  color: var(--c-amber-ink);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-black);
  cursor: pointer;
}
html[data-theme="dark"] .ckb-streak {
  background: var(--c-yellow-dense);
  color: var(--c-yellow-light);
}
.ckb-streak .ico { --ico-size: 16px; }

/* ---- 主体两栏 ---- */
.ckb-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 24vw, 380px);
  gap: var(--space-lg);
  padding: var(--space-lg);
  overflow: hidden;
}
.ckb-main { display: flex; flex-direction: column; min-height: 0; }
.ckb-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  margin-bottom: var(--space-sm);
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
}
.ckb-search {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background: var(--surface-2);
  border: 2px solid var(--border);
  color: var(--text-tertiary);
}
.ckb-search input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  width: 110px;
}
.ckb-filters { display: inline-flex; gap: 4px; }
.ckb-chip {
  padding: 5px 12px;
  border-radius: var(--radius-full);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  cursor: pointer;
}
.ckb-chip.is-on { background: var(--c-green); border-color: var(--c-green-dark); color: var(--text-on-color); }
.ckb-hint { font-size: var(--font-size-xs); color: var(--text-tertiary); margin-left: auto; }
/* 窗口窄时先让位给搜索与筛选，别把提示文字截成半句 */
@media (max-width: 1440px) {
  .ckb-hint { display: none; }
}

/* ---- 小组卡片 ---- */
.ckb-groups {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  /* 列数由 checkin-board.js 的 applyColumns() 按小组数写在行内样上（auto-fill 会留空轨道），
     这里只兜底：脚本没跑起来时也不至于挤成一条 */
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  /* 组少时把纵向空间铺开，组多时自然滚动 */
  grid-auto-rows: minmax(min-content, 1fr);
  gap: 14px;
  align-content: stretch;
  padding-right: 4px;
}
.ckb-group {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-fast), background-color var(--dur-fast);
}
.ckb-group.is-done {
  border-color: var(--c-green);
  background: var(--correct-soft);
}
.ckb-group__head { display: flex; align-items: center; gap: 8px; }
.ckb-group__name {
  margin: 0;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
  color: var(--text);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ckb-group__count { font-size: var(--font-size-xs); font-weight: var(--font-weight-black); color: var(--text-secondary); }
.ckb-dot {
  width: 10px; height: 10px;
  border-radius: var(--radius-full);
  background: var(--c-blue);
  flex-shrink: 0;
}
.ckb-group.is-done .ckb-dot { background: var(--c-green); }
.ckb-students {
  flex: 1;
  /* 单列：名字要一眼看清（双列会把三字姓名挤成「宋…」），
     横向富余靠卡片变宽 + 名字居中留白来消化。 */
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}
/*
  姓名行是「固定列 + 姓名列 1fr」的网格，不是 flex：
  列宽写死（姓名 / 组长位 / 编辑 / 勾选），组长位空着也占位，
  这样每一行的姓名可用宽度、字号完全一致 —— 卡片变窄时是整体一起变窄，
  不会出现「有组长徽章的那行名字被挤掉、字号还和别人不一样」。
*/
.ckb-stu {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 18px 22px 26px;
  align-items: center;
  gap: 5px;
  min-height: 42px;
  padding: 6px 9px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-soft);
  background: var(--surface-2);
  cursor: pointer;
  transition: background-color var(--dur-fast), border-color var(--dur-fast), transform var(--dur-fast);
}
/* 空小组的占位行：不可点、不显示勾选框 */
.ckb-stu--empty {
  display: block;
  color: var(--text-tertiary);
  font-size: var(--font-size-sm);
  cursor: default;
  border-style: dashed;
}
.ckb-stu--empty:hover { background: var(--surface-2); }
.ckb-stu:hover { background: var(--surface-hover); }
.ckb-stu.is-done {
  background: var(--correct-soft);
  border-color: var(--c-green);
}
.ckb-stu.is-hit { outline: 3px solid var(--c-yellow); }
/* 全屏统一字号：所有小组、所有行都用 base（不再是「人多的小组缩小一档」） */
.ckb-stu__name {
  min-width: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  line-height: 1.25;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ckb-stu.is-done .ckb-stu__name { text-decoration: line-through; color: var(--text-secondary); }
/* 组长只留一个皇冠（带 title 提示），把宽度让给姓名 */
.ckb-stu__tag {
  display: grid;
  place-items: center;
  color: var(--c-yellow-dark);
}
.ckb-stu__tag .ico { --ico-size: 14px; }
html[data-theme="dark"] .ckb-stu__tag { color: var(--c-yellow); }
.ckb-stu__tag--empty { visibility: hidden; }
.ckb-check {
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--surface);
  color: transparent;
}
.ckb-stu.is-done .ckb-check {
  background: var(--c-green);
  border-color: var(--c-green-dark);
  color: var(--text-on-color);
}
.ckb-check.is-pop { animation: pop .32s var(--ease-spring); }
.ckb-group__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* 卡片被拉高时，操作行贴住卡片底部，视觉上不悬空 */
  margin-top: auto;
  padding-top: 10px;
  border-top: 2px dashed var(--border-soft);
}
.ckb-links { display: inline-flex; gap: 10px; }
.ckb-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-family: inherit;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  cursor: pointer;
}
.ckb-link:hover { color: var(--c-green-deep); }
.ckb-link .ico { --ico-size: 13px; }
/* 次要操作（全部打卡 / 本组重置）只留图标 + tooltip，宽度不够时也不会挤成两行 */
.ckb-link--icon .ckb-link-text { display: none; }
.ckb-link--icon .ico { --ico-size: 15px; }

/* ---- 右侧排行 ---- */
.ckb-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
}
.ckb-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.ckb-card__head { display: flex; align-items: center; gap: 8px; }
.ckb-card__head h3 {
  margin: 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-black);
  color: var(--text);
}
.ckb-card__head .ico { --ico-size: 20px; color: var(--c-yellow-dark); }
.ckb-card__sub { margin: 4px 0 10px; font-size: var(--font-size-xs); color: var(--text-tertiary); }
/* 实时榜卡片吃掉侧栏剩余高度，行多了自己滚 */
.ckb-card:first-child { display: flex; flex-direction: column; min-height: 0; }
.ckb-rank {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ckb-rank__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border-soft);
  background: var(--surface-2);
}
.ckb-rank__row.is-done { background: var(--correct-soft); border-color: var(--c-green); }
.ckb-rank__icon { display: grid; place-items: center; width: 22px; }
.ckb-rank__icon .ico { --ico-size: 18px; }
.ckb-rank__icon--gold .ico { color: var(--c-yellow-dark); }
.ckb-rank__icon--silver .ico { color: var(--color-gray-400); }
.ckb-rank__icon--bronze .ico { color: var(--c-orange-dark); }
.ckb-rank__no { width: 22px; text-align: center; font-size: var(--font-size-xs); font-weight: var(--font-weight-black); color: var(--text-tertiary); }
.ckb-rank__info { flex: 1; min-width: 0; }
.ckb-rank__name { font-size: var(--font-size-base); font-weight: var(--font-weight-black); color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ckb-rank__sub { font-size: var(--font-size-xs); font-weight: var(--font-weight-bold); color: var(--text-tertiary); }
.ckb-rank__pct { font-size: var(--font-size-base); font-weight: var(--font-weight-black); color: var(--c-blue-deep); }
html[data-theme="dark"] .ckb-rank__pct { color: var(--c-blue-light); }
.ckb-rank__ok { --ico-size: 16px; color: var(--c-green-dark); }
html[data-theme="dark"] .ckb-rank__ok { color: var(--c-green-light); }
.ckb-card--chest { display: flex; flex-direction: column; gap: 10px; }
.ckb-chest { display: flex; align-items: center; gap: 10px; }
.ckb-chest__icon {
  width: 42px; height: 42px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: var(--radius-md);
  background: var(--c-yellow-soft);
  color: var(--c-amber-ink);
}
html[data-theme="dark"] .ckb-chest__icon { background: var(--c-yellow-dense); color: var(--c-yellow-light); }
.ckb-chest__icon .ico { --ico-size: 22px; }
.ckb-chest__title { font-size: var(--font-size-sm); font-weight: var(--font-weight-black); color: var(--text); }
.ckb-chest__desc { font-size: 11px; font-weight: var(--font-weight-bold); color: var(--text-tertiary); line-height: 1.35; }

/* ---- 空状态 ---- */
.ckb-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 20px;
  text-align: center;
  background: var(--surface);
  border: 3px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
}
.ckb-empty .ico { --ico-size: 40px; color: var(--c-purple); }
.ckb-empty h3 { margin: 0; font-size: var(--font-size-lg); font-weight: var(--font-weight-black); color: var(--text); }
.ckb-empty p { margin: 0; max-width: 420px; font-size: var(--font-size-sm); line-height: 1.6; }
.ckb-empty__sm { margin: 4px 0; font-size: var(--font-size-xs); color: var(--text-tertiary); }
.ckb-empty__acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; margin-top: 4px; }

/* ---- 弹窗 ---- */
.ckb-mask {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: rgba(0, 0, 0, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.ckb-dialog {
  width: min(520px, 94vw);
  max-height: 86vh;
  overflow-y: auto;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--elev-3);
  padding: var(--space-lg);
  animation: pop .25s var(--ease-spring);
}
.ckb-dlg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.ckb-dlg__head h3 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-black);
  color: var(--text);
}
.ckb-dlg__hint { margin: 0 0 10px; font-size: var(--font-size-xs); color: var(--text-tertiary); line-height: 1.6; }
.ckb-dlg__row { display: flex; gap: 10px; margin-top: 12px; }
.ckb-dlg__row .ckb-btn { flex: 1; justify-content: center; }
.ckb-presets { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 14px; }
.ckb-preset {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.ckb-preset:hover { border-color: var(--c-green); background: var(--correct-soft); }
.ckb-preset b { font-size: var(--font-size-sm); font-weight: var(--font-weight-black); }
.ckb-preset span { font-size: 11px; color: var(--text-tertiary); }
.ckb-field { display: block; margin-bottom: 10px; }
.ckb-field > span {
  display: block;
  margin-bottom: 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  color: var(--text-secondary);
}
.ckb-field input,
.ckb-field select {
  width: 100%;
  padding: 9px 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  outline: none;
}
.ckb-field input:focus,
.ckb-field select:focus { border-color: var(--c-purple); }
.ckb-field--inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ckb-field--inline select { width: auto; }
.ckb-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ckb-textarea {
  width: 100%;
  min-height: 150px;
  padding: 12px;
  border-radius: var(--radius-md);
  border: 2px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: var(--font-size-sm);
  line-height: 1.7;
  resize: vertical;
  margin-bottom: 10px;
  outline: none;
}
.ckb-textarea:focus { border-color: var(--c-purple); }
.ckb-checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 12px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  cursor: pointer;
}
.ckb-checkline input { width: 18px; height: 18px; }
.ckb-cheer { text-align: center; }
.ckb-cheer__icon {
  width: 76px; height: 76px;
  margin: 4px auto 12px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-full);
  background: var(--correct-soft);
  color: var(--c-green-deep);
}
html[data-theme="dark"] .ckb-cheer__icon { color: var(--c-green-light); }
.ckb-cheer__icon .ico { --ico-size: 40px; }
.ckb-cheer h3 { margin: 0 0 6px; font-size: var(--font-size-xl); font-weight: var(--font-weight-black); color: var(--text); }
.ckb-cheer p { margin: 0; font-size: var(--font-size-sm); color: var(--text-secondary); }

/* ---- 打卡飘字 ---- */
@keyframes ckbFloatUp {
  0% { transform: translateY(0) scale(.85); opacity: 1; }
  100% { transform: translateY(-30px) scale(1.1); opacity: 0; }
}
.ckb-xp {
  position: fixed;
  z-index: 999999;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  background: var(--c-yellow);
  color: var(--c-amber-ink);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-black);
  pointer-events: none;
  animation: ckbFloatUp .7s var(--ease-out) forwards;
}

@media (max-width: 960px) {
  .ckb-body { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .ckb-side { overflow: visible; }
  .ckb-main { overflow: visible; }
  .ckb-groups { overflow: visible; }
  .ckb-hint { display: none; }
}
/* Media readiness feedback shared by opt-in classroom games. */
.question-loading{padding:12px 18px;margin:8px 0;border:1px solid var(--border);border-radius:14px;background:var(--surface);color:var(--text);text-align:center;font-size:18px}
.question-loading button{margin:8px;min-height:44px}
[aria-busy="true"] .option-card:disabled,[aria-busy="true"] .match-item:disabled{opacity:.6;cursor:wait}

/* 试用期提示条 / 到期拦截页（只在 /trial/ 渠道由 src/common/js/trial-guard.js 插入） */
.momo-trial-bar{position:fixed;left:0;right:0;bottom:0;z-index:calc(var(--z-modal) - 1);display:flex;align-items:center;justify-content:center;gap:12px;flex-wrap:wrap;padding:10px 16px;background:#3c3c3c;color:#fff;font-size:14px;line-height:1.5;box-shadow:0 -4px 16px rgba(0,0,0,.16)}
.momo-trial-bar__cta{color:#ffd43b;font-weight:800;text-decoration:none;white-space:nowrap}
.momo-trial-bar__cta:hover{text-decoration:underline}
/* 提示条是常驻底栏：给正文让出高度，并把「回到顶部」抬到条上方，避免遮挡弹层/操作按钮。 */
body.momo-trial-bar-on{padding-bottom:56px}
body.momo-trial-bar-on .to-top{bottom:80px}
.momo-trial-gate{position:fixed;inset:0;z-index:2147483000;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(255,255,255,.96);font-family:inherit}
.momo-trial-gate__card{width:min(460px,90vw);padding:32px;border-radius:22px;background:#fff;border:2px solid #e5e5e5;box-shadow:0 16px 40px rgba(0,0,0,.12);text-align:center}
.momo-trial-gate__title{margin:0 0 12px;font-size:24px;font-weight:900;color:#3c3c3c}
.momo-trial-gate__desc{margin:0 0 22px;font-size:15px;line-height:1.7;color:#6b6b6b}
[data-theme="dark"] .momo-trial-gate{background:rgba(20,21,24,.96)}
[data-theme="dark"] .momo-trial-gate__card{background:#1f2024;border-color:#33353c;box-shadow:none}
[data-theme="dark"] .momo-trial-gate__title{color:#f2f2f2}
[data-theme="dark"] .momo-trial-gate__desc{color:#a3a3a3}
