/* 日式漫画 / 少年志风格：纸张、网点、墨线、赤色强调 */
:root {
  --ink: #141010;
  --ink-soft: #2c2420;
  --paper: #faf6f0;
  --paper-2: #f2e8dc;
  --bg: var(--paper);
  --surface: #fffefb;
  --surface-2: #fff5eb;
  /* 更“网站化”的分隔：弱化粗黑描边，更多依赖留白/阴影/背景层级 */
  --border: rgba(20, 16, 16, 0.22);
  --border-soft: rgba(20, 16, 16, 0.14);
  --text: var(--ink);
  --text-secondary: #4a3f3a;
  --muted: #6b5e56;
  --accent: #e60012;
  --accent-hover: #bf0010;
  --accent-light: #ffd7dc;
  --accent-muted: rgba(230, 0, 18, 0.12);
  --tone-blue: #1e4ed8;
  --tone-violet: #6d28d9;
  --success: #15803d;
  --danger: #b91c1c;
  --radius: 8px;
  --radius-lg: 16px;
  --panel-radius: 4px 18px 4px 18px;
  --shadow-sm: 0 10px 24px rgba(20, 16, 16, 0.08);
  --shadow-md: 0 14px 34px rgba(20, 16, 16, 0.1);
  --shadow-lg: 0 18px 48px rgba(20, 16, 16, 0.12);
  --shadow-xl: 0 22px 64px rgba(20, 16, 16, 0.14);
  --shadow-stamp: 0 14px 36px rgba(20, 16, 16, 0.16);
  /*
   * 字体栈：中文必须以「完整简中覆盖」的字体优先。
   * 为了提升英文的阅读体验，在最前面加入高品质的英文字体栈（Avenir / Apple 系统默认 / Segoe UI / Roboto）。
   * 这样英文会优先使用这些专为英文设计的字体，而中文则会自动降级到后面的 Noto Sans SC / PingFang SC。
   */
  --font-display: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-brand: "Noto Serif SC", "Avenir Next", Avenir, -apple-system, "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --font: "Avenir Next", Avenir, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --font-zh: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  height: 100%;
  overflow: hidden;
  background: #eef2f6;
}

/* Keep the previous document visible until the next same-origin page has a
   renderable first frame. This removes the blank WebView frame between tabs. */
@view-transition {
  navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

/* 标题类：同一字体栈 + 统一字重，避免「一字一字体」造成的粗细跳变 */
#course-title,
#lesson-title,
.kp-card-title,
.hub-section-title,
.hub-tile-title,
.lesson-story-label,
.lesson-act-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-synthesis: none;
}

body {
  margin: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  background-color: var(--paper);
  background-image: radial-gradient(circle at 1px 1px, rgba(20, 16, 16, 0.055) 1px, transparent 0),
    linear-gradient(180deg, rgba(255, 252, 248, 0.95) 0%, rgba(243, 232, 220, 0.45) 100%);
  background-size: 13px 13px, auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- 通用：右上角用户头像（点击退出登录） --- */
.user-avatar-wrap {
  display: inline-flex;
  align-items: center;
}

.user-avatar-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.86);
  color: rgba(11, 18, 32, 0.78);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
}

.user-avatar-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(230, 0, 18, 0.28);
  color: rgba(230, 0, 18, 0.9);
}

.user-avatar-btn:active {
  transform: translateY(0);
}

.user-avatar-ico {
  width: 18px;
  height: 18px;
  opacity: 0.9;
}

.user-avatar-wrap.is-floating {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  z-index: 180;
}

body.player-lock {
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* —— Player 页面：对齐课程列表页（learn）的极简玻璃风 —— */
body.player-lock {
  --p-ink: #0b1220;
  --p-ink-soft: rgba(11, 18, 32, 0.74);
  --p-muted: rgba(11, 18, 32, 0.56);
  --p-surface: rgba(255, 255, 255, 0.84);
  --p-surface-strong: rgba(255, 255, 255, 0.94);
  --p-border: rgba(15, 23, 42, 0.1);
  --p-border-strong: rgba(15, 23, 42, 0.16);
  --p-accent: #e60012;
  --p-accent-2: #bf0010;
  --p-shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.08);
  --p-shadow-hover: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  --p-radius: 16px;
  --p-radius-lg: 22px;
  /* 与首页 learn 同系的细线/玻璃胶囊 */
  --p-hairline: rgba(15, 23, 42, 0.10);
  --p-dock-bg: rgba(255, 255, 255, 0.72);
  --p-dock-btn-bg: rgba(255, 255, 255, 0.86);
  --p-dock-btn-bg-hover: rgba(255, 255, 255, 0.94);
  --p-dock-btn-border: rgba(15, 23, 42, 0.14);
  --p-dock-btn-border-hover: rgba(230, 0, 18, 0.28);
  --p-dock-btn-active: rgba(230, 0, 18, 0.10);
  /* 滚动字幕列表：当前句浅粉高亮（与首页 learn 的红强调同系） */
  --p-sub-active-bg: rgba(230, 0, 18, 0.06);
  --p-sub-active-border: rgba(230, 0, 18, 0.12);
  --p-sub-panel-bg: rgba(255, 255, 255, 0.72);
  --p-sub-divider: rgba(15, 23, 42, 0.06);
  /* 兼容 player 内部仍使用的全局圆角变量（如 video-wrap 用 --radius-lg） */
  --radius: 16px;
  --radius-lg: 22px;
  --panel-radius: 22px;
  /* 播放页布局间距（需在 body 上定义，供 #player-bottom-dock 等兄弟节点使用） */
  --player-gutter: clamp(0.8rem, 1.75vw, 1.2rem);
  --player-gutter-x: var(--player-gutter);
  --player-gap: 0.6rem;
  --player-col-gap: 0.9rem;
  --player-dock-inset: var(--player-gutter);
  font-family: var(--font);
  color: var(--p-ink);
  background:
    radial-gradient(1200px 720px at 16% 8%, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0) 56%),
    radial-gradient(900px 600px at 86% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 55%),
    linear-gradient(180deg, #fcfdff 0%, #f6f7fb 55%, #eef1f8 100%);
}

body.player-lock a {
  color: var(--p-accent);
}

body.player-lock a:hover {
  color: var(--p-accent-2);
}

body.player-lock header.site {
  padding: 0.85rem 1rem;
}

body.player-lock .btn {
  border: none;
  background: rgba(255, 255, 255, 0.82);
  color: var(--p-ink);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  border-radius: 999px;
}

/* 移动端/桌面统一：去掉按钮默认 focus 外观（避免误判为“高亮还在”） */
body.player-lock .btn:focus {
  outline: none;
}

/* 触屏设备：禁用“粘滞 hover”导致的假高亮（iOS/Safari 常见） */
@media (hover: none) {
  /* 全部按钮：hover 回落到默认外观（不要残留“高亮”） */
  body.player-lock .btn:hover:not(:disabled),
  body.player-lock .control-bar-modes .btn:hover:not(:disabled),
  body.player-lock .control-bar-transport .btn:hover:not(:disabled),
  body.player-lock .subtitle-pill:hover:not(:disabled) {
    transform: none !important;
    box-shadow: none !important;
    background: var(--p-dock-btn-bg) !important;
    border-color: var(--p-dock-btn-border) !important;
  }

  /* 播放按钮本身保持红底，不要被上面的通用回落覆盖 */
  body.player-lock .control-bar-transport .control-bar-play.btn-primary:hover:not(:disabled),
  body.player-lock .control-bar-transport #btn-play.btn-primary:hover:not(:disabled) {
    background: var(--p-accent) !important;
    border-color: rgba(230, 0, 18, 0.35) !important;
    color: #fff !important;
  }
}

/* 播放页：以 aria-pressed 作为视觉真源（修复移动端“逻辑已切换但颜色没恢复”） */
body.player-lock .control-bar-modes .btn[aria-pressed="false"],
body.player-lock .control-bar-transport .btn[aria-pressed="false"] {
  background: var(--p-dock-btn-bg) !important;
  color: var(--p-ink) !important;
  border-color: var(--p-dock-btn-border) !important;
}

body.player-lock .control-bar-modes .btn[aria-pressed="true"],
body.player-lock .control-bar-transport .control-bar-pill[aria-pressed="true"] {
  background: var(--p-dock-btn-active) !important;
  color: var(--p-accent) !important;
  border-color: var(--p-dock-btn-border-hover) !important;
}

body.player-lock .btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

body.player-lock .btn-primary {
  background: var(--p-accent);
  border: none;
  color: #fff;
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.25);
}

body.player-lock .btn-primary:hover:not(:disabled) {
  background: var(--p-accent-2);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 0, 18, 0.35);
}

body.player-lock .btn-ghost {
  background: rgba(255, 255, 255, 0.62);
}

/* 去掉 player 控制区的“贴纸阴影”风格，现在改成了统一个漂浮感 */
body.player-lock .control-bar .btn-primary,
body.player-lock .control-bar .btn-primary:hover:not(:disabled) {
  box-shadow: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

header.site {
  flex-shrink: 0;
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  background: var(--surface);
  box-shadow: 0 10px 26px rgba(20, 16, 16, 0.06);
}

header.site h1 {
  margin: 0;
  font-size: 1.55rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  color: var(--ink);
  background: none;
  -webkit-text-fill-color: var(--ink);
}

header.site nav a {
  font-weight: 700;
  color: var(--ink-soft);
  transition: var(--transition);
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 2px solid transparent;
}

header.site nav .btn {
  border-radius: 10px;
  padding: 0.65rem 1.1rem;
}

header.site nav.admin-header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

header.site nav .btn.btn-reload-dirty {
  box-shadow: 0 0 0 2px var(--accent);
  font-weight: 700;
}

header.site nav a:hover {
  color: var(--accent);
  background: var(--accent-light);
  border-color: var(--ink);
  text-decoration: none;
}

main {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2.25rem 2rem 3rem;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

/* Welcome hero (course list homepage) */
.welcome-hero {
  margin: 0 auto 1.75rem;
  max-width: 1200px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: radial-gradient(900px 260px at 12% 0%, rgba(230, 0, 18, 0.1) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(900px 260px at 88% 0%, rgba(255, 140, 90, 0.12) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(135deg, #fffefb 0%, #ffe8dc 100%);
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

.welcome-hero-inner {
  padding: 2.15rem 2rem 2.1rem;
}

.welcome-hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

.welcome-hero-title {
  margin: 0.6rem 0 0.6rem;
  font-family: var(--font-brand);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.18;
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  color: var(--ink);
}

.welcome-hero-slogan {
  margin: -0.2rem 0 0;
  font-weight: 800;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  line-height: 1.5;
  font-size: 1.05rem;
  max-width: 60ch;
}

.learn-grid{
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.learn-section-head{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.05rem;
}

.learn-section-title{
  margin: 0;
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.learn-featured-row{
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 0.5rem 0.25rem;
  flex-wrap: wrap;
}

.learn-featured-thumb{
  width: min(520px, 100%);
  aspect-ratio: 16/9;
  border-radius: 16px;
  border: 1px solid var(--border-soft);
  background: #000;
  object-fit: cover;
  box-shadow: var(--shadow-xl);
  flex: 1 1 420px;
}

.learn-featured-info{
  min-width: 0;
  flex: 1 1 320px;
}

.learn-featured-title{
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
  margin-bottom: 0.45rem;
}

.learn-featured-actions{
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 720px){
  .learn-featured-row{ gap: 0.9rem; }
  .learn-featured-actions{ margin-left: 0; }
}

.welcome-hero-method {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  max-width: 900px;
}

.welcome-step {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 10px 22px rgba(20, 16, 16, 0.08);
}

.welcome-step-num {
  flex: 0 0 auto;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.2rem 0.45rem;
  line-height: 1.1;
  box-shadow: 0 6px 14px rgba(20, 16, 16, 0.12);
}

.welcome-step-title {
  font-weight: 900;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.25;
}

.welcome-step-desc {
  margin-top: 0.18rem;
  font-weight: 650;
  color: var(--text-secondary);
  line-height: 1.55;
  font-size: 0.9rem;
}

.welcome-hero-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .welcome-hero-inner {
    padding: 1.5rem 1.25rem 1.6rem;
  }
  .welcome-hero-method {
    grid-template-columns: 1fr;
  }
}

/* —— 学习首页 learn.html：与 player 统一字体 —— */
body.page-learn {
  --learn-page-gutter: clamp(1rem, 3vw, 2rem);
  /* 高端极简：浅色干净底 + 细腻层级；强调色保留红（与 Logo 一致） */
  --learn-ink: #0b1220;
  --learn-ink-soft: rgba(11, 18, 32, 0.74);
  --learn-muted: rgba(11, 18, 32, 0.56);
  --learn-surface: rgba(255, 255, 255, 0.84);
  --learn-surface-strong: rgba(255, 255, 255, 0.94);
  --learn-border: rgba(15, 23, 42, 0.1);
  --learn-border-strong: rgba(15, 23, 42, 0.16);
  --learn-accent: #e60012;
  --learn-accent-2: #bf0010;
  --learn-accent-soft: rgba(230, 0, 18, 0.12);
  --learn-radius: 16px;
  --learn-radius-lg: 22px;
  --learn-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  --learn-shadow-hover: 0 8px 32px rgba(15, 23, 42, 0.12);
  --learn-font: var(--font);
  background:
    radial-gradient(1200px 720px at 16% 8%, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0) 56%),
    radial-gradient(900px 600px at 86% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 55%),
    linear-gradient(180deg, #fcfdff 0%, #f6f7fb 55%, #eef1f8 100%) !important;
  font-family: var(--learn-font);
  color: var(--learn-ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.page-learn a {
  color: var(--learn-accent);
  font-weight: 600;
}

body.page-learn a:hover {
  color: var(--learn-accent-2);
}

body.page-learn a.learn-carousel-card,
body.page-learn a.learn-carousel-card:hover {
  color: var(--learn-ink);
  text-decoration: none;
}

body.page-learn main.learn-main {
  max-width: min(1600px, 100%);
  width: 100%;
  margin: 0 auto;
  padding: 1.75rem max(var(--learn-page-gutter), env(safe-area-inset-left)) 3.25rem
    max(var(--learn-page-gutter), env(safe-area-inset-right));
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  /* overflow-x 必须为 hidden 而非 visible：
     CSS 规范规定当一轴为 visible 另一轴非 visible 时，visible 被强制改为 auto，
     在移动端 Chrome 会产生横向滚动条并把内容推到屏幕外。
     推荐区横向破栏效果改由 learn-carousel-block 的负 margin 实现。 */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* 隐藏 Firefox 滚动条 */
  -ms-overflow-style: none; /* 隐藏 IE/Edge 滚动条 */
}

body.page-learn main.learn-main::-webkit-scrollbar {
  display: none; /* 隐藏 Chrome/Safari 滚动条 */
}

body.page-learn .learn-topbar {
  flex-shrink: 0;
  width: 100%;
  padding: 1.1rem max(var(--learn-page-gutter), env(safe-area-inset-left)) 1.1rem
    max(var(--learn-page-gutter), env(safe-area-inset-right));
  box-sizing: border-box;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  /* 语言菜单向下展开会与 main 重叠；main 在 DOM 中更晚且轮播含 transform，会盖住顶栏子元素。整层抬高（低于 .modal-backdrop 200） */
  position: relative;
  z-index: 150;
}

body.page-learn .learn-topbar-left {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

body.page-learn .learn-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

/* 顶栏：连胜按钮（桌面端） */
body.page-learn .learn-streak-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(11, 18, 32, 0.75);
  text-decoration: none;
  line-height: 1.2;
  user-select: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body.page-learn .learn-streak-btn:hover {
  color: var(--learn-accent);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

body.page-learn .learn-streak-icon {
  font-size: 1rem;
  line-height: 1;
}

body.page-learn .learn-streak-num {
  font-family: "Outfit", var(--font-display);
  font-weight: 900;
  font-size: 1.05rem;
  color: var(--learn-ink);
}

body.page-learn .learn-streak-label {
  font-weight: 700;
  font-size: 0.85rem;
  color: rgba(11, 18, 32, 0.62);
}

body.page-learn .learn-topbar-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

body.page-learn .learn-topbar-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: auto;
  min-width: 7.75rem;
  white-space: nowrap;
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(11, 18, 32, 0.75);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

/* learn-topbar-cta 既可能是 <a> 也可能是 <button>：统一重置按钮默认样式 */
body.page-learn button.learn-topbar-cta {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
  cursor: pointer;
}

body.page-learn .learn-topbar-cta-icon {
  flex: 0 0 auto;
  display: inline-block;
  width: 16px;
  height: 16px;
  opacity: 0.88;
}

@media (max-width: 520px) {
  body.page-learn-mobile .learn-topbar-cta {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
  }
  body.page-learn-mobile .learn-topbar-cta-icon {
    display: inline-block !important;
  }
  body.page-learn-mobile .learn-topbar-lang-wrap .learn-topbar-cta-icon {
    display: inline-block !important;
  }

  .fc-stats-btn {
    width: auto;
    min-width: 3.9rem;
    padding: 0.5rem 0.65rem;
  }
  .fc-stats-btn span {
    display: none;
  }
  .fc-stats-btn svg {
    margin: 0;
  }
}

body.page-learn .learn-topbar-cta:hover {
  color: var(--learn-accent);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  text-decoration: none;
}

/* 语言：顶栏胶囊 + 自定义下拉（与 learn 弹窗同系毛玻璃/描边，非系统原生菜单） */
body.page-learn .learn-topbar-lang-wrap.learn-topbar-cta {
  width: 9.25rem;
  max-width: 100%;
  padding: 0.5rem 0.75rem;
  gap: 0.45rem;
  box-sizing: border-box;
  justify-content: center;
  position: relative;
  z-index: 120;
  cursor: default;
}

body.page-learn .learn-lang-inner {
  flex: 0 1 auto;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
}

body.page-learn .learn-lang-trigger {
  flex: 0 1 auto;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font: inherit;
  font-weight: inherit;
  font-size: inherit;
  line-height: 1.35;
  letter-spacing: inherit;
  color: inherit;
  cursor: pointer;
  text-align: center;
  appearance: none;
  -webkit-appearance: none;
}

body.page-learn .learn-lang-trigger:focus {
  outline: none;
}

body.page-learn .learn-lang-trigger:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.32);
  outline-offset: 3px;
  border-radius: 8px;
}

body.page-learn .learn-lang-trigger-label {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-learn .learn-lang-chevron {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  opacity: 0.72;
  pointer-events: none;
}

body.page-learn .learn-lang-chevron svg {
  transition: transform 0.18s ease;
}

body.page-learn .learn-lang-combobox.is-open .learn-lang-chevron svg {
  transform: rotate(180deg);
}

body.page-learn .learn-lang-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  left: auto;
  z-index: 130;
  min-width: 100%;
  margin: 0;
  padding: 0.35rem;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-sizing: border-box;
}

body.page-learn .learn-lang-menu[hidden] {
  display: none !important;
}

body.page-learn .learn-lang-option {
  width: 100%;
  margin: 0;
  padding: 0.52rem 0.65rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  font: inherit;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.2;
  color: rgba(11, 18, 32, 0.75);
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

body.page-learn .learn-lang-option:hover {
  background: rgba(15, 23, 42, 0.06);
}

body.page-learn .learn-lang-option.is-active {
  background: rgba(230, 0, 18, 0.1);
  color: var(--learn-accent);
  font-weight: 700;
}

@media (max-width: 520px) {
  body.page-learn .learn-topbar-lang-wrap.learn-topbar-cta {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }
}

body.page-learn .learn-brand-icon {
  flex: 0 0 auto;
  line-height: 0;
  transform: translateY(0);
}

body.page-learn .learn-brand-icon svg {
  display: block;
  width: 34px;
  height: 34px;
}

body.page-learn .learn-brand-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

body.page-learn .learn-brand-name {
  font-family: "Outfit", var(--learn-font);
  font-weight: 800;
  font-size: 1.18rem;
  letter-spacing: -0.01em;
  color: var(--learn-ink);
  line-height: 1.2;
}

body.page-learn .learn-brand-slogan {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--learn-muted);
  letter-spacing: 0.06em;
  line-height: 1.35;
  text-transform: none;
}

/* 顶栏 + 分类：桌面端 wrapper 不参与布局 */
body.page-learn .learn-mobile-chrome {
  display: contents;
}

/* 移动端分类标签：桌面端默认隐藏 */
.mobile-category-tabs {
  display: none;
}

/* 移动端连胜徽章：桌面端默认隐藏 */
.mobile-streak-badge {
  display: none;
}

/* 移动端显示 brand logo+文字 → learn-mobile 页隐藏品牌，仅保留连胜与快捷入口 */
@media (max-width: 768px) {
  body.page-learn-mobile .learn-brand {
    display: none !important;
  }
}

/* 覆盖全局 .learn-section-head 的横向 flex，改为标准纵向：眉题 → 标题 → 说明 */
body.page-learn .learn-section-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 0;
  margin-bottom: 1.1rem;
  max-width: 40rem;
}

body.page-learn .learn-section-head--tight {
  margin-bottom: 0.9rem;
}

body.page-learn .learn-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--learn-muted);
  line-height: 1.3;
}

body.page-learn .learn-section-title {
  margin: 0 0 0.45rem;
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  color: var(--learn-ink);
}

body.page-learn .learn-section-desc {
  margin: 0;
  max-width: 36rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--learn-ink-soft);
}

/* 推荐区：与主栏同宽，左右保留与页面一致的 gutter，避免卡片溢出视口 */
body.page-learn .learn-carousel-block {
  padding-top: 0.25rem;
  margin-bottom: 1.25rem;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

body.page-learn .learn-carousel-slot {
  min-height: 2rem;
}

body.page-learn .learn-muted {
  padding: 1rem 0;
  color: var(--learn-muted);
  font-size: 0.9375rem;
  font-weight: 500;
}

body.page-learn .learn-carousel-root {
  position: relative;
  width: 100%;
}

/* 推荐区：3D Cover Flow，中央最大、两侧透视缩小叠放 */
body.page-learn .learn-coverflow-viewport {
  width: 100%;
  overflow: hidden;
  padding: 0.2rem 0 1.1rem;
  margin: 0;
  -webkit-perspective: 1200px;
  perspective: 1200px;
  perspective-origin: 50% 45%;
  /* 两侧渐隐：卡片滑入/滑出更柔和 */
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, #000 4%, #000 96%, transparent 100%);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

body.page-learn .learn-coverflow-stage {
  transform-style: preserve-3d;
}

body.page-learn .learn-coverflow-track {
  position: relative;
  width: 100%;
  /* 封面 16:9 + 标题/雅思标签/元信息；避免轮播区 overflow 裁切卡片底边 */
  --coverflow-card-w: min(400px, 78vw);
  min-height: calc(var(--coverflow-card-w) * 9 / 16 + 13.5rem);
  transform-style: preserve-3d;
}

body.page-learn .learn-coverflow-item {
  position: absolute;
  left: 50%;
  top: 0;
  width: min(400px, 78vw);
  max-width: 400px;
  transform-origin: center center;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.45s ease, visibility 0.35s ease;
  will-change: transform, opacity;
}

@media (min-width: 1100px) {
  body.page-learn .learn-coverflow-track {
    --coverflow-card-w: min(440px, 42vw);
  }

  body.page-learn .learn-coverflow-item {
    width: min(440px, 42vw);
    max-width: 440px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.page-learn .learn-coverflow-item {
    transition: opacity 0.25s ease, visibility 0.25s ease;
  }
}

body.page-learn .learn-coverflow-item > .learn-carousel-card {
  width: 100%;
  max-width: none;
}

body.page-learn .learn-coverflow-item .learn-carousel-card:hover {
  transform: none;
  box-shadow: var(--learn-shadow-hover);
  border-color: var(--learn-border-strong);
}

/* 推荐轮播：卡片比网格区更大，标题与内边距略放大以匹配比例 */
body.page-learn .learn-coverflow-item .learn-carousel-card-body {
  padding: 0.75rem 0.85rem 0.85rem;
}

body.page-learn .learn-coverflow-item .learn-carousel-card-title {
  font-size: 1rem;
}

body.page-learn .learn-carousel-dots,
body.page-learn .learn-coverflow-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.28rem;
  margin-top: -0.35rem;
  margin-bottom: 1rem;
  padding: 0;
  flex-wrap: wrap;
  row-gap: 0.25rem;
}

body.page-learn .learn-carousel-dot {
  width: 0.35rem;
  height: 0.35rem;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--learn-border-strong);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, width 0.2s ease;
}

body.page-learn .learn-carousel-dot.is-active {
  width: 1.1rem;
  background: var(--learn-ink);
}

body.page-learn .learn-carousel-dot:hover {
  background: var(--learn-ink-soft);
}

body.page-learn .learn-carousel-dot:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 2px;
}

body.page-learn .learn-carousel-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: var(--learn-radius-lg);
  overflow: hidden;
  background: #fff;
  border: none;
  box-shadow: var(--learn-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

body.page-learn .learn-carousel-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--learn-shadow-hover);
  background: #fff;
}

body.page-learn .learn-carousel-card:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 3px;
}

body.page-learn .learn-carousel-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
}

body.page-learn .learn-carousel-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

body.page-learn .learn-carousel-card-body {
  padding: 0.65rem 0.75rem 0.75rem;
  background: var(--learn-surface);
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.page-learn .learn-carousel-card-title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--learn-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.page-learn .learn-all-block {
  padding-bottom: 0.5rem;
  padding-top: 0.25rem;
  border-top: none;
  margin-top: 0.25rem;
}

body.page-learn .learn-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin: 0.55rem 0 1.05rem;
  padding: 0.2rem 0;
}

body.page-learn .learn-category-tab {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(11, 18, 32, 0.75);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  text-decoration: none;
}

body.page-learn .learn-category-tab:hover {
  background: #fff;
  color: var(--learn-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  text-decoration: none;
}

body.page-learn .learn-category-tab:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 3px;
}

body.page-learn .learn-category-block {
  margin: 0 0 1.35rem;
  scroll-margin-top: 1.25rem;
}

body.page-learn .learn-locked-section {
  margin: 0.35rem 0 1.35rem;
}

body.page-learn .learn-category-list {
  display: block;
}

body.page-learn .learn-category-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  margin: 0.35rem 0 0.95rem;
  width: 100%;
}

body.page-learn .learn-category-head-left {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
}

body.page-learn .learn-category-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

body.page-learn .learn-viewall-btn {
  border: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(11, 18, 32, 0.75);
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

body.page-learn .learn-viewall-btn:hover:not(:disabled) {
  background: #fff;
  color: var(--learn-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

body.page-learn .learn-viewall-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

body.page-learn .learn-viewall-btn:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 3px;
}

body.page-learn .learn-category-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--learn-ink);
}

body.page-learn .learn-category-desc {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--learn-muted);
}

body.page-learn .learn-category-desc:empty {
  display: none;
}

body.page-learn .learn-series-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.7rem;
  width: 100%;
  max-width: none;
}

body.page-learn .learn-series-desc {
  margin: 0;
  width: 100%;
  max-width: none;
  color: rgba(11, 18, 32, 0.62);
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.65;
}

body.page-learn .learn-series-source {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--learn-ink, #0b1220);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  white-space: nowrap;
}

body.page-learn .learn-series-source:hover {
  color: var(--learn-ink, #0b1220);
  box-shadow: none;
  transform: none;
}

body.page-learn .learn-series-toggle {
  appearance: none;
  -webkit-appearance: none;
  display: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--learn-ink, #0b1220);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 850;
  line-height: 1.35;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
  cursor: pointer;
}

body.page-learn .learn-series-toggle:hover {
  color: var(--learn-ink, #0b1220);
}

body.page-learn .learn-shelf {
  position: relative;
}

body.page-learn .learn-shelf-scroller {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15rem 0.15rem 0.65rem;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* 两侧渐隐：可滑动时才渐隐；边缘更淡（渐隐范围更窄） */
  --fade-left: 1; /* 0=渐隐, 1=不渐隐（实心） */
  --fade-right: 0;
  -webkit-mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, var(--fade-left)) 0%,
    #000 4%,
    #000 96%,
    rgba(0, 0, 0, var(--fade-right)) 100%
  );
  mask-image: linear-gradient(
    to right,
    rgba(0, 0, 0, var(--fade-left)) 0%,
    #000 4%,
    #000 96%,
    rgba(0, 0, 0, var(--fade-right)) 100%
  );
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

body.page-learn .learn-shelf-scroller::-webkit-scrollbar {
  display: none;
}

body.page-learn .learn-grid-card.learn-grid-card--shelf {
  flex: 0 0 auto;
  width: clamp(260px, 25vw, 320px);
  scroll-snap-align: start;
}

body.page-learn .learn-grid-card.learn-grid-card--locked.learn-grid-card--shelf {
  width: clamp(260px, 25vw, 320px);
}

body.page-learn .learn-shelf-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  color: var(--learn-ink);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 5;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
}

body.page-learn .learn-shelf.has-overflow .learn-shelf-arrow {
  display: inline-flex;
}

body.page-learn .learn-shelf-arrow:disabled {
  opacity: 0.25;
  cursor: default;
}

body.page-learn .learn-shelf-arrow--left {
  left: -0.65rem;
}

body.page-learn .learn-shelf-arrow--right {
  right: -0.65rem;
}

body.page-learn .learn-shelf-arrow:hover:not(:disabled) {
  color: var(--learn-accent);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  transform: translateY(calc(-50% - 2px));
}

body.page-learn .learn-shelf-arrow:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 3px;
}

/* Learn：查看全部弹窗 */
body.page-learn .modal.learn-modal {
  width: min(1000px, 100%);
}

/* Learn：反馈弹窗（二维码） */
body.page-learn .modal.learn-feedback-modal {
  width: min(560px, 100%);
}

body.page-learn .modal.learn-rating-modal {
  width: min(520px, 100%);
}

body.page-learn .learn-rating-sub {
  margin: 0 0 1rem;
  color: var(--learn-muted);
  font-weight: 600;
  font-size: 0.92rem;
  line-height: 1.45;
}

body.page-learn .learn-rating-block {
  margin-bottom: 1.1rem;
}

body.page-learn .learn-rating-label {
  display: block;
  margin: 0 0 0.45rem;
  font-weight: 800;
  font-size: 0.88rem;
  color: var(--learn-ink);
  letter-spacing: -0.01em;
}

body.page-learn .learn-rating-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem;
  justify-content: flex-start;
  align-items: center;
}

body.page-learn .learn-rating-star {
  font-size: 1.85rem;
  line-height: 1;
  padding: 0.15rem 0.28rem;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: rgba(15, 23, 42, 0.22);
  cursor: pointer;
  transition: color 0.12s ease, transform 0.12s ease;
}

body.page-learn .learn-rating-star:hover {
  color: rgba(245, 158, 11, 0.55);
}

body.page-learn .learn-rating-star.is-on {
  color: #f59e0b;
}

body.page-learn .learn-rating-star:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 2px;
}

body.page-learn .learn-rating-textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 5.5rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  border: 2px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.65);
  font: inherit;
  font-size: 0.95rem;
  resize: vertical;
}

body.page-learn .learn-rating-textarea:focus {
  outline: none;
  border-color: var(--learn-accent);
}

body.page-learn .learn-rating-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.55rem;
}

body.page-learn .learn-feedback {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.85rem;
  padding: 0.25rem 0;
}

body.page-learn .learn-feedback-title {
  margin: 0.15rem 0 0;
  font-weight: 800;
  color: var(--learn-ink);
  letter-spacing: -0.01em;
}

body.page-learn .learn-feedback-qr {
  width: min(360px, 100%);
  max-width: 360px;
  border-radius: 18px;
  border: none;
  background: rgba(255, 255, 255, 0.75);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
}

body.page-learn .learn-feedback-open {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  color: var(--learn-accent);
  font-weight: 800;
  text-decoration: none;
}

body.page-learn .learn-feedback-open:hover {
  text-decoration: underline;
}

body.page-learn .learn-toast {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 260;
  max-width: min(520px, calc(100vw - 32px));
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.26);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, calc(-50% + 12px));
  transition: opacity 0.18s ease, transform 0.18s ease;
}

body.page-learn .learn-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%);
}

body.page-learn .learn-modal-sub {
  margin: -0.25rem 0 0.75rem;
  color: var(--learn-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

body.page-learn .learn-modal-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
}

body.page-learn .learn-modal-empty:empty {
  display: none;
}

@media (max-width: 900px) {
  body.page-learn .learn-modal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.page-learn .learn-shelf-arrow--left {
    left: -0.35rem;
  }
  body.page-learn .learn-shelf-arrow--right {
    right: -0.35rem;
  }
}

@media (max-width: 520px) {
  body.page-learn .learn-modal-grid {
    grid-template-columns: 1fr;
  }
}

body.page-learn .learn-course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.1rem;
  padding: 0;
  box-sizing: border-box;
}

body.page-learn .learn-grid-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-radius: var(--learn-radius);
  overflow: hidden;
  background: #fff;
  border: none;
  box-shadow: var(--learn-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  cursor: pointer;
}

body.page-learn .learn-grid-card:hover {
  background: #fff;
  box-shadow: var(--learn-shadow-hover);
  transform: translateY(-4px);
}

body.page-learn .learn-grid-card:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 3px;
}

body.page-learn .learn-grid-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
}

body.page-learn .learn-grid-card-media.learn-grid-card-media--placeholder {
  background: radial-gradient(900px 260px at 12% 0%, rgba(230, 0, 18, 0.12) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(900px 260px at 88% 0%, rgba(99, 102, 241, 0.16) 0%, rgba(255, 255, 255, 0) 55%),
    linear-gradient(160deg, rgba(255, 255, 255, 0.55) 0%, rgba(241, 245, 249, 0.9) 100%);
}

body.page-learn .learn-placeholder-badge {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(230, 0, 18, 0.22);
  background: rgba(255, 255, 255, 0.84);
  color: rgba(230, 0, 18, 0.95);
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}

body.page-learn .learn-learn-badge {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  z-index: 2;
  padding: 0.22rem 0.52rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.12);
}

body.page-learn .learn-learn-badge--not_started {
  background: rgba(254, 226, 226, 0.95);
  color: #b91c1c;
  border-color: rgba(220, 38, 38, 0.35);
}

body.page-learn .learn-learn-badge--in_progress {
  background: rgba(255, 237, 213, 0.96);
  color: #c2410c;
  border-color: rgba(234, 88, 12, 0.38);
}

body.page-learn .learn-learn-badge--completed {
  background: rgba(220, 252, 231, 0.96);
  color: #15803d;
  border-color: rgba(22, 163, 74, 0.35);
}

body.page-learn .learn-access-badge {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  min-height: 1.45rem;
  padding: 0.22rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 850;
  line-height: 1;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.14);
}

body.page-learn .learn-access-badge--locked {
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px) saturate(150%);
  -webkit-backdrop-filter: blur(10px) saturate(150%);
}

body.page-learn .learn-ielts-tags {
  position: absolute;
  left: 0.62rem;
  right: 0.62rem;
  bottom: 0.58rem;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  align-items: center;
  pointer-events: none;
}

body.page-learn .learn-ielts-tag {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.35rem;
  padding: 0.2rem 0.42rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(15, 23, 42, 0.72);
  color: rgba(255, 255, 255, 0.96);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1.1;
  white-space: nowrap;
}

body.page-learn .learn-ielts-tag--total {
  background: rgba(79, 70, 229, 0.9);
  border-color: rgba(255, 255, 255, 0.42);
}

body.page-learn .learn-ielts-tags--body {
  position: static;
  left: auto;
  right: auto;
  bottom: auto;
  z-index: auto;
  margin-top: 0.42rem;
  margin-bottom: 0.05rem;
  gap: 0.25rem;
  pointer-events: none;
}

body.page-learn .learn-ielts-tags--body .learn-ielts-tag {
  min-height: 1.28rem;
  padding: 0.18rem 0.34rem;
  border-color: rgba(79, 70, 229, 0.18);
  background: rgba(79, 70, 229, 0.08);
  color: rgba(67, 56, 202, 0.92);
  box-shadow: none;
  font-size: 0.62rem;
}

body.page-learn .learn-ielts-tags--body .learn-ielts-tag--total {
  background: rgba(79, 70, 229, 0.14);
  color: #4338ca;
}

body.page-learn .learn-ielts-tags--body .learn-ielts-tag--loading {
  color: rgba(15, 23, 42, 0.5);
}

body.page-learn .learn-grid-card.learn-grid-card--placeholder {
  cursor: default;
  opacity: 0.92;
}

body.page-learn .learn-grid-card.learn-grid-card--placeholder:hover {
  border-color: var(--learn-border);
  box-shadow: var(--learn-shadow);
  transform: none;
}

body.page-learn .learn-grid-card-link.learn-grid-card-link--muted {
  color: var(--learn-muted);
  border-bottom-color: transparent;
}

body.page-learn .learn-grid-card.learn-grid-card--locked {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.98));
}

body.page-learn .learn-grid-card.learn-grid-card--locked:hover {
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

body.page-learn .learn-grid-card--locked .learn-grid-card-title {
  color: rgba(15, 23, 42, 0.82);
}

body.page-learn .learn-grid-card-link.learn-grid-card-link--locked {
  color: #475569;
}

body.page-learn .learn-locked-media {
  display: grid;
  place-items: center;
  isolation: isolate;
  padding: 1.05rem 1rem 1rem;
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.04), rgba(15, 23, 42, 0.76)),
    radial-gradient(520px 180px at 20% 15%, rgba(255, 255, 255, 0.34) 0%, transparent 48%),
    radial-gradient(380px 180px at 90% 92%, rgba(230, 0, 18, 0.32) 0%, transparent 54%),
    linear-gradient(135deg, #334155 0%, #111827 100%);
}

body.page-learn .learn-locked-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image:
    linear-gradient(90deg, rgba(255, 255, 255, 0.11) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 34px 34px;
  opacity: 0.34;
}

body.page-learn .learn-locked-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.16), transparent 42%),
    linear-gradient(90deg, rgba(255,255,255,0.14) 0 2px, transparent 2px 12px, rgba(255,255,255,0.1) 12px 14px, transparent 14px 100%),
    linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.28) 100%);
  opacity: 0.28;
  pointer-events: none;
}

body.page-learn .learn-locked-media--sunset {
  background: linear-gradient(180deg, rgba(42, 24, 20, 0.06), rgba(43, 16, 12, 0.72)),
    radial-gradient(420px 180px at 16% 12%, rgba(255, 222, 138, 0.46), transparent 58%),
    linear-gradient(135deg, #f59e0b 0%, #7c2d12 48%, #111827 100%);
}

body.page-learn .learn-locked-media--royal {
  background: linear-gradient(180deg, rgba(19, 26, 50, 0.12), rgba(11, 18, 32, 0.72)),
    radial-gradient(440px 190px at 80% 10%, rgba(199, 210, 254, 0.4), transparent 54%),
    linear-gradient(135deg, #1e3a8a 0%, #312e81 54%, #020617 100%);
}

body.page-learn .learn-locked-media--rose {
  background: linear-gradient(180deg, rgba(88, 28, 62, 0.06), rgba(88, 28, 62, 0.7)),
    radial-gradient(420px 180px at 20% 8%, rgba(251, 207, 232, 0.48), transparent 55%),
    linear-gradient(135deg, #be185d 0%, #7f1d1d 52%, #111827 100%);
}

body.page-learn .learn-locked-media--forest {
  background: linear-gradient(180deg, rgba(6, 78, 59, 0.06), rgba(6, 78, 59, 0.72)),
    radial-gradient(440px 180px at 12% 10%, rgba(187, 247, 208, 0.34), transparent 54%),
    linear-gradient(135deg, #166534 0%, #14532d 52%, #111827 100%);
}

body.page-learn .learn-locked-media--office {
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.08), rgba(15, 23, 42, 0.72)),
    radial-gradient(420px 180px at 78% 10%, rgba(226, 232, 240, 0.42), transparent 56%),
    linear-gradient(135deg, #64748b 0%, #334155 48%, #020617 100%);
}

body.page-learn .learn-locked-media--neon {
  background: linear-gradient(180deg, rgba(8, 47, 73, 0.08), rgba(15, 23, 42, 0.72)),
    radial-gradient(360px 160px at 20% 18%, rgba(34, 211, 238, 0.44), transparent 56%),
    radial-gradient(320px 170px at 88% 82%, rgba(168, 85, 247, 0.38), transparent 58%),
    linear-gradient(135deg, #0f172a 0%, #164e63 52%, #020617 100%);
}

body.page-learn .learn-locked-media--gold {
  background: linear-gradient(180deg, rgba(113, 63, 18, 0.08), rgba(69, 26, 3, 0.7)),
    radial-gradient(420px 170px at 20% 12%, rgba(254, 240, 138, 0.48), transparent 56%),
    linear-gradient(135deg, #ca8a04 0%, #92400e 48%, #111827 100%);
}

body.page-learn .learn-locked-media--violet {
  background: linear-gradient(180deg, rgba(76, 29, 149, 0.08), rgba(46, 16, 101, 0.72)),
    radial-gradient(420px 170px at 80% 14%, rgba(221, 214, 254, 0.42), transparent 55%),
    linear-gradient(135deg, #7c3aed 0%, #4c1d95 50%, #111827 100%);
}

body.page-learn .learn-locked-media--kitchen {
  background: linear-gradient(180deg, rgba(124, 45, 18, 0.08), rgba(69, 26, 3, 0.68)),
    radial-gradient(420px 170px at 18% 10%, rgba(254, 215, 170, 0.46), transparent 56%),
    linear-gradient(135deg, #ea580c 0%, #9a3412 48%, #111827 100%);
}

body.page-learn .learn-locked-media--stage {
  background: linear-gradient(180deg, rgba(76, 29, 149, 0.06), rgba(49, 46, 129, 0.72)),
    radial-gradient(360px 170px at 20% 8%, rgba(253, 224, 71, 0.44), transparent 52%),
    radial-gradient(360px 170px at 88% 82%, rgba(244, 114, 182, 0.36), transparent 56%),
    linear-gradient(135deg, #1e1b4b 0%, #7e22ce 52%, #111827 100%);
}

body.page-learn .learn-locked-cover {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  gap: 0.42rem;
  width: 100%;
  max-width: 92%;
  padding-right: 0;
  color: #fff;
  text-align: center;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.42);
}

body.page-learn .learn-locked-cover::before,
body.page-learn .learn-locked-cover::after {
  position: absolute;
  z-index: -1;
  color: rgba(255, 255, 255, 0.12);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 4.8rem;
  line-height: 1;
  pointer-events: none;
}

body.page-learn .learn-locked-cover::before {
  content: "“";
  left: -0.4rem;
  top: -1.15rem;
}

body.page-learn .learn-locked-cover::after {
  content: "”";
  right: -0.35rem;
  bottom: -1.55rem;
}

body.page-learn .learn-locked-cover-title {
  max-width: 100%;
  order: 2;
  color: rgba(255, 255, 255, 0.72);
  font-family: var(--learn-font, "Inter", sans-serif);
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-learn .learn-locked-cover-line {
  max-width: 100%;
  order: 1;
  color: rgba(255, 255, 255, 0.98);
  font-family: Georgia, "Times New Roman", "Noto Serif", serif;
  font-size: clamp(0.98rem, 1.32vw, 1.4rem);
  font-weight: 850;
  line-height: 1.04;
  letter-spacing: -0.045em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

body.page-learn .learn-locked-subtitle {
  position: absolute;
  left: 0.9rem;
  right: 0.9rem;
  bottom: 0.72rem;
  z-index: 2;
  overflow: hidden;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.62rem;
  font-weight: 780;
  line-height: 1.2;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
}

body.page-learn .learn-locked-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(15, 23, 42, 0.76);
  font-size: 0.86rem;
  font-weight: 900;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
}

body.page-learn .learn-locked-hint {
  position: absolute;
  z-index: 1;
  left: 0.75rem;
  top: 0.82rem;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.04em;
}

body.page-learn .learn-grid-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

body.page-learn .learn-carousel-card-img.is-thumb-missing,
body.page-learn .learn-grid-card-img.is-thumb-missing {
  background: radial-gradient(ellipse 120% 80% at 20% 0%, rgba(37, 99, 235, 0.2) 0%, transparent 55%),
    radial-gradient(ellipse 100% 80% at 100% 100%, rgba(100, 116, 139, 0.25) 0%, transparent 50%),
    linear-gradient(160deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  object-fit: cover;
}

body.page-learn .learn-grid-card-body {
  padding: 0.65rem 0.75rem 0.75rem;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.page-learn .learn-grid-card-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
  color: var(--learn-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

body.page-learn .learn-grid-card-meta-row,
body.page-learn .learn-carousel-card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.35rem;
  min-width: 0;
}

body.page-learn .learn-grid-card-meta,
body.page-learn .learn-carousel-card-meta {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--learn-muted);
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.page-learn .learn-grid-card-link,
body.page-learn .learn-carousel-card-link {
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--learn-accent);
  text-decoration: none;
  white-space: nowrap;
  padding: 0.15rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

body.page-learn .learn-grid-card-link:hover,
body.page-learn .learn-carousel-card:hover .learn-carousel-card-link {
  color: var(--learn-accent-2);
  border-bottom-color: rgba(230, 0, 18, 0.35);
}

body.page-learn .learn-grid-card-link:focus-visible {
  outline: 2px solid var(--learn-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

body.page-learn .learn-carousel-card {
  color: var(--learn-ink);
}

body.page-learn .learn-empty {
  margin: 1.25rem 0 0;
  text-align: center;
  font-weight: 500;
  color: var(--learn-muted);
  padding: 2rem 1rem;
  border-radius: var(--learn-radius);
  border: 1px dashed var(--learn-border-strong);
  background: rgba(255, 255, 255, 0.5);
}

@media (max-width: 900px) {
  body.page-learn-mobile .learn-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  body.page-learn-mobile .learn-course-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 后台页：缩小左右边距，让列表更“满” */
body.admin-page main {
  max-width: 1600px;
  padding: 1.25rem max(1rem, env(safe-area-inset-left)) 2rem max(1rem, env(safe-area-inset-right));
}

/* —— 后台页：admin.html 统一为极简玻璃风 —— */
body.admin-page {
  --ink: #0b1220;
  --ink-soft: rgba(11, 18, 32, 0.74);
  --paper: #f6f7fb;
  --paper-2: #eef1f8;
  --bg: var(--paper);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-2: rgba(255, 255, 255, 0.94);
  --border: rgba(15, 23, 42, 0.16);
  --border-soft: rgba(15, 23, 42, 0.1);
  --text: var(--ink);
  --text-secondary: rgba(11, 18, 32, 0.74);
  --muted: rgba(11, 18, 32, 0.56);
  --accent: #e60012;
  --accent-hover: #bf0010;
  --accent-light: rgba(230, 0, 18, 0.12);
  --accent-muted: rgba(230, 0, 18, 0.12);
  --shadow-sm: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  --shadow-lg: var(--shadow-md);
  --shadow-xl: var(--shadow-md);
  --radius: 16px;
  --radius-lg: 22px;
  --panel-radius: 22px;
  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, system-ui,
    sans-serif;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 720px at 16% 8%, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0) 56%),
    radial-gradient(900px 600px at 86% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 55%),
    linear-gradient(180deg, #fcfdff 0%, #f6f7fb 55%, #eef1f8 100%);
}

body.admin-page header.site {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

body.admin-page main {
  max-width: none;
  padding: 0;
}

/* 后台壳：左侧侧栏 + 右侧内容（类似常见后台） */
body.admin-page .admin-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: calc(100vh - 0px);
}

body.admin-page .admin-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  border-right: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px) saturate(140%);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  padding: 16px 12px;
}

body.admin-page .admin-sidebar-inner {
  border: none;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

body.admin-page .admin-side-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 10px 8px 18px;
  cursor: pointer;
  user-select: none;
  border-radius: 16px;
}

body.admin-page .admin-side-brand:hover {
  background: rgba(15, 23, 42, 0.04);
}

body.admin-page .admin-side-brand:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.5);
  outline-offset: 2px;
}

body.admin-page .admin-side-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
}

body.admin-page .admin-side-name {
  font-weight: 950;
  letter-spacing: 0.2px;
  font-size: 1.15rem;
  line-height: 1.15;
}

body.admin-page .admin-side-sub {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

body.admin-page .admin-sidebar-nav {
  display: grid;
  gap: 0.15rem;
  margin-top: 2px;
}

body.admin-page .admin-nav-item {
  position: relative;
  width: 100%;
  text-align: left;
  padding: 0.62rem 0.7rem;
  border-radius: 14px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 900;
  font-size: 1rem;
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}

body.admin-page .admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text);
  border-color: rgba(15, 23, 42, 0.08);
}

body.admin-page .admin-nav-item.is-active {
  background: rgba(230, 0, 18, 0.10);
  color: var(--text);
  border-color: rgba(230, 0, 18, 0.22);
}

body.admin-page .admin-nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 12px;
  bottom: 12px;
  width: 3px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(230, 0, 18, 0.95), rgba(230, 0, 18, 0.55));
}

body.admin-page .admin-nav-ico {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(11, 18, 32, 0.62);
}

body.admin-page .admin-nav-item.is-active .admin-nav-ico,
body.admin-page .admin-nav-item:hover .admin-nav-ico {
  color: rgba(11, 18, 32, 0.88);
}

body.admin-page .admin-nav-ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

body.admin-page .admin-nav-text {
  flex: 1;
  min-width: 0;
}

body.admin-page .admin-content {
  min-width: 0;
  padding: 18px 22px 32px;
}

/* 右侧页面标题区 */
body.admin-page .admin-page-head {
  padding: 8px 0 12px;
  margin-bottom: 10px;
}

body.admin-page .admin-page-head--courses {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.9rem;
}

body.admin-page .admin-page-head-text {
  min-width: 0;
}

body.admin-page .admin-page-title {
  font-size: 1.15rem;
  font-weight: 950;
  letter-spacing: 0.2px;
  color: var(--text);
}

body.admin-page .admin-page-sub {
  margin-top: 4px;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 课程管理页操作（仅在 courses 视图出现） */
body.admin-page .admin-courses-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin: 0 0 10px;
}

body.admin-page .admin-page-head--courses .admin-courses-actions {
  margin: 0;
  justify-content: flex-end;
}

/* 课程管理：分类筛选下拉宽度自适应（覆盖全局 select: width:100%） */
body.admin-page .admin-courses-actions .admin-courses-filter {
  flex: 0 1 auto;
  width: auto;
  min-width: 9.5rem;
  max-width: min(18rem, 48vw);
  min-height: 2.6rem;
  padding-top: 0.58rem;
  padding-bottom: 0.58rem;
  font-size: 0.95rem;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 720px) {
  body.admin-page .admin-page-head--courses {
    flex-wrap: wrap;
  }
  body.admin-page .admin-page-head--courses .admin-courses-actions {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  body.admin-page .admin-courses-actions .admin-courses-filter {
    max-width: 100%;
  }
}

/* 右侧内容标题区：更像“页面内容”而不是卡片头 */
body.admin-page .admin-analytics-head {
  padding: 0;
  margin: 0 0 0.9rem;
  justify-content: flex-end;
}

@media (max-width: 980px) {
  /* 移动端改为普通块流，避免 grid 拉伸行高导致内容上方出现大片空白 */
  body.admin-page .admin-shell {
    display: block;
    min-height: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  /* 移动端：菜单栏改为顶部 sticky，避免被 iOS Safari 底部工具栏遮挡 */
  body.admin-page .admin-sidebar {
    position: sticky;
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    height: auto;
    z-index: 100;
    border-right: none;
    border-top: none;
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    padding: calc(6px + env(safe-area-inset-top, 0px)) 8px 6px;
    overflow: visible;
  }
  body.admin-page .admin-side-brand {
    display: none;
  }
  body.admin-page .admin-sidebar-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.2rem;
    margin-top: 0;
  }
  body.admin-page .admin-nav-item {
    justify-content: center;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.45rem 0.3rem;
    text-align: center;
    border-radius: 10px;
  }
  body.admin-page .admin-nav-item.is-active::before {
    display: none;
  }
  body.admin-page .admin-nav-text {
    font-size: 0.68rem;
    font-weight: 700;
  }
  body.admin-page .admin-content {
    padding: 14px 14px calc(20px + env(safe-area-inset-bottom, 0px));
  }
}

body.admin-page .card {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
}

/* 新版后台：内容不再用“卡片框”包起来 */
body.admin-page .admin-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0;
}

/* 后台统计面板 */
body.admin-page .admin-analytics-card {
  padding: 0;
}

body.admin-page .admin-analytics-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
}

body.admin-page .admin-analytics-title {
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.2px;
}

body.admin-page .admin-analytics-sub {
  color: var(--text-secondary);
  font-size: 0.92rem;
  margin-top: 0.2rem;
}

body.admin-page .admin-analytics-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* 统计面板：时间范围说明是行内文案，避免 .status 的上边距导致“白条” */
body.admin-page .admin-analytics-actions #analytics-status {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  min-height: 3.05rem; /* 与 body.admin-page select 一致，便于对齐 */
  padding: 0 0.9rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: none;
  width: auto;
  flex: 0 0 auto;
}

/* 反馈看板：日期 + 快捷 + 刷新行对齐 */
body.admin-page .admin-feedback-ratings-actions {
  align-items: flex-start;
}

body.admin-page .admin-feedback-ratings-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

body.admin-page .admin-feedback-ratings-date-label {
  font-size: 0.88rem;
  font-weight: 700;
  color: rgba(11, 18, 32, 0.72);
  white-space: nowrap;
}

body.admin-page .admin-feedback-ratings-date {
  min-width: 10.5rem;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  font-size: 0.9rem;
}

body.admin-page .admin-feedback-ratings-presets {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

body.admin-page .admin-feedback-preset-btn {
  padding: 0.45rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 12px;
  line-height: 1.2;
}

body.admin-page .admin-feedback-ratings-refreshRow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: nowrap;
  margin-left: auto;
}

body.admin-page .admin-feedback-ratings-refreshRow .btn {
  flex: 0 0 auto;
}

body.admin-page .admin-feedback-ratings-refreshRow #feedback-ratings-status {
  margin: 0;
  white-space: nowrap;
  line-height: 1.35;
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.88);
}

/* 反馈看板表格：列宽与正文字号统一（避免部分列被写成更小字号） */
body.admin-page table.course-table.admin-feedback-ratings-table th,
body.admin-page table.course-table.admin-feedback-ratings-table td {
  font-size: 0.875rem;
}

body.admin-page table.course-table.admin-feedback-ratings-table thead th {
  font-size: 0.85rem;
}

body.admin-page table.course-table.admin-feedback-ratings-table .admin-feedback-ratings-cell-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.875rem;
}

body.admin-page table.course-table.admin-feedback-ratings-table .admin-feedback-ratings-cell-nowrap {
  white-space: nowrap;
}

body.admin-page table.course-table.admin-feedback-ratings-table .admin-feedback-ratings-cell-comment {
  max-width: 420px;
  word-break: break-word;
}

body.admin-page .admin-api-search {
  flex: 1 1 260px;
  min-width: 180px;
  max-width: 560px;
  width: auto;
}

/* 接口表页：搜索在左、复制在右，同一行 */
body.admin-page .admin-api-actions {
  flex-wrap: nowrap;
  width: 100%;
  justify-content: space-between;
}

body.admin-page .admin-api-actions .admin-api-search {
  flex: 1 1 auto;
  max-width: none;
}

body.admin-page #btn-api-copy {
  white-space: nowrap;
  flex: 0 0 auto;
}

body.admin-page #analytics-range {
  min-width: 9.2rem;
  width: auto;
}

body.admin-page .admin-analytics-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

body.admin-page .admin-analytics-retention-kpis {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.9rem;
}

body.admin-page .admin-kpi--ret .admin-kpi-sub {
  margin-top: 0.25rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--text-secondary);
  font-weight: 500;
}

body.admin-page .admin-retention-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.admin-page table.admin-retention-table {
  table-layout: auto;
  min-width: 58rem;
}

body.admin-page table.admin-retention-table th.ret-col,
body.admin-page table.admin-retention-table td.ret-col {
  font-size: 0.8rem;
  white-space: nowrap;
  min-width: 4.6rem;
}

body.admin-page table.admin-retention-table th.dev-col,
body.admin-page table.admin-retention-table td.dev-col {
  white-space: nowrap;
  min-width: 4.6rem;
}

/* 统计概览表列数较多：禁用 mini-table 的 fixed 布局与省略号截断，
   改为按内容宽度排布，超出宽度由外层容器横向滚动 */
body.admin-page table.course-table.admin-mini-table.admin-retention-table {
  table-layout: auto;
  width: auto;
  min-width: 100%;
}

body.admin-page table.course-table.admin-mini-table.admin-retention-table th,
body.admin-page table.course-table.admin-mini-table.admin-retention-table td {
  overflow: visible;
  text-overflow: clip;
  white-space: nowrap;
}

body.admin-page .admin-kpi {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  padding: 0.7rem 0.75rem;
}

body.admin-page .admin-kpi .k {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 0.3rem;
}

body.admin-page .admin-kpi .v {
  font-size: 1.25rem;
  font-weight: 900;
  letter-spacing: 0.2px;
}

body.admin-page .admin-analytics-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 0.9rem;
  align-items: start;
}

/* 统计面板：撑满右侧剩余高度，避免下方空一大块 */
body.admin-page .admin-analytics-card[data-admin-view="analytics"] {
  min-height: calc(100vh - 18px - 32px); /* roughly: content padding top/bottom */
  display: flex;
  flex-direction: column;
}

body.admin-page .admin-analytics-card[data-admin-view="analytics"] .admin-analytics-grid {
  flex: 1 1 auto;
  align-content: start;
}

body.admin-page .admin-analytics-card[data-admin-view="analytics"] .admin-analytics-block:first-child {
  display: flex;
  flex-direction: column;
}

body.admin-page .admin-analytics-card[data-admin-view="analytics"] .admin-analytics-block:first-child .course-table-wrap {
  flex: 1 1 auto;
  min-height: 360px;
  overflow: auto;
}

body.admin-page .admin-analytics-block {
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0;
}

body.admin-page .admin-analytics-block-title {
  font-weight: 850;
  margin-bottom: 0.65rem;
}

body.admin-page .admin-analytics-table-wrap {
  overflow: auto;
}

body.admin-page .admin-analytics-top {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

body.admin-page .admin-top-block {
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.55);
  border-radius: 14px;
  padding: 0.7rem 0.75rem;
  /* Top 榜单：条目太多时不撑爆布局，块内滚动 */
  max-height: 360px;
  overflow: auto;
}

body.admin-page .admin-top-title {
  font-weight: 900;
  margin-bottom: 0.55rem;
}

body.admin-page .admin-top-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.35rem 0;
  border-top: 2px dashed rgba(15, 23, 42, 0.08);
}

body.admin-page .admin-top-row:first-of-type {
  border-top: none;
}

body.admin-page .admin-top-row .t {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

body.admin-page .admin-top-row .m {
  color: var(--text-secondary);
  font-weight: 850;
  white-space: nowrap;
}

@media (max-width: 980px) {
  body.admin-page .admin-analytics-grid {
    grid-template-columns: 1fr;
  }
  body.admin-page .admin-analytics-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.admin-page .admin-analytics-retention-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  body.admin-page .admin-analytics-top {
    grid-template-columns: 1fr;
  }
}

/* 让统计/接口表复用课程管理表格风格，但避免“强制 min-width=980”影响小表 */
body.admin-page table.course-table.admin-mini-table {
  min-width: 0;
  width: 100%;
  table-layout: fixed; /* 让小表格拉伸铺满容器宽度 */
}

body.admin-page table.course-table.admin-mini-table th,
body.admin-page table.course-table.admin-mini-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 2px dashed var(--border-soft);
  overflow: hidden;
  text-overflow: ellipsis;
}

body.admin-page table.course-table.admin-mini-table thead th {
  font-size: 0.85rem;
}

/* 反馈看板：覆盖 mini 表的 fixed 布局与溢出，避免匿名列 UUID 压到「来源」列 */
body.admin-page table.course-table.admin-mini-table.admin-feedback-ratings-table {
  table-layout: auto;
  width: 100%;
  min-width: 0;
}

body.admin-page table.course-table.admin-mini-table.admin-feedback-ratings-table th,
body.admin-page table.course-table.admin-mini-table.admin-feedback-ratings-table td {
  vertical-align: top;
}

/* 覆盖全局 .course-table td { white-space: nowrap }，允许意见/匿名列换行 */
body.admin-page table.course-table.admin-mini-table.admin-feedback-ratings-table tbody td {
  white-space: normal;
}

body.admin-page table.course-table.admin-mini-table.admin-feedback-ratings-table tbody td.admin-feedback-ratings-cell-nowrap {
  white-space: nowrap;
}

body.admin-page table.course-table.admin-mini-table.admin-feedback-ratings-table td.admin-feedback-ratings-cell-anon {
  max-width: 22rem;
  min-width: 0;
  word-break: break-all;
  overflow-wrap: anywhere;
  overflow: hidden;
  text-overflow: clip;
}

body.admin-page table.course-table.admin-api-table td code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

body.admin-page input[type="text"],
body.admin-page input[type="number"],
body.admin-page input[type="date"],
body.admin-page input[type="file"],
body.admin-page select,
body.admin-page textarea {
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
  box-shadow: none;
}

body.admin-page input[type="text"]:focus,
body.admin-page input[type="number"]:focus,
body.admin-page input[type="file"]:focus,
body.admin-page select:focus,
body.admin-page textarea:focus {
  outline: none;
  border-color: rgba(230, 0, 18, 0.32);
  box-shadow: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.12);
}

/* 后台：按钮整体更紧凑 */
body.admin-page .btn {
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  border-radius: 999px;
}

body.admin-page .btn.btn-ghost {
  border-width: 2px;
}

body.admin-page .btn.btn-primary {
  border-width: 2px;
}

body.admin-page select {
  appearance: none;
  -webkit-appearance: none;
  width: 100%;
  min-height: 3.05rem;
  padding: 0.72rem 2.5rem 0.72rem 0.9rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.2;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(11, 18, 32, 0.7) 50%),
    linear-gradient(135deg, rgba(11, 18, 32, 0.7) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 12px) 50%;
  background-size: 7px 7px, 7px 7px;
  background-repeat: no-repeat;
}

body.admin-page .file-picker {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.9);
}

body.admin-page .file-picker input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

body.admin-page .file-picker-btn {
  flex: 0 0 auto;
  padding: 0.5rem 0.9rem;
  min-height: 2.4rem;
}

body.admin-page .file-picker-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.9rem;
}

body.admin-page .file-picker:focus-within {
  border-color: rgba(230, 0, 18, 0.32);
  box-shadow: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.12);
}

body.admin-page .btn.btn-primary {
  border: 1px solid rgba(230, 0, 18, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  box-shadow: none;
}

body.admin-page .btn.btn-primary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(230, 0, 18, 0.32);
  color: var(--accent);
  transform: translateY(-3px);
}

body.admin-page .btn.btn-ghost {
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  box-shadow: none;
}

body.admin-page .btn.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(15, 23, 42, 0.22);
  transform: translateY(-3px);
}

.card {
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-stamp);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-xl);
  transform: translateY(-1px);
}

.card h2 {
  margin: 0 0 1.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="number"],
input[type="file"],
input[type="email"],
input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: var(--transition);
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow-sm);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
input[type="email"]:focus,
input[type="password"]:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(230, 0, 18, 0.28), 0 0 0 4px var(--accent-light), var(--shadow-md);
}

input[type="file"] {
  padding: 0.65rem 1rem;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  margin-right: 1rem;
  transition: var(--transition);
  box-shadow: inset 0 0 0 1px var(--border-soft);
}

input[type="file"]::file-selector-button:hover {
  background: var(--accent);
  color: white;
}

textarea {
  width: 100%;
  min-height: 5rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: none;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  line-height: 1.55;
  resize: vertical;
  transition: var(--transition);
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow-sm);
}

textarea:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px rgba(230, 0, 18, 0.28), 0 0 0 4px var(--accent-light), var(--shadow-md);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  border: none;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn::before {
  content: none;
}

.btn:active::before {
  content: none;
}

.btn .ico {
  width: 1.25rem;
  height: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.btn .ico svg {
  width: 1.25rem;
  height: 1.25rem;
  display: block;
}

.btn .lbl {
  white-space: nowrap;
  position: relative;
  z-index: 1;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.25);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(230, 0, 18, 0.35);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(230, 0, 18, 0.2);
}

.btn-ghost {
  background: var(--surface);
  color: var(--ink);
  border: none;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.btn-ghost:hover:not(:disabled) {
  background: #fff;
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
}

.btn-ghost:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}

.status {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--muted);
}

.status.error {
  color: var(--danger);
}

.course-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.course-list li {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1.25rem;
  padding: 1.15rem 1.1rem;
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  background: linear-gradient(135deg, #fffefb 0%, #fff0e6 100%);
  box-shadow: var(--shadow-stamp);
  flex-wrap: wrap;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  margin-bottom: 0;
}

.course-list li:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(230, 0, 18, 0.35);
}

.course-list li:last-child {
  border-bottom: none;
}

.course-list li strong {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}

.course-meta {
  font-size: 0.875rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

.course-item-left {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
  flex: 1 1 420px;
}

.course-thumb {
  width: 168px;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
  background: #000;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(20, 16, 16, 0.12);
  flex: 0 0 auto;
}

.course-thumb.is-thumb-missing,
.learn-featured-thumb.is-thumb-missing{
  background: radial-gradient(540px 260px at 20% 0%, rgba(230, 0, 18, 0.22) 0%, rgba(255, 255, 255, 0) 55%),
    radial-gradient(540px 260px at 85% 100%, rgba(255, 140, 90, 0.18) 0%, rgba(255, 255, 255, 0) 60%),
    linear-gradient(135deg, #141010 0%, #2b1e1b 55%, #141010 100%);
  border-color: rgba(255, 255, 255, 0.22);
}

.course-info {
  min-width: 0;
}

.course-info strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-item-right {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 0 0 auto;
  margin-left: auto;
}

@media (max-width: 720px) {
  .course-thumb {
    width: 132px;
  }
  .course-item-left {
    flex-basis: 100%;
  }
  .course-item-right {
    margin-left: 0;
  }
}

/* 资源库表格（后台管理页） */
.course-table-wrap {
  width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  /* 外层卡片已有边框与阴影，这里只做滚动容器，避免出现“多一层框” */
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.course-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 980px; /* 窄屏横向滚动，避免按钮挤成一团 */
}

.course-table th,
.course-table td {
  padding: 0.9rem 0.85rem;
  border-bottom: 2px dashed var(--border-soft);
  vertical-align: middle;
  /* 放不下就横向滚动，不在单元格内硬换行 */
  white-space: nowrap;
}

.course-table thead th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  border-bottom: 3px solid var(--ink);
  text-align: left;
  font-size: 0.875rem;
  font-weight: 900;
  color: var(--ink);
  z-index: 1;
}

/* 后台壳布局：表头不需要白底 */
body.admin-page .course-table thead th {
  background: transparent;
}

.admin-course-count {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.875rem;
  font-weight: 700;
}

/* 后台课程表：封面缩略图 */
.course-table-thumb {
  width: 112px;
  aspect-ratio: 16 / 9;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: #0f172a;
  object-fit: cover;
  display: block;
  box-shadow: var(--shadow-sm);
}

.poster-modal {
  width: min(960px, calc(100vw - 2rem));
}

.poster-modal-sub {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.poster-candidate-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.poster-candidate-card {
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.poster-candidate-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  object-fit: cover;
  background: #0f172a;
}

.poster-candidate-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.55rem;
}

.poster-candidate-time {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 750;
}

@media (max-width: 760px) {
  .poster-candidate-grid {
    grid-template-columns: 1fr;
  }
}

.course-table tbody tr:hover td {
  background: var(--surface-2);
}

.course-table td strong {
  font-size: 1rem;
  font-weight: 800;
}

.course-table td.title-cell {
  max-width: 260px; /* 约缩短为原来的一半，放不下则省略 */
}

.course-table .title-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}

/* 后台课程表：悬停显示完整标题 */
.admin-title-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: min(420px, calc(100vw - 24px));
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.94);
  color: #f8fafc;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.45;
  white-space: normal;
  word-break: break-word;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  pointer-events: none;
}

.admin-title-tooltip[hidden] {
  display: none !important;
}

.course-link {
  display: inline-block;
  max-width: 420px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

/* 资源库表格内的“编辑”按钮组 */
.course-table .course-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: nowrap;
  margin: 0;
}

.course-table .course-actions .btn {
  padding: 0.55rem 0.9rem;
  font-size: 0.8125rem;
  border-width: 3px;
}

/* 弹窗 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  background: rgba(20, 18, 16, 0.48);
  backdrop-filter: blur(3px);
}

.modal-backdrop.is-open {
  display: flex;
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 820px);
  overflow: hidden;
  border: none;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
  display: flex;
  flex-direction: column;
}

/* 移动端：所有弹窗底部直角（左下/右下不圆角） */
@media (max-width: 768px) {
  .modal {
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
  }
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: none;
  background: rgba(255, 255, 255, 0.55);
}

.modal-title {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: 0.02em;
  font-size: 1.05rem;
  color: var(--ink);
}

.modal-head-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex-shrink: 0;
}

/* 标题栏内成对按钮：统一尺寸（避免 .modal-close 单独缩小 padding） */
.modal-head-actions .btn {
  box-sizing: border-box;
  min-width: 5.25rem;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  justify-content: center;
}

.modal-body {
  padding: 1.25rem;
  overflow: auto;
}

.confirm-text {
  text-align: center;
  font-weight: 650;
  color: var(--text);
  line-height: 1.7;
}

#confirm-status:empty {
  display: none;
}

#rename-status:empty {
  display: none;
}

#task-status:empty {
  display: none;
}

.modal-foot {
  padding: 1rem 1.25rem;
  border-top: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.55);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.task-kind {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.modal-close {
  padding: 0.5rem 0.85rem;
}

/* Player：整页不滚动，仅在内容区内分配高度 */
.player-page {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 1600px;
  margin: 0 auto;
  padding-top: calc(var(--player-gutter) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--player-gutter) + env(safe-area-inset-bottom, 0px));
  padding-left: calc(var(--player-gutter-x) + env(safe-area-inset-left, 0px));
  padding-right: calc(var(--player-gutter-x) + env(safe-area-inset-right, 0px));
  width: 100%;
}

.player-page {
  --player-sub-en-size: calc(1.55rem - 3px + 0.125rem);
  --player-sub-zh-size: calc(0.98rem + 0.125rem);
  --kw-card-font-size: calc(var(--player-sub-en-size) * 0.877 - 0.25rem);
}

@media (min-width: 921px) {
  .player-page {
    --player-sub-en-size: calc(1.14rem + 0.125rem);
    --player-sub-zh-size: calc(0.92rem + 0.125rem);
  }
}

.player-left-topbar {
  position: absolute;
  top: calc(var(--player-gutter) + env(safe-area-inset-top, 0px) - 6px);
  left: calc(var(--player-gutter-x) + env(safe-area-inset-left, 0px));
  margin: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.player-right-topbar {
  position: absolute;
  top: calc(var(--player-gutter) + env(safe-area-inset-top, 0px) - 6px);
  right: calc(var(--player-gutter-x) + env(safe-area-inset-right, 0px));
  margin: 0;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

/* 顶栏按钮统一样式：返回 / 雅思词汇 / 单词本 */
body.player-lock .player-left-topbar > .fc-back,
body.player-lock .player-left-topbar > .topbar-vocab,
body.player-lock .player-right-topbar > .topbar-vocab {
  height: 38px;
  padding: 0 0.85rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
  color: rgba(11, 18, 32, 0.76);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
  transition: var(--transition);
  text-decoration: none;
  cursor: pointer;
}

body.player-lock .player-left-topbar > .fc-back {
  width: 38px;
  padding: 0;
}

body.player-lock .player-left-topbar > .fc-back:hover,
body.player-lock .player-left-topbar > .topbar-vocab:hover,
body.player-lock .player-right-topbar > .topbar-vocab:hover {
  color: var(--p-accent);
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14);
}

body.player-lock .player-left-topbar > .fc-back:active,
body.player-lock .player-left-topbar > .topbar-vocab:active,
body.player-lock .player-right-topbar > .topbar-vocab:active {
  transform: scale(0.98);
}

body.player-lock .player-left-topbar > .fc-back .fc-back-ico,
body.player-lock .player-left-topbar > .topbar-vocab .ico svg {
  width: 18px;
  height: 18px;
  display: block;
}

/* 播放页返回：与闪卡顶栏 .fc-back 一致（需盖过 body.player-lock a 的全局链接色） */
body.player-lock .player-left-topbar .fc-back {
  color: rgba(11, 18, 32, 0.75);
  text-decoration: none;
}

body.player-lock .player-left-topbar .fc-back:hover {
  color: var(--p-accent);
}

body.player-lock .player-left-topbar .fc-back:active {
  color: var(--p-accent-2);
}

/* 顶部标题：黑色框，单独占一行 */
.player-titlebar {
  flex: 0 0 auto;
  width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.05);
  padding: 0.7rem 0.9rem;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.player-titlebar-leading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

body.player-lock .player-titlebar-leading .fc-back {
  color: rgba(0, 0, 0, 0.68);
  text-decoration: none;
}

body.player-lock .player-titlebar-leading .fc-back:hover {
  color: var(--p-accent);
  border-color: rgba(230, 0, 18, 0.28);
  text-decoration: none;
}

.player-title {
  font-family: "Inter", var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--p-ink);
  line-height: 1.25;
  font-size: 1.05rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1 1 auto;
}

.player-title-actions {
  flex: 0 0 auto;
}

.player-vocab-link {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font: inherit;
  font-weight: 700;
  color: var(--p-ink);
  cursor: pointer;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1;
}

.player-vocab-link:hover {
  color: var(--p-accent);
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(230, 0, 18, 0.28);
}

.vocab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
  font-size: 0.75rem;
  line-height: 1;
}

@media (min-width: 1400px) {
  .player-page {
    max-width: 1920px;
  }
}

@media (min-width: 921px) {
  body.player-lock .player-page {
    --player-topbar-reserve: 42px;
    display: flex;
    flex-direction: column;
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    padding-top: calc(
      var(--player-gutter) + var(--player-topbar-reserve) + env(safe-area-inset-top, 0px)
    );
    padding-bottom: calc(
      var(--player-dock-h, 5.5rem) + var(--player-dock-inset) + env(safe-area-inset-bottom, 0px)
    );
  }
}

.player-shell {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: row;
  gap: 1.25rem;
  height: auto;
}

.left-panel {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  /* 改为通铺背景：不再用整块大卡片包住左右内容 */
  border-radius: 0;
  overflow: visible;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.left-main,
.keyword-col,
.right-col {
  min-width: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* 桌面：左视频+字幕+底栏 / 右词卡 */
@media (min-width: 921px) {
  body.player-lock .player-shell {
    flex: 1 1 auto;
    min-height: 0;
  }

  .left-panel {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    column-gap: var(--player-col-gap);
    row-gap: 0;
    align-items: stretch;
    padding-top: 0;
    min-height: 100%;
  }

  .left-main {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    width: 100%;
    padding-top: 0;
    min-height: 0;
    height: var(--player-main-h, var(--player-keyword-h, auto));
    max-height: var(--player-main-h, var(--player-keyword-h, none));
    gap: 0;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-bottom: none;
    border-radius: 18px 18px 0 0;
    box-shadow:
      0 1px 2px rgba(15, 23, 42, 0.06),
      0 12px 32px rgba(15, 23, 42, 0.08);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    overflow: hidden;
  }

  .keyword-col {
    grid-column: 2;
    grid-row: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding-top: 0;
    align-self: stretch;
    margin-top: var(--player-keyword-offset, 0px);
    height: var(--player-keyword-h, auto);
    max-height: var(--player-keyword-h, none);
    overflow: hidden;
  }

  body.player-lock .left-main .keyword-panel {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .left-main .keyword-scroll {
    flex: 1 1 0;
    min-height: 0;
    height: 0;
    max-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.6rem 1rem;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.22) transparent;
  }

  .left-main .keyword-scroll .kw-masonry-col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }

  .left-main .keyword-scroll .kw-masonry-item {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
  }

  .left-main .keyword-scroll .kw-masonry-item .kw-card {
    width: 100%;
    margin: 0;
    min-width: 0;
  }

  .left-main .keyword-scroll .kw-masonry-item .kw-preview,
  .left-main .keyword-scroll .kw-masonry-item .kw-card-top {
    min-width: 0;
  }

  .left-main .keyword-scroll .kw-empty {
    flex: 1 1 100%;
    width: 100%;
    margin: 0;
  }

  .left-main .keyword-scroll::-webkit-scrollbar {
    width: 6px;
  }

  .left-main .keyword-scroll::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.18);
  }

  .left-main .keyword-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(15, 23, 42, 0.28);
  }

  body.player-lock .left-main .video-wrap {
    flex: 0 0 auto;
    border-radius: 0;
    box-shadow: none;
  }

  body.player-lock .left-main .video-wrap::before,
  body.player-lock .left-main .video-wrap::after {
    border-radius: 0;
  }

  .left-main .now-controls {
    display: none;
  }

  .keyword-col > .now-line {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0;
    padding: 0;
    border-radius: 18px 18px 0 0;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-bottom: none;
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow: none;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
  }

  .keyword-col > .now-line .now-line-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.7rem 0.85rem 0.6rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    mask-image: linear-gradient(
      to bottom,
      #000 0%,
      #000 calc(100% - 2.5rem),
      transparent 100%
    );
    -webkit-mask-image: linear-gradient(
      to bottom,
      #000 0%,
      #000 calc(100% - 2.5rem),
      transparent 100%
    );
  }

  .keyword-col > .now-line .now-line-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  body.player-lock .keyword-col > .now-line .sub-line {
    opacity: 1;
    filter: none;
    transform: none;
    border: none;
    background: transparent;
    text-align: left;
    transition:
      opacity 280ms ease,
      background 280ms ease,
      box-shadow 280ms ease;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.active {
    position: relative;
    margin: 0.15rem 0 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    border-left: 3px solid var(--p-accent);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 2px 12px rgba(230, 0, 18, 0.06);
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.active .en {
    font-family: var(--font-display);
    font-size: calc(var(--player-sub-en-size) - 0.125rem);
    font-weight: 650;
    letter-spacing: -0.015em;
    line-height: 1.55;
    color: var(--p-ink);
    text-align: left;
    width: 100%;
    margin-bottom: 0;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.active .zh {
    font-size: calc(var(--player-sub-zh-size) - 0.125rem);
    font-weight: 500;
    line-height: 1.58;
    color: var(--p-muted);
    margin-top: 0.38rem;
    text-align: left;
    width: 100%;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.active .en .w {
    border-radius: 5px;
    padding: 0 2px;
    margin: 0 -2px;
    transition: background 160ms ease, color 160ms ease;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.active .en .w:hover {
    background: rgba(230, 0, 18, 0.08);
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.past,
  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming {
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-radius: 14px;
    border-left: 3px solid transparent;
    cursor: pointer;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.past {
    opacity: 0.46;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.past:hover,
  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:hover {
    background: rgba(15, 23, 42, 0.03);
    border-left-color: rgba(15, 23, 42, 0.08);
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:nth-child(2) {
    opacity: 0.82;
  }
  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:nth-child(3) {
    opacity: 0.68;
  }
  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:nth-child(n + 4) {
    opacity: 0.52;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.past .en,
  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming .en {
    font-family: var(--font-display);
    font-size: calc(var(--player-sub-en-size) - 0.25rem);
    font-weight: 500;
    line-height: 1.52;
    letter-spacing: -0.01em;
    color: rgba(11, 18, 32, 0.48);
    margin-bottom: 0;
    text-align: left;
  }

  .keyword-col > .now-line .now-line-scroll .sub-line.past .zh,
  .keyword-col > .now-line .now-line-scroll .sub-line.upcoming .zh {
    font-size: calc(var(--player-sub-zh-size) - 0.25rem);
    font-weight: 500;
    line-height: 1.55;
    color: rgba(11, 18, 32, 0.28);
    margin-top: 0.22rem;
    text-align: left;
  }

  .player-page {
    --player-subtitle-bottom-gap: 0px;
  }

  body.player-lock #player-bottom-dock {
    position: fixed;
    top: auto;
    left: var(--player-dock-left, 0);
    width: var(--player-dock-width, 100%);
    right: auto;
    bottom: calc(var(--player-dock-inset) + env(safe-area-inset-bottom, 0px));
    z-index: 45;
    pointer-events: none;
    background: transparent;
  }

  body.player-lock #player-bottom-dock > * {
    pointer-events: auto;
  }

  body.player-lock #player-bottom-dock .control-bar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    width: 100%;
    margin: 0;
    padding: 0.45rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    border-radius: 0 0 18px 18px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.78);
    -webkit-backdrop-filter: blur(18px) saturate(150%);
    backdrop-filter: blur(18px) saturate(150%);
    box-shadow:
      0 8px 24px rgba(15, 23, 42, 0.06),
      0 1px 2px rgba(15, 23, 42, 0.04);
  }
}

/* 桌面：速度/字幕弹层（.menu-pop）在 now-controls 内绝对定位；
   now-controls 若 overflow:hidden 会把弹层裁掉 */
@media (min-width: 921px) {
  .now-controls {
    overflow: visible;
  }
}

/* 视频下方：与视频同一底板，仅用顶部分隔线区分 */
.now-controls {
  flex: 0 0 auto;
  width: 100%;
  max-width: none; /* 与视频同宽 */
  margin: 0;
  border: none;
  border-radius: 0;
  border-top: none;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  padding: 0.95rem 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
}

/* 通铺背景模式下：控制区也做独立圆角（不再依赖 left-panel 裁切） */
body.player-lock .now-controls {
  border-radius: 18px;
  box-shadow: none;
}

.video-progress {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  flex: 0 0 auto;
  width: 100%;
}

.video-time {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.82rem;
  color: var(--p-muted);
  min-width: 3.2rem;
  text-align: center;
}

.video-seek {
  width: 100%;
  margin: 0;
  appearance: none;
  height: 34px;
  background: transparent;
}

.video-seek:focus {
  outline: none;
}

.video-seek::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
      90deg,
      rgba(230, 0, 18, 0.95) 0%,
      rgba(230, 0, 18, 0.95) var(--pct, 0%),
      rgba(15, 23, 42, 0.14) var(--pct, 0%),
      rgba(15, 23, 42, 0.14) 100%
    );
}

.video-seek::-webkit-slider-thumb {
  appearance: none;
  width: 28px;
  height: 28px;
  margin-top: -10px;
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' width='64' height='64'%3E%3Cpath d='M16 30L10 12L28 20Z' fill='%23F59E0B' stroke='%23D97706' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M48 30L54 12L36 20Z' fill='%23F59E0B' stroke='%23D97706' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M15 26L12 16L23 21Z' fill='%23FEF3C7'/%3E%3Cpath d='M49 26L52 16L41 21Z' fill='%23FEF3C7'/%3E%3Ccircle cx='32' cy='36' r='22' fill='%23F59E0B' stroke='%23D97706' stroke-width='2'/%3E%3Cpath d='M32 58C20 58 10 48 10 36C10 30 14 26 20 28C26 30 28 36 32 36C36 36 38 30 44 28C50 26 54 30 54 36C54 48 44 58 32 58Z' fill='%23FFFFFF'/%3E%3Ccircle cx='22' cy='32' r='3.5' fill='%231F2937'/%3E%3Ccircle cx='42' cy='32' r='3.5' fill='%231F2937'/%3E%3Ccircle cx='22' cy='24' r='2.5' fill='%23FEF3C7'/%3E%3Ccircle cx='42' cy='24' r='2.5' fill='%23FEF3C7'/%3E%3Cellipse cx='32' cy='39' rx='5' ry='3.5' fill='%231F2937'/%3E%3Cpath d='M26 45Q32 49 38 45' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 28px 28px;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.video-seek::-moz-range-track {
  height: 8px;
  border-radius: 999px;
  background: linear-gradient(
      90deg,
      rgba(230, 0, 18, 0.95) 0%,
      rgba(230, 0, 18, 0.95) var(--pct, 0%),
      rgba(15, 23, 42, 0.14) var(--pct, 0%),
      rgba(15, 23, 42, 0.14) 100%
    );
}

.video-seek::-moz-range-thumb {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64' width='64' height='64'%3E%3Cpath d='M16 30L10 12L28 20Z' fill='%23F59E0B' stroke='%23D97706' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M48 30L54 12L36 20Z' fill='%23F59E0B' stroke='%23D97706' stroke-width='2' stroke-linejoin='round'/%3E%3Cpath d='M15 26L12 16L23 21Z' fill='%23FEF3C7'/%3E%3Cpath d='M49 26L52 16L41 21Z' fill='%23FEF3C7'/%3E%3Ccircle cx='32' cy='36' r='22' fill='%23F59E0B' stroke='%23D97706' stroke-width='2'/%3E%3Cpath d='M32 58C20 58 10 48 10 36C10 30 14 26 20 28C26 30 28 36 32 36C36 36 38 30 44 28C50 26 54 30 54 36C54 48 44 58 32 58Z' fill='%23FFFFFF'/%3E%3Ccircle cx='22' cy='32' r='3.5' fill='%231F2937'/%3E%3Ccircle cx='42' cy='32' r='3.5' fill='%231F2937'/%3E%3Ccircle cx='22' cy='24' r='2.5' fill='%23FEF3C7'/%3E%3Ccircle cx='42' cy='24' r='2.5' fill='%23FEF3C7'/%3E%3Cellipse cx='32' cy='39' rx='5' ry='3.5' fill='%231F2937'/%3E%3Cpath d='M26 45Q32 49 38 45' fill='none' stroke='%231F2937' stroke-width='2.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-size: 28px 28px;
  background-repeat: no-repeat;
  background-position: center;
  border: none;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

body.player-lock[data-progress-on-video="1"] .video-wrap .video-progress {
  position: absolute;
  left: clamp(1rem, 2.4vw, 1.8rem);
  right: clamp(1rem, 2.4vw, 1.8rem);
  bottom: clamp(0.85rem, 2vw, 1.35rem);
  width: auto;
  max-width: none;
  box-sizing: border-box;
  z-index: 12;
  padding: 0;
  gap: 0.75rem;
  background: transparent;
  border-radius: 0;
  pointer-events: none;
  overflow: hidden;
}

body.player-lock[data-progress-on-video="1"] .video-wrap .video-time {
  color: rgba(255, 255, 255, 0.94);
  min-width: 3.2rem;
  text-shadow: 0 1px 7px rgba(0, 0, 0, 0.72);
}

body.player-lock[data-progress-on-video="1"] .video-wrap .video-seek {
  height: 34px;
  pointer-events: auto;
}

body.player-lock[data-progress-on-video="1"] .video-wrap .video-seek::-webkit-slider-runnable-track {
  background: linear-gradient(
    90deg,
    rgba(230, 0, 18, 0.98) 0%,
    rgba(230, 0, 18, 0.98) var(--pct, 0%),
    rgba(255, 255, 255, 0.28) var(--pct, 0%),
    rgba(255, 255, 255, 0.28) 100%
  );
}

body.player-lock[data-progress-on-video="1"] .video-wrap .video-seek::-moz-range-track {
  background: linear-gradient(
    90deg,
    rgba(230, 0, 18, 0.98) 0%,
    rgba(230, 0, 18, 0.98) var(--pct, 0%),
    rgba(255, 255, 255, 0.28) var(--pct, 0%),
    rgba(255, 255, 255, 0.28) 100%
  );
}

body.player-lock[data-progress-on-video="1"] .video-wrap #media-host {
  padding-bottom: 0;
}

.left-bottom {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.keyword-panel {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 8px 24px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}

.keyword-head {
  flex: 0 0 auto;
  padding: 0.7rem 0.8rem 0.5rem;
  border-bottom: 1px solid var(--p-sub-divider);
  background: rgba(255, 255, 255, 0.45);
}

.keyword-title {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--p-ink);
  letter-spacing: -0.01em;
}

.vocab-mastery-hint {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--p-muted);
  line-height: 1.45;
}

.keyword-sub {
  margin: 0.18rem 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--p-muted);
}

.keyword-mobile-entry {
  display: none;
}

.keyword-head--desktop {
  display: block;
}

.keyword-head--entry {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0;
  border: none;
  background: transparent;
}

.keyword-head-main {
  min-width: 0;
  flex: 1 1 auto;
  text-align: left;
}

.keyword-entry-side {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.1rem;
}

.keyword-entry-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.5rem;
  height: 1.5rem;
  padding: 0 0.45rem;
  border-radius: 999px;
  background: rgba(230, 0, 18, 0.1);
  color: var(--p-accent);
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1;
}

.keyword-entry-chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: rgba(15, 23, 42, 0.38);
}

.kw-list-backdrop {
  z-index: 1240;
  background: rgba(11, 18, 32, 0.46);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.kw-list-backdrop.is-open {
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

@keyframes kw-list-sheet-in {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.kw-list-modal {
  width: 100%;
  max-width: 100%;
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  margin: 0;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 44px rgba(15, 23, 42, 0.18);
  animation: kw-list-sheet-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .kw-list-modal {
    animation: none;
  }
}

.kw-list-modal .modal-head {
  flex: 0 0 auto;
  padding: 1rem 1rem 0.65rem;
  background: transparent;
}

.kw-list-modal .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  padding: 0 0.85rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

.kw-list-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
  height: 100%;
  padding-top: 0;
}

.kw-list-modal-sub {
  margin: 0 0 0.55rem;
  padding: 0 0.15rem;
  flex: 0 0 auto;
}

.keyword-scroll {
  flex: 1 1 0;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.5rem 0.65rem 0.7rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 921px) {
  .keyword-scroll.keyword-scroll--inline .kw-card {
    flex: 0 0 auto;
    height: auto;
    min-height: 0;
    max-height: none;
    min-width: 0;
  }

  .keyword-scroll.keyword-scroll--inline .kw-card-top {
    flex-wrap: wrap;
    row-gap: 0.25rem;
  }

  .keyword-scroll.keyword-scroll--inline .kw-add-vocab {
    font-size: 0.68rem;
    padding: 0.18rem 0.45rem;
  }

  .keyword-scroll.keyword-scroll--inline .kw-card-expand-body {
    flex: 0 0 auto;
    height: auto;
    overflow: visible;
  }

  .keyword-scroll.keyword-scroll--inline .kw-card-expand-body .def-grid {
    gap: 0.55rem;
  }

  .keyword-scroll.keyword-scroll--inline .kw-card-expand-body .def-item {
    grid-template-columns: 3.25rem minmax(0, 1fr);
    gap: 0.4rem;
    align-items: start;
  }

  .keyword-scroll.keyword-scroll--inline .kw-card-expand-body .def-value,
  .keyword-scroll.keyword-scroll--inline .kw-card-expand-body .def-meaning,
  .keyword-scroll.keyword-scroll--inline .kw-card-expand-body .def-meanings {
    overflow: visible;
    max-height: none;
  }
}

.keyword-scroll.keyword-scroll--modal {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 14rem;
  max-height: none;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  gap: 0.5rem;
  padding: 0.65rem 0.55rem 0.75rem;
  background: rgba(15, 23, 42, 0.045);
  border-radius: 14px;
}

.keyword-scroll.keyword-scroll--modal .kw-masonry-item {
  display: block;
  width: 100%;
  margin: 0;
}

.kw-empty {
  margin: 0.5rem 0;
  padding: 0.75rem 0.35rem;
  color: var(--p-muted);
  font-size: 0.86rem;
  font-weight: 650;
  text-align: center;
}

.kw-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  flex: 0 0 auto;
  height: auto;
  min-height: 0;
  max-height: none;
  align-self: auto;
  font-size: var(--kw-card-font-size, 1rem);
  line-height: 1.55;
  padding: 0.62rem 0.65rem 0.58rem;
  overflow: visible;
  cursor: default;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(15, 23, 42, 0.07);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    transform 180ms ease;
}

.kw-card:hover {
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
}

.kw-card--pending {
  opacity: 0.92;
}

.kw-card.kw-card--mastered {
  opacity: 0.58;
  background: rgba(243, 244, 246, 0.94);
  border-color: rgba(15, 23, 42, 0.05);
  box-shadow: none;
}

.kw-card.kw-card--mastered .kw-card-word,
.kw-card.kw-card--mastered .kw-preview-phonetic,
.kw-card.kw-card--mastered .kw-preview-def,
.kw-card.kw-card--mastered .kw-preview-meaning,
.kw-card.kw-card--mastered .def-label,
.kw-card.kw-card--mastered .def-value,
.kw-card.kw-card--mastered .def-meaning,
.kw-card.kw-card--mastered .def-meanings,
.kw-card.kw-card--mastered .def-example,
.kw-card.kw-card--mastered .def-example-zh {
  color: rgba(11, 18, 32, 0.42);
}

.kw-card.kw-card--mastered:hover {
  opacity: 0.62;
  border-color: rgba(15, 23, 42, 0.08);
  box-shadow: none;
  transform: none;
}

.kw-card.kw-card--mastered .kw-mastery-check {
  opacity: 1;
}

.kw-add-vocab {
  flex: 0 0 auto;
  padding: 0.2rem 0.55rem;
  height: auto;
  min-height: 0;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.9);
  color: rgba(11, 18, 32, 0.88);
  box-shadow: none;
  white-space: nowrap;
}

.kw-add-vocab:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.98);
  border-color: rgba(230, 0, 18, 0.28);
  color: #e60012;
  transform: none;
}

.kw-add-vocab:disabled,
.kw-add-vocab.kw-add-vocab--added {
  opacity: 0.55;
  cursor: default;
  border-color: rgba(15, 23, 42, 0.1);
  color: rgba(11, 18, 32, 0.5);
}

.kw-card-modal-actions .kw-add-vocab {
  font-size: 0.78rem;
  padding: 0.28rem 0.7rem;
}

.kw-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  min-width: 0;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  cursor: default;
}

.kw-card-wordline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  min-width: 0;
  flex: 1 1 auto;
}

.kw-card-word {
  color: var(--p-ink);
  font-weight: 800;
  font-size: calc(1em + 0.125rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.kw-corpus-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 1.25rem;
  padding: 0.08rem 0.44rem;
  border: 1px solid rgba(230, 0, 18, 0.14);
  border-radius: 999px;
  background: rgba(230, 0, 18, 0.08);
  color: #d90012;
  font-size: 0.72em;
  font-weight: 850;
  line-height: 1.2;
  white-space: normal;
}

.kw-corpus-badge[hidden] {
  display: none;
}

.kw-mastery-check {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex: 0 0 auto;
  line-height: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.kw-mastery-check-box {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 0.35rem;
  border: 1.5px solid rgba(15, 23, 42, 0.22);
  background: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.kw-mastery-check-mark {
  width: 0.82rem;
  height: 0.82rem;
  opacity: 0;
  transform: scale(0.72);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  color: #fff;
}

.kw-mastery-check.is-checked .kw-mastery-check-box {
  background: #16a34a;
  border-color: #16a34a;
  box-shadow: 0 1px 4px rgba(22, 163, 74, 0.22);
}

.kw-mastery-check.is-checked .kw-mastery-check-mark {
  opacity: 1;
  transform: scale(1);
}

.kw-mastery-check:hover:not(.is-checked) .kw-mastery-check-box {
  border-color: rgba(15, 23, 42, 0.34);
  background: rgba(15, 23, 42, 0.03);
}

.kw-mastery-check:focus-visible .kw-mastery-check-box {
  outline: 2px solid rgba(37, 99, 235, 0.45);
  outline-offset: 2px;
}

@media (min-width: 921px) {
  .left-main .kw-mastery-check-box {
    width: 1.28rem;
    height: 1.28rem;
  }
}

.kw-preview {
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  overflow: visible;
  padding-right: 0.1rem;
}

.kw-preview-phonetic-row {
  display: flex;
  align-items: center;
  gap: 0.32rem;
  min-width: 0;
  flex: 0 0 auto;
}

.kw-say-btn {
  flex: 0 0 auto;
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.92);
  color: rgba(11, 18, 32, 0.58);
  width: 1.42rem;
  height: 1.42rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

.kw-say-btn:hover {
  color: var(--p-accent);
  border-color: rgba(230, 0, 18, 0.22);
  background: rgba(230, 0, 18, 0.06);
  box-shadow: 0 1px 4px rgba(230, 0, 18, 0.1);
}

.kw-say-ico {
  width: 0.78rem;
  height: 0.78rem;
  display: block;
}

.kw-preview-phonetic {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: inherit;
  font-weight: 500;
  line-height: 1.45;
  color: rgba(11, 18, 32, 0.48);
  font-family: var(--font-display, inherit);
  letter-spacing: 0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kw-preview-def {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  color: rgba(11, 18, 32, 0.78);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kw-preview-pos {
  display: inline;
  margin-right: 0.28rem;
  font-weight: 700;
  color: rgba(11, 18, 32, 0.45);
}

.kw-preview-meaning {
  font-weight: 550;
  color: rgba(11, 18, 32, 0.78);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.kw-preview-empty {
  color: rgba(11, 18, 32, 0.32);
}

.kw-preview--loading {
  font-size: inherit;
  color: rgba(11, 18, 32, 0.38);
}

.kw-card-expand-body {
  flex: 0 0 auto;
  height: auto;
  min-width: 0;
  overflow: visible;
  font-size: inherit;
  line-height: inherit;
}

.player-page .kw-card .def-label,
.player-page .kw-card .def-value,
.player-page .kw-card .def-meaning,
.player-page .kw-card .def-meanings,
.player-page .kw-card .def-example,
.player-page .kw-card .def-example-zh,
.player-page .kw-card .def-usage,
.player-page .kw-card .def-phonetic,
.player-page .kw-card .def-loading,
.player-page .kw-card .def-placeholder {
  font-size: inherit;
  line-height: inherit;
}

@media (max-width: 920px) {
  .keyword-scroll.keyword-scroll--modal .kw-card:not(.kw-card--expanded) {
    height: auto;
    min-height: 7.5rem;
    max-height: 7.5rem;
    overflow: hidden;
    transition:
      border-color 0.18s ease,
      box-shadow 0.18s ease;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card.kw-card--expanded {
    height: auto;
    min-height: auto;
    max-height: none;
    overflow: visible;
    align-self: start;
    cursor: default;
    border-color: rgba(230, 0, 18, 0.14);
    box-shadow: 0 4px 16px rgba(230, 0, 18, 0.07);
  }

  .keyword-scroll.keyword-scroll--modal .kw-card.kw-card--expanded .kw-preview {
    display: none;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body {
    display: none;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card.kw-card--expanded .kw-card-expand-body {
    display: block;
    flex: 0 0 auto;
    height: auto;
    min-width: 0;
    overflow: visible;
    padding-top: 0.1rem;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-grid {
    gap: 0.55rem;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-item {
    gap: 0.2rem;
    align-items: start;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-label {
    font-size: inherit;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-value,
  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-meaning,
  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-meanings {
    overflow: visible;
    max-height: none;
    font-size: inherit;
    line-height: inherit;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-value,
  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-meaning {
    font-size: inherit;
    line-height: inherit;
  }

  .keyword-scroll.keyword-scroll--modal .kw-card-expand-body .def-example {
    font-size: inherit;
    line-height: inherit;
  }
}

.kw-card .def-pop-head {
  padding: 0.85rem 1rem;
}

.kw-card .def-pop-body {
  padding: 1rem;
  max-height: none;
  overflow: visible;
}

.kw-card-backdrop .kw-card-modal {
  width: min(440px, calc(100% - 2rem));
  max-height: min(78vh, 620px);
}

.kw-card-modal-head {
  align-items: flex-start;
  gap: 0.75rem;
}

.kw-card-modal-head-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  min-width: 0;
  flex: 1 1 auto;
}

.kw-card-modal-titleline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  min-width: 0;
}

.kw-card-modal-word {
  margin: 0;
  color: var(--p-ink);
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-break: break-word;
}

.kw-card-modal-body {
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 1.15rem 1.2rem;
  font-size: 0.95rem;
  line-height: 1.65;
}

.video-wrap {
  position: relative;
  width: 100%;
  background: #000;
  border-radius: 0;
  overflow: hidden;
  /* 固定 16:9：播放区域保持横屏比例 */
  aspect-ratio: 16 / 9;
  flex: 0 0 auto;
  min-height: 0;
  /* 视频高度由宽度与 16:9 决定；剩余高度由下方 now-controls 补上 */
  max-height: none;
  box-shadow: none;
  transform: translateZ(0);
  isolation: isolate;
}

body[data-wechat-webview="1"] .video-wrap {
  transform: none;
  isolation: auto;
}

body[data-wechat-webview="1"] #media-host {
  z-index: 3;
}

body[data-wechat-webview="1"] .video-wrap::before,
body[data-wechat-webview="1"] .video-wrap::after {
  display: none;
}

.video-wrap::before,
.video-wrap::after {
  content: "";
  position: absolute;
  inset: -2px;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.22s ease, filter 0.22s ease, transform 0.22s ease;
}

body.player-lock .video-wrap::before,
body.player-lock .video-wrap::after {
  border-radius: 0;
}

/* 通铺背景模式下：视频区自身承担卡片层级与圆角 */
body.player-lock .video-wrap {
  border-radius: 18px;
  box-shadow: none;
}

body.player-lock .video-wrap::before,
body.player-lock .video-wrap::after {
  border-radius: 18px;
}

/* 霓虹边框：只在播放/缓冲时显现 */
.video-wrap::before {
  border-radius: calc(var(--radius-lg) + 2px);
  background:
    conic-gradient(
      from 180deg,
      rgba(124, 92, 255, 0.0),
      rgba(56, 189, 248, 0.85),
      rgba(34, 197, 94, 0.75),
      rgba(230, 0, 18, 0.85),
      rgba(124, 92, 255, 0.0)
    );
  filter: blur(12px) saturate(130%);
  mix-blend-mode: screen;
  animation: videoNeonSpin 5.5s linear infinite;
}

/* 扫描线 + 噪点：加强“屏幕感” */
.video-wrap::after {
  border-radius: calc(var(--radius-lg) + 2px);
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.00) 0px,
      rgba(255,255,255,0.00) 6px,
      rgba(255,255,255,0.035) 7px,
      rgba(255,255,255,0.00) 10px
    ),
    radial-gradient(900px 420px at 25% 12%, rgba(56, 189, 248, 0.12), transparent 60%),
    radial-gradient(900px 420px at 85% 18%, rgba(230, 0, 18, 0.10), transparent 62%),
    radial-gradient(1100px 520px at 50% 100%, rgba(124, 92, 255, 0.10), transparent 65%);
  opacity: 0.0;
  mix-blend-mode: overlay;
  animation: videoScanDrift 2.4s ease-in-out infinite;
}

.video-wrap.is-playing::before,
.video-wrap.is-playing::after {
  opacity: 1;
}

.video-wrap.is-playing::after {
  opacity: 0.38;
}

/* Player 在极简玻璃风下：弱化霓虹/扫描线，避免风格“赛博”突兀 */
body.player-lock .video-wrap::before {
  filter: blur(16px) saturate(110%);
  opacity: 0 !important;
  animation: none !important;
}

body.player-lock .video-wrap::after {
  opacity: 0 !important;
  animation: none !important;
}

/* 与上面圆角一致：避免伪元素溢出露出直角 */
body.player-lock .video-wrap::before,
body.player-lock .video-wrap::after {
  border-radius: 18px;
}

body.player-lock .video-wrap.is-buffering::before,
body.player-lock .video-wrap.is-buffering::after {
  opacity: 0.14 !important;
}

.video-wrap.is-buffering::before {
  opacity: 1;
  animation-duration: 1.35s;
  filter: blur(14px) saturate(150%);
}

.video-wrap.is-buffering::after {
  opacity: 0.55;
}

.video-wrap.is-paused::before {
  opacity: 0.22;
  animation-play-state: paused;
  filter: blur(16px) saturate(115%);
}

.video-wrap.is-paused::after {
  opacity: 0.12;
}

@keyframes videoNeonSpin {
  0% { transform: rotate(0deg) scale(1.0); }
  100% { transform: rotate(360deg) scale(1.0); }
}

@keyframes videoScanDrift {
  0% { transform: translateY(0px); filter: blur(0px); }
  50% { transform: translateY(4px); filter: blur(0.2px); }
  100% { transform: translateY(0px); filter: blur(0px); }
}

.audio-visual {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(1200px 420px at 50% 85%, rgba(124, 92, 255, 0.18), transparent 60%),
    radial-gradient(900px 360px at 20% 20%, rgba(56, 189, 248, 0.14), transparent 60%),
    radial-gradient(900px 360px at 80% 20%, rgba(34, 197, 94, 0.10), transparent 60%),
    #070812;
  z-index: 0;
  isolation: isolate;
}

.audio-visual::before,
.audio-visual::after {
  content: "";
  position: absolute;
  inset: -10%;
  pointer-events: none;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.22s ease, filter 0.22s ease;
}

/* 彩色旋转能量环 */
.audio-visual::before {
  background:
    conic-gradient(
      from 45deg,
      rgba(56, 189, 248, 0.0),
      rgba(56, 189, 248, 0.65),
      rgba(124, 92, 255, 0.70),
      rgba(230, 0, 18, 0.55),
      rgba(34, 197, 94, 0.55),
      rgba(56, 189, 248, 0.0)
    );
  filter: blur(18px) saturate(150%);
  mix-blend-mode: screen;
  animation: audioHaloSpin 6.2s linear infinite;
}

/* 轻微扫描线 + 颗粒 */
.audio-visual::after {
  background:
    repeating-linear-gradient(
      180deg,
      rgba(255,255,255,0.00) 0px,
      rgba(255,255,255,0.00) 5px,
      rgba(255,255,255,0.035) 6px,
      rgba(255,255,255,0.00) 10px
    ),
    radial-gradient(circle at 35% 40%, rgba(255,255,255,0.08), transparent 55%),
    radial-gradient(circle at 70% 65%, rgba(255,255,255,0.06), transparent 60%);
  mix-blend-mode: overlay;
  animation: audioGrainDrift 2.7s ease-in-out infinite;
}

.audio-visual.is-playing::before { opacity: 1; }
.audio-visual.is-playing::after { opacity: 0.35; }

.audio-visual.is-buffering::before {
  opacity: 1;
  animation-duration: 1.4s;
  filter: blur(22px) saturate(170%);
}
.audio-visual.is-buffering::after { opacity: 0.55; }

.audio-visual.is-paused::before {
  opacity: 0.25;
  animation-play-state: paused;
  filter: blur(22px) saturate(120%);
}
.audio-visual.is-paused::after { opacity: 0.14; }

.audio-visual-core {
  width: min(22%, 140px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.35), rgba(124,92,255,0.18) 45%, rgba(0,0,0,0) 70%);
  filter: blur(0.2px);
  box-shadow:
    0 0 0 1px rgba(255,255,255,0.10) inset,
    0 20px 60px rgba(0,0,0,0.45);
  position: relative;
  z-index: 1;
  animation: audioCoreBreath 3.6s ease-in-out infinite;
}

.audio-visual.is-playing .audio-visual-core {
  animation-duration: 2.15s;
}

.audio-visual.is-buffering .audio-visual-core {
  animation-duration: 1.15s;
  filter: blur(0.35px) saturate(120%);
}

.audio-visual.is-paused .audio-visual-core {
  animation-duration: 4.6s;
  opacity: 0.95;
}

@keyframes audioHaloSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes audioGrainDrift {
  0% { transform: translateY(0px); filter: blur(0px); }
  50% { transform: translateY(3px); filter: blur(0.2px); }
  100% { transform: translateY(0px); filter: blur(0px); }
}

@keyframes audioCoreBreath {
  0%,
  100% {
    transform: scale(1);
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.10) inset,
      0 20px 60px rgba(0,0,0,0.45),
      0 0 0 0 rgba(56, 189, 248, 0.0);
  }
  50% {
    transform: scale(1.05);
    box-shadow:
      0 0 0 1px rgba(255,255,255,0.14) inset,
      0 24px 80px rgba(0,0,0,0.55),
      0 0 0 14px rgba(56, 189, 248, 0.0);
  }
}

.audio-ripple {
  position: absolute;
  width: min(32%, 240px);
  aspect-ratio: 1 / 1;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.16);
  box-shadow: 0 0 0 1px rgba(124, 92, 255, 0.14) inset;
  opacity: 0;
  transform: scale(0.75);
  animation: audioRipple 3.2s ease-out infinite;
  z-index: 1;
}
.audio-ripple.r2 { animation-delay: 1.05s; }
.audio-ripple.r3 { animation-delay: 2.1s; }

@keyframes audioRipple {
  0% { opacity: 0; transform: scale(0.72); }
  15% { opacity: 0.65; }
  100% { opacity: 0; transform: scale(2.05); }
}

#media-host {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* 遮住视频内烧录字幕（底部渐变蒙层） */
.video-sub-mask {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(3rem, 17%, 5rem);
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.98) 0%,
    rgba(0, 0, 0, 0.94) 28%,
    rgba(0, 0, 0, 0.72) 58%,
    rgba(0, 0, 0, 0.18) 82%,
    transparent 100%
  );
}

body[data-video-sub-mask="1"] .video-sub-mask {
  display: block;
}

body.player-lock[data-video-sub-mask="1"] .video-sub-mask {
  border-radius: 0 0 18px 18px;
}

body.player-lock[data-progress-on-video="1"][data-video-sub-mask="1"] .video-sub-mask {
  height: clamp(3.4rem, 19%, 5.4rem);
}

.video-wrap.is-video-mini .video-sub-mask {
  border-radius: 0 0 12px 12px;
  height: clamp(2rem, 22%, 3rem);
}

/* 视频盲听/挖空时自动小窗：主区域为听音波纹（复用 #audio-visual），画面缩至左上减轻烧录字幕 */
.video-wrap.is-video-mini #media-host {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  right: auto;
  width: min(38%, 300px);
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 48%;
  z-index: 5;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.55);
  border: 2px solid rgba(255, 255, 255, 0.3);
  background: #000;
}

.video-wrap.is-video-mini #media-host video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 720px) {
  .video-wrap.is-video-mini #media-host {
    width: min(44%, 220px);
    max-height: 52%;
    top: 0.35rem;
    left: 0.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .video-wrap::before,
  .video-wrap::after,
  .audio-visual::before,
  .audio-visual::after,
  .audio-visual-core,
  .audio-ripple {
    animation: none !important;
    transition: none !important;
  }
  .video-wrap.is-playing::before,
  .video-wrap.is-playing::after,
  .audio-visual.is-playing::before,
  .audio-visual.is-playing::after {
    opacity: 0.18;
  }
}

#media-host video,
#media-host audio,
#media-host iframe {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
  border: 0;
  outline: none;
}

#media-host video,
#media-host audio {
  cursor: pointer;
}

.video-title {
  flex: 0 0 auto;
  margin-top: 0.55rem;
  margin-bottom: 0.25rem;
  padding: 0 0.25rem;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.01em;
  color: rgba(0, 0, 0, 0.85);
  line-height: 1.35;
  text-align: center;
  font-size: calc(clamp(1.05rem, 1.5vw, 1.35rem) - 3px);
}

body.player-lock .video-wrap .video-title {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3;
  margin: 0;
  padding: 0.75rem 1rem 2rem;
  text-align: left;
  color: #fff;
  font-size: clamp(0.86rem, 1.2vw, 1.05rem);
  line-height: 1.4;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.28) 55%, transparent 100%);
}

body.player-lock .video-wrap .video-title:empty {
  display: none;
}

.video-title:empty {
  display: none;
}

.achievement-backdrop {
  z-index: 1200;
  background: rgba(11, 18, 32, 0.46);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.achievement-modal {
  position: relative;
  width: min(760px, calc(100vw - 2rem));
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 252, 0.96));
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
  animation: achievement-pop 520ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}

@media (max-width: 768px) {
  .achievement-modal {
    border-radius: 24px !important;
  }
}

.achievement-body {
  position: relative;
  z-index: 2;
  padding: 2.35rem 2rem 1.2rem;
  text-align: center;
}

.achievement-medal {
  width: 104px;
  height: 104px;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--p-accent, #e60012);
  background: rgba(230, 0, 18, 0.09);
  box-shadow: 0 18px 48px rgba(230, 0, 18, 0.18), 0 0 0 18px rgba(230, 0, 18, 0.035);
  animation: achievement-medal-pulse 1500ms ease-in-out infinite;
}

.achievement-medal svg {
  width: 62px;
  height: 62px;
}

.achievement-body h2 {
  margin: 0;
  color: var(--p-ink, #0b1220);
  font-size: 2rem;
  line-height: 1.18;
  letter-spacing: 0;
}

.achievement-summary {
  margin: 0.7rem auto 1rem;
  color: rgba(15, 23, 42, 0.66);
  font-weight: 760;
  line-height: 1.5;
}

.achievement-summary strong,
.achievement-progress strong {
  color: var(--p-accent, #e60012);
  font-weight: 950;
}

.achievement-levels {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.55rem;
  margin: 1rem 0;
}

.achievement-level {
  --course-vocab-color: #64748b;
  min-width: 0;
  padding: 0.62rem 0.65rem;
  border-radius: 12px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-top: 3px solid color-mix(in srgb, var(--course-vocab-color) 58%, transparent);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

.achievement-level span {
  color: rgba(15, 23, 42, 0.52);
  font-size: 0.82rem;
  font-weight: 900;
}

.achievement-level strong {
  color: #0f172a;
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 950;
}

.achievement-progress {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1rem;
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.45;
}

.achievement-actions {
  position: relative;
  z-index: 2;
  display: flex;
  justify-content: center;
  padding: 0 2rem 1.65rem;
}

.achievement-actions .btn {
  min-width: 8rem;
}

.ielts-goal-backdrop {
  z-index: 1250;
  background: rgba(11, 18, 32, 0.46);
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
}

.ielts-goal-modal {
  width: min(860px, calc(100vw - 2rem));
  border-radius: 24px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  max-height: min(88vh, 820px);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 252, 0.96));
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.24);
}

.ielts-goal-head {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1.5rem 1.65rem 0.75rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ielts-goal-head-main {
  min-width: 0;
  flex: 1 1 auto;
}

.ielts-goal-close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin: -0.15rem -0.15rem 0 0;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(15, 23, 42, 0.62);
  font-size: 1.45rem;
  line-height: 1;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.ielts-goal-close:hover {
  background: rgba(15, 23, 42, 0.1);
  color: rgba(15, 23, 42, 0.88);
}

.ielts-goal-close:active {
  transform: scale(0.96);
}

.ielts-goal-kicker {
  margin: 0 0 0.25rem;
  color: var(--p-accent, #e60012);
  font-size: 0.82rem;
  font-weight: 950;
}

.ielts-goal-head h2 {
  margin: 0;
  color: var(--p-ink, #0b1220);
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.18;
  letter-spacing: 0;
}

.ielts-goal-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(300px, 1.15fr);
  gap: 1rem;
  padding: 1.2rem 1.65rem 1.55rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.ielts-goal-form {
  display: grid;
  gap: 0.75rem;
  align-content: start;
}

.ielts-goal-field {
  display: grid;
  gap: 0.35rem;
  color: rgba(15, 23, 42, 0.66);
  font-size: 0.86rem;
  font-weight: 850;
}

.ielts-goal-field input,
.ielts-goal-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  background: rgba(255, 255, 255, 0.84);
  color: #0f172a;
  font: inherit;
  font-size: 1rem;
  font-weight: 850;
  outline: none;
}

.ielts-goal-field input:focus,
.ielts-goal-field select:focus {
  border-color: rgba(230, 0, 18, 0.42);
  box-shadow: 0 0 0 4px rgba(230, 0, 18, 0.08);
}

.ielts-goal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-top: 0.25rem;
}

.ielts-goal-actions .btn {
  min-height: 42px;
  padding-inline: 1rem;
}

.ielts-goal-actions .btn:disabled {
  opacity: 0.46;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.ielts-goal-result {
  min-height: 310px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.ielts-goal-result[hidden] {
  display: block;
}

.ielts-goal-result[hidden]::before {
  content: "填写上方信息后生成预计学习计划";
  min-height: 278px;
  display: grid;
  place-items: center;
  color: rgba(15, 23, 42, 0.45);
  font-weight: 850;
  text-align: center;
}

.ielts-goal-result.is-ready[hidden] {
  display: none;
}

.ielts-goal-statgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
  margin-bottom: 0.9rem;
}

.ielts-goal-stat {
  min-width: 0;
  border-radius: 14px;
  padding: 0.75rem;
  background: rgba(248, 250, 252, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.07);
}

.ielts-goal-stat span {
  display: block;
  color: rgba(15, 23, 42, 0.52);
  font-size: 0.76rem;
  font-weight: 900;
  line-height: 1.25;
}

.ielts-goal-stat strong {
  display: block;
  margin-top: 0.2rem;
  color: #0f172a;
  font-size: 1.25rem;
  line-height: 1;
  font-weight: 950;
}

.ielts-goal-status {
  margin: 0 0 0.8rem;
  color: rgba(15, 23, 42, 0.68);
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.45;
}

.ielts-goal-status strong {
  color: var(--p-accent, #e60012);
  font-weight: 950;
}

.ielts-goal-chart {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  display: block;
  margin-top: 0.15rem;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.82));
}

.ielts-goal-note {
  margin: 0.75rem 0 0;
  color: rgba(15, 23, 42, 0.52);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.45;
}

.ielts-level-modal {
  width: min(520px, calc(100vw - 2rem));
  max-height: min(88vh, 720px);
}

.ielts-level-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.15rem 1.65rem 1.6rem;
}

.ielts-level-intro {
  margin: 0 0 1rem;
  color: rgba(15, 23, 42, 0.62);
  font-size: 0.92rem;
  font-weight: 780;
  line-height: 1.5;
}

.ielts-level-options {
  display: grid;
  gap: 0.7rem;
}

.ielts-level-option {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.95rem 1.05rem;
  border: 1.5px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.12s ease, box-shadow 0.16s ease;
}

.ielts-level-option:hover {
  border-color: rgba(230, 0, 18, 0.35);
  background: rgba(255, 255, 255, 0.98);
}

.ielts-level-option:active {
  transform: scale(0.99);
}

.ielts-level-option.is-active {
  border-color: var(--p-accent, #e60012);
  background: color-mix(in srgb, var(--p-accent, #e60012) 7%, #fff);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--p-accent, #e60012) 10%, transparent);
}

.ielts-level-option-dot {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: var(--ielts-color, #94a3b8);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ielts-color, #94a3b8) 18%, transparent);
}

.ielts-level-option-dot[data-ielts-book="ielts_primary"] {
  --ielts-color: #10b981;
}

.ielts-level-option-dot[data-ielts-book="ielts_intermediate"] {
  --ielts-color: #0ea5e9;
}

.ielts-level-option-dot[data-ielts-book="ielts_intermediate_advanced"] {
  --ielts-color: #0ea5e9;
  background: linear-gradient(135deg, #0ea5e9 0 48%, #8b5cf6 52% 100%);
}

.ielts-level-option-dot[data-ielts-book="ielts_advanced"] {
  --ielts-color: #8b5cf6;
}

.ielts-level-option-text {
  flex: 1 1 auto;
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.ielts-level-option-label {
  color: #0f172a;
  font-size: 1.02rem;
  font-weight: 950;
  line-height: 1.2;
}

.ielts-level-option-desc {
  color: rgba(15, 23, 42, 0.55);
  font-size: 0.82rem;
  font-weight: 780;
  line-height: 1.35;
}

.ielts-level-option-check {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.16);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.ielts-level-option.is-active .ielts-level-option-check {
  border-color: color-mix(in srgb, var(--p-accent, #e60012) 40%, transparent);
  background: radial-gradient(circle, var(--p-accent, #e60012) 0 40%, transparent 44%);
}

@media (max-width: 720px) {
  .ielts-level-modal {
    width: 100%;
    max-width: 100%;
  }

  .ielts-level-body {
    padding: 1rem 1rem 1.25rem;
  }
}

@media (max-width: 720px) {
  .ielts-goal-backdrop {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .ielts-goal-modal {
    width: 100%;
    max-width: 100%;
    max-height: calc(
      100vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 0.75rem
    );
    max-height: calc(
      100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 0.75rem
    );
    border-radius: 20px 20px 0 0;
  }

  .ielts-goal-head {
    padding: 1rem 1rem 0.65rem;
  }

  .ielts-goal-head h2 {
    font-size: 1.25rem;
  }

  .ielts-goal-body {
    grid-template-columns: 1fr;
    padding: 0.85rem 1rem 1rem;
  }

  .ielts-goal-form {
    gap: 0.65rem;
  }

  .ielts-goal-result {
    min-height: 0;
  }

  .ielts-goal-result[hidden]::before {
    min-height: 9.5rem;
    padding: 1rem;
    content: "填写上方信息后生成预计学习计划";
  }

  .ielts-goal-statgrid {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .ielts-goal-stat {
    padding: 0.65rem 0.75rem;
  }

  .ielts-goal-stat strong {
    font-size: 1.1rem;
    margin-top: 0.15rem;
  }

  .ielts-goal-status {
    margin-bottom: 1rem;
    line-height: 1.5;
  }

  .ielts-goal-chart {
    aspect-ratio: 16 / 12;
  }

  .ielts-goal-note {
    margin-top: 0.9rem;
    padding-bottom: 0.35rem;
  }

  .ielts-goal-actions .btn {
    flex: 1 1 120px;
  }
}

.achievement-burst {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}

.achievement-burst span {
  position: absolute;
  left: 50%;
  top: 42%;
  width: 9px;
  height: 14px;
  border-radius: 3px;
  background: var(--c);
  opacity: 0;
  transform: translate(-50%, -50%) rotate(var(--rot));
  animation: achievement-confetti var(--dur) ease-out var(--delay) both;
}

.achievement-burst span.ribbon {
  width: 8px;
  height: 42px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.55), transparent 24%),
    var(--c);
}

.achievement-burst span.paper {
  clip-path: polygon(14% 0, 100% 12%, 86% 100%, 0 88%);
}

@keyframes achievement-pop {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes achievement-medal-pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

@keyframes achievement-confetti {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.35) rotate(var(--rot));
  }
  12% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.05) rotate(calc(var(--rot) + 40deg));
  }
  100% {
    opacity: 0;
    transform:
      translate(
        calc(-50% + var(--dx)),
        calc(-50% + var(--dy) + var(--fall))
      )
      scale(0.9)
      rotate(calc(var(--rot) + 560deg));
  }
}

@media (max-width: 720px) {
  .achievement-body {
    padding: 1.65rem 1rem 1rem;
  }

  .achievement-body h2 {
    font-size: 1.4rem;
  }

  .achievement-medal {
    width: 88px;
    height: 88px;
  }

  .achievement-medal svg {
    width: 52px;
    height: 52px;
  }

  .achievement-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .achievement-actions {
    padding: 0 1rem 1.25rem;
  }
}

.now-line {
  flex: 0 0 auto;
  min-width: 0;
  margin-top: -0.75rem; /* 贴近视频下边缘 */
  padding: 0.2rem 0;
}

.now-controls .now-line {
  margin-top: 0;
  padding: 0;
  text-align: center;
}

/* 字幕区占用更多垂直空间，按钮区固定在底部 */
.now-controls .now-line {
  flex: 1 1 auto;
  min-height: 84px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.now-controls .now-line {
  /* 文字再长也不溢出边框：在当前句区域内部滚动 */
  justify-content: flex-start;
  max-height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.35rem; /* 给滚动条/手势留一点空间 */
  scrollbar-gutter: stable;
}

.now-controls .now-line::-webkit-scrollbar {
  width: 8px;
}
.now-controls .now-line::-webkit-scrollbar-track {
  background: rgba(20, 16, 16, 0.06);
  border-radius: 6px;
}
.now-controls .now-line::-webkit-scrollbar-thumb {
  background: rgba(20, 16, 16, 0.28);
  border-radius: 6px;
}
.now-controls .now-line::-webkit-scrollbar-thumb:hover {
  background: rgba(20, 16, 16, 0.42);
}

.now-line .en {
  font-size: 1.125rem;
  color: var(--text);
  margin-bottom: 0.35rem;
  font-family: var(--font);
  font-weight: 500;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.now-line .en .w {
  cursor: pointer;
  /* 左右不留 padding，避免拖选时每个词块之间出现竖向白缝；hover 仍用浅色底区分 */
  padding: 2px 0;
  border-radius: 4px;
  transition: var(--transition);
}

.now-line .en .w:hover {
  background: var(--accent-light);
  color: var(--accent);
}

/* 当前句英文拖选：浅红、尽量连成一片（少圆角、少左右内边距） */
.now-line .en::selection,
.now-line .en *::selection {
  background: rgba(255, 192, 192, 0.92);
  color: var(--text);
  border-radius: 0;
}
@supports (background: color-mix(in srgb, red, blue)) {
  .now-line .en::selection,
  .now-line .en *::selection {
    background: color-mix(in srgb, #ffc9c9 88%, rgba(255, 255, 255, 0.35));
    color: var(--text);
  }
}

/* 拖选后出现「查词」按钮 */
.en-lookup-float {
  position: fixed;
  z-index: 55;
  pointer-events: auto;
  filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.18));
}
.en-lookup-float-btn {
  font-size: 0.875rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  white-space: nowrap;
}

.now-line .zh {
  font-size: 1.0625rem;
  color: var(--text-secondary);
  font-family: var(--font-zh);
  line-height: 1.6;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.now-controls .now-line .en,
.now-controls .now-line .zh {
  margin-left: auto;
  margin-right: auto;
  max-width: 72ch;
}

body.player-lock .now-controls .now-line .en {
  font-weight: 600;
  color: var(--p-ink);
}

body.player-lock .now-controls .now-line .zh {
  font-size: 1rem;
  color: var(--p-muted);
  font-weight: 650;
}

body[data-subtitle-mode="en"] .now-line .zh {
  display: none;
}

body[data-subtitle-mode="zh"] .now-line .en {
  display: none;
}


/* 影子跟读：全屏遮罩 + 居中弹窗，不占用左栏文档流 */
.shadowing-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px)) max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  box-sizing: border-box;
}

.shadowing-overlay-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.48);
  backdrop-filter: blur(3px);
}

.shadowing-overlay .shadowing-panel {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(88vh, 720px);
  overflow-y: auto;
  margin: 0;
  -webkit-overflow-scrolling: touch;
}

.shadowing-panel {
  border: 1px solid var(--border-soft);
  border-radius: var(--panel-radius);
  background: linear-gradient(135deg, #f8fffb 0%, #fff5f0 100%);
  padding: 1rem 1.25rem 1.25rem;
  box-shadow: var(--shadow-xl);
}

.shadowing-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.shadowing-panel-head strong {
  flex: 1;
  min-width: 0;
  font-size: 1rem;
  color: var(--text);
}

.shadowing-panel-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.15s ease;
}

.shadowing-panel-close:hover {
  background: var(--surface-2);
  transform: translate(-1px, -1px);
  box-shadow: inset 0 0 0 1px rgba(230, 0, 18, 0.22), var(--shadow-md);
}

.shadowing-panel-close:active {
  transform: translate(1px, 1px);
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow-sm);
}

.shadowing-ref-en {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  font-family: var(--font);
  line-height: 1.45;
  margin: 0 0 0.5rem;
  text-align: center;
}

.shadowing-ref-zh {
  font-size: 1rem;
  color: var(--text-secondary);
  font-family: var(--font-zh);
  line-height: 1.55;
  margin: 0 0 1rem;
  text-align: center;
}

.shadowing-practice {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.75rem;
}

.shadowing-mic-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 0.5rem;
}

.shadowing-mic-caption {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
}

/* 居中圆形麦克风 */
.btn-shadow-mic {
  width: 88px;
  height: 88px;
  padding: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(15, 23, 42, 0.14);
  background: linear-gradient(165deg, #ffffff 0%, #ececef 100%);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-shadow-mic:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(230, 0, 18, 0.45);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.btn-shadow-mic:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

.btn-shadow-mic:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-shadow-mic.is-listening {
  background: linear-gradient(145deg, var(--accent) 0%, #e60012 55%, #c40010 100%);
  color: #fff;
  border-color: rgba(230, 0, 18, 0.6);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 12px 36px rgba(230, 0, 18, 0.18);
  animation: shadowing-mic-pulse 1.25s ease-in-out infinite;
}

@keyframes shadowing-mic-pulse {
  0%,
  100% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 12px 36px rgba(230, 0, 18, 0.18), 0 0 0 0 rgba(230, 0, 18, 0.25);
  }
  50% {
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42), 0 12px 36px rgba(230, 0, 18, 0.18), 0 0 0 12px rgba(230, 0, 18, 0);
  }
}

.shadowing-transcript {
  width: 100%;
  min-height: 3.25rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  border: 2px solid var(--border-soft);
  background: var(--surface);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--text);
  font-family: var(--font);
  box-sizing: border-box;
}

.shadowing-transcript[data-empty="1"]:empty::before {
  content: "识别文字显示在下方…";
  color: var(--muted);
  font-weight: 500;
}

.shadowing-score-block {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 2px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.65);
}

.shadowing-score-block[data-tier="none"] .shadowing-score-tier {
  display: none;
}

.shadowing-score-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.65rem;
}

.shadowing-score-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.shadowing-score-value {
  font-size: 1.75rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1;
}

.shadowing-score-tier {
  font-size: 0.875rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 6px;
  background: var(--surface-2);
}

.shadowing-score-block[data-tier="high"] .shadowing-score-value {
  color: #15803d;
}
.shadowing-score-block[data-tier="high"] .shadowing-score-tier {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
}

.shadowing-score-block[data-tier="good"] .shadowing-score-value {
  color: #0d9488;
}
.shadowing-score-block[data-tier="good"] .shadowing-score-tier {
  background: rgba(13, 148, 136, 0.12);
  color: #0d9488;
}

.shadowing-score-block[data-tier="ok"] .shadowing-score-value {
  color: #b45309;
}
.shadowing-score-block[data-tier="ok"] .shadowing-score-tier {
  background: rgba(180, 83, 9, 0.12);
  color: #b45309;
}

.shadowing-score-block[data-tier="low"] .shadowing-score-value {
  color: #c2410c;
}
.shadowing-score-block[data-tier="low"] .shadowing-score-tier {
  background: rgba(194, 65, 12, 0.12);
  color: #c2410c;
}

.shadowing-score-block[data-tier="bad"] .shadowing-score-value {
  color: var(--accent);
}
.shadowing-score-block[data-tier="bad"] .shadowing-score-tier {
  background: var(--accent-light);
  color: var(--accent);
}

.shadowing-score-hint {
  margin: 0.45rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-secondary);
  text-align: center;
}

.shadowing-score-footnote {
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  line-height: 1.35;
  color: var(--muted);
  text-align: center;
}

.shadowing-sr-note {
  font-size: 0.8125rem;
  color: var(--muted);
  margin: 0.5rem 0 0;
  line-height: 1.4;
}

.shadowing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: stretch;
  width: 100%;
}

/* 跟读弹窗：两按钮等分整行，与上方识别区/评分框左右对齐 */
.shadowing-actions .btn {
  flex: 1 1 0;
  min-width: 0;
  box-sizing: border-box;
  justify-content: center;
  padding: 0.65rem 1rem;
  border: none;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow-sm);
  font-weight: 600;
}

.shadowing-actions .btn-ghost {
  background: #fffefb;
  color: var(--ink);
}

.shadowing-actions .btn-ghost:hover:not(:disabled) {
  background: var(--surface-2);
  transform: translateY(-2px);
  box-shadow: inset 0 0 0 1px rgba(230, 0, 18, 0.18), var(--shadow-md);
}

.shadowing-actions .btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
}

.shadowing-actions .btn:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: inset 0 0 0 1px var(--border-soft), var(--shadow-sm);
}

.muted {
  color: var(--muted);
  font-weight: 500;
}

.video-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.subtitle-panel {
  flex: 1 1 auto;
  min-width: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  flex-direction: column;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
}

@media (min-width: 921px) {
  .right-col .subtitle-panel {
    border-radius: 0;
    border: none;
    margin-left: 0;
  }
}

.control-bar {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-start;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1.25rem;
  border-radius: var(--panel-radius);
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: var(--shadow-lg);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}

/* 现在 control-bar 在 now-controls 里，避免“框套框” */
.now-controls .control-bar {
  margin-top: 0;
  padding: 0.65rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  justify-content: center;
  flex-wrap: wrap;
  overflow: visible;
  width: 100%;
  box-sizing: border-box;
  gap: 0.75rem;
}

/* 控制条：宽屏一行；order 适用于 portal 后的 #player-bottom-dock */
@media (min-width: 921px) {
  body.player-lock #player-bottom-dock .control-bar,
  .now-controls .control-bar {
    display: grid;
    grid-template-columns:
      repeat(3, minmax(84px, 1fr))
      minmax(42px, 0.48fr)
      minmax(52px, 0.58fr)
      minmax(42px, 0.48fr)
      repeat(3, minmax(84px, 1fr));
    align-items: center;
    justify-content: stretch;
    gap: clamp(0.35rem, 0.7vw, 0.65rem);
    padding: 0.45rem 0.55rem calc(0.45rem + env(safe-area-inset-bottom, 0px));
    overflow: visible;
  }

  body.player-lock #player-bottom-dock .control-bar {
    border-radius: 0 0 18px 18px;
    border-top-color: rgba(15, 23, 42, 0.06);
    background: rgba(255, 255, 255, 0.78);
  }

  body.player-lock #player-bottom-dock .control-bar .control-bar-modes,
  body.player-lock #player-bottom-dock .control-bar .control-bar-transport,
  .now-controls .control-bar .control-bar-modes,
  .now-controls .control-bar .control-bar-transport {
    display: contents;
  }

  body.player-lock #player-bottom-dock .control-bar #btn-blind,
  .now-controls .control-bar #btn-blind {
    order: 1;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-cloze,
  .now-controls .control-bar #btn-cloze {
    order: 2;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-shadowing,
  .now-controls .control-bar #btn-shadowing {
    order: 3;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-prev,
  .now-controls .control-bar #btn-prev {
    order: 4;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-play,
  .now-controls .control-bar #btn-play {
    order: 5;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-next,
  .now-controls .control-bar #btn-next {
    order: 6;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-replay-sent,
  .now-controls .control-bar #btn-replay-sent {
    order: 7;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-speed,
  .now-controls .control-bar #btn-speed {
    order: 8;
  }
  body.player-lock #player-bottom-dock .control-bar #btn-sub-mode,
  .now-controls .control-bar #btn-sub-mode {
    order: 9;
  }

  body.player-lock #player-bottom-dock .control-bar .control-bar-pill,
  body.player-lock #player-bottom-dock .control-bar #btn-blind,
  body.player-lock #player-bottom-dock .control-bar #btn-cloze,
  body.player-lock #player-bottom-dock .control-bar #btn-speed,
  body.player-lock #player-bottom-dock .control-bar #btn-sub-mode,
  .now-controls .control-bar .control-bar-pill,
  .now-controls .control-bar #btn-blind,
  .now-controls .control-bar #btn-cloze,
  .now-controls .control-bar #btn-speed,
  .now-controls .control-bar #btn-sub-mode {
    width: 100%;
    justify-content: center;
  }

  body.player-lock #player-bottom-dock .control-bar .control-bar-icon,
  .now-controls .control-bar .control-bar-icon {
    width: 100%;
    min-width: 42px;
    justify-content: center;
  }

  body.player-lock #player-bottom-dock .control-bar .control-bar-play,
  .now-controls .control-bar .control-bar-play {
    width: 100%;
    min-width: 50px;
    justify-content: center;
  }
}

@media (min-width: 921px) and (max-width: 1240px) {
  body.player-lock #player-bottom-dock .control-bar,
  .now-controls .control-bar {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 44px;
    align-items: stretch;
  }

  body.player-lock #player-bottom-dock .control-bar .control-bar-play,
  .now-controls .control-bar .control-bar-play {
    min-width: 44px;
  }

  body.player-lock #player-bottom-dock .control-bar .control-bar-icon,
  .now-controls .control-bar .control-bar-icon {
    min-width: 40px;
  }
}

.now-controls .control-bar .btn {
  border: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: none;
}

.now-controls .control-bar .btn:hover:not(:disabled) {
  border-color: var(--p-dock-btn-border-hover);
  background: var(--p-dock-btn-bg-hover);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.now-controls .control-bar .btn-primary {
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(230, 0, 18, 0.28);
}

.now-controls .control-bar .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 18px rgba(230, 0, 18, 0.34);
}

/* Player control bar button tuning */
.control-bar .btn {
  border-radius: 12px;
  padding: 0.75rem clamp(0.55rem, 1vw, 1.15rem);
  height: auto;
  line-height: 1;
  font-size: 0.9375rem;
  flex: 1 1 5.5rem;
  min-width: 0;
  white-space: nowrap;
}

/* 仅图标的播放控制：略收紧左右留白 */
.control-bar #btn-prev,
.control-bar #btn-play,
.control-bar #btn-next {
  padding-left: 0.65rem;
  padding-right: 0.65rem;
}

.menu-pop {
  /* 用 fixed 配合 getBoundingClientRect 定位，避免被布局包含块影响导致“弹层看不见” */
  position: fixed;
  z-index: 2000;
  min-width: 140px;
  padding: 0.5rem;
  border-radius: 16px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15), 0 2px 8px rgba(15, 23, 42, 0.05);
}

.menu-item {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  transition: var(--transition);
}

.menu-item:hover {
  background: var(--surface-2);
}

.menu-item.active {
  background: var(--accent-light);
  color: var(--accent);
}

.control-bar .btn:hover:not(:disabled) {
  transform: translateY(-2px);
}

.control-bar .btn:active:not(:disabled) {
  transform: translateY(0);
}

.control-bar .btn-primary {
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.25);
}

.control-bar .btn-primary:hover:not(:disabled) {
  box-shadow: 0 6px 16px rgba(230, 0, 18, 0.35);
}

.control-bar .btn .ico {
  width: 1.25rem;
  height: 1.25rem;
}

.control-bar .btn .ico svg {
  width: 1.25rem;
  height: 1.25rem;
}

.subtitle-panel header {
  display: none;
}

.subtitle-head-left {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 800;
  color: rgba(11, 18, 32, 0.72);
}

.subtitle-head {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
}

.subtitle-head-actions {
  position: absolute;
  top: -0.55rem;
  right: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  flex: 0 0 auto;
}

body.player-lock .subtitle-pill {
  border-radius: 999px;
  padding: 0.45rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 800;
  background: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: var(--p-ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

body.player-lock .subtitle-pill:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  background: #fff;
}

body.player-lock .subtitle-pill[aria-pressed="true"] {
  background: rgba(230, 0, 18, 0.10);
  border: none;
  box-shadow: 0 2px 8px rgba(230, 0, 18, 0.15);
  color: rgba(11, 18, 32, 0.88);
}

.subtitle-pill-label {
  opacity: 0.78;
  font-weight: 900;
}

.subtitle-current {
  padding: 1.05rem 1.25rem 1.15rem;
}

/* 右侧字幕：去掉“当前句”重复块（保留 DOM 供 JS 更新/查词等逻辑使用） */
body.player-lock .subtitle-current {
  display: none;
}

/* 聚焦阅读：顶部/底部淡出遮罩（不影响滚动） */
body.player-lock .subtitle-scroll {
  padding: 0.25rem 0;
  mask-image: linear-gradient(to bottom, transparent 0%, #000 16px, #000 calc(100% - 16px), transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 16px, #000 calc(100% - 16px), transparent 100%);
}

body.player-lock .sub-line {
  border-bottom: none;
  padding: 0.5rem 0;
  background: transparent;
  transition: opacity 400ms cubic-bezier(0.25, 1, 0.5, 1), filter 400ms cubic-bezier(0.25, 1, 0.5, 1), transform 400ms cubic-bezier(0.25, 1, 0.5, 1);
  opacity: 0.52;
  filter: blur(0.25px);
  transform: scale(0.85);
  transform-origin: left center;
  position: relative;
}

body.player-lock .sub-line.near {
  opacity: 0.74;
  filter: blur(0.08px);
  transform: scale(0.9);
}

body.player-lock .sub-line.active {
  opacity: 1;
  filter: none;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
  transform: scale(1);
}

body.player-lock .sub-line.active .en {
  /* 当前句：黑色更突出（其余句靠蒙层/透明度弱化） */
  color: rgba(0, 0, 0, 0.92);
  font-weight: 600;
}

body.player-lock .sub-line.active .zh {
  color: rgba(0, 0, 0, 0.72);
  font-weight: 650;
}

body.player-lock .sub-line .en {
  font-family: var(--font-display);
  font-size: var(--player-sub-en-size);
  letter-spacing: -0.015em;
  line-height: 1.36;
  margin-bottom: 0.35rem;
  color: rgba(0, 0, 0, 0.78);
  font-weight: 600;
  transition: color 400ms cubic-bezier(0.25, 1, 0.5, 1), font-weight 400ms cubic-bezier(0.25, 1, 0.5, 1);
}

body.player-lock .sub-line .zh {
  font-family: var(--font-zh);
  font-size: var(--player-sub-zh-size);
  line-height: 1.5;
  color: rgba(0, 0, 0, 0.62);
  font-weight: 650;
  transition: color 400ms cubic-bezier(0.25, 1, 0.5, 1), font-weight 400ms cubic-bezier(0.25, 1, 0.5, 1);
}

/* 非当前句：字号统一为当前句的 0.95 倍（保持 active 尺寸不变） */
body.player-lock .sub-line:not(.active) .en {
  font-size: calc(0.95 * var(--player-sub-en-size));
}
body.player-lock .sub-line:not(.active) .zh {
  font-size: calc(0.95 * var(--player-sub-zh-size));
}

/* 隐藏翻译：仅在双语/英文模式下生效，中文模式仍显示 */
body.player-lock[data-hide-zh="1"]:not([data-subtitle-mode="zh"]) .sub-line .zh,
body.player-lock[data-hide-zh="1"]:not([data-subtitle-mode="zh"]) .subtitle-panel .now-line .zh {
  display: none;
}

.subtitle-current {
  padding: 0.75rem 1rem 0.85rem;
  border-bottom: 1px solid var(--p-sub-divider);
  background: rgba(255, 255, 255, 0.62);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.subtitle-panel .now-line {
  margin: 0;
  padding: 0;
  text-align: left;
  max-height: 12rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.subtitle-panel .now-line .en,
.subtitle-panel .now-line .zh {
  margin-left: 0;
  margin-right: 0;
  max-width: none;
}

body.player-lock .subtitle-panel .now-line .en {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--p-ink);
}

body.player-lock .subtitle-panel .now-line .zh {
  font-size: 0.98rem;
  color: var(--p-muted);
  font-weight: 650;
}

.subtitle-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.subtitle-mode {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.mode-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  padding: 0.375rem 0.75rem;
  border: 2px solid var(--border-soft);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
  transition: var(--transition);
  font-weight: 500;
  font-size: 0.8125rem;
}

.mode-opt:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.mode-opt input:checked + span {
  color: var(--accent);
}

.mode-opt input {
  margin: 0;
  cursor: pointer;
}

body[data-subtitle-mode="en"] .sub-line .zh {
  display: none;
}

body[data-subtitle-mode="zh"] .sub-line .en {
  display: none;
}

/* 盲听：模糊遮盖所有字幕正文，保留版式与高亮，便于纯听力练习 */
body[data-blind-listen="1"] .sub-line .en,
body[data-blind-listen="1"] .sub-line .zh,
body[data-blind-listen="1"] .now-line .en,
body[data-blind-listen="1"] .now-line .zh,
body[data-blind-listen="1"] .empty-hint {
  filter: blur(12px);
  user-select: none;
  pointer-events: none;
}

/* 挖空：仅模糊标为 .cloze-target 的词/短语（由播放器根据 keywords 或启发式标注） */
body[data-cloze="1"] .cloze-target {
  filter: blur(10px);
  user-select: none;
  pointer-events: none;
}

.subtitle-scroll {
  flex: 1;
  overflow-y: auto;
  /* 给 active 红框留“安全区”，避免被 subtitle-panel 的 overflow:hidden 裁切 */
  padding: calc(0.65rem + var(--player-sub-pad, 0px)) 0;
  scroll-behavior: smooth;
  /* 隐藏右侧滚动条，但保留滚动能力 */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/旧 Edge */
}

.subtitle-scroll::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none; /* Chrome/Safari */
}

.sub-line {
  /* 统一给每条字幕留安全边距：active 描边不会“压住”文字 */
  padding: 0.9rem 1.15rem;
  margin-bottom: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--p-sub-divider);
  position: relative;
  transition: background 0.2s ease;
  cursor: pointer;
  background: transparent;
}

.sub-line:hover {
  background: rgba(15, 23, 42, 0.04);
  z-index: 1;
}

.subtitle-scroll .sub-line:last-child {
  border-bottom: none;
}

.sub-line .en {
  font-size: 1.02rem;
  color: var(--p-ink);
  margin-bottom: 0.4rem;
  font-family: var(--font);
  font-weight: 650;
  line-height: 1.55;
}

.sub-line .en .w {
  cursor: pointer;
  padding: 2px 0;
  border-radius: 4px;
  transition: var(--transition);
}

.sub-line .en .w:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.sub-line .en::selection,
.sub-line .en *::selection {
  background: rgba(255, 192, 192, 0.92);
  color: var(--text);
}
@supports (background: color-mix(in srgb, red, blue)) {
  .sub-line .en::selection,
  .sub-line .en *::selection {
    background: color-mix(in srgb, #ffc9c9 88%, rgba(255, 255, 255, 0.35));
    color: var(--text);
  }
}

/* 右侧滚动字幕：
 * - 非当前句：禁用单词级交互，整句可点跳转
 * - 当前（高亮）句：允许悬停高亮 + 单击直接查词
 */
.subtitle-scroll .sub-line:not(.active) .en .w {
  pointer-events: none;
  cursor: inherit;
}

.subtitle-scroll .sub-line:not(.active) .en .w:hover {
  background: transparent;
  color: inherit;
}

.subtitle-scroll .sub-line.active .en .w {
  pointer-events: auto;
  cursor: pointer;
}

.sub-line .zh {
  font-size: 0.93rem;
  color: rgba(11, 18, 32, 0.70);
  font-family: var(--font-zh);
  line-height: 1.65;
}

.sub-line.active {
  /* 当前播放句（滚动字幕区域）：仅通过无蒙层/清晰度突出，不加底色 */
  background: transparent;
  border: none;
  border-radius: 18px;
  box-shadow: none;
  transform: none;
  z-index: 2;

  /* 激活态不改变排版尺寸：只改变颜色/描边 */
  margin: 0;
  padding: 0.9rem 1.15rem;
}


.sub-line.active .en {
  color: var(--p-ink);
  font-weight: 650;
}

.sub-line.active .zh {
  color: rgba(11, 18, 32, 0.70);
  font-weight: 400;
}

.empty-hint {
  color: var(--muted);
  font-size: 1rem;
  text-align: center;
  padding: 3rem 2rem;
}

@media (max-width: 920px) {
  /* 小屏：收紧左右边距，避免内容区过窄 */
  body.player-lock .player-page {
    --player-gutter: clamp(0.85rem, 2.4vw, 1.25rem);
    --player-gutter-x: calc(var(--player-gutter) + 6px);
  }

  /* 小屏：顶部工具条更稳（避免绝对定位压住视频） */
  body.player-lock .player-left-topbar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    width: auto;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 0.5rem;
    z-index: 60;
    pointer-events: none;
  }

  body.player-lock .player-right-topbar {
    position: fixed;
    top: calc(env(safe-area-inset-top, 0px) + 16px);
    right: max(12px, env(safe-area-inset-right, 0px));
    left: auto;
    max-width: calc(100vw - 132px - env(safe-area-inset-left, 0px) - env(safe-area-inset-right, 0px));
    z-index: 60;
    pointer-events: none;
  }

  body.player-lock .player-left-topbar > *,
  body.player-lock .player-right-topbar > * {
    pointer-events: auto;
  }
  body.player-lock .player-left-topbar > .fc-back,
  body.player-lock .player-left-topbar > .topbar-vocab,
  body.player-lock .player-right-topbar > .topbar-vocab {
    height: 38px;
    padding: 0 0.75rem;
    font-size: 0.8rem;
  }
  body.player-lock .player-left-topbar > .fc-back {
    width: 38px;
    padding: 0;
  }

  body.player-lock .player-right-topbar > .topbar-vocab {
    padding: 0 0.65rem;
    min-width: 0;
    white-space: nowrap;
  }

  /* 窄屏：贴边全宽，不再套「卡片」边框与页边留白（仅保留安全区与底栏占位） */
  body.player-lock .player-page {
    padding-left: calc(var(--player-gutter-x) + env(safe-area-inset-left, 0px));
    padding-right: calc(var(--player-gutter-x) + env(safe-area-inset-right, 0px));
    /* 上下边距一致（保持底栏占位） */
    /* 顶部预留：给 fixed 顶栏留出空间 */
    padding-top: calc(var(--player-gutter) + 48px + env(safe-area-inset-top, 0px));
    padding-bottom: calc(var(--player-dock-h, 9rem) + var(--player-gutter) + env(safe-area-inset-bottom, 0px));
    /* 底栏占位区也铺白，避免透出页面灰底形成“灰带” */
    background: #fff;
  }

  body.player-lock .player-titlebar {
    border: none;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 0;
    padding-left: max(0.65rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.65rem, env(safe-area-inset-right, 0px));
    padding-top: max(0.55rem, env(safe-area-inset-top, 0px));
    padding-bottom: 0.65rem;
    background: rgba(255, 255, 255, 0.92);
  }

  /* 窄屏：整列连续排布，无外框 */
  body.player-lock .player-shell {
    flex-direction: column;
    gap: 0.65rem;
    flex: 1 1 auto;
    min-height: 0;
    border-radius: 0;
    /* iOS/Safari：若祖先有滤镜/毛玻璃/overflow，可能把 fixed 子元素当作相对定位并裁切 */
    overflow: visible;
    background: transparent;
    border: none;
    box-shadow: none;
  }

  .player-page .player-shell {
    flex-direction: column;
    gap: 0;
  }

  .left-panel {
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    overflow: visible;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.player-lock .left-main {
    order: 1;
    display: flex;
    flex-direction: column;
    flex: 0 0 auto;
    min-height: 0;
    gap: 0;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  }

  body.player-lock .left-main .video-wrap {
    border-radius: 18px 18px 0 0;
    box-shadow: none;
  }

  body.player-lock .left-main .video-wrap::before,
  body.player-lock .left-main .video-wrap::after {
    border-radius: 18px 18px 0 0;
  }

  body.player-lock .keyword-col > .now-line {
    flex: 1 1 auto;
    min-height: 0;
    margin-top: 0.2rem;
    padding: 0 0 1rem;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 0.85rem 0.7rem 1.35rem;
    scroll-padding-top: 0.85rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll::-webkit-scrollbar {
    width: 0;
    height: 0;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line {
    position: relative;
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-left: none;
    border-radius: 14px;
    opacity: 0.55;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.past {
    opacity: 0.46;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:nth-child(2) {
    opacity: 0.7;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:nth-child(3) {
    opacity: 0.62;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.upcoming:nth-child(n + 4) {
    opacity: 0.5;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.active {
    margin-top: 0;
    margin-bottom: 0.75rem;
    padding: 0.65rem 0.9rem;
    background: var(--p-sub-active-bg);
    opacity: 1;
    box-shadow:
      inset 3px 0 0 rgba(230, 0, 18, 0.55),
      0 2px 12px rgba(230, 0, 18, 0.06);
    border-radius: 14px;
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line .en {
    font-size: calc(var(--player-sub-en-size) - 0.125rem);
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.past .en,
  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.upcoming .en {
    font-size: calc(var(--player-sub-en-size) - 0.25rem);
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line .zh {
    font-size: calc(var(--player-sub-zh-size) - 0.125rem);
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.past .zh,
  body.player-lock .keyword-col > .now-line .now-line-scroll .sub-line.upcoming .zh {
    font-size: calc(var(--player-sub-zh-size) - 0.25rem);
  }

  body.player-lock .keyword-col {
    order: 3;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin-top: 0.35rem;
    overflow: hidden;
  }

  body.player-lock .left-main .keyword-panel {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: none;
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    border-radius: 0 0 18px 18px;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.player-lock .keyword-mobile-entry {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0.7rem 0.8rem 0.75rem;
    border: none;
    border-radius: 0 0 18px 18px;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 160ms ease;
  }

  body.player-lock .keyword-mobile-entry:hover {
    background: rgba(15, 23, 42, 0.03);
  }

  body.player-lock .keyword-mobile-entry:active {
    background: rgba(15, 23, 42, 0.05);
  }

  body.player-lock .keyword-mobile-entry:disabled {
    opacity: 0.55;
    cursor: default;
  }

  body.player-lock .keyword-head--desktop,
  body.player-lock .keyword-scroll--inline {
    display: none !important;
  }

  /* 手机：字幕区需要成为真正可滚动的容器（否则 scrollTop 改了也不会动） */
  body.player-lock .right-col {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    /* 让标题下方到字幕区之间有一点呼吸感 */
    margin-top: 0.15rem;
  }

  /* 手机：视频标题更大一点 */
  body.player-lock .video-title {
    font-size: calc(clamp(1.18rem, 4.2vw, 1.6rem) - 2px);
    margin-top: 0.65rem;
    margin-bottom: 0.25rem;
  }

  body.player-lock .right-col .subtitle-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }
  body.player-lock .right-col .subtitle-scroll {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
  }

  /* 手机：关闭字幕区上下淡出遮罩（否则第一句高亮会被“洗白”） */
  body.player-lock .subtitle-scroll {
    mask-image: none;
    -webkit-mask-image: none;
  }

  /* 手机：进度条覆盖在视频容器底部 */
  body.player-lock[data-progress-on-video="1"] .video-wrap .video-progress {
    position: absolute;
    left: 0.85rem;
    right: 0.85rem;
    bottom: 0.65rem;
    width: auto;
    max-width: none;
    box-sizing: border-box;
    z-index: 12;
    padding: 0;
    gap: 0.4rem;
    background: transparent;
    border-radius: 0;
    pointer-events: none; /* 默认不拦截视频手势 */
    overflow: hidden;
  }

  body.player-lock[data-progress-on-video="1"] .video-wrap .video-time {
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.92);
    min-width: 2.55rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
  }

  body.player-lock[data-progress-on-video="1"] .video-wrap .video-seek {
    height: 28px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 0.35rem;
    box-sizing: border-box;
    pointer-events: auto; /* 只允许滑条可交互 */
  }

  body.player-lock[data-progress-on-video="1"] .video-wrap .video-seek::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    margin-top: -8px;
    background-size: 24px 24px;
  }

  body.player-lock[data-progress-on-video="1"] .video-wrap .video-seek::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background-size: 24px 24px;
  }

  /* 进度条悬浮在视频上：不要改变视频布局（避免“视频被缩小”） */
  body.player-lock[data-progress-on-video="1"] .video-wrap #media-host {
    padding-bottom: 0;
  }

  /* 手机：视频铺满容器，避免左右黑边（必要时会轻微裁切） */
  body.player-lock .video-wrap video {
    object-fit: cover;
    object-position: center;
  }

  /* 手机：仅保留滚动字幕在视频下方，不显示「当前句」大块 */
  body.player-lock .now-controls .now-line {
    display: none !important;
  }

  /* 兼容旧选择器：subtitle-panel 实际在 .right-col 下 */
  body.player-lock .right-col .subtitle-panel {
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--p-sub-divider);
  }

  .video-wrap {
    height: auto;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
    max-height: min(62vh, 720px);
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }

  .subtitle-panel {
    margin-top: 0;
    min-width: 0;
    border: none;
    border-radius: 0;
    border-top: none;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: none;
  }

  body.player-lock .subtitle-scroll {
    /* 手机：左右与视频容器对齐（safe-area 已由 .player-page 处理） */
    padding-left: 0;
    padding-right: 0;
  }

  /* 手机浏览器：字幕字号再小一点，并统一字号（不做“近大远小”） */
  body.player-lock .sub-line .en {
    font-size: calc((1.55rem - 3px) * 0.88);
  }
  body.player-lock .sub-line .zh {
    font-size: calc(0.98rem * 0.88);
  }
  body.player-lock .sub-line:not(.active) .en {
    font-size: calc((1.55rem - 3px) * 0.88);
  }
  body.player-lock .sub-line:not(.active) .zh {
    font-size: calc(0.98rem * 0.88);
  }
  body.player-lock .subtitle-panel .now-line .en {
    font-size: calc(1.25rem * 0.88);
  }
  body.player-lock .subtitle-panel .now-line .zh {
    font-size: calc(0.98rem * 0.88);
  }

  /* 关闭“近大远小”缩放/模糊：移动端所有行同一视觉尺寸 */
  body.player-lock .sub-line,
  body.player-lock .sub-line.near,
  body.player-lock .sub-line.active {
    transform: none !important;
    filter: none !important;
  }

  body.player-lock .subtitle-scroll .sub-line {
    /* 不要清零：保持与桌面一致的统一安全边距 */
    padding-left: clamp(0.5rem, 2.2vw, 0.8rem);
    padding-right: clamp(0.5rem, 2.2vw, 0.8rem);
  }

  /* 手机：当前句更明显（仅增强视觉，不改变字号） */
  body.player-lock .subtitle-scroll .sub-line.active {
    background: var(--p-sub-active-bg);
    border-radius: 14px;
  }
  body.player-lock .subtitle-scroll .sub-line.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    bottom: 10px;
    width: 3px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.75);
  }


  body.player-lock .subtitle-panel header {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
    border-bottom: none;
    background: rgba(243, 244, 246, 0.92);
  }

  /* 手机浏览器：控制条吸底，上为模式行、下为「跟读 | 上句 | 播放 | 下句 | 重播」 */
  body.player-lock .now-controls {
    flex: 0 0 auto;
    padding: 0;
    border-top: none;
  }

  /* 固定底栏（在 JS 中会 portal 到 #player-bottom-dock，避免 iOS fixed 被裁切） */
  body.player-lock #player-bottom-dock {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 45;
    pointer-events: none;
    background: transparent;
  }

  body.player-lock #player-bottom-dock > * {
    pointer-events: auto;
  }

  body.player-lock #player-bottom-dock .control-bar,
  body.player-lock .now-controls .control-bar {
    position: relative;
    left: auto;
    right: auto;
    bottom: auto;
    z-index: 45;
    margin-top: 0;
    display: flex !important;
    visibility: visible;
    opacity: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.32rem;
    width: 100%;
    box-sizing: border-box;
    padding: 0.35rem max(0.65rem, env(safe-area-inset-left, 0px))
      calc(0.85rem + env(safe-area-inset-bottom, 0px))
      max(0.65rem, env(safe-area-inset-right, 0px));
    border-radius: 0 0 18px 18px;
    border: 1px solid rgba(15, 23, 42, 0.07);
    border-top: 1px solid rgba(15, 23, 42, 0.06);
    background: #fff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    overflow: visible;
    max-width: 100%;
    pointer-events: auto;
  }

  /* 手机：两排展示——第一排播放/跟读，第二排盲听/挖空/速度/字幕 */
  body.player-lock .control-bar-transport {
    order: 1;
  }
  body.player-lock .control-bar-modes {
    order: 2;
  }

  body.player-lock .control-bar-modes {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(0.32rem, 2vw, 0.45rem);
    width: 100%;
  }

  body.player-lock .control-bar .btn {
    border-radius: 999px;
    border: 1px solid var(--p-dock-btn-border);
    background: var(--p-dock-btn-bg);
    box-shadow: none;
    transform: none;
  }

  body.player-lock .control-bar .btn:hover:not(:disabled) {
    box-shadow: none;
    transform: none;
  }

  /* 一排：模式按钮（盲听/挖空/速度/字幕等）统一更小 */
  body.player-lock .control-bar-modes .btn {
    flex-direction: column;
    justify-content: center;
    gap: 0.18rem;
    padding: 0.32rem clamp(0.12rem, 1.5vw, 0.2rem);
    min-height: clamp(36px, 10vw, 38px);
    min-width: 0;
    font-size: clamp(0.6rem, 2.5vw, 0.64rem);
  }

  body.player-lock .control-bar-modes .btn .lbl {
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.1;
  }

  body.player-lock .control-bar-modes .btn .ico {
    width: 1.05rem;
    height: 1.05rem;
  }

  body.player-lock .control-bar-modes .btn .ico svg {
    width: 1.05rem;
    height: 1.05rem;
  }

  body.player-lock .control-bar-modes .btn:hover:not(:disabled),
  body.player-lock .control-bar-transport .btn:hover:not(:disabled) {
    background: var(--p-dock-btn-bg-hover);
    border-color: rgba(15, 23, 42, 0.22);
  }

  body.player-lock .control-bar-modes .btn:active:not(:disabled),
  body.player-lock .control-bar-transport .btn:active:not(:disabled) {
    transform: none;
    background: rgba(255, 255, 255, 0.90);
  }

  body.player-lock .control-bar-modes .btn[aria-pressed="true"] {
    background: var(--p-dock-btn-active);
    color: var(--p-accent);
    border-color: var(--p-dock-btn-border-hover);
  }

  /* 手机：跟读按钮在 transport 行（control-bar-pill），JS 会切 btn-primary/btn-ghost。
     transport 的基础样式会覆盖 btn-primary 背景，导致“白字在浅底”看起来像空白。 */
  body.player-lock .control-bar-transport .control-bar-pill[aria-pressed="true"],
  body.player-lock .control-bar-transport .control-bar-pill.btn-primary {
    background: var(--p-dock-btn-active);
    color: var(--p-accent);
    border-color: var(--p-dock-btn-border-hover);
  }

  /* 手机：播放按钮（control-bar-play / control-bar-icon）必须保持红底白图标 */
  body.player-lock .control-bar-transport .control-bar-play.btn-primary,
  body.player-lock .control-bar-transport #btn-play.btn-primary {
    background: var(--p-accent);
    border-color: rgba(230, 0, 18, 0.35);
    color: #fff;
  }

  /* transport：作为第一排播放行 */
  body.player-lock .control-bar-transport {
    display: grid;
    grid-template-columns:
      minmax(0, 1fr)
      clamp(34px, 9.5vw, 38px)
      clamp(42px, 11.5vw, 46px)
      clamp(34px, 9.5vw, 38px)
      minmax(0, 1fr);
    align-items: center;
    justify-content: stretch;
    gap: clamp(0.28rem, 1.8vw, 0.4rem);
    width: 100%;
    max-width: none;
    margin: 0;
    padding-top: 0.05rem;
  }

  body.player-lock .control-bar-transport .control-bar-pill {
    flex: 0 0 auto;
    justify-content: center;
    gap: 0.3rem;
    padding: 0.5rem clamp(0.45rem, 2.8vw, 0.75rem);
    border-radius: 999px;
    font-size: clamp(0.7rem, 2.8vw, 0.76rem);
    font-weight: 700;
    height: clamp(40px, 11vw, 44px);
    width: 100%;
    min-width: 0;
  }

  body.player-lock .control-bar-transport .control-bar-pill .lbl {
    white-space: nowrap;
  }

  body.player-lock .control-bar-transport .control-bar-icon {
    flex: 0 0 auto;
    width: clamp(34px, 9.5vw, 38px);
    height: clamp(34px, 9.5vw, 38px);
    min-width: clamp(34px, 9.5vw, 38px);
    padding: 0;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
  }

  body.player-lock .control-bar-transport .control-bar-icon:hover:not(:disabled),
  body.player-lock .control-bar-transport .control-bar-pill:hover:not(:disabled),
  body.player-lock .control-bar-modes .btn:hover:not(:disabled) {
    border-color: var(--p-dock-btn-border-hover);
  }

  body.player-lock .control-bar-transport .control-bar-icon .ico {
    width: 1.05rem;
    height: 1.05rem;
  }

  body.player-lock .control-bar-transport .control-bar-play {
    flex: 0 0 auto;
    width: clamp(42px, 11.5vw, 46px);
    height: clamp(42px, 11.5vw, 46px);
    min-width: clamp(42px, 11.5vw, 46px);
    padding: 0;
    border-radius: 999px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(230, 0, 18, 0.35);
    box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(230, 0, 18, 0.14);
  }

  body.player-lock .control-bar-transport .control-bar-play .ico {
    width: 1.25rem;
    height: 1.25rem;
  }

  body.player-lock .control-bar-transport .control-bar-play .ico svg {
    width: 1.25rem;
    height: 1.25rem;
  }

  /* 第一排：让“跟读/重播”更大、更好点按 */
  body.player-lock .control-bar-transport #btn-shadowing,
  body.player-lock .control-bar-transport #btn-replay-sent {
    height: clamp(40px, 11vw, 44px);
    font-size: clamp(0.72rem, 2.8vw, 0.8rem);
    padding-left: clamp(0.55rem, 2.5vw, 0.9rem);
    padding-right: clamp(0.55rem, 2.5vw, 0.9rem);
  }

  body.player-lock .player-titlebar {
    position: relative;
    z-index: 50;
  }

  body.player-lock .menu-pop {
    z-index: 70;
  }

  /* 手机：雅思词汇弹窗宽度收窄，避免几乎铺满屏幕 */
  body.player-lock #ielts-pop.menu-pop {
    width: min(19rem, calc(100vw - 3.25rem));
    max-width: calc(100vw - 3.25rem);
    box-sizing: border-box;
  }

  /* 底栏弹出菜单：用 fixed 以视口为参照（配合 positionMenuNear 的移动端分支） */
  body.player-lock #player-bottom-dock .menu-pop {
    position: fixed;
  }

  header.site {
    padding: 1rem 1.5rem;
  }
  header.site h1 {
    font-size: 1.25rem;
  }
  main {
    padding: 2rem 1.5rem;
  }
}

@media (max-width: 600px) {
  .video-wrap {
    max-height: min(66vh, 720px);
    aspect-ratio: 16 / 9;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
  }
  header.site {
    padding: 1rem;
  }
  main {
    padding: 1.5rem 1rem;
  }
  .card {
    padding: 1.5rem;
  }
  .control-bar {
    padding: 0.75rem 1rem;
    gap: 0.5rem;
  }
  .control-bar .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
}

.def-card {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: min(440px, calc(100vw - 40px));
  max-height: min(60vh, 560px);
  overflow: hidden;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 30;
  display: flex;
  flex-direction: column;
}

.def-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 2px solid var(--border);
  background: var(--surface-2);
  font-weight: 700;
}

.def-body {
  padding: 1.25rem;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
}

.def-close {
  padding: 0.5rem 1rem;
}

/* Definition popover (near clicked word) */
.def-pop {
  position: absolute;
  z-index: 60;
  width: min(480px, calc(100vw - 32px));
  max-height: min(58vh, 520px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 22px;
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.def-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.92);
  flex: 0 0 auto;
  backdrop-filter: blur(12px) saturate(140%);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  touch-action: manipulation;
}

.def-pop-word {
  color: #e60012;
  font-weight: 800;
  font-size: 1.125rem;
}

.def-pop-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 0 0 auto;
}

.def-pop-body {
  padding: 1.25rem;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.7;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.def-pop-body::-webkit-scrollbar {
  width: 0;
  height: 0;
  background: transparent;
}

.def-grid {
  display: grid;
  gap: 0.75rem;
}

.def-item {
  display: grid;
  grid-template-columns: 5.25rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: start;
}

.def-label {
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.15rem;
  white-space: nowrap;
  text-align: left;
  justify-self: start;
}

.def-value {
  color: var(--text);
  font-weight: 650;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.def-phonetic-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.def-phonetic {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-weight: 800;
  color: var(--ink);
}

.def-example {
  color: var(--text-secondary);
  font-weight: 600;
}

.def-meanings {
  margin: 0;
  padding-left: 1.05rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.def-meanings li::marker {
  color: var(--accent);
}

.def-pos {
  display: inline-block;
  margin-right: 0.5rem;
  font-weight: 900;
  color: var(--muted);
}

.def-meaning {
  color: var(--text);
  font-weight: 650;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@media (max-width: 360px) {
  .def-item {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }
  .def-label {
    padding-top: 0;
  }
}

.def-example-zh {
  margin-top: 0.4rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
}

.def-placeholder {
  color: var(--muted);
  font-weight: 600;
}

.def-loading {
  padding: 0.9rem 0.25rem;
  color: var(--text);
  font-weight: 750;
  letter-spacing: 0.01em;
}

.def-usage,
.def-sentence-notes {
  font-weight: 600;
  color: var(--text);
}

.def-highlights {
  margin: 0;
  padding-left: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.def-highlights li::marker {
  color: var(--accent);
}

.def-hl-term {
  font-weight: 800;
  color: var(--text);
  font-family: var(--font);
}

.def-hl-note {
  color: var(--text-secondary);
  font-weight: 600;
}

.def-hl-sub {
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.55;
}

.def-hl-sep {
  color: var(--muted);
  font-weight: 600;
}

.def-say.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.7rem;
  border-width: 1px;
  line-height: 0;
}

.def-say-ico {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
}

.ielts-corpus-card {
  margin-top: 0.9rem;
  border: 0;
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(218, 237, 255, 0.96), rgba(232, 244, 255, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78), 0 10px 26px rgba(74, 121, 180, 0.12);
  padding: 0.7rem;
}

.ielts-corpus-shell {
  display: grid;
  gap: 0.65rem;
  color: #253044;
}

.ielts-corpus-shell.is-empty {
  opacity: 0.86;
}

.ielts-corpus-headline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  min-height: 2.15rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.58);
  padding: 0.42rem 0.55rem 0.42rem 0.72rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.ielts-corpus-title {
  color: #1b2740;
  font-size: 0.92rem;
  font-weight: 950;
  white-space: nowrap;
}

.ielts-corpus-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.45rem;
  border-radius: 999px;
  background: #1d4290;
  color: rgba(255, 255, 255, 0.9);
  padding: 0.14rem 0.62rem;
  font-size: 0.75rem;
  font-weight: 850;
  white-space: nowrap;
}

.ielts-corpus-freq {
  padding: 0.12rem 0.18rem;
  color: #263349;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.55;
}

.ielts-corpus-freq strong {
  color: #e13f42;
  font-size: 1.18em;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.ielts-corpus-status,
.ielts-corpus-sub,
.ielts-corpus-source {
  color: #65738b;
  font-size: 0.82rem;
  font-weight: 750;
}

.ielts-corpus-meta,
.ielts-corpus-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
  align-items: center;
}

.ielts-corpus-meta > span {
  color: #66758f;
  font-size: 0.78rem;
  font-weight: 850;
}

.ielts-corpus-meta b,
.ielts-corpus-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 1.35rem;
  border: 1px solid rgba(72, 117, 202, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #3463b7;
  padding: 0.12rem 0.45rem;
  font-size: 0.76rem;
  font-weight: 850;
}

.ielts-corpus-examples {
  margin: 0.05rem 0 0;
  display: grid;
  gap: 0.5rem;
}

.ielts-corpus-paper {
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  padding: 0.72rem 0.82rem;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.ielts-corpus-paper .ielts-corpus-tags {
  margin-top: 0.4rem;
}

.ielts-corpus-sentence {
  margin-top: 0.42rem;
  color: #273246;
  font-weight: 700;
  line-height: 1.55;
}

.def-pop-close {
  padding: 0.45rem 0.75rem;
  height: auto;
}

.def-pop-add {
  padding: 0.45rem 0.75rem;
  height: auto;
}

/* 查词弹窗的按钮：更轻、更干净（不沿用全局“粗黑框”按钮风格） */
.def-pop-head .btn.btn-ghost {
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: rgba(11, 18, 32, 0.88);
  box-shadow: none;
  border-radius: 999px;
  font-weight: 700;
}

.def-pop-head .btn.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(230, 0, 18, 0.28);
  color: #e60012;
  transform: none;
}

.def-pop-head .btn.btn-ghost:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.vocab-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.vocab-item {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.08);
  padding: 0.85rem 0.9rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.vocab-item-main {
  flex: 1 1 auto;
  min-width: 0;
}

.vocab-item-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  padding-top: 0.05rem;
}

.vocab-item-word {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--ink);
  line-height: 1.25;
}

.vocab-item-phonetic {
  font-weight: 800;
  color: var(--muted);
  font-size: 0.9em;
}

.vocab-item-pos {
  font-weight: 900;
  color: var(--muted);
}

.vocab-item-meaning {
  margin-top: 0.25rem;
  color: var(--text);
  font-weight: 650;
  line-height: 1.6;
}

.vocab-item-example {
  margin-top: 0.35rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9rem;
  line-height: 1.6;
}

.vocab-item-example-zh {
  margin-top: 0.25rem;
  color: var(--muted);
  font-weight: 600;
  line-height: 1.6;
}

.status {
  margin-top: 1rem;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: var(--surface-2);
}

.status.error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 知识点卡片（课程详情页）·漫画分镜感 */
.kp-card {
  position: relative;
  margin: 0;
  border-radius: var(--panel-radius);
  border: 1px solid var(--border-soft);
  background: linear-gradient(165deg, #fffefb 0%, #fff8f0 45%, #fce8dc 100%);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.22s ease, transform 0.2s ease;
}

.kp-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(180deg, var(--accent) 0%, #ff6b4a 50%, #ffb38a 100%);
  border-radius: var(--panel-radius) 0 0 var(--panel-radius);
  opacity: 1;
}

.kp-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.kp-card-head {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1.05rem 1.1rem 1.15rem calc(1.1rem + 4px);
}

.kp-card-num {
  flex-shrink: 0;
  width: 2.125rem;
  height: 2.125rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8125rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 10px 24px rgba(230, 0, 18, 0.16);
  line-height: 1;
}

.kp-card-head-main {
  flex: 1;
  min-width: 0;
}

.kp-card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 800;
  font-family: var(--font-display);
  letter-spacing: 0.01em;
  line-height: 1.35;
  color: var(--text);
}

.kp-card-short {
  margin-top: 0.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem 0.6rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: var(--accent-light);
  border: 1px dashed rgba(230, 0, 18, 0.28);
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--accent-hover);
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
}

.kp-card-short-label {
  flex-shrink: 0;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-hover);
  font-family: var(--font);
}

.kp-card-explain {
  margin-top: 0.75rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.78;
}

.kp-card-examples {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.88);
  border: none;
  box-shadow: inset 0 0 0 1px var(--border-soft), inset 0 2px 0 rgba(255, 255, 255, 0.85);
}

.kp-card-examples-hd {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.kp-card-examples-hd::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  border: none;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.72);
}

.kp-card-examples-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
  line-height: 1.68;
}

.kp-card-examples-list li {
  margin: 0.2rem 0;
}

.kp-card-examples-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

.kp-card:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .kp-card:hover {
    transform: none;
  }
}

/* Course detail */
body.page-course .course-title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0 0 0.75rem;
  min-width: 0;
}

body.page-course .course-title-heading {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
}

body.page-course .course-title-row .fc-back {
  color: rgba(0, 0, 0, 0.68);
  text-decoration: none;
}

body.page-course .course-title-row .fc-back:hover {
  color: var(--accent);
  border-color: rgba(230, 0, 18, 0.28);
  text-decoration: none;
}

.course-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

.course-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
  align-items: center;
}

.course-source-hint {
  flex: 1 1 100%;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.5;
}

.course-original-link {
  max-width: 100%;
}

.course-description-card {
  padding-top: 1.35rem;
}

.course-description-kicker {
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 0.5rem;
}

.course-description-text,
.course-desc-text {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.78;
  white-space: pre-wrap;
}

.course-desc-subtitle {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.course-desc-modal {
  max-width: 720px;
}

.course-outline-unit {
  border: 1px solid var(--border-soft);
  border-radius: var(--panel-radius);
  padding: 1rem;
  background: linear-gradient(135deg, #fffefb 0%, #ffe8dc 100%);
  box-shadow: var(--shadow-sm);
  margin-bottom: 0.75rem;
}

.course-outline-unit .t {
  font-weight: 900;
  letter-spacing: -0.02em;
}

.course-outline-lessons {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}

.course-outline-lesson.btn {
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
}

/* Lesson detail (story-first) */
.lesson-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.lesson-kicker {
  font-size: 0.8125rem;
  font-weight: 900;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lesson-head-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lesson-kps {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 0.75rem;
}

/* 课程详情页知识点使用 .kp-card，样式见上 */

.lesson-story {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.lesson-story-block {
  border: 1px solid var(--border-soft);
  border-radius: var(--panel-radius);
  padding: 1rem 1.1rem;
  background: linear-gradient(135deg, rgba(230, 0, 18, 0.06) 0%, rgba(255, 200, 160, 0.12) 100%);
  box-shadow: var(--shadow-sm);
}

.lesson-story-label {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
  color: var(--ink);
}

.lesson-story-text {
  color: var(--text);
  font-weight: 600;
  line-height: 1.8;
  white-space: pre-wrap;
}

.lesson-acts {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.lesson-act {
  border: 1px solid var(--border-soft);
  border-radius: var(--panel-radius);
  padding: 1rem 1.1rem;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.lesson-act-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.lesson-act-title {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.lesson-act-kp {
  color: var(--muted);
  font-weight: 800;
  font-size: 0.9rem;
}

.lesson-act-story {
  line-height: 1.85;
  font-weight: 600;
  color: var(--text);
}

.lesson-act-practice {
  margin-top: 0.9rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border);
}

.lesson-act-practice-label {
  font-weight: 900;
  margin-bottom: 0.35rem;
}

.lesson-act-practice-text {
  color: var(--text-secondary);
  font-weight: 650;
  line-height: 1.75;
}

/* —— 工具集合首页 —— */
html.hub-doc {
  height: 100%;
  overflow: hidden;
}

body.page-hub {
  /* 与课程列表/详情统一：浅色渐变底 + 红色点缀 */
  --ink: #0b1220;
  --ink-soft: rgba(11, 18, 32, 0.74);
  --paper: #f6f7fb;
  --paper-2: #eef1f8;
  --bg: var(--paper);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-2: rgba(255, 255, 255, 0.94);
  --border: rgba(15, 23, 42, 0.16);
  --border-soft: rgba(15, 23, 42, 0.1);
  --text: var(--ink);
  --text-secondary: rgba(11, 18, 32, 0.74);
  --muted: rgba(11, 18, 32, 0.56);
  --accent: #e60012;
  --accent-hover: #bf0010;
  --accent-light: rgba(230, 0, 18, 0.12);
  --accent-muted: rgba(230, 0, 18, 0.12);
  --shadow-sm: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  --shadow-lg: var(--shadow-md);
  --shadow-xl: var(--shadow-md);
  --radius: 16px;
  --radius-lg: 22px;
  --panel-radius: 22px;
  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, system-ui,
    sans-serif;
  font-family: var(--font);
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  color: var(--text);
  background:
    radial-gradient(1200px 720px at 16% 8%, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0) 56%),
    radial-gradient(900px 600px at 86% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 55%),
    linear-gradient(180deg, #fcfdff 0%, #f6f7fb 55%, #eef1f8 100%);
}

/* hub 顶栏：玻璃风 */
body.page-hub header.site {
  position: sticky;
  top: 0;
  z-index: 90;
  padding: 0.95rem 2rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

body.page-hub .site-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

body.page-hub .site-brand svg {
  display: block;
  flex-shrink: 0;
}

body.page-hub .site-brand h1 {
  font-size: 1.3rem;
}

@media (max-width: 720px) {
  body.page-hub header.site {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
  }
}

/* —— 应用首页（影子跟读）—— */
body.page-app {
  /* 与课程列表/详情统一：浅色渐变底 + 红色点缀 */
  --ink: #0b1220;
  --ink-soft: rgba(11, 18, 32, 0.74);
  --paper: #f6f7fb;
  --paper-2: #eef1f8;
  --bg: var(--paper);
  --surface: rgba(255, 255, 255, 0.84);
  --surface-2: rgba(255, 255, 255, 0.94);
  --border: rgba(15, 23, 42, 0.16);
  --border-soft: rgba(15, 23, 42, 0.1);
  --text: var(--ink);
  --text-secondary: rgba(11, 18, 32, 0.74);
  --muted: rgba(11, 18, 32, 0.56);
  --accent: #e60012;
  --accent-hover: #bf0010;
  --accent-light: rgba(230, 0, 18, 0.12);
  --accent-muted: rgba(230, 0, 18, 0.12);
  --shadow-sm: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  --shadow-lg: var(--shadow-md);
  --shadow-xl: var(--shadow-md);
  --radius: 16px;
  --radius-lg: 22px;
  --panel-radius: 22px;
  --font-display: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-brand: "Inter", "Noto Serif SC", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    sans-serif;
  --font: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", -apple-system, system-ui,
    sans-serif;
  background:
    radial-gradient(1200px 720px at 16% 8%, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0) 56%),
    radial-gradient(900px 600px at 86% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 55%),
    linear-gradient(180deg, #fcfdff 0%, #f6f7fb 55%, #eef1f8 100%);
}

body.page-app main {
  max-width: 1120px;
  padding: 3.5rem 2rem 3.5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.page-app main::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.app-cta{
  padding-bottom: 1rem;
}

.app-cta-card{
  padding: 1.35rem 1.35rem;
  text-align: center;
}

.app-cta-kicker{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.6);
  color: rgba(20, 16, 16, 0.7);
  font-weight: 700;
  font-size: 0.85rem;
}

.app-cta-desc{
  max-width: 44rem;
  margin: 0 auto 1.05rem;
  color: rgba(20, 16, 16, 0.72);
  line-height: 1.65;
}

.app-cta-actions{
  display: flex;
  justify-content: center;
}

.app-cta-arrow{
  display: inline-block;
  transform: translateY(1px);
  animation: appCtaNudge 1.05s ease-in-out infinite;
}

@keyframes appCtaNudge{
  0%,100%{ transform: translate(0,1px); }
  50%{ transform: translate(6px,1px); }
}

@media (max-width: 720px) {
  body.page-app main {
    padding: 2.75rem 1.25rem 2.75rem;
  }
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.app-topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

@media (max-width: 720px) {
  .app-topbar-inner {
    padding: 0.8rem 1.25rem;
  }
}

.app-topbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
}

.app-topbar-actions {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
}

body.page-app .app-topbar-cta {
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(230, 0, 18, 0.22);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  font-weight: 700;
  box-shadow: none;
}

body.page-app .app-topbar-cta:hover {
  background: rgba(255, 255, 255, 0.94);
  color: var(--accent);
  border-color: rgba(230, 0, 18, 0.32);
  text-decoration: none;
}

/* 首页 CTA：与当前极简玻璃风保持一致（覆盖全局“粗黑框/贴纸阴影”的 btn-primary） */
body.page-app .app-cta-actions .btn.btn-primary {
  border: 1px solid rgba(230, 0, 18, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  box-shadow: 0 1px 1px rgba(15, 23, 42, 0.04), 0 10px 26px rgba(15, 23, 42, 0.08);
  transform: none;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

body.page-app .app-cta-actions .btn.btn-primary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(230, 0, 18, 0.32);
  color: var(--accent);
  box-shadow: 0 2px 2px rgba(15, 23, 42, 0.06), 0 18px 44px rgba(15, 23, 42, 0.14);
  transform: translateY(-3px);
}

body.page-app .app-cta-actions .btn.btn-primary:active:not(:disabled) {
  transform: translateY(-1px);
}

.app-topbar-brand:hover {
  text-decoration: none;
}

.app-topbar-icon {
  flex: 0 0 auto;
  line-height: 0;
  display: flex;
  align-items: center;
}

.app-topbar-icon svg {
  width: 40px;
  height: 40px;
  display: block;
}

.app-topbar-wordmark {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.12rem;
  line-height: 1.15;
  min-height: 40px;
}

.app-topbar-zh {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.12rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.app-topbar-en {
  font-family: var(--font);
  font-weight: 850;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.app-hero {
  margin: 0 auto 2.25rem;
  text-align: center;
}

.app-hero-inner {
  margin: 0 auto;
  padding: 2.75rem 1.25rem 1.75rem;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  position: relative;
}

.app-hero-kicker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.8rem;
  color: var(--muted);
}

.app-hero-title {
  margin: 1.35rem 0 1.15rem;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.14;
  font-size: clamp(2.3rem, 4.2vw, 3.4rem);
  color: var(--ink);
}

.app-hero-slogan {
  margin: 0 auto;
  max-width: 100%;
  font-weight: 650;
  color: var(--text-secondary);
  letter-spacing: -0.01em;
  line-height: 1.75;
  font-size: clamp(0.72rem, 2.85vw, 1.05rem);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

@media (max-width: 720px) {
  .app-hero-inner {
    padding: 2.25rem 0.25rem 1.25rem;
  }
}

.app-hero-actions {
  margin-top: 2rem;
  display: inline-flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

.app-hero-actions .btn {
  border-width: 1px;
  box-shadow: none;
}

@media (max-width: 900px) {
  .app-nav {
    display: none;
  }
}

.app-section {
  margin-top: 2.25rem;
}

.app-section-head {
  text-align: left;
  margin-bottom: 1rem;
}

.app-section-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-size: 1.35rem;
}

.app-feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.1rem;
}

.app-feature {
  --feature-accent: var(--accent);
  --feature-icon-bg: linear-gradient(145deg, rgba(255, 215, 220, 0.95) 0%, rgba(255, 250, 248, 1) 100%);
  --feature-card-tint: linear-gradient(165deg, rgba(255, 245, 246, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--feature-card-tint);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem 1.2rem 1.3rem;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

@media (prefers-reduced-motion: reduce) {
  .app-feature,
  .app-step,
  body.page-app .course-list li {
    transition: none;
  }
  .app-feature:hover,
  .app-step:hover {
    transform: none;
    box-shadow: 0 14px 32px rgba(20, 16, 16, 0.08);
  }
  body.page-app .course-list li:hover {
    transform: none;
    box-shadow: 0 10px 26px rgba(20, 16, 16, 0.07);
  }
}

.app-feature--b {
  --feature-accent: var(--tone-blue);
  --feature-icon-bg: linear-gradient(145deg, rgba(219, 234, 254, 0.98) 0%, rgba(248, 250, 255, 1) 100%);
  --feature-card-tint: linear-gradient(165deg, rgba(238, 244, 255, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
}

.app-feature--c {
  --feature-accent: var(--success);
  --feature-icon-bg: linear-gradient(145deg, rgba(209, 250, 229, 0.98) 0%, rgba(248, 255, 252, 1) 100%);
  --feature-card-tint: linear-gradient(165deg, rgba(236, 253, 245, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
}

.app-feature-icon {
  flex-shrink: 0;
  width: 3.1rem;
  height: 3.1rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--border-soft);
  background: var(--feature-icon-bg);
  color: var(--feature-accent);
}

.app-feature-body {
  min-width: 0;
}

.app-feature .t {
  font-family: var(--font-display);
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  line-height: 1.35;
}

.app-feature .d {
  margin-top: 0.45rem;
  color: var(--text-secondary);
  font-weight: 650;
  line-height: 1.72;
  font-size: 0.95rem;
}

.app-steps {
  display: grid;
  gap: 1rem;
}

.app-step {
  --step-badge-bg: linear-gradient(145deg, #ff6b4a 0%, #e60012 100%);
  --step-card-tint: linear-gradient(165deg, rgba(255, 245, 246, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: var(--step-card-tint);
  box-shadow: var(--shadow-sm);
  padding: 1.2rem 1.15rem 1.25rem;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.22s cubic-bezier(0.4, 0, 0.2, 1);
}

.app-step:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.app-step--b {
  --step-badge-bg: linear-gradient(145deg, #60a5fa 0%, #1e4ed8 100%);
  --step-card-tint: linear-gradient(165deg, rgba(238, 244, 255, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
}

.app-step--c {
  --step-badge-bg: linear-gradient(145deg, #4ade80 0%, #15803d 100%);
  --step-card-tint: linear-gradient(165deg, rgba(236, 253, 245, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
}

.app-step--d {
  --step-badge-bg: linear-gradient(145deg, #a78bfa 0%, #6d28d9 100%);
  --step-card-tint: linear-gradient(165deg, rgba(245, 243, 255, 0.55) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
}

.app-step--e {
  --step-badge-bg: linear-gradient(145deg, #fbbf24 0%, #b45309 100%);
  --step-card-tint: linear-gradient(165deg, rgba(255, 251, 235, 0.6) 0%, rgba(255, 255, 255, 0.92) 45%, rgba(255, 255, 255, 0.88) 100%);
}

.app-step .n {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--step-badge-bg);
  color: #fff;
  font-weight: 950;
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-family: var(--font-display);
  font-size: 0.92rem;
  letter-spacing: 0.04em;
}

.app-step .c {
  min-width: 0;
  padding-top: 0.08rem;
}

.app-step .c .t {
  font-family: var(--font-display);
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-size: 1.05rem;
  line-height: 1.35;
}

.app-step .c .d {
  margin-top: 0.4rem;
  color: var(--text-secondary);
  font-weight: 650;
  line-height: 1.72;
  font-size: 0.95rem;
}

@media (max-width: 980px) {
  .app-feature-grid {
    grid-template-columns: 1fr;
  }
}

.app-course-card.card {
  margin-bottom: 0;
}

/* 课程列表卡片：与 app-feature / app-step 一致的墨线 + 柔阴影 */
body.page-app .card {
  padding: 2.25rem 2rem;
}

body.page-app .app-course-card.card {
  border: 1px solid var(--border-soft);
  background: linear-gradient(
    165deg,
    rgba(255, 255, 255, 0.85) 0%,
    rgba(255, 255, 255, 0.94) 45%,
    rgba(255, 255, 255, 0.88) 100%
  );
  box-shadow: var(--shadow-sm);
}

body.page-app .app-course-card.card:hover {
  transform: none;
  box-shadow: var(--shadow-md);
}

body.page-app .card h2 {
  text-align: center;
  font-weight: 900;
  letter-spacing: 0.02em;
}

body.page-app .course-list li {
  padding: 1.15rem 1.2rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
}

body.page-app .course-list li:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: rgba(230, 0, 18, 0.22);
}

body.page-app .course-list li strong {
  font-family: var(--font-display);
  font-weight: 950;
  letter-spacing: -0.01em;
  color: var(--ink);
}

body.page-app .course-thumb {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
}

/* 与首页 Hero 主按钮一致：细描边 + 浅色错位，避免整块黑阴影 */
body.page-app .app-course-card .btn-primary {
  border-width: 1px;
  box-shadow: none;
}

body.page-app .app-course-card .btn-primary:hover:not(:disabled) {
  box-shadow: none;
}

.hub-main {
  flex: 1 1 auto;
  min-height: 0;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 2.25rem 2rem 3.5rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.hub-main::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.hub-section {
  margin-bottom: 2.75rem;
}

.hub-section:last-child {
  margin-bottom: 0;
}

.hub-section-title {
  margin: 0 0 1.15rem;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border-soft);
  display: inline-block;
  min-width: min(100%, 12rem);
}

.hub-grid {
  display: grid;
  gap: 1.25rem;
  align-items: stretch;
}

.hub-grid--backend {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.hub-tile {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  padding: 1.75rem 1.5rem;
  background: #fff;
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.06);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
  text-decoration: none;
  color: inherit;
  position: relative;
  overflow: hidden;
}

.hub-tile::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.22s ease;
  pointer-events: none;
}

.hub-tile-admin::before {
  background: linear-gradient(135deg, rgba(230, 0, 18, 0.07) 0%, rgba(255, 200, 180, 0.12) 100%);
}
.hub-tile-app::before {
  background: linear-gradient(135deg, rgba(21, 128, 61, 0.08) 0%, rgba(230, 0, 18, 0.05) 100%);
}
.hub-tile-product {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.hub-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.12);
  text-decoration: none;
}

.hub-tile:hover::before {
  opacity: 1;
}

.hub-tile-icon {
  line-height: 0;
  margin-bottom: 0.75rem;
}

.hub-tile-icon svg {
  display: block;
  width: 2.5rem;
  height: 2.5rem;
}

.hub-tile-icon--admin {
  color: var(--accent);
}

.hub-tile-icon--app {
  color: var(--success);
}

.hub-tile-title {
  margin: 0 0 0.5rem;
  font-size: 1.28rem;
  font-family: "Outfit", var(--font-display);
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--ink);
  position: relative;
  z-index: 1;
}

.hub-tile-desc {
  margin: 0 0 1rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1 1 auto;
  position: relative;
  z-index: 1;
}

.hub-tile-meta {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: var(--muted);
  position: relative;
  z-index: 1;
}

.hub-health-ok {
  color: var(--success);
}

.hub-health-err {
  color: var(--danger);
}

.hub-tile-cta {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--accent);
  position: relative;
  z-index: 1;
}

.hub-tile:hover .hub-tile-cta {
  color: var(--accent-hover);
}

.hub-tile-admin .hub-tile-cta::after,
.hub-tile-app .hub-tile-cta::after {
  content: " →";
  transition: transform 0.18s ease;
  display: inline-block;
}

.hub-tile:hover .hub-tile-cta::after {
  transform: translateX(3px);
}

@media (max-width: 900px) {
  .hub-grid--backend {
    grid-template-columns: 1fr;
  }
  .hub-main {
    padding: 1.5rem 1.25rem 2.5rem;
  }
}

@media (max-width: 480px) {
  /* empty */
}

/* —— 笔记本闪卡页 —— */
body.page-flashcards {
  --fc-page-gutter: clamp(1rem, 3vw, 2rem);
  --fc-ink: #0b1220;
  --fc-ink-soft: rgba(11, 18, 32, 0.74);
  --fc-muted: rgba(11, 18, 32, 0.56);
  --fc-surface: rgba(255, 255, 255, 0.84);
  --fc-surface-strong: rgba(255, 255, 255, 0.94);
  --fc-border: rgba(15, 23, 42, 0.1);
  --fc-border-strong: rgba(15, 23, 42, 0.16);
  --fc-accent: #e60012;
  --fc-accent-2: #bf0010;
  --fc-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
  --fc-shadow-hover: 0 16px 48px rgba(15, 23, 42, 0.15);
  --fc-radius: 16px;
  --fc-radius-lg: 22px;
  --fc-rarity-safe-inset: clamp(2.25rem, 5.5vw, 4rem);
  --fc-rarity-badge-v-space: 0px;
  --fc-face-v-safe: clamp(1.25rem, 4vw, 2.25rem);
  font-family: "Inter", "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", system-ui, -apple-system, sans-serif;
  color: var(--fc-ink);
  background:
    radial-gradient(1200px 720px at 16% 8%, rgba(230, 0, 18, 0.08) 0%, rgba(230, 0, 18, 0) 56%),
    radial-gradient(900px 600px at 86% 0%, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0) 55%),
    linear-gradient(180deg, #fcfdff 0%, #f6f7fb 55%, #eef1f8 100%) !important;
}

body.page-flashcards a {
  color: var(--fc-accent);
}

.fc-topbar {
  flex-shrink: 0;
  width: 100%;
  padding: 1rem max(var(--fc-page-gutter), env(safe-area-inset-left)) 1rem
    max(var(--fc-page-gutter), env(safe-area-inset-right));
  /* 与课程列表页 learn-topbar 保持一致高度（由内容自然撑开） */
  min-height: unset;
  box-sizing: border-box;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  /* 下拉菜单向下展开时与下方 main 重叠：main 在 DOM 中更晚，默认会盖住顶栏；抬高顶栏整层 */
  position: relative;
  z-index: 100;
}

.fc-topbar-leading {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  flex: 1 1 auto;
}

.fc-topbar-title {
  font-weight: 700;
  letter-spacing: -0.02em;
  font-size: 1.05rem;
  min-width: 0;
  flex: 1 1 auto;
}

.fc-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

/* 顶栏返回：与卡片两侧 fc-arrow 同形，尺寸适配顶栏 */
.fc-back {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: none;
  background: #fff;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(0, 0, 0, 0.68);
  display: inline-grid;
  place-items: center;
  text-decoration: none;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.fc-back:hover {
  color: var(--fc-accent);
  background: #fff;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.fc-back:active {
  transform: scale(0.98);
}

.fc-topbar-nav {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 0.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.04);
  flex: 0 1 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 100%;
}
.fc-topbar-nav::-webkit-scrollbar { display: none; }

.fc-topbar-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: rgba(11, 18, 32, 0.68);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  line-height: 1;
  font-size: 0.82rem;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.fc-topbar-chip:hover {
  background: rgba(255, 255, 255, 0.82);
  color: rgba(11, 18, 32, 0.88);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}

.fc-topbar-chip.is-active {
  background: rgba(230, 0, 18, 0.08);
  color: var(--fc-accent);
  font-weight: 700;
}

.fc-topbar-chip .fc-chip-count {
  margin-left: 0.35rem;
  padding: 0.04rem 0.3rem;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.05);
  color: rgba(11, 18, 32, 0.5);
  font-size: 0.75em;
  font-weight: 700;
  min-width: 1rem;
  text-align: center;
}

.fc-topbar-chip.is-active .fc-chip-count {
  background: rgba(230, 0, 18, 0.1);
  color: rgba(230, 0, 18, 0.82);
}

.fc-stats-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: auto;
  white-space: nowrap;
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
  border: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(11, 18, 32, 0.75);
  font-weight: 600;
  text-decoration: none;
  line-height: 1.35;
  box-sizing: border-box;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  font-size: 0.85rem;
}
.fc-stats-btn:hover {
  color: var(--fc-accent);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  text-decoration: none;
}

.fc-stats-btn svg {
  flex: 0 0 auto;
  display: inline-block;
  width: 16px;
  height: 16px;
  opacity: 0.88;
}

.fc-clear-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border-radius: 999px;
  border: none;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  color: rgba(11, 18, 32, 0.5);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, color 0.2s ease;
  flex: 0 0 auto;
}
.fc-clear-btn:hover {
  color: #e60012;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}
.fc-clear-btn svg {
  width: 16px;
  height: 16px;
}

.fc-back:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.75);
  outline-offset: 3px;
}

.fc-back-ico {
  width: 22px;
  height: 22px;
  display: block;
}

body.page-flashcards .fc-back {
  color: rgba(11, 18, 32, 0.75);
}

body.page-flashcards .fc-back:hover {
  color: var(--fc-accent);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.fc-chip {
  appearance: none;
  border: none;
  background: #fff;
  color: rgba(11, 18, 32, 0.75);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0.48rem 0.7rem;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.fc-chip:hover {
  background: #fff;
  color: var(--fc-accent);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
}

.fc-chip.is-active {
  background: rgba(230, 0, 18, 0.08);
  color: var(--fc-accent);
  box-shadow: 0 4px 12px rgba(230, 0, 18, 0.15);
  font-weight: 700;
}

.fc-chip-count {
  display: inline-block;
  margin-left: 0.35em;
  font-size: 0.78em;
  font-weight: 700;
  opacity: 0.65;
  min-width: 1em;
}
.fc-chip-count:empty {
  display: none;
}


.fc-main {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0;
  position: relative;
  z-index: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.fc-main::-webkit-scrollbar {
  display: none;
}

/* 左侧筛选栏 */
  /* 左侧筛选栏：已移至顶栏，隐藏 */
  .fc-sidebar {
    display: none;
  }

/* 右侧内容区 */
.fc-content {
  flex: 1 1 0;
  min-width: 0;
  --fc-search-vgap: 1rem;
  padding: 0 1.25rem 2.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  max-width: 1000px;
  margin: 0 auto;
}

.fc-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin-top: var(--fc-search-vgap, 1rem);
  margin-bottom: var(--fc-search-vgap, 1rem);
  padding: 0;
}

body.page-flashcards .fc-toolbar {
  display: none;
}

.fc-quiz-float {
  position: fixed;
  top: clamp(150px, 28vh, 310px);
  right: max(0.85rem, env(safe-area-inset-right));
  z-index: 220;
  width: 126px;
  min-height: 152px;
  padding: 0;
  border: none;
  background: transparent;
  color: #9f1239;
  font: inherit;
  cursor: pointer;
  touch-action: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0;
  filter: drop-shadow(0 18px 28px rgba(159, 18, 57, 0.16));
  transition: filter 0.18s ease;
}

.fc-quiz-float:focus-visible {
  outline: 3px solid rgba(230, 0, 18, 0.38);
  outline-offset: 5px;
  border-radius: 22px;
}

.fc-quiz-bubble {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 86px;
  min-height: 40px;
  padding: 0.46rem 0.82rem;
  border: 2px solid rgba(244, 114, 182, 0.46);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 22px rgba(159, 18, 57, 0.1);
  color: #be123c;
  font-size: 1rem;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(4px);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.fc-quiz-bubble::after {
  content: "";
  position: absolute;
  right: 24px;
  bottom: -7px;
  width: 14px;
  height: 14px;
  background: rgba(255, 255, 255, 0.94);
  border-right: 1px solid rgba(244, 114, 182, 0.35);
  border-bottom: 1px solid rgba(244, 114, 182, 0.35);
  transform: rotate(45deg);
}

.fc-quiz-mascot {
  position: relative;
  width: 94px;
  height: 98px;
  display: block;
  transform-origin: 50% 85%;
  animation: fcMascotNod 5.2s ease-in-out infinite;
  transition: transform 0.18s ease;
}

.fc-quiz-tail {
  position: absolute;
  right: 3px;
  top: 43px;
  width: 28px;
  height: 24px;
  border-radius: 50%;
  background: #fb923c;
  border: 2px solid rgba(154, 52, 18, 0.13);
  transform-origin: 18% 55%;
  animation: fcMascotTail 5.2s ease-in-out infinite;
}

.fc-quiz-face {
  position: absolute;
  left: 7px;
  top: 17px;
  width: 80px;
  height: 74px;
  border-radius: 36px 36px 32px 32px;
  background:
    radial-gradient(circle at 30% 67%, rgba(255, 255, 255, 0.72) 0 18%, transparent 19%),
    radial-gradient(circle at 70% 67%, rgba(255, 255, 255, 0.72) 0 18%, transparent 19%),
    linear-gradient(180deg, #fed7aa 0%, #fdba74 100%);
  border: 2px solid rgba(154, 52, 18, 0.16);
  box-shadow: inset 0 -7px 12px rgba(154, 52, 18, 0.08);
}

.fc-quiz-ear {
  position: absolute;
  top: 8px;
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: #fb923c;
  border: 2px solid rgba(154, 52, 18, 0.13);
}

.fc-quiz-ear::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: #ffedd5;
}

.fc-quiz-ear-left {
  left: 9px;
}

.fc-quiz-ear-right {
  right: 9px;
}

.fc-quiz-eye {
  position: absolute;
  top: 30px;
  width: 9px;
  height: 11px;
  border-radius: 999px;
  background: #431407;
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, 0.78);
}

.fc-quiz-eye-left {
  left: 27px;
}

.fc-quiz-eye-right {
  right: 27px;
}

.fc-quiz-nose {
  position: absolute;
  left: 50%;
  top: 43px;
  width: 12px;
  height: 9px;
  border-radius: 60% 60% 70% 70%;
  background: #7c2d12;
  transform: translateX(-50%);
}

.fc-quiz-mouth {
  position: absolute;
  left: 50%;
  top: 51px;
  width: 24px;
  height: 12px;
  border-bottom: 2px solid #7c2d12;
  border-radius: 0 0 20px 20px;
  transform: translateX(-50%);
}

.fc-quiz-cheek {
  position: absolute;
  top: 47px;
  width: 12px;
  height: 8px;
  border-radius: 999px;
  background: rgba(244, 114, 182, 0.5);
}

.fc-quiz-cheek-left {
  left: 15px;
}

.fc-quiz-cheek-right {
  right: 15px;
}

.fc-quiz-paw {
  position: absolute;
  bottom: 0;
  width: 28px;
  height: 22px;
  border-radius: 12px 12px 10px 10px;
  background: #ffedd5;
  border: 2px solid rgba(154, 52, 18, 0.12);
}

.fc-quiz-paw-left {
  left: 19px;
  transform: rotate(-8deg);
  transform-origin: 70% 18%;
  animation: fcMascotPawLeft 5.2s ease-in-out infinite;
}

.fc-quiz-paw-right {
  right: 19px;
  transform: rotate(8deg);
  transform-origin: 30% 18%;
  animation: fcMascotPawRight 5.2s ease-in-out infinite;
}

.fc-quiz-float.is-left .fc-quiz-bubble::after {
  right: auto;
  left: 24px;
}

.fc-quiz-float.is-left .fc-quiz-tail {
  right: auto;
  left: 3px;
  transform-origin: 82% 55%;
  animation-name: fcMascotTailLeft;
}

.fc-quiz-float:hover .fc-quiz-bubble {
  transform: translateY(0);
  box-shadow: 0 12px 28px rgba(159, 18, 57, 0.14);
}

.fc-quiz-float:hover .fc-quiz-mascot {
  animation-play-state: paused;
  transform: translateY(-4px) rotate(-2deg);
}

.fc-quiz-float.is-left:hover .fc-quiz-mascot {
  transform: translateY(-4px) rotate(2deg);
}

.fc-quiz-float:active .fc-quiz-mascot {
  transform: translateY(0) scale(0.96);
}

.fc-quiz-float.is-dragging {
  filter: drop-shadow(0 24px 34px rgba(159, 18, 57, 0.22));
}

.fc-quiz-float.is-dragging .fc-quiz-bubble,
.fc-quiz-float.is-dragging .fc-quiz-mascot {
  transition: none;
}

.fc-quiz-float:hover .fc-quiz-tail,
.fc-quiz-float:hover .fc-quiz-paw,
.fc-quiz-float.is-dragging .fc-quiz-mascot,
.fc-quiz-float.is-dragging .fc-quiz-tail,
.fc-quiz-float.is-dragging .fc-quiz-paw {
  animation-play-state: paused;
}

@keyframes fcMascotNod {
  0%, 72%, 100% { transform: translateY(0) rotate(0deg); }
  76% { transform: translateY(-2px) rotate(-4deg); }
  80% { transform: translateY(0) rotate(4deg); }
  84% { transform: translateY(-1px) rotate(-2deg); }
  88% { transform: translateY(0) rotate(0deg); }
}

@keyframes fcMascotTail {
  0%, 66%, 100% { transform: rotate(8deg) scale(1); }
  69% { transform: rotate(27deg) scale(1.04); }
  72% { transform: rotate(-12deg) scale(0.98); }
  75% { transform: rotate(24deg) scale(1.03); }
  78% { transform: rotate(8deg) scale(1); }
}

@keyframes fcMascotTailLeft {
  0%, 66%, 100% { transform: rotate(-8deg) scale(1); }
  69% { transform: rotate(-27deg) scale(1.04); }
  72% { transform: rotate(12deg) scale(0.98); }
  75% { transform: rotate(-24deg) scale(1.03); }
  78% { transform: rotate(-8deg) scale(1); }
}

@keyframes fcMascotPawLeft {
  0%, 58%, 100% { transform: translateY(0) rotate(-8deg); }
  61% { transform: translateY(-5px) rotate(-18deg); }
  64% { transform: translateY(0) rotate(-5deg); }
  67% { transform: translateY(-3px) rotate(-14deg); }
  70% { transform: translateY(0) rotate(-8deg); }
}

@keyframes fcMascotPawRight {
  0%, 58%, 100% { transform: translateY(0) rotate(8deg); }
  61% { transform: translateY(-3px) rotate(14deg); }
  64% { transform: translateY(0) rotate(5deg); }
  67% { transform: translateY(-5px) rotate(18deg); }
  70% { transform: translateY(0) rotate(8deg); }
}

.fc-search {
  flex: 1 1 260px;
  min-width: 0;
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

body.page-flashcards .fc-search {
  display: none;
}

.fc-search input {
  width: 100%;
  border: none;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  padding: 0.62rem 0.9rem;
  font: inherit;
  outline: none;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.fc-search input:focus {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(230, 0, 18, 0.15);
}

.fc-progress {
  flex: 0 0 auto;
  color: var(--fc-muted);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ===== 艾宾浩斯复习仪表盘 ===== */
.fc-dashboard {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin: -0.25rem 0 1.25rem;
}
.fc-stat {
  background: var(--surface, #fff);
  border: 1px solid var(--border-soft, rgba(20, 16, 16, 0.14));
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.fc-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}
.fc-stat-num {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ink, #141010);
  font-variant-numeric: tabular-nums;
}
.fc-stat-lbl {
  font-size: 0.78rem;
  color: var(--muted, #6b5e56);
  letter-spacing: 0.02em;
}
.fc-stat[data-stat="due"] .fc-stat-num { color: var(--accent, #e60012); }
.fc-stat[data-stat="mastered"] .fc-stat-num { color: var(--success, #15803d); }
.fc-stat[data-stat="retention"] .fc-stat-num { color: var(--tone-blue, #1e4ed8); }

@media (max-width: 640px) {
  .fc-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .fc-stat-num { font-size: 1.2rem; }
}

/* ===== 背面的艾宾浩斯复习计划模块 ===== */
.fc-review-meta {
  margin-top: 0.82rem;
  color: var(--text-secondary, #4a3f3a);
}

.fc-eb-card {
  border: 1px solid rgba(38, 92, 157, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 251, 255, 0.9)),
    radial-gradient(circle at 14% 0%, rgba(196, 235, 213, 0.28), transparent 34%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86), 0 12px 26px rgba(35, 78, 130, 0.1);
  padding: 0.86rem;
  color: #213047;
}

.fc-eb-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
  margin-bottom: 0.78rem;
}

.fc-eb-title {
  color: #17243a;
  font-size: 0.98rem;
  font-weight: 950;
  line-height: 1.25;
}

.fc-eb-sub {
  margin-top: 0.22rem;
  color: #647189;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.45;
}

.fc-eb-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.55rem;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.16rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.fc-eb-status.is-due {
  background: rgba(254, 226, 226, 0.92);
  color: #991b1b;
}

.fc-eb-status.is-scheduled {
  background: rgba(219, 234, 254, 0.92);
  color: #1e40af;
}

.fc-eb-status.is-learning {
  background: rgba(236, 253, 245, 0.92);
  color: #166534;
}

.fc-eb-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.fc-eb-metric {
  min-width: 0;
  border: 1px solid rgba(53, 74, 110, 0.08);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.66);
  padding: 0.58rem 0.62rem;
}

.fc-eb-metric span,
.fc-eb-strength-top span {
  display: block;
  color: #718098;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.3;
}

.fc-eb-metric strong {
  display: block;
  margin-top: 0.22rem;
  color: #17243a;
  font-size: 0.9rem;
  font-weight: 950;
  line-height: 1.3;
  font-variant-numeric: tabular-nums;
}

.fc-eb-metric em {
  display: block;
  margin-top: 0.15rem;
  color: #5b667a;
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 650;
  line-height: 1.38;
}

.fc-eb-strength {
  margin-top: 0.72rem;
}

.fc-eb-strength-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.32rem;
}

.fc-eb-strength-top strong {
  color: #17243a;
  font-size: 0.74rem;
  font-weight: 950;
}

.fc-eb-bar {
  display: block;
  height: 8px;
  border-radius: 999px;
  background: rgba(30, 64, 175, 0.09);
  overflow: hidden;
}

.fc-eb-bar > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 38%, #2563eb 70%, #16a34a 100%);
  transition: width 0.3s ease;
}

.fc-eb-timeline {
  margin-top: 0.66rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.34rem;
}

.fc-eb-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.35rem;
  border: 1px solid rgba(53, 74, 110, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: #65738b;
  padding: 0.1rem 0.44rem;
  font-size: 0.66rem;
  font-weight: 850;
  white-space: nowrap;
}

.fc-eb-step.is-done {
  background: rgba(220, 252, 231, 0.85);
  color: #166534;
  border-color: rgba(22, 101, 52, 0.12);
}

.fc-eb-step.is-current {
  background: #1d4290;
  color: #fff;
  border-color: #1d4290;
  box-shadow: 0 5px 14px rgba(29, 66, 144, 0.18);
}

.fc-list-review-plan {
  margin-top: 0.58rem;
}

.fc-eb-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.8rem;
  border-left: 4px solid #f59e0b;
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 247, 237, 0.82), rgba(255, 255, 255, 0.52));
  padding: 0.52rem 0.66rem;
  color: #3b2f25;
}

.fc-eb-strip-main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
  font-size: 0.78rem;
  line-height: 1.3;
}

.fc-eb-strip-label {
  color: #9a3412;
  font-weight: 950;
}

.fc-eb-strip-main strong {
  color: #1f2937;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.fc-eb-strip-main span:last-child {
  color: #6b7280;
  font-weight: 760;
}

.fc-eb-strip-side {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.fc-eb-strip .fc-eb-status {
  min-height: 1.32rem;
  padding: 0.1rem 0.48rem;
  font-size: 0.64rem;
}

.fc-eb-strip-meter {
  width: 5.6rem;
  height: 6px;
  border-radius: 999px;
  background: rgba(120, 113, 108, 0.16);
  overflow: hidden;
}

.fc-eb-strip-meter > i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #f97316, #f59e0b, #22c55e);
}

.fc-stage {
  display: grid;
  place-items: center;
  margin-top: 20px;
}

.fc-card-shell {
  width: min(760px, calc(100% - 9rem));
  perspective: 1200px;
  position: relative;
  /* 牌堆仅覆盖卡片尺寸；留白放到外部避免“露底板” */
  margin-bottom: 1.25rem;
  overflow: visible;
}

.fc-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 3;
  width: 54px;
  height: 54px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.1);
  color: rgba(0, 0, 0, 0.68);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.fc-arrow-ico {
  width: 26px;
  height: 26px;
  display: block;
  filter: none;
}

/* 圆形按钮的柔光高光 */
.fc-arrow::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.0;
  transition: opacity 0.22s ease;
  border-radius: 999px;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%),
    radial-gradient(circle at 70% 80%, rgba(230, 0, 18, 0.06), rgba(230, 0, 18, 0) 55%);
}

.fc-arrow:hover {
  color: var(--fc-accent);
  background: #fff;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
  transform: translateY(-50%) scale(1.05);
}

.fc-arrow:hover::before {
  opacity: 1;
}

.fc-arrow:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  color: rgba(0, 0, 0, 0.25);
  border-color: rgba(15, 23, 42, 0.10);
}

.fc-arrow:disabled:hover {
  transform: translateY(-50%);
}

.fc-arrow:active {
  transform: translateY(-50%) scale(0.98);
}

.fc-arrow:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.75);
  outline-offset: 3px;
}

.fc-arrow-left {
  left: -4.25rem;
}

.fc-arrow-right {
  right: -4.25rem;
}

@media (max-width: 520px) {
  .fc-arrow {
    width: 50px;
    height: 50px;
  }
  .fc-arrow-ico { width: 24px; height: 24px; }
}

.fc-deck {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.fc-deck-card {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  border-radius: var(--fc-radius-lg);
  border: none;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  transform-origin: 50% 55%;
  transform: translate(0, 0) rotate(0deg) scale(1);
  opacity: 0;
}

/* 每层牌的“斜着叠放”参数（轻微错位 + 旋转） */
.fc-deck-card.d1 { --fc-dx: -14px; --fc-dy: 16px; --fc-rot: -3.0deg; }
.fc-deck-card.d2 { --fc-dx: 16px; --fc-dy: 28px; --fc-rot:  3.2deg; }
.fc-deck-card.d3 { --fc-dx: -18px; --fc-dy: 40px; --fc-rot: -2.3deg; }
.fc-deck-card.d4 { --fc-dx: 20px; --fc-dy: 52px; --fc-rot:  2.6deg; }

/* 叠牌层数：根据 data-left 显示 0~4 层 */
.fc-deck[data-left="2"] .d1,
.fc-deck[data-left="3"] .d1,
.fc-deck[data-left="4"] .d1,
.fc-deck[data-left="5"] .d1,
.fc-deck[data-left="6"] .d1,
.fc-deck[data-left="7"] .d1,
.fc-deck[data-left="8"] .d1,
.fc-deck[data-left="9"] .d1,
.fc-deck[data-left="10"] .d1,
.fc-deck[data-left="11"] .d1,
.fc-deck[data-left="12"] .d1,
.fc-deck[data-left="13"] .d1,
.fc-deck[data-left="14"] .d1,
.fc-deck[data-left="15"] .d1 {
  opacity: 0.95;
  transform: translate(var(--fc-dx), var(--fc-dy)) rotate(var(--fc-rot)) scale(0.992);
}

.fc-deck[data-left="3"] .d2,
.fc-deck[data-left="4"] .d2,
.fc-deck[data-left="5"] .d2,
.fc-deck[data-left="6"] .d2,
.fc-deck[data-left="7"] .d2,
.fc-deck[data-left="8"] .d2,
.fc-deck[data-left="9"] .d2,
.fc-deck[data-left="10"] .d2,
.fc-deck[data-left="11"] .d2,
.fc-deck[data-left="12"] .d2,
.fc-deck[data-left="13"] .d2,
.fc-deck[data-left="14"] .d2,
.fc-deck[data-left="15"] .d2 {
  opacity: 0.82;
  transform: translate(var(--fc-dx), var(--fc-dy)) rotate(var(--fc-rot)) scale(0.985);
}

.fc-deck[data-left="4"] .d3,
.fc-deck[data-left="5"] .d3,
.fc-deck[data-left="6"] .d3,
.fc-deck[data-left="7"] .d3,
.fc-deck[data-left="8"] .d3,
.fc-deck[data-left="9"] .d3,
.fc-deck[data-left="10"] .d3,
.fc-deck[data-left="11"] .d3,
.fc-deck[data-left="12"] .d3,
.fc-deck[data-left="13"] .d3,
.fc-deck[data-left="14"] .d3,
.fc-deck[data-left="15"] .d3 {
  opacity: 0.70;
  transform: translate(var(--fc-dx), var(--fc-dy)) rotate(var(--fc-rot)) scale(0.978);
}

.fc-deck[data-left="5"] .d4,
.fc-deck[data-left="6"] .d4,
.fc-deck[data-left="7"] .d4,
.fc-deck[data-left="8"] .d4,
.fc-deck[data-left="9"] .d4,
.fc-deck[data-left="10"] .d4,
.fc-deck[data-left="11"] .d4,
.fc-deck[data-left="12"] .d4,
.fc-deck[data-left="13"] .d4,
.fc-deck[data-left="14"] .d4,
.fc-deck[data-left="15"] .d4 {
  opacity: 0.58;
  transform: translate(var(--fc-dx), var(--fc-dy)) rotate(var(--fc-rot)) scale(0.97);
}

.fc-card {
  width: 100%;
  min-height: 620px;
  border-radius: var(--fc-radius-lg);
  border: none;
  box-shadow: var(--fc-shadow);
  background: transparent;
  transform-style: preserve-3d;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  position: relative;
  z-index: 1;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.fc-card::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--fc-radius-lg) + 2px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease;
}

/* 抽卡光带扫过 */
.fc-card::before {
  background:
    linear-gradient(
      115deg,
      rgba(255, 255, 255, 0) 20%,
      rgba(255, 255, 255, 0.55) 45%,
      rgba(255, 255, 255, 0) 70%
    );
  filter: blur(6px);
  transform: translateX(-40%) rotate(0deg);
}

/* 稀有度不再影响卡片描边颜色（避免出现红色线框）；仅用右上角徽标区分 */
.fc-card[data-rarity] {
  border-color: var(--fc-border);
}

/* 切换卡片不做位移/缩放动画，避免“抖动” */

.fc-rarity-badge {
  display: none;
}

.fc-rarity-badge::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.65), transparent 45%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.55), transparent 55%),
    repeating-linear-gradient(
      135deg,
      rgba(15, 23, 42, 0.035) 0px,
      rgba(15, 23, 42, 0.035) 6px,
      rgba(15, 23, 42, 0.0) 6px,
      rgba(15, 23, 42, 0.0) 12px
    );
  opacity: 0.55;
  pointer-events: none;
}

.fc-rarity-code,
.fc-rarity-insc {
  position: relative;
  z-index: 1;
}

.fc-rarity-code {
  font-weight: 950;
  letter-spacing: 0.12em;
  font-size: 0.8rem;
  line-height: 1.05;
}

.fc-rarity-insc {
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 0.62rem;
  line-height: 1.05;
  opacity: 0.75;
}

/* 徽标跟随稀有度变色（利用父级 data-rarity） */
.fc-card[data-rarity="r"] .fc-rarity-badge {
  border-color: rgba(37, 99, 235, 0.28);
  color: rgba(37, 99, 235, 0.92);
  background: linear-gradient(145deg, rgba(219, 234, 254, 0.82), rgba(248, 250, 255, 0.72));
}
.fc-card[data-rarity="hr"] .fc-rarity-badge {
  border-color: rgba(124, 92, 255, 0.30);
  color: rgba(109, 40, 217, 0.92);
  background: linear-gradient(145deg, rgba(237, 233, 254, 0.84), rgba(250, 245, 255, 0.74));
}
.fc-card[data-rarity="sr"] .fc-rarity-badge {
  border-color: rgba(180, 83, 9, 0.28);
  color: rgba(180, 83, 9, 0.95);
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.86), rgba(255, 255, 255, 0.72));
}
.fc-card[data-rarity="ssr"] .fc-rarity-badge {
  border-color: rgba(230, 0, 18, 0.28);
  color: rgba(230, 0, 18, 0.92);
  background: linear-gradient(145deg, rgba(255, 215, 220, 0.84), rgba(255, 255, 255, 0.72));
}

@media (prefers-reduced-motion: reduce) {
  .fc-card.is-drawing,
  .fc-card.is-drawing::before {
    animation: none !important;
  }
}

.fc-card.is-flipped {
  transform: rotateY(180deg);
}

.fc-face {
  position: absolute;
  inset: 0;
  border-radius: var(--fc-radius-lg);
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border: 1px solid rgba(15, 23, 42, 0.10);
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* 铭文在 .fc-face 上绝对定位；正文区上下对称安全边距，短内容竖向居中（::before/::after 避免 center+overflow 裁切长文） */
.fc-face-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  padding: var(--fc-face-v-safe) var(--fc-rarity-safe-inset);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.fc-face-body::before,
.fc-face-body::after {
  content: "";
  flex: 1 1 0;
  min-height: 0;
}

.fc-face.back {
  transform: rotateY(180deg);
}

.fc-face.back .fc-face-body {
  padding-bottom: calc(var(--fc-face-v-safe) + 4.4rem);
}

.fc-face.back .fc-face-body::before,
.fc-face.back .fc-face-body::after {
  display: none;
}

.fc-word {
  font-family: var(--font-display);
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  line-height: 1.1;
  text-align: center;
  margin: 0 0 0.45rem;
}

.fc-phonetic {
  text-align: center;
  color: var(--fc-muted);
  font-weight: 700;
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  margin: 0;
}

.fc-phonetic-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
}

.fc-say {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: rgba(11, 18, 32, 0.82);
  border-radius: 999px;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: var(--transition);
  flex: 0 0 auto;
}

.fc-say:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.94);
  border-color: rgba(230, 0, 18, 0.28);
  color: rgba(230, 0, 18, 0.95);
}

.fc-say:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fc-say-ico {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  pointer-events: none;
}

.fc-meaning {
  margin-top: 0.75rem;
  color: var(--fc-ink);
  font-weight: 650;
  line-height: 1.7;
}

.fc-example {
  margin-top: 0.75rem;
  color: var(--fc-ink-soft);
  font-weight: 600;
  line-height: 1.7;
}

.fc-corpus,
.fc-list-corpus {
  margin-top: 0.75rem;
  color: var(--fc-ink-soft);
  font-weight: 650;
  line-height: 1.55;
}

.fc-list-corpus {
  margin-top: 0.65rem;
  font-size: 0.86rem;
}

.fc-corpus .ielts-corpus-card,
.fc-list-corpus .ielts-corpus-card {
  margin-top: 0;
}

.fc-corpus .ielts-corpus-headline,
.fc-list-corpus .ielts-corpus-headline {
  min-height: 2.15rem;
}

.fc-corpus .ielts-corpus-kicker,
.fc-list-corpus .ielts-corpus-kicker {
  font-size: 0.82rem;
}

.fc-list-corpus .ielts-corpus-paper {
  padding: 0.62rem 0.72rem;
}

.fc-actions {
  width: auto;
  margin: 0;
  padding: 0.9rem var(--fc-rarity-safe-inset) var(--fc-face-v-safe);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 4;
  border-radius: 0 0 var(--fc-radius-lg) var(--fc-radius-lg);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.92) 32%, rgba(255, 255, 255, 0.98));
  backdrop-filter: blur(10px) saturate(140%);
  -webkit-backdrop-filter: blur(10px) saturate(140%);
  box-sizing: border-box;
}

.fc-grade {
  appearance: none;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 16px;
  padding: 0.72rem 1rem;
  font: inherit;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.86);
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
}


.fc-grade:hover {
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--fc-shadow-hover);
}

.fc-grade.bad { border-color: rgba(185, 28, 28, 0.28); color: #b91c1c; }
.fc-grade.good { border-color: rgba(21, 128, 61, 0.28); color: #15803d; }

/* 红绿灯风格：更直观的”决策”按钮 */
.fc-grade {
  position: relative;
  overflow: hidden;
}

.fc-grade-dot {
  width: 0.62rem;
  height: 0.62rem;
  border-radius: 999px;
  flex: 0 0 auto;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.10);
}
.fc-grade.bad .fc-grade-dot {
  background: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.16), 0 10px 22px rgba(239, 68, 68, 0.18);
}
.fc-grade.mid .fc-grade-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.16), 0 10px 22px rgba(245, 158, 11, 0.18);
}
.fc-grade.good .fc-grade-dot {
  background: #22c55e;
  box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.16), 0 10px 22px rgba(34, 197, 94, 0.18);
}

.fc-grade.bad {
  background: linear-gradient(145deg, rgba(254, 242, 242, 0.92), rgba(255, 255, 255, 0.86));
}
.fc-grade.mid {
  background: linear-gradient(145deg, rgba(255, 251, 235, 0.92), rgba(255, 255, 255, 0.86));
}
.fc-grade.good {
  background: linear-gradient(145deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.86));
}

.fc-grade:hover {
  transform: translateY(-2px);
}

.fc-grade-txt {
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.fc-hint {
  margin-top: 1.1rem;
  text-align: center;
  color: var(--fc-muted);
  font-weight: 600;
}

.fc-list-view {
  width: 100%;
  margin: 1.25rem auto 0;
}

.fc-stage[hidden],
.fc-list-view[hidden] {
  display: none !important;
}

.fc-boot-skeleton {
  display: none;
}

body.page-flashcards.is-fc-booting .fc-toolbar,
body.page-flashcards.is-fc-booting .fc-stage,
body.page-flashcards.is-fc-booting .fc-list-view,
body.page-flashcards.is-fc-booting .fc-quiz-float {
  display: none !important;
}

body.page-flashcards.is-fc-booting .fc-topbar-leading > .fc-back {
  visibility: hidden;
}

body.page-flashcards.is-fc-booting .fc-boot-skeleton {
  display: grid;
  gap: 0.85rem;
  width: 100%;
  margin: 0;
}

.fc-boot-skeleton-card {
  position: relative;
  min-height: 238px;
  padding: 1.25rem;
  overflow: hidden;
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  border-radius: var(--fc-radius, 16px);
  background: var(--fc-surface-strong, #fff);
}

.fc-boot-skeleton-card::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.72) 48%, transparent 76%);
  content: "";
  transform: translateX(-100%);
  animation: fcBootShimmer 1.15s ease-in-out infinite;
}

.fc-boot-skeleton-card :is(i, span, b) {
  display: block;
  border-radius: 4px;
  background: rgba(111, 124, 143, 0.11);
}

.fc-boot-skeleton-card i {
  width: 28%;
  height: 22px;
  margin-bottom: 18px;
}

.fc-boot-skeleton-card span {
  width: 82%;
  height: 13px;
  margin-top: 10px;
}

.fc-boot-skeleton-card span:nth-of-type(2) {
  width: 64%;
}

.fc-boot-skeleton-card b {
  width: 100%;
  height: 92px;
  margin-top: 24px;
}

@keyframes fcBootShimmer {
  to { transform: translateX(100%); }
}

@media (prefers-reduced-motion: reduce) {
  .fc-boot-skeleton-card::after { animation: none; }
}

.fc-list-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.85rem;
  color: var(--fc-ink);
}

.fc-list-head strong {
  font-size: 1.05rem;
  font-weight: 800;
}

.fc-list-head span {
  color: var(--fc-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.fc-word-list {
  display: grid;
  gap: 0.85rem;
}

.fc-word-list.fc-word-list--grid3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.fc-list-card {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: 1rem 2.35rem 1rem 1.1rem;
}

.fc-list-card > .fc-list-mastery {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 1;
}

/* 全部分类：三列网格 */
.fc-word-list--grid3 .fc-list-card {
  padding: 0.75rem 2.15rem 0.85rem 0.9rem;
  height: 100%;
}

.fc-word-list--grid3 .fc-list-meaning {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 0.1rem;
}

.fc-word-list--grid3 .fc-list-example,
.fc-word-list--grid3 .fc-list-meta,
.fc-word-list--grid3 .fc-list-review-plan {
  display: none;
}

.fc-word-list--grid3 .fc-list-card {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.08);
}

.fc-word-list--grid3 .fc-list-mastery .kw-mastery-check-box {
  width: 1.15rem;
  height: 1.15rem;
}

.fc-word-list--grid3 .fc-list-mastery .kw-mastery-check-mark {
  width: 0.72rem;
  height: 0.72rem;
}

.fc-list-card--mastered .fc-list-mastery {
  opacity: 1;
}

.fc-list-main {
  display: grid;
  gap: 0.35rem;
  min-width: 0;
}

.fc-list-word-line {
  min-width: 0;
  padding-right: 0.15rem;
}

.fc-list-phonetic-line {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  flex-wrap: nowrap;
  min-height: 1.5rem;
}

.fc-list-word {
  color: var(--fc-ink);
  font-size: 1.35rem;
  line-height: 1.18;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.fc-word-list--grid3 .fc-list-word {
  font-size: 1.05rem;
}

.fc-list-phonetic {
  color: var(--fc-muted);
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-weight: 750;
  font-size: 0.88rem;
  line-height: 1.3;
}

.fc-word-list--grid3 .fc-list-phonetic {
  font-size: 0.82rem;
}

.fc-list-say {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  flex: 0 0 auto;
  padding: 0;
  line-height: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: rgba(11, 18, 32, 0.52);
  box-shadow: none;
}

.fc-list-say .fc-say-ico {
  width: 0.9rem;
  height: 0.9rem;
  display: block;
}

.fc-list-say:hover:not(:disabled) {
  background: transparent;
  border: none;
  color: var(--fc-accent);
  box-shadow: none;
}

.fc-list-say:active:not(:disabled) {
  transform: scale(0.92);
}

.fc-list-say:focus-visible {
  outline: 2px solid rgba(230, 0, 18, 0.35);
  outline-offset: 2px;
  border-radius: 4px;
}

.fc-word-list--grid3 .fc-list-say .fc-say-ico {
  width: 0.82rem;
  height: 0.82rem;
}

.fc-list-meaning {
  margin: 0;
  color: var(--fc-ink);
  font-weight: 700;
  line-height: 1.55;
}

.fc-list-example {
  margin: 0;
  color: var(--fc-ink-soft);
  font-weight: 600;
  line-height: 1.55;
  white-space: pre-line;
}

.fc-list-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  color: var(--fc-muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.fc-list-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
  margin-top: 0.95rem;
}

.fc-list-actions .fc-grade {
  min-height: 2.55rem;
  border-radius: 12px;
  padding: 0.58rem 0.9rem;
}

.fc-list-actions .fc-grade:disabled {
  cursor: wait;
  opacity: 0.7;
  transform: none;
}

.fc-list-grade {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.16rem 0.5rem;
  background: rgba(15, 23, 42, 0.06);
  color: rgba(11, 18, 32, 0.68);
}

.fc-list-card[data-grade="2"] .fc-list-grade {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
}

@media (prefers-reduced-motion: reduce) {
  .fc-card {
    transition: none;
  }
}

/* ============================================================
   Mobile responsive fixes (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {
  body.page-learn-mobile {
    background: #f5f6f8;
  }

  /* Topbar: shrink brand icon, compress buttons */
  body.page-learn-mobile .learn-topbar {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    gap: 0.5rem;
  }

  /* 移动端不显示桌面端连胜按钮 */
  body.page-learn-mobile .learn-streak-btn {
    display: none !important;
  }

  body.page-learn-mobile .learn-brand-icon svg {
    width: 34px;
    height: 34px;
  }

  body.page-learn-mobile .learn-brand-name {
    font-size: 0.95rem;
  }

  body.page-learn-mobile .learn-topbar-actions {
    gap: 0.35rem;
    margin-left: auto;
  }

  /* Topbar buttons: 圆形图标按钮 */
  body.page-learn-mobile .learn-topbar-cta {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    gap: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
  }

  body.page-learn-mobile .learn-topbar-cta:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  }

  body.page-learn-mobile .learn-topbar-cta span:not(.learn-topbar-cta-icon) {
    display: none;
  }

  body.page-learn-mobile .learn-topbar-cta-icon {
    display: inline-block !important;
  }

  body.page-learn-mobile .learn-topbar-lang-wrap.learn-topbar-cta {
    width: 2.5rem;
    height: 2.5rem;
    min-width: 2.5rem;
    padding: 0;
    gap: 0;
    justify-content: center;
  }

  body.page-learn-mobile .learn-topbar-lang-wrap .learn-topbar-cta-icon {
    display: inline-block !important;
  }

  /* Hide language text and chevron on mobile */
  body.page-learn-mobile .learn-lang-trigger-label,
  body.page-learn-mobile .learn-lang-chevron {
    display: none;
  }

  body.page-learn-mobile .learn-lang-trigger {
    min-width: 0;
    padding: 0;
  }

  body.page-learn-mobile .mobile-streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    padding: 0.35rem 0.65rem 0.35rem 0.5rem;
    border-radius: 999px;
    background: rgba(255, 59, 48, 0.08);
    border: 1.5px solid rgba(255, 59, 48, 0.18);
    color: #e60012;
    font-family: "Outfit", var(--learn-font, sans-serif);
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
  }
  body.page-learn-mobile .mobile-streak-badge[hidden] {
    display: none !important;
  }
  body.page-learn-mobile .mobile-streak-badge:hover,
  body.page-learn-mobile .mobile-streak-badge:active {
    background: rgba(255, 59, 48, 0.14);
    border-color: rgba(255, 59, 48, 0.35);
  }
  body.page-learn-mobile .mobile-streak-fire {
    width: 1.25rem;
    height: 1.25rem;
    display: grid;
    place-items: center;
    font-size: 1rem;
    line-height: 1;
  }

  body.page-learn-mobile .mobile-streak-fire svg {
    width: 100%;
    height: 100%;
    display: block;
  }
  body.page-learn-mobile .mobile-streak-num {
    font-size: 1rem;
    font-weight: 800;
  }

  /* Main content padding */
  body.page-learn-mobile main.learn-main {
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
    padding-top: 0.25rem;
    padding-bottom: max(0.75rem, env(safe-area-inset-bottom));
  }
  /* 移动端：精选轮播全宽 + 指示点 */
  body.page-learn-mobile .learn-mobile-carousel-root {
    position: relative;
    margin-bottom: 0.75rem;
  }

  body.page-learn-mobile .learn-mobile-carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0;
    scroll-behavior: smooth;
    margin-left: calc(-1 * max(0.75rem, env(safe-area-inset-left)));
    margin-right: calc(-1 * max(0.75rem, env(safe-area-inset-right)));
  }

  body.page-learn-mobile .learn-mobile-carousel-track::-webkit-scrollbar {
    display: none;
  }

  body.page-learn-mobile .learn-mobile-carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: start;
    min-width: 0;
    padding: 0 max(0.75rem, env(safe-area-inset-left));
    box-sizing: border-box;
  }

  body.page-learn-mobile .learn-mobile-carousel-slide .learn-carousel-card {
    width: 100%;
    max-width: none;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
    background: transparent;
  }

  body.page-learn-mobile .learn-mobile-carousel-slide .learn-carousel-card-body {
    display: none;
  }

  body.page-learn-mobile .learn-mobile-carousel-slide .learn-carousel-card-media {
    border-radius: 14px;
    aspect-ratio: 16 / 9;
  }

  body.page-learn-mobile .learn-mobile-carousel-dots {
    position: absolute;
    right: max(1.35rem, calc(0.75rem + env(safe-area-inset-right)));
    bottom: 0.85rem;
    left: auto;
    top: auto;
    transform: none;
    margin: 0;
    padding: 0;
    background: transparent;
    z-index: 5;
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 0.35rem;
  }

  body.page-learn-mobile .learn-mobile-carousel-dots .learn-carousel-dot {
    width: 6px;
    height: 6px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.35);
    cursor: pointer;
  }

  body.page-learn-mobile .learn-mobile-carousel-dots .learn-carousel-dot.is-active {
    width: 18px;
    background: #fff;
  }

  /* 精选区紧贴分类标签 */
  body.page-learn-mobile .learn-carousel-block {
    margin-top: 0;
  }
  /* 移动端最后一节去除底部多余间距 */
  body.page-learn-mobile main.learn-main > section:last-of-type,
  body.page-learn-mobile .learn-all-block {
    margin-bottom: 0;
  }
  body.page-learn-mobile .learn-end-hint {
    padding: 0.75rem 0 max(0.5rem, env(safe-area-inset-bottom));
  }

  /* 移动端轮播：取消 3D 效果，改为纯平移 */
  body.page-learn-mobile .learn-coverflow-viewport {
    perspective: none;
    -webkit-perspective: none;
    mask-image: none;
    -webkit-mask-image: none;
  }
  body.page-learn-mobile .learn-coverflow-stage,
  body.page-learn-mobile .learn-coverflow-track {
    transform-style: flat;
  }
  body.page-learn-mobile .learn-coverflow-item {
    width: 100%;
    max-width: 100%;
  }

  body.page-learn-mobile .learn-carousel-block {
    margin-bottom: 0.5rem;
  }

  /* 移动端：把小圆点叠加到视频封面顶部居中 */
  body.page-learn-mobile .learn-coverflow-root {
    position: relative;
  }
  body.page-learn-mobile .learn-carousel-dots,
  body.page-learn-mobile .learn-coverflow-dots {
    position: absolute;
    right: 0.75rem;
    bottom: 1.1rem;
    left: auto;
    top: auto;
    transform: none;
    margin: 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    /* 高于活动卡片（z-index 30），保证常驻可见 */
    z-index: 50;
    pointer-events: auto;
  }
  body.page-learn-mobile .learn-carousel-dot {
    background: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 2px rgba(0, 0, 0, 0.4);
  }
  body.page-learn-mobile .learn-carousel-dot.is-active {
    background: #fff;
  }

  /* 顶栏 + 分类：一体磨砂区，用间距与底部羽化代替硬分割线 */
  body.page-learn-mobile .learn-mobile-chrome {
    display: block;
    position: sticky;
    top: 0;
    z-index: 150;
    flex-shrink: 0;
    isolation: isolate;
    background: rgba(252, 253, 255, 0.68);
    backdrop-filter: blur(22px) saturate(165%);
    -webkit-backdrop-filter: blur(22px) saturate(165%);
    box-shadow: 0 10px 28px -22px rgba(15, 23, 42, 0.35);
  }

  body.page-learn-mobile .learn-mobile-chrome::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 14px;
    pointer-events: none;
    background: linear-gradient(
      180deg,
      rgba(252, 253, 255, 0) 0%,
      rgba(246, 247, 251, 0.55) 55%,
      rgba(246, 247, 251, 0) 100%
    );
  }

  body.page-learn-mobile .learn-mobile-chrome .learn-topbar {
    position: relative;
    /* 语言弹窗需覆盖在分类标签之上：顶栏层级必须高于 tabs 的 stacking context */
    z-index: 30;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    box-shadow: none;
    padding-top: max(1.05rem, env(safe-area-inset-top));
    padding-bottom: 0.75rem;
  }

  body.page-learn-mobile .learn-mobile-chrome .learn-topbar::after {
    content: "";
    position: absolute;
    left: max(0.875rem, env(safe-area-inset-left));
    right: max(0.875rem, env(safe-area-inset-right));
    bottom: 0;
    height: 1px;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(15, 23, 42, 0.07) 22%,
      rgba(15, 23, 42, 0.07) 78%,
      transparent 100%
    );
    pointer-events: none;
  }

  /* 移动端分类标签：参考视频网站（抖音/B站）顶部导航样式 */
  body.page-learn-mobile .mobile-category-tabs,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    position: relative;
    z-index: 10;
    margin: 0 max(1rem, env(safe-area-inset-right)) 0 max(1rem, env(safe-area-inset-left));
    padding: 0.65rem 0 0.75rem;
    gap: 0.65rem;
    width: auto;
    box-sizing: border-box;
    align-items: center;
    background: transparent;
  }
  body.page-learn-mobile .mobile-category-tabs::-webkit-scrollbar,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs::-webkit-scrollbar {
    display: none;
  }
  body.page-learn-mobile .mobile-category-tabs::after,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs::after {
    content: "";
    flex: 0 0 0.35rem;
  }
  body.page-learn-mobile .mobile-category-tabs .learn-category-tab,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs .learn-category-tab {
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    /* 所有状态使用相同 padding & 高度，避免切换抖动 */
    padding: 0.45rem 0.55rem;
    height: 2rem;
    min-height: 2rem;
    line-height: 1;
    font-size: 0.95rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    background: transparent;
    border: none;
    color: rgba(11, 18, 32, 0.55);
    text-decoration: none;
    box-shadow: none;
    border-radius: 999px;
    transition: color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
    /* 用相同的 letter-spacing 让加粗与未加粗占位一致 */
    letter-spacing: -0.01em;
  }
  body.page-learn-mobile .mobile-category-tabs .learn-category-tab:hover,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs .learn-category-tab:hover {
    color: rgba(11, 18, 32, 0.85);
  }
  /* 选中态：更像参考图（加粗/稍放大 + 底部短下划线） */
  body.page-learn-mobile .mobile-category-tabs .learn-category-tab.is-active,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs .learn-category-tab.is-active {
    color: rgba(11, 18, 32, 0.92);
    background: transparent;
    font-weight: 800;
    transform: translateY(-0.5px);
  }
  body.page-learn-mobile .mobile-category-tabs .learn-category-tab.is-active::after,
  body.page-learn-mobile .learn-mobile-chrome .learn-category-tabs .learn-category-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0.55rem;
    right: 0.55rem;
    bottom: -0.2rem;
    height: 3px;
    border-radius: 999px;
    background: var(--learn-accent, #e60012);
    opacity: 0.95;
  }
  
  /* 隐藏原有的分类标签 */
  body.page-learn-mobile .learn-all-block .learn-category-tabs {
    display: none !important;
  }

  body.page-learn-mobile .learn-category-block {
    margin-bottom: 1.15rem;
  }

  body.page-learn .learn-category-block--mobile-active {
    margin-bottom: 0.85rem;
  }

  body.page-learn-mobile .learn-category-head {
    display: block;
    margin: 0.15rem 0 0.75rem;
  }

  body.page-learn .learn-category-block--mobile-active .learn-category-head {
    display: block;
    margin: 0.15rem 0 0.75rem;
  }

  body.page-learn-mobile .learn-category-head-left {
    gap: 0.35rem;
  }

  body.page-learn-mobile .learn-category-actions {
    display: none;
  }

  body.page-learn-mobile .learn-series-meta {
    gap: 0.65rem;
    width: 100%;
  }

  body.page-learn-mobile .learn-series-desc {
    color: rgba(11, 18, 32, 0.58);
    font-size: 0.82rem;
    line-height: 1.55;
  }

  body.page-learn .learn-series-meta--collapsible {
    gap: 0.42rem;
  }

  body.page-learn .learn-series-meta--collapsible .learn-series-toggle {
    display: inline-block;
  }

  body.page-learn .learn-series-meta--collapsible.is-collapsed .learn-series-desc {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  body.page-learn .learn-series-meta--collapsible.is-collapsed .learn-series-source {
    display: none;
  }

  body.page-learn .learn-series-meta--collapsible.is-expanded .learn-series-desc {
    display: block;
    overflow: visible;
  }

  body.page-learn-mobile .learn-series-source {
    font-size: inherit;
  }

  /* 移动端隐藏「精选」「全部课程」section 标题 */
  body.page-learn-mobile .learn-carousel-block > .learn-section-head,
  body.page-learn-mobile .learn-all-block > .learn-section-head {
    display: none;
  }

  /* 移动端：精选轮播只展示封面，隐藏标题/日期/打开 */
  body.page-learn-mobile .learn-coverflow-item .learn-carousel-card-body {
    display: none;
  }
  body.page-learn-mobile .learn-coverflow-item .learn-carousel-card {
    background: transparent;
    box-shadow: none;
    border-radius: 12px;
  }

  /* 缩小所有视频卡片圆角 */
  body.page-learn-mobile .learn-grid-card {
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
  }
  body.page-learn-mobile .learn-grid-card:hover {
    transform: none;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.07);
  }
  body.page-learn-mobile .learn-grid-card .learn-grid-card-media {
    border-radius: 12px 12px 0 0;
  }

  /* 隐藏卡片上的日期/句数/打开 一行 */
  body.page-learn-mobile .learn-grid-card .learn-grid-card-meta-row {
    display: none;
  }
  /* 精选只剩封面：四角统一圆角 */
  body.page-learn-mobile .learn-coverflow-item .learn-carousel-card-media {
    border-radius: 12px;
  }

  /* Shelf cards: 双列网格内自适应宽度 */
  body.page-learn-mobile .learn-grid-card.learn-grid-card--shelf {
    width: auto;
    min-width: 0;
    max-width: 100%;
  }

  /* Hide shelf arrows on touch devices */
  body.page-learn-mobile .learn-shelf.has-overflow .learn-shelf-arrow {
    display: none;
  }

  /* 移动端：课程列表双列网格 */
  body.page-learn-mobile .learn-shelf-scroller,
  body.page-learn-mobile .learn-course-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
    overflow: visible;
    padding: 0;
    mask-image: none;
    -webkit-mask-image: none;
    scroll-snap-type: none;
  }

  body.page-learn-mobile .learn-course-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    padding: 0 0 0.75rem 0;
  }

  /* 滑到底文案提示 */
  body.page-learn-mobile .learn-end-hint {
    text-align: center;
    color: rgba(11, 18, 32, 0.4);
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    padding: 1.25rem 0 1.75rem;
    letter-spacing: 0.02em;
  }

  /* 用与基础规则同等优先级覆盖固定宽度，防止两列卡片超出容器 */
  body.page-learn-mobile .learn-grid-card {
    width: auto !important;
    min-width: 0;
    max-width: 100%;
    flex: none;
    scroll-snap-align: none;
  }

  /* 封面保持 16:9 完整显示 */
  body.page-learn-mobile .learn-grid-card .learn-grid-card-media {
    aspect-ratio: 16 / 9;
    width: 100%;
  }

  body.page-learn-mobile .learn-access-badge {
    top: 0.42rem;
    right: 0.42rem;
    min-height: 1.18rem;
    padding: 0.16rem 0.36rem;
    font-size: 0.56rem;
  }

  body.page-learn-mobile .learn-locked-media {
    padding: 0.72rem 0.55rem 0.98rem;
  }

  body.page-learn-mobile .learn-locked-cover {
    gap: 0.28rem;
    max-width: 94%;
    padding-right: 0;
  }

  body.page-learn-mobile .learn-locked-cover::before,
  body.page-learn-mobile .learn-locked-cover::after {
    font-size: 3.1rem;
  }

  body.page-learn-mobile .learn-locked-cover::before {
    left: -0.2rem;
    top: -0.8rem;
  }

  body.page-learn-mobile .learn-locked-cover::after {
    right: -0.2rem;
    bottom: -1rem;
  }

  body.page-learn-mobile .learn-locked-cover-title {
    max-width: 100%;
    font-size: 0.5rem;
    line-height: 1.1;
    letter-spacing: 0.06em;
  }

  body.page-learn-mobile .learn-locked-cover-line {
    max-width: 100%;
    font-size: 0.78rem;
    line-height: 1.02;
    -webkit-line-clamp: 3;
  }

  body.page-learn-mobile .learn-locked-subtitle {
    left: 0.5rem;
    right: 0.5rem;
    bottom: 0.42rem;
    font-size: 0.48rem;
  }

  body.page-learn-mobile .learn-locked-hint {
    left: 0.46rem;
    top: 0.42rem;
    bottom: auto;
    font-size: 0.5rem;
  }

  body.page-learn-mobile .learn-ielts-tags {
    left: 0.42rem;
    right: 0.42rem;
    bottom: 0.42rem;
    gap: 0.18rem;
  }

  body.page-learn-mobile .learn-ielts-tag {
    min-height: 1.08rem;
    padding: 0.14rem 0.26rem;
    font-size: 0.52rem;
    line-height: 1;
  }

  /* 标题折行，不截断 */
  body.page-learn-mobile .learn-grid-card .learn-grid-card-title {
    -webkit-line-clamp: unset;
    overflow: visible;
    display: block;
    white-space: normal;
    font-size: 0.78rem;
    line-height: 1.38;
    margin-bottom: 0;
    color: var(--learn-ink);
    font-weight: 600;
  }

  /* 网格卡片仅保留封面 + 标题 */
  body.page-learn-mobile .learn-grid-card .learn-ielts-tags--body {
    display: none !important;
  }

  body.page-learn-mobile .learn-bottom-hint {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(11, 18, 32, 0.35);
    padding: 0.75rem 0 max(0.5rem, env(safe-area-inset-bottom));
    margin: 0;
    letter-spacing: 0.02em;
  }

  body.page-learn-mobile .learn-grid-card .learn-grid-card-body {
    padding: 0.5rem 0.6rem 0.6rem;
  }

  body.page-learn-mobile .learn-grid-card .learn-grid-card-meta-row {
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  body.page-learn-mobile .learn-grid-card .learn-grid-card-meta {
    font-size: 0.7rem;
    white-space: nowrap;
  }

  /* Section title smaller */
  body.page-learn-mobile .learn-section-title {
    font-size: 1.2rem;
  }

  body.page-learn-mobile .learn-category-title {
    font-size: 0.95rem;
  }

  /* Modal: full-width on mobile */
  body.page-learn-mobile .modal.learn-modal,
  body.page-learn-mobile .modal.learn-feedback-modal,
  body.page-learn-mobile .modal.learn-rating-modal {
    width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    margin-top: auto;
    margin-bottom: 0;
  }

  /* 加微信反馈弹窗：移动端缩小，避免占满屏 */
  body.page-learn-mobile .modal.learn-feedback-modal .modal-body {
    padding-top: 0.5rem;
    padding-bottom: 0.75rem;
  }
  body.page-learn-mobile .learn-feedback {
    gap: 0.55rem;
    padding: 0;
  }
  body.page-learn-mobile .learn-feedback-title {
    font-size: 0.95rem;
  }
  body.page-learn-mobile .learn-feedback-qr {
    width: 220px;
    max-width: 220px;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
  }
  body.page-learn-mobile .learn-feedback-open {
    font-size: 0.9rem;
  }

  body.page-learn-mobile .modal-backdrop.is-open {
    align-items: flex-end;
    padding: 0;
  }
}

/* ============================================================
   Flashcards mobile fixes (≤ 768px)
   ============================================================ */

/* Desktop: hide mobile-only elements */
.fc-filter-mobile {
  display: none;
}

@media (max-width: 768px) {
  body.page-flashcards {
    /* 缩小右上稀有度徽标占位，给正文更多竖向空间 */
    --fc-rarity-badge-v-space: max(0.9rem, min(3.2rem, 10vw));
    --fc-face-v-safe: max(0.9rem, var(--fc-rarity-badge-v-space));
    /* 移动端：把卡片正文左右安全边距缩小，避免长单词（如 almighty）被裁切 */
    --fc-rarity-safe-inset: max(0.55rem, min(1.25rem, 3vw));
  }

  /* Hide desktop chip row, show mobile filter button */
  .fc-topbar-actions {
    display: none;
  }

  .fc-filter-mobile {
    display: flex;
    align-items: center;
    position: relative;
  }

  /* Filter trigger button */
  .fc-filter-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem 0.75rem;
    white-space: nowrap;
  }

  .fc-filter-chevron {
    transition: transform 0.18s ease;
  }

  .fc-filter-trigger[aria-expanded="true"] .fc-filter-chevron {
    transform: rotate(180deg);
  }

  /* Dropdown menu */
  .fc-filter-menu {
    position: absolute;
    top: calc(100% + 0.4rem);
    /* 从按钮右端对齐向左展开，避免贴到屏幕右边 */
    right: 0;
    left: auto;
    min-width: 130px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    border: 1px solid rgba(15, 23, 42, 0.12);
    border-radius: 14px;
    box-shadow: 0 4px 6px rgba(15, 23, 42, 0.06), 0 12px 28px rgba(15, 23, 42, 0.12);
    list-style: none;
    margin: 0;
    padding: 0.35rem;
    z-index: 50;
  }

  .fc-filter-menu li {
    padding: 0.55rem 0.85rem;
    border-radius: 9px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.9rem;
    color: rgba(11, 18, 32, 0.75);
    transition: background 0.14s ease;
  }

  .fc-filter-menu li:hover {
    background: rgba(15, 23, 42, 0.06);
  }

  .fc-filter-menu li.is-active {
    background: rgba(230, 0, 18, 0.08);
    color: #e60012;
  }

  /* Card: narrower + taller on portrait mobile（宽度相对主内容区，避免再用 100vw 顶破 fc-main 内边距） */
  .fc-card-shell {
    /* 卡片本体左右各留 24px 给牌堆 d1~d4 偏移露出（dx ≤ 20px） */
    width: calc(100% - 48px);
    max-width: calc(100% - 48px);
    margin: 0 auto;
    /* 关键：按视口剩余高度分配卡片高度，避免小屏被顶栏/搜索挤到"显示不全" */
    height: clamp(500px, calc(100dvh - 230px), 720px);
  }

  /* 移动端：用左右滑动手势切换，隐藏遮挡文字的两侧箭头按钮 */
  body.page-flashcards .fc-arrow {
    display: none !important;
  }

  .fc-card {
    height: 100%;
    min-height: 0;
  }

  /* 卡内分级按钮：英文标签允许折行避免裁切 */
  .fc-actions {
    gap: 0.45rem;
    padding: 0.7rem var(--fc-rarity-safe-inset) var(--fc-face-v-safe);
    box-sizing: border-box;
  }

  .fc-grade {
    min-width: 0;
    padding: 0.6rem 0.4rem;
    font-size: 0.8125rem;
  }

  .fc-grade-txt {
    white-space: normal;
    text-align: center;
    line-height: 1.2;
    overflow-wrap: anywhere;
  }

  /* 移动端：卡片内字号整体缩小一档，避免溢出 */
  body.page-flashcards .fc-word {
    font-size: clamp(1.5rem, 7.5vw, 2.1rem);
    margin-bottom: 0.35rem;
  }

  body.page-flashcards .fc-phonetic {
    font-size: 0.85rem;
  }

  body.page-flashcards .fc-meaning {
    font-size: 0.92rem;
    line-height: 1.55;
    margin-top: 0.55rem;
  }

  body.page-flashcards .fc-example {
    font-size: 0.85rem;
    line-height: 1.55;
    margin-top: 0.5rem;
  }

  body.page-flashcards .fc-hint {
    font-size: 0.78rem;
    margin-top: 0.75rem;
  }

  body.page-flashcards .fc-review-meta {
    margin-top: 0.65rem;
  }

  body.page-flashcards .fc-eb-card {
    border-radius: 15px;
    padding: 0.68rem;
  }

  body.page-flashcards .fc-eb-head {
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.6rem;
  }

  body.page-flashcards .fc-eb-status {
    align-self: flex-start;
  }

  body.page-flashcards .fc-eb-grid {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }

  body.page-flashcards .fc-eb-metric {
    padding: 0.5rem 0.54rem;
  }

  body.page-flashcards .fc-eb-title {
    font-size: 0.92rem;
  }

  body.page-flashcards .fc-eb-sub,
  body.page-flashcards .fc-eb-metric em {
    font-size: 0.65rem;
  }

  body.page-flashcards .fc-eb-step {
    font-size: 0.62rem;
    padding-inline: 0.36rem;
  }

  body.page-flashcards .fc-eb-strip {
    grid-template-columns: 1fr;
    gap: 0.42rem;
  }

  body.page-flashcards .fc-eb-strip-side {
    justify-content: space-between;
  }

  /* 手机端：顶部导航栏换行 */
  body.page-flashcards .fc-main {
    flex-direction: column;
    align-items: stretch;
    padding-top: 0;
  }

  body.page-flashcards .fc-topbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }
  
  body.page-flashcards .fc-topbar-actions {
    width: 100%;
    margin-top: 0;
    justify-content: flex-end;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  body.page-flashcards .fc-topbar-nav {
    max-width: none;
    margin-right: 0;
    flex: 1 1 100%;
    order: 2;
  }

  .fc-stats-btn {
    order: 1;
  }

  .fc-quiz-float {
    top: auto;
    right: max(0.6rem, env(safe-area-inset-right));
    bottom: max(5.2rem, env(safe-area-inset-bottom));
    width: 98px;
    min-height: 118px;
    filter: drop-shadow(0 14px 22px rgba(159, 18, 57, 0.14));
  }

  .fc-quiz-bubble {
    min-width: 70px;
    min-height: 33px;
    padding: 0.36rem 0.64rem;
    font-size: 0.84rem;
  }

  .fc-quiz-bubble::after {
    right: 18px;
    bottom: -6px;
    width: 11px;
    height: 11px;
  }

  .fc-quiz-mascot {
    width: 72px;
    height: 76px;
  }

  .fc-quiz-tail {
    right: 2px;
    top: 34px;
    width: 22px;
    height: 19px;
  }

  .fc-quiz-face {
    left: 5px;
    top: 13px;
    width: 62px;
    height: 58px;
    border-radius: 27px 27px 25px 25px;
  }

  .fc-quiz-ear {
    top: 6px;
    width: 24px;
    height: 24px;
  }

  .fc-quiz-ear::after {
    inset: 5px;
  }

  .fc-quiz-ear-left {
    left: 7px;
  }

  .fc-quiz-ear-right {
    right: 7px;
  }

  .fc-quiz-eye {
    top: 24px;
    width: 7px;
    height: 9px;
  }

  .fc-quiz-eye-left {
    left: 21px;
  }

  .fc-quiz-eye-right {
    right: 21px;
  }

  .fc-quiz-nose {
    top: 34px;
    width: 10px;
    height: 7px;
  }

  .fc-quiz-mouth {
    top: 41px;
    width: 19px;
    height: 9px;
  }

  .fc-quiz-cheek {
    top: 38px;
    width: 9px;
    height: 6px;
  }

  .fc-quiz-cheek-left {
    left: 12px;
  }

  .fc-quiz-cheek-right {
    right: 12px;
  }

  .fc-quiz-paw {
    width: 21px;
    height: 17px;
  }

  .fc-quiz-paw-left {
    left: 15px;
  }

  .fc-quiz-paw-right {
    right: 15px;
  }

  .fc-quiz-float.is-left .fc-quiz-bubble::after {
    left: 18px;
  }

  body.page-flashcards .fc-content {
    --fc-search-vgap: 0.45rem;
    /* 强制全宽 + 几乎贴边，由 fc-card-shell 自己留 deck 偏移所需空间 */
    width: 100%;
    max-width: 100%;
    align-self: stretch;
    padding: 0 0 2.75rem;
  }

  body.page-flashcards .fc-stage {
    margin-top: 8px;
    /* 关键：让 stage 不再按"内容自然宽度"收缩，卡片可以撑满 */
    display: block;
  }

  body.page-flashcards .fc-list-view {
    margin-top: 8px;
  }

  body.page-flashcards .fc-search input {
    padding: 0.52rem 0.85rem;
  }

  .fc-word-list.fc-word-list--grid3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
  }

  .fc-word-list--grid3 .fc-list-card {
    padding: 0.75rem 0.8rem;
  }

  .fc-word-list--grid3 .fc-list-word {
    font-size: 0.98rem;
  }
}

@media (max-width: 420px) {
  .fc-word-list.fc-word-list--grid3 {
    grid-template-columns: 1fr;
  }
}

/* =======================================================
 * 词书高亮
 * ======================================================= */

.menu-item.menu-item-vocab {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  min-width: 12.5rem;
  max-width: min(19rem, calc(100vw - 3.25rem));
}

.menu-item.menu-item-vocab .vocab-opt-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.menu-item.menu-item-vocab .vocab-opt-label {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 900;
}

.menu-item.menu-item-vocab .vocab-opt-desc {
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.38;
  color: var(--muted);
}

.menu-item.menu-item-vocab.active .vocab-opt-desc {
  color: var(--text-secondary);
}

.vocab-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--ielts-color, transparent);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
  flex: 0 0 auto;
  align-self: center;
}

.vocab-dot[data-ielts-book="ielts_primary"] {
  --ielts-color: #10b981;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ielts-color, transparent) 18%, transparent);
}

.vocab-dot[data-ielts-book="ielts_intermediate"] {
  --ielts-color: #0ea5e9;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ielts-color, transparent) 18%, transparent);
}

.vocab-dot[data-ielts-book="ielts_intermediate_advanced"] {
  --ielts-color: #0ea5e9;
  background: linear-gradient(135deg, #0ea5e9 0 48%, #8b5cf6 52% 100%);
  box-shadow: 0 0 0 3px color-mix(in srgb, #8b5cf6 18%, transparent);
}

.vocab-dot[data-ielts-book="ielts_advanced"] {
  --ielts-color: #8b5cf6;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ielts-color, transparent) 18%, transparent);
}

.menu-item.menu-item-vocab .ielts-opt-dot {
  width: 0.72rem;
  height: 0.72rem;
  align-self: auto;
}

.ielts-opt-check {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 999px;
  border: 2px solid rgba(15, 23, 42, 0.13);
  flex: 0 0 auto;
  align-self: center;
}

.menu-item.menu-item-vocab.active .ielts-opt-check {
  border-color: color-mix(in srgb, var(--accent) 36%, transparent);
  background: radial-gradient(circle, var(--accent) 0 38%, transparent 42%);
}

/* 悬停时保留原蓝色强调，便于查词交互 */
.sub-line .en .w:hover {
  color: var(--accent, #2563eb);
}

body[data-ielts-target="ielts_primary"] .sub-line .en .w[data-ielts-book="ielts_primary"] {
  --ielts-color: #10b981;
  color: var(--ielts-color);
  font-weight: 800;
}

body[data-ielts-target="ielts_intermediate"] .sub-line .en .w[data-ielts-book="ielts_intermediate"] {
  --ielts-color: #0ea5e9;
  color: var(--ielts-color);
  font-weight: 800;
}

body[data-ielts-target="ielts_intermediate_advanced"] .sub-line .en .w[data-ielts-book="ielts_intermediate"] {
  --ielts-color: #0ea5e9;
  color: var(--ielts-color);
  font-weight: 800;
}

body[data-ielts-target="ielts_intermediate_advanced"] .sub-line .en .w[data-ielts-book="ielts_advanced"] {
  --ielts-color: #8b5cf6;
  color: var(--ielts-color);
  font-weight: 800;
}

body[data-ielts-target="ielts_advanced"] .sub-line .en .w[data-ielts-book="ielts_advanced"] {
  --ielts-color: #8b5cf6;
  color: var(--ielts-color);
  font-weight: 800;
}

@media (prefers-color-scheme: dark) {
  .sub-line .en .w[data-ielts-book="ielts_primary"],
  .vocab-dot[data-ielts-book="ielts_primary"] { --ielts-color: #34d399; }
  .sub-line .en .w[data-ielts-book="ielts_intermediate"],
  .vocab-dot[data-ielts-book="ielts_intermediate"] { --ielts-color: #38bdf8; }
  .sub-line .en .w[data-ielts-book="ielts_advanced"],
  .vocab-dot[data-ielts-book="ielts_advanced"] { --ielts-color: #a78bfa; }
}

/* Native App shell ------------------------------------------------------- */
html.is-native-shell-pending {
  background: #f7f8fb;
}

html.is-native-shell-pending body {
  visibility: hidden !important;
}

html.is-native-app,
html.is-native-app body {
  min-height: 100%;
  overscroll-behavior-y: none;
  touch-action: manipulation;
}

body.is-native-app:not(.player-lock):not(.page-legal) {
  padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
}

html.is-native-app :is(a, button, [role="button"]) {
  text-decoration: none !important;
}

html.is-native-app :is(a, button, [role="button"]):is(:hover, :focus, :active) {
  text-decoration: none !important;
}

body.is-native-app.is-app-tab-root.page-stats .st-left-topbar,
body.is-native-app.is-app-tab-root.page-flashcards .fc-topbar-leading > .fc-back {
  display: none !important;
}

body.is-native-app.is-app-tab-root.page-stats .st-main {
  padding-top: calc(var(--st-gutter) + env(safe-area-inset-top, 0px)) !important;
}

.app-bottom-nav {
  position: fixed;
  z-index: 9000;
  inset: auto 0 0;
  height: calc(68px + env(safe-area-inset-bottom, 0px));
  padding: 5px 8px env(safe-area-inset-bottom, 0px);
  border-top: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  box-sizing: border-box;
}

.app-bottom-nav__item {
  min-width: 0;
  min-height: 58px;
  color: #667085;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  -webkit-tap-highlight-color: transparent;
}

body.is-native-app .app-bottom-nav__item {
  transform: translateY(-3px);
}

.app-bottom-nav__item svg {
  width: 23px;
  height: 23px;
  flex: 0 0 23px;
}

.app-bottom-nav__item.is-active {
  color: #e60012;
}

.app-system-layer[hidden] {
  display: none !important;
}

.app-system-layer {
  position: fixed;
  z-index: 20000;
  inset: 0;
  padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
  background: #f7f8fb;
  color: #111827;
  display: grid;
  place-items: center;
}

.app-system-layer__panel {
  width: min(360px, 100%);
  text-align: center;
}

.app-system-layer__icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 18px;
  border-radius: 50%;
  background: #fff1f2;
  color: #e60012;
  display: grid;
  place-items: center;
  font-size: 25px;
  font-weight: 800;
}

.app-system-layer h1 {
  margin: 0 0 9px;
  font-size: 23px;
  letter-spacing: 0;
}

.app-system-layer p {
  margin: 0 0 24px;
  color: #667085;
  line-height: 1.65;
}

.app-system-layer button {
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  border: 0;
  border-radius: 6px;
  background: #e60012;
  color: white;
  font: inherit;
  font-weight: 750;
}

.app-system-layer button + button {
  background: transparent;
  color: #344054;
  border: 1px solid #d0d5dd;
}

.app-exit-toast {
  position: fixed;
  z-index: 21000;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  padding: 10px 15px;
  border-radius: 5px;
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
}

/* Native App home: shared premium card language */
@media (max-width: 768px) {
  body.page-learn-mobile.is-native-app {
    --app-home-bg: #eef2f6;
    --app-home-panel: #ffffff;
    --app-home-ink: #11151c;
    --app-home-muted: #778190;
    background: var(--app-home-bg) !important;
    color: var(--app-home-ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }

  body.page-learn-mobile.is-native-app .learn-mobile-chrome {
    background: rgba(238, 242, 246, 0.96);
    border-bottom: 1px solid rgba(38, 50, 68, 0.07);
    box-shadow: 0 10px 28px rgba(37, 50, 70, 0.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
  }

  body.page-learn-mobile.is-native-app .learn-mobile-chrome::after,
  body.page-learn-mobile.is-native-app .learn-mobile-chrome .learn-topbar::after {
    display: none;
  }

  body.page-learn-mobile.is-native-app .learn-mobile-chrome .learn-topbar {
    min-height: 66px;
    padding: max(18px, calc(env(safe-area-inset-top, 0px) + 10px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
    gap: 10px;
  }

  body.page-learn-mobile.is-native-app .learn-topbar-actions {
    gap: 8px;
  }

  body.page-learn-mobile.is-native-app .learn-topbar-cta,
  body.page-learn-mobile.is-native-app .learn-topbar-lang-wrap.learn-topbar-cta {
    width: 42px;
    height: 42px;
    min-width: 42px;
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
  }

  body.page-learn-mobile.is-native-app .learn-topbar-cta:hover,
  body.page-learn-mobile.is-native-app .learn-topbar-cta:active {
    background: #f7f9fb;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
  }

  body.page-learn-mobile.is-native-app .learn-topbar-cta-icon {
    width: 19px;
    height: 19px;
    stroke-width: 1.8;
  }

  body.page-learn-mobile.is-native-app .mobile-streak-badge {
    min-height: 42px;
    padding: 0 13px 0 11px;
    gap: 6px;
    border: 1px solid rgba(210, 42, 52, 0.12);
    border-radius: 8px;
    background: #fff;
    color: #cf2933;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
  }

  body.page-learn-mobile.is-native-app .mobile-streak-fire {
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
  }

  body.page-learn-mobile.is-native-app .mobile-streak-fire svg {
    width: 22px;
    height: 22px;
    display: block;
    overflow: visible;
    filter: drop-shadow(0 3px 4px rgba(207, 41, 51, 0.2));
  }

  body.page-learn-mobile.is-native-app .mobile-streak-fire .streak-flame-outer {
    fill: url("#streak-flame-outer");
    stroke: #c91f3b;
    stroke-width: 0.7;
    stroke-linejoin: round;
  }

  body.page-learn-mobile.is-native-app .mobile-streak-fire .streak-flame-inner {
    fill: url("#streak-flame-inner");
  }

  body.page-learn-mobile.is-native-app .mobile-streak-fire .streak-flame-shine {
    fill: none;
    stroke: rgba(255, 255, 255, 0.82);
    stroke-width: 1.15;
    stroke-linecap: round;
  }

  body.page-learn-mobile.is-native-app .mobile-streak-num {
    font-size: 15px;
    font-weight: 750;
  }

  body.page-learn-mobile.is-native-app .mobile-category-tabs,
  body.page-learn-mobile.is-native-app .learn-mobile-chrome .learn-category-tabs {
    margin: 0;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) 15px max(16px, env(safe-area-inset-left, 0px));
    gap: 9px;
  }

  body.page-learn-mobile.is-native-app .mobile-category-tabs .learn-category-tab,
  body.page-learn-mobile.is-native-app .learn-mobile-chrome .learn-category-tabs .learn-category-tab {
    height: 36px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    color: #6f7987;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0;
    box-shadow: 0 6px 16px rgba(37, 50, 70, 0.05);
    transform: none;
  }

  body.page-learn-mobile.is-native-app .mobile-category-tabs .learn-category-tab.is-active,
  body.page-learn-mobile.is-native-app .learn-mobile-chrome .learn-category-tabs .learn-category-tab.is-active {
    border-color: #202630;
    background: #202630;
    color: #fff;
    font-weight: 700;
    transform: none;
  }

  body.page-learn-mobile.is-native-app .mobile-category-tabs .learn-category-tab.is-active::after,
  body.page-learn-mobile.is-native-app .learn-mobile-chrome .learn-category-tabs .learn-category-tab.is-active::after {
    display: none;
  }

  body.page-learn-mobile.is-native-app main.learn-main {
    padding: 22px max(16px, env(safe-area-inset-right, 0px)) 36px max(16px, env(safe-area-inset-left, 0px));
    background: transparent;
  }

  body.page-learn-mobile.is-native-app :is(.learn-all-block, .learn-category-list, .learn-category-block) {
    background: transparent;
  }

  body.page-learn-mobile.is-native-app .learn-category-block,
  body.page-learn-mobile.is-native-app .learn-category-block--mobile-active {
    margin-bottom: 30px;
  }

  body.page-learn-mobile.is-native-app .learn-category-head,
  body.page-learn-mobile.is-native-app .learn-category-block--mobile-active .learn-category-head {
    margin: 0 0 16px;
  }

  body.page-learn-mobile.is-native-app .learn-category-head-left {
    gap: 7px;
  }

  body.page-learn-mobile.is-native-app .learn-category-title {
    color: var(--app-home-ink);
    font-family: inherit;
    font-size: 20px;
    font-weight: 760;
    line-height: 1.3;
    letter-spacing: 0;
  }

  body.page-learn-mobile.is-native-app .learn-series-desc {
    color: var(--app-home-muted);
    font-size: 13px;
    font-weight: 450;
    line-height: 1.65;
  }

  body.page-learn-mobile.is-native-app .learn-series-toggle,
  body.page-learn-mobile.is-native-app .learn-series-source {
    color: #435064;
    font-size: 13px;
    font-weight: 650;
  }

  body.page-learn-mobile.is-native-app .learn-shelf-scroller,
  body.page-learn-mobile.is-native-app .learn-course-grid {
    gap: 14px;
  }

  body.page-learn-mobile.is-native-app .learn-grid-card {
    overflow: hidden;
    border: 1px solid rgba(38, 50, 68, 0.06);
    border-radius: 8px;
    background: var(--app-home-panel);
    box-shadow: 0 12px 28px rgba(37, 50, 70, 0.08);
  }

  body.page-learn-mobile.is-native-app .learn-grid-card:hover,
  body.page-learn-mobile.is-native-app .learn-grid-card:active {
    transform: none;
    box-shadow: 0 12px 28px rgba(37, 50, 70, 0.08);
  }

  body.page-learn-mobile.is-native-app .learn-grid-card .learn-grid-card-media,
  body.page-learn-mobile.is-native-app .learn-coverflow-item .learn-carousel-card-media {
    border-radius: 8px 8px 0 0;
  }

  body.page-learn-mobile.is-native-app .learn-grid-card .learn-grid-card-body {
    min-height: 52px;
    padding: 10px 11px 12px;
    background: #fff;
  }

  body.page-learn-mobile.is-native-app .learn-grid-card .learn-grid-card-title {
    margin: 0;
    color: #252b35;
    font-size: 13px;
    font-weight: 650;
    line-height: 1.45;
    letter-spacing: 0;
  }

  body.page-learn-mobile.is-native-app .learn-coverflow-item .learn-carousel-card {
    border-radius: 8px;
  }

  body.page-learn-mobile.is-native-app .learn-learn-badge {
    top: 10px;
    left: 10px;
    min-height: 24px;
    padding: 0 9px;
    border: 1px solid rgba(38, 50, 68, 0.09);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.94);
    color: #4f5968;
    box-shadow: 0 6px 16px rgba(37, 50, 70, 0.09);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: 0;
  }

  body.page-learn-mobile.is-native-app .learn-learn-badge--not_started {
    border-color: rgba(79, 89, 104, 0.12);
    background: rgba(255, 255, 255, 0.94);
    color: #4f5968;
  }

  body.page-learn-mobile.is-native-app .learn-learn-badge--in_progress {
    border-color: rgba(66, 111, 210, 0.12);
    background: rgba(230, 237, 255, 0.95);
    color: #426fd2;
  }

  body.page-learn-mobile.is-native-app .learn-learn-badge--completed {
    border-color: rgba(36, 157, 104, 0.12);
    background: rgba(220, 245, 232, 0.95);
    color: #218c5f;
  }

  body.page-learn-mobile.is-native-app .learn-access-badge,
  body.page-learn-mobile.is-native-app .learn-ielts-tag {
    border-radius: 6px;
  }

  body.page-learn-mobile.is-native-app .learn-bottom-hint,
  body.page-learn-mobile.is-native-app .learn-end-hint {
    color: #8a94a2;
    letter-spacing: 0;
  }

  body.page-learn-mobile.is-native-app:not(.player-lock):not(.page-legal) {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  body.page-learn-mobile.is-native-app .app-bottom-nav {
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px env(safe-area-inset-bottom, 0px);
    border-top-color: rgba(44, 58, 80, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 28px rgba(42, 55, 75, 0.06);
  }

  body.page-learn-mobile.is-native-app .app-bottom-nav__item {
    min-height: 54px;
    gap: 5px;
    color: #98a1ae;
    font-size: 11px;
    font-weight: 500;
  }

  body.page-learn-mobile.is-native-app .app-bottom-nav__item svg {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    stroke-width: 1.8;
  }

  body.page-learn-mobile.is-native-app .app-bottom-nav__item.is-active {
    color: #202630;
    font-weight: 680;
  }

  body.page-learn-mobile.is-native-app .modal.learn-modal,
  body.page-learn-mobile.is-native-app .modal.learn-feedback-modal,
  body.page-learn-mobile.is-native-app .modal.learn-rating-modal {
    border-radius: 8px 8px 0 0;
  }
}

/* App settings */
body.page-app-settings {
  --app-settings-bg: #f2f3f5;
  --app-settings-line: rgba(15, 23, 42, 0.08);
  margin: 0;
  background: var(--app-settings-bg);
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

.app-settings-head {
  padding: max(24px, calc(env(safe-area-inset-top, 0px) + 16px)) 20px 19px;
  background: var(--app-settings-bg);
}

.app-settings-head h1 {
  margin: 0;
  font-size: 30px;
  font-weight: 760;
  line-height: 1.14;
  letter-spacing: 0;
}

.app-settings-main {
  width: min(680px, 100%);
  margin: 0 auto;
  padding: 0 0 32px;
}

.app-settings-group {
  margin: 0;
  padding-top: 8px;
  background: transparent;
}

.app-settings-group h2 {
  margin: 0;
  padding: 8px 16px 7px;
  color: #7b8493;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
}

.app-settings-item {
  position: relative;
  width: 100%;
  min-height: 58px;
  padding: 0 40px 0 16px;
  border: 0;
  box-sizing: border-box;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #151922;
  text-decoration: none;
  font: inherit;
  font-size: 15px;
  font-weight: 560;
  line-height: 1.35;
  text-align: left;
  transition: background-color 100ms ease;
  -webkit-tap-highlight-color: transparent;
}

.app-settings-item:first-of-type {
  border-top: 1px solid var(--app-settings-line);
}

.app-settings-item:last-child {
  border-bottom: 1px solid var(--app-settings-line);
}

.app-settings-item + .app-settings-item::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 56px;
  height: 1px;
  background: var(--app-settings-line);
  transform: scaleY(0.5);
  transform-origin: 50% 0;
}

.app-settings-item:active {
  background: #e9eaed;
}

.app-settings-item:focus-visible {
  z-index: 1;
  outline: 2px solid rgba(230, 0, 18, 0.72);
  outline-offset: -2px;
}

.app-settings-item:is(a, button)::after {
  content: "";
  position: absolute;
  right: 18px;
  width: 7px;
  height: 7px;
  border-top: 1.5px solid #a6aeba;
  border-right: 1.5px solid #a6aeba;
  transform: rotate(45deg);
}

.app-settings-item__main {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-settings-item__icon {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: 0 0 28px;
  color: #fff;
}

.app-settings-item__icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-settings-item__icon--stats { background: #e5484d; }
.app-settings-item__icon--vocab { background: #1f8a82; }
.app-settings-item__icon--support { background: #3478f6; }
.app-settings-item__icon--privacy { background: #2a9d65; }
.app-settings-item__icon--terms { background: #7656d6; }
.app-settings-item__icon--version { background: #7a8492; }
.app-settings-item__icon--danger { background: #d92d20; }

.app-settings-item:not(a):not(button) {
  padding-right: 16px;
}

.app-settings-item__meta {
  min-width: 0;
  color: #8c96a5;
  font-size: 14px;
  font-weight: 450;
  overflow-wrap: anywhere;
  text-align: right;
}

.app-settings-item--danger {
  color: #11151c;
  cursor: pointer;
}

body.page-app-settings.is-native-app:not(.player-lock):not(.page-legal) {
  padding-bottom: calc(61px + env(safe-area-inset-bottom, 0px));
}

body.page-app-settings .app-bottom-nav {
  height: calc(61px + env(safe-area-inset-bottom, 0px));
  padding: 6px 7px env(safe-area-inset-bottom, 0px);
  border-top-color: rgba(15, 23, 42, 0.1);
  background: rgba(252, 252, 253, 0.94);
  box-shadow: none;
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
}

body.page-app-settings .app-bottom-nav__item {
  min-height: 49px;
  gap: 3px;
  color: #727c8c;
  font-size: 10px;
  font-weight: 520;
}

body.page-app-settings .app-bottom-nav__item svg {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
}

body.page-app-settings .app-bottom-nav__item.is-active {
  color: #e60012;
  font-weight: 650;
}

.app-confirm-dialog {
  width: min(440px, calc(100% - 32px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: #101828;
  box-shadow: 0 24px 80px rgba(15, 23, 42, 0.22);
}

.app-confirm-dialog::backdrop {
  background: rgba(16, 24, 40, 0.58);
}

.app-confirm-dialog form {
  padding: 24px 22px 20px;
}

.app-confirm-dialog h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 720;
  letter-spacing: 0;
}

.app-confirm-dialog p {
  color: #667085;
  line-height: 1.55;
}

.app-confirm-status {
  min-height: 20px;
  margin: 8px 0 0 !important;
  color: #c70012 !important;
  font-size: 13px;
}

.app-confirm-dialog__actions {
  margin-top: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.app-confirm-dialog__actions button {
  min-height: 43px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  background: #fff;
  color: #344054;
  font: inherit;
  font-weight: 650;
  -webkit-tap-highlight-color: transparent;
}

.app-confirm-dialog__actions .is-danger {
  border-color: #c70012;
  background: #c70012;
  color: #fff;
}

/* App settings learning-product visual pilot */
body.page-app-settings {
  --app-settings-bg: #eef2f6;
  --app-settings-panel: #ffffff;
  --app-settings-ink: #11151c;
  --app-settings-muted: #7a8492;
  --app-settings-blue: #245fd6;
  min-height: 100dvh;
  background: var(--app-settings-bg);
  color: var(--app-settings-ink);
}

body.page-app-settings .app-settings-head {
  padding: max(30px, calc(env(safe-area-inset-top, 0px) + 20px)) 22px 8px;
  background: var(--app-settings-bg);
}

body.page-app-settings .app-settings-head h1 {
  color: var(--app-settings-ink);
  font-size: 32px;
  font-weight: 780;
  line-height: 1.15;
}

body.page-app-settings .app-settings-main {
  width: min(680px, 100%);
  padding: 0 0 48px;
}

body.page-app-settings .app-settings-group {
  margin: 20px 16px 0;
  padding: 20px 0 12px;
  overflow: hidden;
  border: 1px solid rgba(38, 50, 68, 0.06);
  border-radius: 8px;
  background: var(--app-settings-panel);
  box-shadow: 0 14px 34px rgba(37, 50, 70, 0.08);
}

body.page-app-settings .app-settings-group[aria-labelledby="about-title"] {
  margin-top: 8px;
}

body.page-app-settings .app-settings-group h2 {
  position: relative;
  margin: 0 20px 16px;
  padding: 0 0 0 13px;
  color: var(--app-settings-ink);
  font-size: 20px;
  font-weight: 760;
  line-height: 1.35;
}

body.page-app-settings .app-settings-group h2::before {
  content: "";
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 0;
  width: 3px;
  border-radius: 1.5px;
  background: var(--app-settings-blue);
}

body.page-app-settings .app-settings-item {
  min-height: 64px;
  margin: 0;
  padding: 0 48px 0 20px;
  border: 0;
  background: transparent;
  color: #252b35;
  font-size: 15.5px;
  font-weight: 600;
}

body.page-app-settings .app-settings-item:first-of-type,
body.page-app-settings .app-settings-item:last-child {
  border: 0;
}

body.page-app-settings .app-settings-item + .app-settings-item::before {
  display: none;
}

body.page-app-settings .app-settings-item:active {
  background: #f2f5f8;
}

body.page-app-settings .app-settings-item:is(a, button)::after {
  right: 24px;
  border-color: #a5aeba;
}

body.page-app-settings .app-settings-item__main {
  gap: 15px;
}

body.page-app-settings .app-settings-item__icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  flex-basis: 40px;
  color: #2768e8;
}

body.page-app-settings .app-settings-item__icon svg {
  width: 22px;
  height: 22px;
  stroke-width: 1.8;
}

body.page-app-settings .app-settings-item__icon--support {
  background: #fff0d9;
  color: #dc841a;
}

body.page-app-settings .app-settings-item__icon--language {
  background: #e6edff;
  color: #426fd2;
}

body.page-app-settings .app-settings-item__icon--privacy {
  background: #e0f3ff;
  color: #2388c7;
}

body.page-app-settings .app-settings-item__icon--terms {
  background: #ece8ff;
  color: #6b56cf;
}

body.page-app-settings .app-settings-item__icon--version {
  background: #edf0f4;
  color: #697485;
}

body.page-app-settings .app-settings-item__icon--danger {
  background: #ffe8e8;
  color: #d92d20;
}

body.page-app-settings .app-settings-group[aria-labelledby="about-title"] .app-settings-item + .app-settings-item::before {
  display: block;
  right: 20px;
  left: 75px;
  background: rgba(49, 61, 78, 0.1);
}

body.page-app-settings .app-settings-group[aria-labelledby="data-title"] h2::before {
  background: #e5484d;
}

body.page-app-settings .app-settings-group[aria-labelledby="data-title"] .app-settings-item {
  width: 100%;
  min-height: 64px;
  margin: 0;
  padding: 0 48px 0 20px;
  border-radius: 0;
  background: transparent;
  color: var(--app-settings-ink);
}

body.page-app-settings .app-settings-item__meta {
  color: #8993a1;
  font-size: 14px;
  font-weight: 500;
}

body.page-app-settings.is-native-app:not(.player-lock):not(.page-legal) {
  padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
}

body.page-app-settings .app-bottom-nav {
  height: calc(70px + env(safe-area-inset-bottom, 0px));
  padding: 8px 10px env(safe-area-inset-bottom, 0px);
  border-top-color: rgba(44, 58, 80, 0.08);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -10px 28px rgba(42, 55, 75, 0.06);
}

body.page-app-settings .app-bottom-nav__item {
  min-height: 54px;
  gap: 5px;
  color: #98a1ae;
  font-size: 11px;
  font-weight: 500;
}

body.page-app-settings .app-bottom-nav__item svg {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  stroke-width: 1.8;
}

body.page-app-settings .app-bottom-nav__item.is-active {
  color: #202630;
  font-weight: 680;
}

.app-language-dialog {
  width: min(420px, calc(100% - 32px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #141922;
  box-shadow: 0 24px 80px rgba(35, 55, 84, 0.24);
}

.app-language-dialog::backdrop {
  background: rgba(25, 37, 54, 0.42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.app-language-dialog form {
  padding: 20px 0 8px;
}

.app-language-dialog h2 {
  margin: 0;
  padding: 0 20px 16px;
  font-size: 20px;
  font-weight: 760;
  letter-spacing: 0;
}

.app-language-option {
  width: 100%;
  min-height: 58px;
  padding: 0 20px;
  border: 0;
  border-top: 1px solid rgba(78, 98, 125, 0.09);
  background: #fff;
  color: #202631;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font: inherit;
  font-size: 16px;
  font-weight: 620;
  text-align: left;
  box-sizing: border-box;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.app-language-option:active {
  background: #eef3fa;
}

.app-language-option:focus-visible {
  border-radius: 6px;
  background: #f3f7ff;
  box-shadow: inset 0 0 0 2px rgba(39, 104, 232, 0.55);
}

.app-language-option.is-active {
  background: #f7f9ff;
}

.app-language-option__check {
  color: var(--app-settings-blue, #2768e8);
  font-size: 18px;
  font-weight: 800;
  visibility: hidden;
}

.app-language-option.is-active .app-language-option__check {
  visibility: visible;
}

@media (max-width: 360px) {
  body.page-app-settings .app-settings-group {
    margin-inline: 12px;
  }

}

/* Legal/support pages */
body.page-legal {
  margin: 0;
  background: #fff;
  color: #101828;
}

.legal-page {
  width: min(720px, 100%);
  margin: 0 auto;
  padding: max(26px, calc(env(safe-area-inset-top, 0px) + 16px)) 20px max(36px, env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}

.legal-back {
  display: inline-block;
  margin-bottom: 24px;
  color: #e60012;
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.legal-page h1 {
  margin: 0 0 8px;
  font-size: 27px;
  letter-spacing: 0;
}

.legal-updated {
  color: #98a2b3 !important;
  font-size: 13px;
}

.legal-page h2 {
  margin: 28px 0 8px;
  font-size: 17px;
  letter-spacing: 0;
}

.legal-page p {
  margin: 0 0 12px;
  color: #475467;
  line-height: 1.8;
  font-size: 15px;
}

.legal-page a {
  color: #c70012;
}

.support-actions {
  margin: 20px 0 28px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.support-actions a {
  min-height: 44px;
  border: 1px solid #d0d5dd;
  border-radius: 6px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-weight: 700;
}

@media (min-width: 769px) {
  .app-bottom-nav {
    left: 50%;
    width: min(680px, 100%);
    transform: translateX(-50%);
    border-inline: 1px solid rgba(15, 23, 42, 0.08);
  }
}

/* ─── 词汇测验弹窗 ──────────────────────────────────────── */
.quiz-backdrop {
  z-index: 1100;
  background: rgba(15, 23, 42, 0.44);
  backdrop-filter: blur(10px) saturate(120%);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
}
.quiz-modal {
  max-width: 480px;
  width: 94vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  border-radius: var(--fc-radius-lg, 22px);
  background:
    radial-gradient(720px 360px at 14% 0%, rgba(230, 0, 18, 0.08), transparent 58%),
    radial-gradient(560px 300px at 92% 0%, rgba(99, 102, 241, 0.08), transparent 62%),
    rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(22px) saturate(140%);
  -webkit-backdrop-filter: blur(22px) saturate(140%);
  box-shadow: 0 28px 72px rgba(15, 23, 42, 0.24);
}
.quiz-header {
  padding: 1.35rem clamp(1.25rem, 3vw, 1.75rem) 1rem;
  border-bottom: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  background: rgba(255, 255, 255, 0.52);
  flex: 0 0 auto;
}
.quiz-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.95rem;
}
.quiz-header-top h2 {
  margin: 0;
  color: var(--fc-ink, var(--ink));
  font-size: clamp(1.15rem, 2.2vw, 1.35rem);
  font-weight: 900;
  min-width: 0;
  letter-spacing: 0;
}
.quiz-exit-btn {
  flex: 0 0 auto;
  padding: 0.46rem 0.86rem;
  height: auto;
  font-size: 0.84rem;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border-color: var(--fc-border, rgba(15, 23, 42, 0.1));
}
.quiz-progress-wrap { display: flex; align-items: center; gap: .65rem; }
.quiz-progress-bar {
  flex: 1;
  height: 10px;
  background: rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, color-mix(in srgb, var(--fc-accent, var(--accent)) 68%, #fff), var(--fc-accent, var(--accent)));
  border-radius: 999px;
  transition: width .35s cubic-bezier(.2,.9,.2,1);
}
.quiz-counter {
  min-width: 3.2rem;
  color: var(--fc-muted, var(--ink));
  font-size: .82rem;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}
.quiz-body {
  padding: clamp(1.2rem, 3vw, 1.75rem);
  flex: 1 1 auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.quiz-tag {
  display: inline-block;
  margin-bottom: 1rem;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: .02em;
}
.quiz-prompt-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.quiz-question-card {
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  border-radius: var(--fc-radius, 16px);
  background: var(--fc-surface-strong, rgba(255, 255, 255, 0.94));
  box-shadow: var(--fc-shadow, 0 8px 32px rgba(15, 23, 42, 0.1));
  padding: clamp(1.05rem, 2.8vw, 1.35rem);
  margin-bottom: 1rem;
}
.quiz-word-text {
  color: var(--fc-ink, var(--ink));
  font-size: clamp(2.15rem, 5vw, 3rem);
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}
.quiz-phonetic-text {
  color: var(--fc-muted, var(--ink));
  font-family: ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace;
  font-size: .92rem;
  margin: .45rem 0 0;
  font-weight: 750;
}
.quiz-meaning-text {
  color: var(--fc-ink, var(--ink));
  font-size: clamp(1.14rem, 2.5vw, 1.35rem);
  font-weight: 850;
  line-height: 1.55;
}
.quiz-eg {
  color: var(--fc-ink-soft, var(--ink));
  font-size: .92rem;
  margin-top: .68rem;
  font-style: normal;
  font-weight: 600;
  line-height: 1.6;
}
.quiz-ask {
  color: var(--fc-muted, var(--ink));
  font-size: .82rem;
  font-weight: 850;
  margin: 1rem 0 0;
}

.quiz-say {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.3rem; height: 2.3rem;
  border-radius: 999px;
  border: none;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  cursor: pointer;
  transition: transform .12s ease, background .15s ease;
}
.quiz-say:hover { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.quiz-say:active { transform: scale(.92); }

.quiz-listen-big {
  display: flex; align-items: center; justify-content: center;
  width: 5.2rem; height: 5.2rem;
  margin: .5rem auto .2rem;
  border-radius: 999px;
  border: none;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  cursor: pointer;
  box-shadow: 0 10px 30px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform .12s ease, background .15s ease;
}
.quiz-listen-big:hover { background: color-mix(in srgb, var(--accent) 22%, transparent); }
.quiz-listen-big:active { transform: scale(.94); }

.quiz-cloze-sentence {
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.7;
  color: var(--ink);
}
.quiz-cloze-hint { font-size: .86rem; opacity: .6; margin-top: .5rem; font-weight: 700; }

.quiz-spell-slots {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.38rem 0.42rem;
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  border-radius: var(--fc-radius, 16px);
  background: var(--fc-surface-strong, rgba(255, 255, 255, 0.94));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  padding: clamp(0.95rem, 2.6vw, 1.25rem);
  margin-bottom: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0;
}
.quiz-spell-fixed {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1em;
  color: var(--ink);
  user-select: none;
}
.quiz-spell-slots .quiz-spell-slot {
  width: 1.75em;
  height: 2em;
  min-width: 1.75em;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  text-align: center;
  border-radius: 12px;
  border: 1px solid var(--fc-border-strong, rgba(15, 23, 42, 0.16));
  background: rgba(255, 255, 255, 0.92);
  color: var(--fc-ink, var(--ink));
  font: inherit;
  font-size: 1em;
  text-transform: lowercase;
  outline: none;
  box-sizing: border-box;
  box-shadow: none;
  transition: border-color .15s, background .15s, color .15s, box-shadow .15s;
}
.quiz-spell-slots .quiz-spell-slot.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent);
}
.quiz-spell-capture {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: transparent;
  caret-color: transparent;
  font-size: 16px;
  opacity: 0;
  cursor: text;
}
.quiz-spell-capture:focus { outline: none; }
.quiz-spell-capture:disabled { cursor: default; }
.quiz-spell-slots.is-correct .quiz-spell-slot { border-color: #22c55e; background: #f0fdf4; color: #15803d; }
.quiz-spell-slots.is-wrong .quiz-spell-slot { border-color: var(--accent); background: #fff5f5; color: #c00; }
.quiz-spell-slots.is-feedback-pop .quiz-spell-slot {
  animation: quizCorrectPop 420ms cubic-bezier(.2, .9, .2, 1) both;
}
.quiz-spell-slots.is-feedback-shake .quiz-spell-slot {
  animation: quizWrongShake 420ms ease both;
}

.quiz-opts {
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.quiz-opt {
  position: relative;
  text-align: left;
  padding: .9rem 1rem;
  border-radius: var(--fc-radius, 16px);
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  background: var(--fc-surface-strong, rgba(255, 255, 255, 0.94));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  color: var(--fc-ink, var(--ink));
  font-size: .98rem;
  font-weight: 750;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
  line-height: 1.45;
}
.quiz-opt:hover {
  border-color: color-mix(in srgb, var(--fc-accent, var(--accent)) 45%, var(--fc-border, rgba(15, 23, 42, 0.1)));
  box-shadow: var(--fc-shadow-hover, 0 16px 48px rgba(15, 23, 42, 0.15));
}
.quiz-opt:active { transform: scale(.99); }
.quiz-opt.is-locked { cursor: default; pointer-events: none; }
.quiz-opt-correct { border-color: #22c55e !important; background: #f0fdf4 !important; color: #15803d !important; font-weight: 850; }
.quiz-opt-wrong { border-color: var(--accent) !important; background: #fff5f5 !important; color: #c00 !important; }
.quiz-opt.is-feedback-pop {
  animation: quizCorrectPop 420ms cubic-bezier(.2, .9, .2, 1) both;
}
.quiz-opt.is-feedback-shake {
  animation: quizWrongShake 420ms ease both;
}

.quiz-reveal { margin-top: .7rem; font-size: .95rem; font-weight: 700; opacity: .8; }
.quiz-reveal b { color: #15803d; }
.quiz-reveal--answer {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  border: 1px solid rgba(34, 197, 94, 0.34);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(240, 253, 244, 0.96), rgba(255, 255, 255, 0.88));
  padding: 0.9rem 1rem;
  opacity: 1;
  box-shadow: 0 12px 28px rgba(21, 128, 61, 0.12);
  animation: quizAnswerReveal 360ms cubic-bezier(.2, .9, .2, 1) both;
}
.quiz-reveal--answer span {
  color: #166534;
  font-size: 0.78rem;
  font-weight: 950;
}
.quiz-reveal--answer b {
  color: #15803d;
  font-size: 1.55rem;
  line-height: 1.1;
  font-weight: 950;
  overflow-wrap: anywhere;
}
.quiz-auto-next {
  margin-left: auto;
  color: #15803d;
  font-size: 0.9rem;
  font-weight: 900;
  animation: quizCorrectPop 420ms cubic-bezier(.2, .9, .2, 1) both;
}
.quiz-body.is-quiz-correct {
  animation: quizBodyCorrect 460ms cubic-bezier(.2, .9, .2, 1) both;
}
.quiz-body.is-quiz-wrong {
  animation: quizBodyWrong 460ms ease both;
}

@keyframes quizCorrectPop {
  0% { transform: scale(0.97); }
  45% { transform: scale(1.035); }
  100% { transform: scale(1); }
}

@keyframes quizWrongShake {
  0%, 100% { transform: translateX(0); }
  18% { transform: translateX(-7px); }
  36% { transform: translateX(6px); }
  54% { transform: translateX(-4px); }
  72% { transform: translateX(3px); }
}

@keyframes quizBodyCorrect {
  0% { box-shadow: inset 0 0 0 0 rgba(34, 197, 94, 0); }
  42% { box-shadow: inset 0 0 0 999px rgba(34, 197, 94, 0.055); }
  100% { box-shadow: inset 0 0 0 0 rgba(34, 197, 94, 0); }
}

@keyframes quizBodyWrong {
  0% { box-shadow: inset 0 0 0 0 rgba(230, 0, 18, 0); }
  42% { box-shadow: inset 0 0 0 999px rgba(230, 0, 18, 0.05); }
  100% { box-shadow: inset 0 0 0 0 rgba(230, 0, 18, 0); }
}

@keyframes quizAnswerReveal {
  0% { opacity: 0; transform: translateY(8px) scale(0.98); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.quiz-footer {
  min-height: 4.6rem;
  padding: 0.95rem clamp(1.25rem, 3vw, 1.75rem) 1.25rem;
  border-top: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  background: rgba(255, 255, 255, 0.48);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .6rem;
  flex: 0 0 auto;
}
.quiz-footer .btn {
  min-height: 2.65rem;
  padding-inline: 1.15rem;
  font-weight: 850;
}
.quiz-next-btn { min-width: 7rem; border-radius: 999px; }
.quiz-footer .btn-ghost { border-radius: 999px; }

.quiz-result { text-align: center; padding-top: .3rem; }
.quiz-ring { position: relative; width: 150px; height: 150px; margin: .2rem auto .3rem; }
.quiz-ring svg { width: 100%; height: 100%; }
.quiz-ring svg circle:last-child { transition: stroke-dasharray .8s cubic-bezier(.2,.9,.2,1); }
.quiz-ring-center {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.quiz-ring-pct { font-size: 2.15rem; font-weight: 950; line-height: 1; color: var(--accent); }
.quiz-ring-frac { font-size: .82rem; font-weight: 800; opacity: .5; margin-top: .25rem; }
.quiz-result-msg { font-size: 1rem; font-weight: 850; margin: .35rem 0 1rem; }
/* 旧版得分展示（闪卡页 flashcards.html 仍在使用） */
.quiz-score {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: .18rem;
  width: min(260px, 100%);
  margin: .15rem auto .2rem;
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  border-radius: var(--fc-radius, 16px);
  background: var(--fc-surface-strong, rgba(255, 255, 255, 0.94));
  box-shadow: var(--fc-shadow, 0 8px 32px rgba(15, 23, 42, 0.1));
  padding: 1.1rem 1rem 0.9rem;
}
.quiz-score-n { font-size: 4rem; font-weight: 950; line-height: 1; color: var(--fc-accent, var(--accent)); }
.quiz-score-d { font-size: 1.5rem; font-weight: 850; opacity: .52; }
.quiz-score-label { text-align: center; font-size: .88rem; font-weight: 800; opacity: .62; margin: .65rem 0 1rem; }
.quiz-all-correct { text-align: center; font-size: 1rem; font-weight: 800; color: #15803d; padding: .3rem 0 .8rem; }
.quiz-wrongs {
  text-align: left;
  border: 1px solid var(--fc-border, rgba(15, 23, 42, 0.1));
  border-radius: var(--fc-radius, 16px);
  background: var(--fc-surface-strong, rgba(255, 255, 255, 0.94));
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  margin-top: .8rem;
  padding: .95rem 1rem;
}
.quiz-wrongs-hd { font-size: .78rem; font-weight: 900; opacity: .56; margin-bottom: .62rem; letter-spacing: 0; }
.quiz-wrong-row { display: flex; gap: .75rem; align-items: baseline; font-size: .92rem; padding: .45rem 0; border-bottom: 1px dashed color-mix(in srgb, var(--fc-border, rgba(15, 23, 42, 0.1)) 70%, transparent); }
.quiz-wrong-row:last-child { border-bottom: none; }
.quiz-wrong-row b { color: var(--fc-ink, var(--ink)); font-weight: 850; min-width: 6rem; flex: 0 0 auto; overflow-wrap: anywhere; }
.quiz-wrong-row span { color: var(--fc-muted, var(--ink)); font-weight: 650; }

@media (max-width: 768px) {
  .quiz-backdrop {
    align-items: flex-end;
    padding: max(0.7rem, env(safe-area-inset-top, 0px)) 0 0;
  }

  .quiz-modal {
    width: 100%;
    max-width: none;
    max-height: 88vh;
    border-radius: var(--fc-radius-lg, 22px) var(--fc-radius-lg, 22px) 0 0 !important;
  }

  .quiz-header {
    padding: 1rem 1rem 0.85rem;
  }

  .quiz-body {
    padding: 1rem;
  }

  .quiz-question-card {
    padding: 0.95rem;
    margin-bottom: 0.75rem;
  }

  .quiz-word-text {
    font-size: clamp(1.9rem, 10vw, 2.45rem);
  }

  .quiz-meaning-text {
    font-size: 1.05rem;
  }

  .quiz-opt {
    padding: 0.86rem 0.92rem;
  }

  .quiz-spell-slots {
    justify-content: flex-start;
    padding: 0.85rem;
    font-size: 1.25rem;
  }

  .quiz-spell-slots .quiz-spell-slot {
    width: 1.65em;
    min-width: 1.65em;
  }

  .quiz-footer {
    min-height: 4.2rem;
    padding: 0.8rem 1rem max(0.95rem, env(safe-area-inset-bottom, 0px));
  }

  .quiz-wrong-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.18rem;
  }

  .quiz-wrong-row b {
    min-width: 0;
  }
}

@media (prefers-color-scheme: dark) {
  .quiz-opt-correct { background: #052e16 !important; color: #4ade80 !important; }
  .quiz-opt-wrong { background: #1a0000 !important; color: #f87171 !important; }
  .quiz-spell-slots.is-correct .quiz-spell-slot { background: #052e16; color: #4ade80; border-color: #22c55e; }
  .quiz-spell-slots.is-wrong .quiz-spell-slot { background: #1a0000; color: #f87171; border-color: var(--accent); }
  .quiz-reveal--answer {
    background: linear-gradient(135deg, rgba(5, 46, 22, 0.92), rgba(15, 23, 42, 0.88));
    border-color: rgba(74, 222, 128, 0.42);
  }
  .quiz-reveal--answer span {
    color: #86efac;
  }
  .quiz-reveal b { color: #4ade80; }
  .quiz-auto-next { color: #4ade80; }
  .quiz-all-correct { color: #4ade80; }
}

/* Native App vocabulary: shared premium card language */
.fc-quiz-app-content {
  display: none;
}

@media (max-width: 768px) {
  body.page-flashcards.is-native-app {
    --fc-ink: #11151c;
    --fc-ink-soft: #4f5968;
    --fc-muted: #7a8492;
    --fc-surface: #ffffff;
    --fc-surface-strong: #ffffff;
    --fc-border: rgba(38, 50, 68, 0.08);
    --fc-border-strong: rgba(38, 50, 68, 0.14);
    --fc-accent: #245fd6;
    --fc-radius: 8px;
    --fc-radius-lg: 8px;
    --fc-shadow: 0 14px 34px rgba(37, 50, 70, 0.09);
    --fc-shadow-hover: 0 14px 34px rgba(37, 50, 70, 0.09);
    --fc-rarity-safe-inset: 20px;
    --fc-face-v-safe: 22px;
    background: #eef2f6 !important;
    color: var(--fc-ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }

  body.page-flashcards.is-native-app .fc-topbar {
    position: sticky;
    top: 0;
    z-index: 200;
    min-height: 74px;
    padding: max(18px, calc(env(safe-area-inset-top, 0px) + 10px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
    border-bottom: 1px solid rgba(38, 50, 68, 0.07);
    background: rgba(238, 242, 246, 0.96);
    box-shadow: 0 10px 28px rgba(37, 50, 70, 0.06);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    flex-direction: row;
    align-items: center;
    gap: 12px;
  }

  body.page-flashcards.is-native-app .fc-topbar-leading {
    width: 100%;
    gap: 12px;
  }

  body.page-flashcards.is-native-app .fc-topbar-title {
    color: #11151c;
    font-size: 23px;
    font-weight: 760;
    line-height: 1.2;
    letter-spacing: 0;
  }

  body.page-flashcards.is-native-app .fc-back {
    width: 42px;
    height: 42px;
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.page-flashcards.is-native-app .fc-filter-mobile {
    margin-left: auto;
  }

  body.page-flashcards.is-native-app .fc-filter-trigger {
    min-height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
    font-size: 13px;
    font-weight: 650;
  }

  body.page-flashcards.is-native-app .fc-filter-menu {
    top: calc(100% + 8px);
    min-width: 150px;
    padding: 6px;
    border: 1px solid rgba(38, 50, 68, 0.08);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(37, 50, 70, 0.16);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.page-flashcards.is-native-app .fc-filter-menu li {
    min-height: 42px;
    padding: 0 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #4f5968;
    font-size: 13px;
    font-weight: 600;
  }

  body.page-flashcards.is-native-app .fc-filter-menu li.is-active {
    background: #202630;
    color: #fff;
  }

  body.page-flashcards.is-native-app .fc-main {
    padding: 20px max(16px, env(safe-area-inset-right, 0px)) 36px max(16px, env(safe-area-inset-left, 0px));
  }

  body.page-flashcards.is-native-app .fc-content {
    width: 100%;
    max-width: 680px;
    padding: 0 0 28px;
  }

  body.page-flashcards.is-native-app .fc-stage {
    margin-top: 0;
  }

  body.page-flashcards.is-native-app .fc-card-shell {
    width: 100%;
    max-width: 560px;
    height: clamp(500px, calc(100dvh - 200px), 680px);
    margin: 0 auto 20px;
  }

  body.page-flashcards.is-native-app .fc-deck {
    display: none;
  }

  body.page-flashcards.is-native-app .fc-card {
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(37, 50, 70, 0.09);
  }

  body.page-flashcards.is-native-app .fc-card::before {
    display: none;
  }

  body.page-flashcards.is-native-app .fc-face {
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.page-flashcards.is-native-app .fc-face-body {
    padding: 22px 20px;
  }

  body.page-flashcards.is-native-app .fc-face.back .fc-face-body {
    padding: 22px 20px 92px;
  }

  body.page-flashcards.is-native-app .fc-word {
    margin-bottom: 8px;
    color: #11151c;
    font-family: inherit;
    font-size: clamp(28px, 8vw, 36px);
    font-weight: 780;
    line-height: 1.15;
    letter-spacing: 0;
  }

  body.page-flashcards.is-native-app .fc-phonetic {
    color: #7a8492;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 13px;
    font-weight: 600;
  }

  body.page-flashcards.is-native-app .fc-say,
  body.page-flashcards.is-native-app .fc-list-say {
    width: 40px;
    height: 40px;
    border: 1px solid rgba(66, 111, 210, 0.12);
    border-radius: 8px;
    background: #e6edff;
    color: #426fd2;
  }

  body.page-flashcards.is-native-app .fc-list-say {
    position: relative;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 7px;
    background: transparent;
  }

  body.page-flashcards.is-native-app .fc-list-say::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(66, 111, 210, 0.12);
    border-radius: 6px;
    background: #e6edff;
    box-sizing: border-box;
    content: "";
    pointer-events: none;
    transform: translate(-50%, -50%);
  }

  body.page-flashcards.is-native-app .fc-list-say .fc-say-ico {
    position: relative;
    z-index: 1;
    width: 16px;
    height: 16px;
  }

  body.page-flashcards.is-native-app .fc-meaning {
    margin-top: 16px;
    color: #252b35;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.7;
  }

  body.page-flashcards.is-native-app .fc-example {
    margin-top: 12px;
    color: #657080;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.65;
  }

  body.page-flashcards.is-native-app .fc-hint {
    color: #8993a1;
    font-size: 12px;
    font-weight: 520;
    line-height: 1.55;
  }

  body.page-flashcards.is-native-app .fc-actions {
    padding: 14px 20px 20px;
    gap: 12px;
    border-top: 1px solid rgba(49, 61, 78, 0.08);
    border-radius: 0 0 8px 8px;
    background: #fff;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body.page-flashcards.is-native-app .fc-grade {
    min-height: 48px;
    padding: 0 10px;
    border-radius: 8px;
    box-shadow: none;
    transform: none;
  }

  body.page-flashcards.is-native-app .fc-grade.bad {
    border-color: rgba(207, 32, 41, 0.12);
    background: #fff0f1;
    color: #c8212b;
  }

  body.page-flashcards.is-native-app .fc-grade.good {
    border-color: rgba(36, 157, 104, 0.12);
    background: #eaf8f1;
    color: #218c5f;
  }

  body.page-flashcards.is-native-app .fc-grade:hover,
  body.page-flashcards.is-native-app .fc-grade:active {
    box-shadow: none;
    transform: none;
  }

  body.page-flashcards.is-native-app .fc-grade-txt {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0;
  }

  body.page-flashcards.is-native-app .fc-list-actions {
    width: min(276px, 100%);
    margin: 12px auto 0;
    gap: 10px;
  }

  body.page-flashcards.is-native-app .fc-list-actions .fc-grade {
    min-height: 40px;
    padding: 0 10px;
    border-radius: 7px;
  }

  body.page-flashcards.is-native-app .fc-eb-card,
  body.page-flashcards.is-native-app .fc-eb-metric,
  body.page-flashcards.is-native-app .fc-eb-strip {
    border-radius: 8px;
  }

  body.page-flashcards.is-native-app .fc-list-view {
    margin-top: 0;
  }

  body.page-flashcards.is-native-app .fc-word-list {
    gap: 14px;
  }

  body.page-flashcards.is-native-app .fc-list-card {
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(37, 50, 70, 0.08);
  }

  body.page-flashcards.is-native-app .fc-list-word {
    font-size: 20px;
    font-weight: 760;
    line-height: 1.2;
  }

  body.page-flashcards.is-native-app .fc-list-phonetic {
    font-size: 13px;
    font-weight: 600;
  }

  body.page-flashcards.is-native-app .fc-list-meaning {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.55;
  }

  body.page-flashcards.is-native-app .fc-list-example {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) .ielts-corpus-title {
    font-size: 13px;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) .ielts-corpus-kicker {
    font-size: 11px;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) .ielts-corpus-freq {
    font-size: 14px;
    line-height: 1.5;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) :is(.ielts-corpus-status, .ielts-corpus-sub, .ielts-corpus-source) {
    font-size: 12px;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) .ielts-corpus-meta > span {
    font-size: 11px;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) :is(.ielts-corpus-meta b, .ielts-corpus-tags span) {
    font-size: 11px;
  }

  body.page-flashcards.is-native-app :is(.fc-corpus, .fc-list-corpus) .ielts-corpus-sentence {
    font-size: 13px;
    line-height: 1.6;
  }

  body.page-flashcards.is-native-app .fc-quiz-float {
    top: auto;
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(86px + env(safe-area-inset-bottom, 0px));
    width: auto;
    min-height: 48px;
    padding: 0 16px;
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    color: #252b35;
    box-shadow: 0 14px 32px rgba(37, 50, 70, 0.14);
    filter: none;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.page-flashcards.is-native-app .fc-quiz-bubble,
  body.page-flashcards.is-native-app .fc-quiz-mascot {
    display: none;
  }

  body.page-flashcards.is-native-app .fc-quiz-app-content {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
  }

  body.page-flashcards.is-native-app .fc-quiz-app-content svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #426fd2;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  body.page-flashcards.is-native-app:not(.player-lock):not(.page-legal) {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px));
  }

  body.page-flashcards.is-native-app .app-bottom-nav {
    height: calc(70px + env(safe-area-inset-bottom, 0px));
    padding: 8px 10px env(safe-area-inset-bottom, 0px);
    border-top-color: rgba(44, 58, 80, 0.08);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -10px 28px rgba(42, 55, 75, 0.06);
  }

  body.page-flashcards.is-native-app .app-bottom-nav__item {
    min-height: 54px;
    gap: 5px;
    color: #98a1ae;
    font-size: 11px;
    font-weight: 500;
  }

  body.page-flashcards.is-native-app .app-bottom-nav__item svg {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
    stroke-width: 1.8;
  }

  body.page-flashcards.is-native-app .app-bottom-nav__item.is-active {
    color: #202630;
    font-weight: 680;
  }

  body.page-flashcards.is-native-app .quiz-modal {
    border-radius: 8px 8px 0 0 !important;
    background: #fff;
  }

  body.page-flashcards.is-native-app .quiz-question-card,
  body.page-flashcards.is-native-app .quiz-opt,
  body.page-flashcards.is-native-app .quiz-spell-slots,
  body.page-flashcards.is-native-app .quiz-reveal {
    border-radius: 8px;
  }

  body.page-flashcards.is-native-app .quiz-question-card,
  body.page-flashcards.is-native-app .quiz-opt {
    border-color: rgba(38, 50, 68, 0.08);
    background: #f7f9fb;
  }

  body.page-flashcards.is-native-app .quiz-progress-fill {
    background: #245fd6;
  }
}

/* Native App player: shared premium card language */
@media (max-width: 920px) {
  body.player-lock.is-native-app {
    --p-ink: #11151c;
    --p-ink-soft: #4f5968;
    --p-muted: #7a8492;
    --p-accent: #245fd6;
    --p-accent-2: #1d4fad;
    --p-dock-btn-bg: #ffffff;
    --p-dock-btn-bg-hover: #f7f9fc;
    --p-dock-btn-border: rgba(38, 50, 68, 0.14);
    --p-dock-btn-border-hover: rgba(66, 111, 210, 0.38);
    --p-dock-btn-active: #e8f0ff;
    --p-sub-active-bg: #edf3ff;
    --p-sub-divider: rgba(38, 50, 68, 0.08);
    background: #eef2f6 !important;
    color: var(--p-ink);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
    font-synthesis: none;
    -webkit-font-smoothing: antialiased;
  }

  body.player-lock.is-native-app .player-page {
    --player-gutter: 16px;
    --player-gutter-x: 0px;
    padding-top: calc(74px + env(safe-area-inset-top, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
    padding-bottom: calc(var(--player-dock-h, 9rem) + 24px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    background: #eef2f6;
  }

  body.player-lock.is-native-app .player-left-topbar,
  body.player-lock.is-native-app .player-right-topbar {
    top: calc(env(safe-area-inset-top, 0px) + 16px);
  }

  body.player-lock.is-native-app .player-left-topbar {
    left: max(16px, env(safe-area-inset-left, 0px));
    gap: 8px;
  }

  body.player-lock.is-native-app .player-right-topbar {
    right: max(16px, env(safe-area-inset-right, 0px));
  }

  body.player-lock.is-native-app #btn-source {
    display: none !important;
  }

  body.player-lock.is-native-app .player-left-topbar > .fc-back,
  body.player-lock.is-native-app .player-left-topbar > .topbar-vocab,
  body.player-lock.is-native-app .player-right-topbar > .topbar-vocab {
    height: 42px;
    padding: 0 13px;
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-radius: 8px;
    background: #fff;
    color: #4b5563;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    font-size: 13px;
    font-weight: 650;
  }

  body.player-lock.is-native-app .player-left-topbar > .fc-back {
    width: 42px;
    padding: 0;
  }

  body.player-lock.is-native-app .player-left-topbar > :is(.fc-back, .topbar-vocab):is(:hover, :active),
  body.player-lock.is-native-app .player-right-topbar > .topbar-vocab:is(:hover, :active) {
    background: #f7f9fb;
    color: #252b35;
    box-shadow: 0 8px 20px rgba(37, 50, 70, 0.07);
    transform: none;
  }

  body.player-lock.is-native-app .player-shell {
    gap: 16px;
  }

  body.player-lock.is-native-app .left-panel {
    gap: 16px;
  }

  body.player-lock.is-native-app .left-main {
    border: 1px solid rgba(38, 50, 68, 0.06);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(37, 50, 70, 0.08);
  }

  body.player-lock.is-native-app .left-main .video-wrap,
  body.player-lock.is-native-app .left-main .video-wrap::before,
  body.player-lock.is-native-app .left-main .video-wrap::after {
    border-radius: 8px 8px 0 0;
  }

  body.player-lock.is-native-app .left-main .video-wrap {
    overflow: hidden;
    background: #11151c;
  }

  body.player-lock.is-native-app .left-main .keyword-panel {
    border-top: 1px solid rgba(49, 61, 78, 0.08);
    border-radius: 0 0 8px 8px;
  }

  body.player-lock.is-native-app .keyword-mobile-entry {
    min-height: 58px;
    padding: 0 16px;
    border-radius: 0 0 8px 8px;
    background: #fff;
  }

  body.player-lock.is-native-app .keyword-mobile-entry:is(:hover, :active) {
    background: #f2f5f8;
  }

  body.player-lock.is-native-app .keyword-title {
    color: #252b35;
    font-size: 15px;
    font-weight: 680;
    letter-spacing: 0;
  }

  body.player-lock.is-native-app .keyword-entry-count {
    color: #426fd2;
    font-weight: 700;
  }

  body.player-lock.is-native-app .keyword-col {
    margin-top: 0;
  }

  body.player-lock.is-native-app .keyword-col > .now-line {
    margin-top: 0;
    padding: 0;
    overflow: hidden;
    border: 1px solid rgba(38, 50, 68, 0.06);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(37, 50, 70, 0.08);
  }

  body.player-lock.is-native-app .keyword-col > .now-line .now-line-scroll {
    padding: 12px 10px 18px;
    scroll-padding-top: 12px;
  }

  body.player-lock.is-native-app .keyword-col > .now-line .now-line-scroll .sub-line {
    padding: 11px 12px;
    border-radius: 8px;
  }

  body.player-lock.is-native-app .keyword-col > .now-line .now-line-scroll .sub-line.active,
  body.player-lock.is-native-app .subtitle-scroll .sub-line.active {
    margin-bottom: 10px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #edf3ff;
    box-shadow: none;
  }

  body.player-lock.is-native-app .subtitle-scroll .sub-line.active::before {
    top: 9px;
    bottom: 9px;
    width: 3px;
    border-radius: 1.5px;
    background: #426fd2;
  }

  body.player-lock.is-native-app .sub-line .en {
    color: #252b35;
    font-weight: 620;
    letter-spacing: 0;
  }

  body.player-lock.is-native-app .sub-line .zh {
    color: #6f7987;
    font-weight: 450;
  }

  body.player-lock.is-native-app #player-bottom-dock .control-bar,
  body.player-lock.is-native-app .now-controls .control-bar {
    gap: 8px;
    padding: 10px max(12px, env(safe-area-inset-left, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
    border: 1px solid rgba(38, 50, 68, 0.07);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -12px 32px rgba(37, 50, 70, 0.09);
  }

  body.player-lock.is-native-app .control-bar-modes,
  body.player-lock.is-native-app .control-bar-transport {
    gap: 8px;
  }

  body.player-lock.is-native-app .control-bar .btn,
  body.player-lock.is-native-app .control-bar-transport .control-bar-pill,
  body.player-lock.is-native-app .control-bar-transport .control-bar-icon,
  body.player-lock.is-native-app .control-bar-transport .control-bar-play {
    border: 1px solid rgba(38, 50, 68, 0.14);
    border-radius: 8px;
    background: #fff;
    color: #252b35;
    box-shadow: none;
    transform: none;
  }

  body.player-lock.is-native-app .control-bar-modes .btn {
    min-height: 42px;
  }

  body.player-lock.is-native-app .control-bar-modes .btn[aria-pressed="true"],
  body.player-lock.is-native-app .control-bar-transport .control-bar-pill[aria-pressed="true"],
  body.player-lock.is-native-app .control-bar .btn[aria-expanded="true"] {
    border-color: rgba(66, 111, 210, 0.38) !important;
    background: #e8f0ff !important;
    color: #426fd2;
  }

  body.player-lock.is-native-app .control-bar-transport .control-bar-play.btn-primary,
  body.player-lock.is-native-app .control-bar-transport #btn-play.btn-primary {
    border-color: #202630 !important;
    background: #202630 !important;
    color: #fff !important;
    box-shadow: 0 10px 24px rgba(32, 38, 48, 0.18) !important;
  }

  body.player-lock.is-native-app .control-bar .btn:disabled {
    border-color: #e5e8ed !important;
    background: #f0f2f5 !important;
    color: #a0a7b2 !important;
    box-shadow: none !important;
    opacity: 1;
  }

  body.player-lock.is-native-app .control-bar .btn:focus-visible {
    outline: 2px solid rgba(66, 111, 210, 0.42);
    outline-offset: 2px;
  }

  body.player-lock.is-native-app .control-bar :is(.btn:hover, .btn:active):not(:disabled) {
    transform: none;
    box-shadow: none;
  }

  body.player-lock.is-native-app .video-progress {
    font-family: inherit;
  }

  body.player-lock.is-native-app .menu-pop {
    border: 1px solid rgba(38, 50, 68, 0.08);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 18px 42px rgba(37, 50, 70, 0.16);
  }
}

/* Native App modal system */
body.is-native-app .modal-backdrop,
body.is-native-app .shadowing-overlay-backdrop {
  background: rgba(25, 37, 54, 0.44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.is-native-app .modal-backdrop,
body.is-native-app .shadowing-overlay {
  z-index: 12000;
}

body.is-native-app .modal {
  overflow: hidden;
  border: 1px solid rgba(38, 50, 68, 0.07);
  border-radius: 8px;
  background: #fff;
  color: #11151c;
  box-shadow: 0 24px 80px rgba(35, 55, 84, 0.24);
}

body.is-native-app .modal-head,
body.is-native-app .quiz-header,
body.is-native-app .kw-card-modal-head {
  min-height: 60px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(49, 61, 78, 0.08);
  background: #fff;
  box-sizing: border-box;
}

body.is-native-app .modal-title,
body.is-native-app .quiz-header h2 {
  color: #11151c;
  font-size: 20px;
  font-weight: 760;
  line-height: 1.3;
  letter-spacing: 0;
}

body.is-native-app .modal-body,
body.is-native-app .quiz-body {
  padding: 20px;
  background: #fff;
}

body.is-native-app .modal-foot,
body.is-native-app .quiz-footer {
  padding: 14px 20px max(16px, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(49, 61, 78, 0.08);
  background: #fff;
}

body.is-native-app .modal :is(.btn, button),
body.is-native-app .shadowing-panel :is(.btn, button),
body.is-native-app dialog :is(.btn, button) {
  border-radius: 8px;
}

body.is-native-app .modal .btn-ghost,
body.is-native-app .modal-close,
body.is-native-app .quiz-exit-btn {
  border: 1px solid rgba(38, 50, 68, 0.08);
  background: #f5f7fa;
  color: #4f5968;
  box-shadow: none;
}

body.is-native-app .modal .btn-primary,
body.is-native-app .quiz-footer .btn-primary {
  border-color: #202630;
  background: #202630;
  color: #fff;
  box-shadow: none;
}

body.is-native-app .shadowing-overlay .shadowing-panel {
  border: 1px solid rgba(38, 50, 68, 0.07);
  border-radius: 8px;
  background: #fff;
  color: #11151c;
  box-shadow: 0 24px 80px rgba(35, 55, 84, 0.24);
}

body.is-native-app .shadowing-panel-head {
  margin: -16px -20px 16px;
  min-height: 60px;
  padding: 0 20px;
  border-bottom: 1px solid rgba(49, 61, 78, 0.08);
}

body.is-native-app .shadowing-panel-close {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(38, 50, 68, 0.08);
  border-radius: 8px;
  background: #f5f7fa;
  color: #4f5968;
  box-shadow: none;
}

body.is-native-app .btn-shadow-mic {
  border-color: rgba(66, 111, 210, 0.14);
  background: #e6edff;
  color: #426fd2;
  box-shadow: 0 12px 28px rgba(37, 50, 70, 0.1);
}

body.is-native-app .btn-shadow-mic.is-listening {
  border-color: #cf2933;
  background: #cf2933;
  color: #fff;
}

body.is-native-app .shadowing-transcript,
body.is-native-app .shadowing-score-block,
body.is-native-app .quiz-question-card,
body.is-native-app .quiz-opt,
body.is-native-app .quiz-spell-slots,
body.is-native-app .quiz-reveal {
  border: 1px solid rgba(38, 50, 68, 0.08);
  border-radius: 8px;
  background: #f7f9fb;
}

body.is-native-app .shadowing-actions .btn {
  min-height: 46px;
  border-radius: 8px;
  box-shadow: none;
}

body.is-native-app .shadowing-actions .btn-primary {
  background: #202630;
  color: #fff;
}

body.is-native-app .shadowing-actions .btn-ghost {
  border: 1px solid rgba(38, 50, 68, 0.08);
  background: #f5f7fa;
  color: #4f5968;
}

body.is-native-app :is(.learn-lang-menu, .fc-filter-menu, .menu-pop, .def-pop) {
  border: 1px solid rgba(38, 50, 68, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(37, 50, 70, 0.16);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-native-app :is(.app-confirm-dialog, .app-language-dialog) {
  border: 1px solid rgba(38, 50, 68, 0.07);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 80px rgba(35, 55, 84, 0.24);
}

body.is-native-app :is(.app-confirm-dialog, .app-language-dialog)::backdrop {
  background: rgba(25, 37, 54, 0.44);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

body.page-learn-mobile.is-native-app .modal.learn-feedback-modal .modal-body {
  padding: 18px 20px max(24px, calc(env(safe-area-inset-bottom, 0px) + 16px));
  overflow-y: auto;
}

body.page-learn-mobile.is-native-app .learn-feedback {
  gap: 14px;
}

body.page-learn-mobile.is-native-app .learn-feedback-title {
  color: #4f5968;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0;
}

body.page-learn-mobile.is-native-app .learn-feedback-qr {
  width: min(280px, 100%);
  max-width: 280px;
  height: auto;
  border: 1px solid rgba(38, 50, 68, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(37, 50, 70, 0.1);
}

body.page-learn-mobile.is-native-app .learn-feedback-open {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(38, 50, 68, 0.08);
  border-radius: 8px;
  background: #f5f7fa;
  color: #252b35;
  font-size: 13px;
  font-weight: 650;
}

@media (max-width: 768px) {
  body.is-native-app .modal-backdrop.is-open {
    align-items: flex-end;
    padding: max(16px, env(safe-area-inset-top, 0px)) 0 0;
  }

  body.is-native-app .modal {
    width: 100%;
    max-width: none;
    max-height: 88dvh;
    margin: auto 0 0;
    border-radius: 8px 8px 0 0 !important;
  }
}

/* Native App vocabulary quiz: compact mobile scale */
@media (max-width: 768px) {
  body.page-flashcards.is-native-app .quiz-backdrop.is-open {
    inset: var(--quiz-viewport-top, 0px) 0 auto;
    height: var(--quiz-viewport-height, 100dvh);
    min-height: 0;
    box-sizing: border-box;
    align-items: center;
    padding:
      max(16px, env(safe-area-inset-top, 0px))
      0
      max(16px, env(safe-area-inset-bottom, 0px));
  }

  body.page-flashcards.is-native-app .quiz-modal {
    width: calc(100% - 24px);
    max-width: 420px;
    max-height: min(calc(var(--quiz-viewport-height, 100dvh) - 32px), 620px);
    margin: auto;
    border-radius: 8px !important;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open {
    padding: 8px 0;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-modal {
    height: calc(var(--quiz-viewport-height, 100dvh) - 16px);
    max-height: calc(var(--quiz-viewport-height, 100dvh) - 16px);
    margin: 0 auto;
  }

  body.page-flashcards.is-native-app .quiz-header {
    min-height: 52px;
    padding: 12px 16px 10px;
  }

  body.page-flashcards.is-native-app .quiz-header-top {
    margin-bottom: 10px;
  }

  body.page-flashcards.is-native-app .quiz-header h2 {
    font-size: 18px;
  }

  body.page-flashcards.is-native-app .quiz-exit-btn {
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
  }

  body.page-flashcards.is-native-app .quiz-progress-bar {
    height: 8px;
  }

  body.page-flashcards.is-native-app .quiz-counter {
    min-width: 40px;
    font-size: 12px;
  }

  body.page-flashcards.is-native-app .quiz-body {
    min-height: 0;
    padding: 14px;
    overscroll-behavior: contain;
  }

  body.page-flashcards.is-native-app .quiz-question-card {
    margin-bottom: 10px;
    padding: 14px;
  }

  body.page-flashcards.is-native-app .quiz-word-text {
    font-size: 30px;
    line-height: 1.1;
  }

  body.page-flashcards.is-native-app .quiz-phonetic-text {
    margin-top: 6px;
    font-size: 13px;
  }

  body.page-flashcards.is-native-app .quiz-meaning-text {
    font-size: 15px;
    line-height: 1.5;
  }

  body.page-flashcards.is-native-app .quiz-eg {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.5;
  }

  body.page-flashcards.is-native-app .quiz-ask {
    margin-top: 12px;
    font-size: 12px;
  }

  body.page-flashcards.is-native-app .quiz-opts {
    gap: 8px;
  }

  body.page-flashcards.is-native-app .quiz-opt {
    min-height: 48px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.45;
  }

  body.page-flashcards.is-native-app .quiz-spell-slots {
    padding: 12px;
    font-size: 18px;
  }

  body.page-flashcards.is-native-app .quiz-spell-slots .quiz-spell-slot {
    border-radius: 8px;
  }

  body.page-flashcards.is-native-app .quiz-footer {
    min-height: 58px;
    padding: 9px 14px max(10px, env(safe-area-inset-bottom, 0px));
  }

  body.page-flashcards.is-native-app .quiz-footer:empty {
    display: none;
  }

  body.page-flashcards.is-native-app .quiz-footer .btn {
    min-height: 40px;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-header {
    min-height: 0;
    padding: 8px 14px;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-header-top {
    margin-bottom: 6px;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-body {
    padding: 10px 12px;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-question-card {
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-spell-slots {
    margin-bottom: 0;
    padding: 9px;
  }

  body.page-flashcards.is-native-app .quiz-backdrop.is-keyboard-open .quiz-footer {
    min-height: 52px;
    padding: 6px 12px;
  }

  body.is-native-app .quiz-backdrop.is-keyboard-open {
    inset: var(--quiz-viewport-top, 0px) 0 auto;
    height: var(--quiz-viewport-height, 100dvh);
    min-height: 0;
    box-sizing: border-box;
    align-items: flex-start;
    padding: 8px 0;
  }

  body.is-native-app .quiz-backdrop.is-keyboard-open .quiz-modal {
    height: calc(var(--quiz-viewport-height, 100dvh) - 16px);
    max-height: calc(var(--quiz-viewport-height, 100dvh) - 16px);
    margin: 0 auto;
  }

  body.page-flashcards.is-native-app .quiz-score {
    padding: 14px 14px 12px;
  }

  body.page-flashcards.is-native-app .quiz-score-n {
    font-size: 52px;
  }

  body.page-flashcards.is-native-app .quiz-wrongs {
    padding: 12px 14px;
  }
}

/* Native App vocabulary quiz mascot */
@media (max-width: 768px) {
  body.page-flashcards.is-native-app .fc-quiz-float {
    width: 96px;
    min-height: 126px;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  body.page-flashcards.is-native-app .fc-quiz-app-content {
    width: 96px;
    min-height: 130px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
  }

  body.page-flashcards.is-native-app .fc-quiz-app-label {
    position: relative;
    z-index: 1;
    min-height: 36px;
    padding: 0 15px;
    border: 2px solid #315b9f;
    border-radius: 15px 15px 15px 5px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(255, 255, 255, 0) 38%),
      linear-gradient(135deg, #f7fbff 0%, #e2edff 54%, #cfdefc 100%);
    color: #244f98;
    box-shadow:
      inset 0 -2px 0 rgba(49, 91, 159, 0.1),
      0 0 0 3px rgba(255, 255, 255, 0.94),
      0 10px 22px rgba(34, 68, 132, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: 0;
    white-space: nowrap;
    transform: translateY(2px) rotate(-2deg);
    transform-origin: 50% 100%;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
  }

  body.page-flashcards.is-native-app .fc-quiz-app-label::after {
    position: absolute;
    left: 50%;
    bottom: -8px;
    width: 12px;
    height: 12px;
    border-right: 2px solid #315b9f;
    border-bottom: 2px solid #315b9f;
    background: #d8e6ff;
    box-shadow: 3px 3px 0 rgba(255, 255, 255, 0.94);
    content: "";
    transform: translateX(-50%) rotate(45deg);
  }

  @media (hover: hover) {
    body.page-flashcards.is-native-app .fc-quiz-float:hover .fc-quiz-app-label {
      box-shadow:
        inset 0 -2px 0 rgba(49, 91, 159, 0.1),
        0 0 0 3px rgba(255, 255, 255, 0.98),
        0 14px 28px rgba(34, 68, 132, 0.24);
      transform: translateY(-1px) rotate(0deg);
    }
  }

  body.page-flashcards.is-native-app .fc-quiz-float:active .fc-quiz-app-label {
    transform: translateY(4px) rotate(-1deg) scale(0.97);
  }

  body.page-flashcards.is-native-app .fc-quiz-app-content .fc-quiz-app-bot {
    width: 82px;
    height: 88px;
    margin-top: 5px;
    overflow: visible;
    filter: drop-shadow(0 12px 16px rgba(34, 68, 132, 0.2));
    transform-origin: 50% 100%;
    animation: fcQuizBotFloat 3.2s ease-in-out infinite;
  }

  body.page-flashcards.is-native-app .fc-quiz-float:active .fc-quiz-app-bot {
    animation-play-state: paused;
    transform: translateY(1px) scale(0.96);
  }
}

@keyframes fcQuizBotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  body.page-flashcards.is-native-app .fc-quiz-app-content .fc-quiz-app-bot {
    animation: none;
  }
}

/* Mobile player: reclaim subtitle space above the fixed controls */
@media (max-width: 920px) {
  body.player-lock .player-page {
    padding-bottom: calc(var(--player-dock-h, 9rem) + 8px);
  }

  /* The measured dock height already includes the iPhone bottom safe area. */
  body.player-lock.is-native-app .player-page {
    padding-bottom: calc(var(--player-dock-h, 9rem) + 8px);
  }

  body.player-lock .keyword-col > .now-line .now-line-scroll {
    padding-bottom: 8px;
  }
}

/* Native App achievement result stays centered instead of becoming a bottom sheet */
@media (max-width: 768px) {
  body.is-native-app .achievement-backdrop.is-open {
    align-items: center;
    padding:
      max(20px, env(safe-area-inset-top, 0px))
      16px
      max(20px, env(safe-area-inset-bottom, 0px));
  }

  body.is-native-app .achievement-modal {
    width: min(380px, 100%);
    max-height: calc(
      100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 40px
    );
    margin: auto;
    border-radius: 8px !important;
  }
}
