/* ============================================================
   EarVlog — 暖色编辑风设计系统（对齐 learnvloglish.com）
   主色：橙 #FF6A00 · 纸白 #FAF8F3 · 墨黑 #181818
   --orange 即是品牌主色（历史变量名沿用）。
   ============================================================ */

:root {
  /* 品牌主色 */
  --brand: #ff7200;
  --accent: #ff8a24;
  --orange: #ff7200;
  --orange-2: #c25200;
  --orange-soft: rgba(255, 114, 0, 0.14);
  --orange-softer: rgba(255, 114, 0, 0.07);
  --grad-brand: linear-gradient(135deg, #ff8a24 0%, #ff6a00 100%);

  /* 浅色主题：暖纸白（原站 light 配色） */
  --bg: #faf8f3;
  --bg-2: #f3f0ea;
  --panel: #ffffff;
  --panel-2: #f7f4ee;
  --text: #181818;
  --muted: #77736d;
  --faint: #aaa7a3;
  --border: rgba(42, 37, 32, 0.10);
  --border-strong: rgba(42, 37, 32, 0.16);
  --shadow: 0 1px 2px rgba(73, 57, 38, 0.05), 0 8px 24px rgba(73, 57, 38, 0.07);
  --shadow-lg: 0 18px 48px rgba(73, 57, 38, 0.16);

  /* 侧栏自带底色（浅色时与页面纸白一致，深色时更深一档形成层次） */
  --sidebar-bg: #faf8f3;

  --radius-xl: 22px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;

  --sidebar-w: 212px;
  --subtitle-size-factor: 1;

  /* 词性颜色（暖色系） */
  --pos-noun: #ff7200;
  --pos-verb: #2f9e6b;
  --pos-adjective: #c2810a;
  --pos-adverb: #9257e0;
  --pos-phrase: #0f8fa8;

  color-scheme: light;
}

[data-theme="dark"] {
  /* 深色主题：原站深色（近黑 + 橙） */
  --bg: #060606;
  --bg-2: #101111;
  --panel: #101111;
  --panel-2: #171818;
  --text: #f7f8ff;
  --muted: #9ca7be;
  --faint: #6a7288;
  --border: rgba(255, 255, 255, 0.09);
  --border-strong: rgba(255, 255, 255, 0.16);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.6), 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 55px rgba(0, 0, 0, 0.7);
  --sidebar-bg: #0b0a09;
  /* 深色主题下的品牌色淡底：沿用橙色，避免深色导航回到旧的蓝色调 */
  --orange-soft: rgba(255, 114, 0, 0.18);
  --orange-softer: rgba(255, 114, 0, 0.09);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body {
  background: radial-gradient(circle at 48% -8%, rgba(255, 114, 0, 0.10), transparent 32%),
              linear-gradient(180deg, #fffdf9 0%, #faf8f3 58%, #f3f0ea 100%);
  /* 不用 background-attachment: fixed —— 移动端/部分 macOS Chrome 下固定背景不随文档重绘，
     向下滚动时会被「画」到侧栏区域，表现为侧栏变浅色 */
  height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 520px at 76% -10%, rgba(255, 138, 36, 0.16), transparent 62%),
    radial-gradient(880px 440px at 8% -4%, rgba(255, 176, 103, 0.12), transparent 58%),
    linear-gradient(180deg, #fffdf9 0%, var(--bg) 34%, var(--bg) 100%);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "PingFang SC", "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.25s, color 0.25s;
}
[data-theme="dark"] body {
  background:
    radial-gradient(1100px 560px at 82% -10%, rgba(255, 114, 0, 0.14), transparent 60%),
    radial-gradient(900px 480px at 8% 4%, rgba(255, 176, 103, 0.07), transparent 55%),
    linear-gradient(180deg, #0e0d0b 0%, var(--bg) 38%, #080706 100%);
}

button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
a { color: var(--orange); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }

/* ---------------- 图标 ---------------- */
.nav-icon svg, .search-icon svg, .player-icon-btn svg, .m-icon-btn svg, .m-tab svg,
.pill-btn svg, .play-big svg, .play-toggle svg, .player-cover svg {
  width: 20px; height: 20px; display: block;
  stroke: currentColor; fill: none; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

/* ---------------- 启动加载 ---------------- */
.startup-loading {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  background: var(--bg); z-index: 50; color: var(--muted);
}
.startup-logo { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 22px; }
.startup-logo img { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(0.92);opacity:.7} }

/* ---------------- 品牌 ---------------- */
.brand { display: flex; align-items: center; gap: 10px; font-size: 20px; letter-spacing: -0.02em; }
.brand strong { font-weight: 800; }

/* ---------------- 登录 / 注册 ---------------- */
.auth-shell {
  min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column;
  align-items: center; padding: 28px 32px 20px;
}
.auth-shell-header { width: 100%; max-width: 1200px; }
.auth-card {
  flex: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  align-items: center; gap: 72px; width: 100%; max-width: 1100px; padding: 32px 0;
}
.auth-hero { max-width: 520px; }
.auth-hero h1 {
  font-size: clamp(38px, 4.4vw, 62px); line-height: 1.14; letter-spacing: -0.045em;
  font-weight: 900; margin: 0 0 20px; color: var(--text);
}
/* 标题第二行用品牌橙，和原站一致 */
.auth-hero h1 .hero-accent { color: var(--orange); display: inline-block; }
.auth-hero h1 { color: var(--text); }
.auth-hero p { color: var(--muted); font-size: 17px; line-height: 1.7; margin: 0; }
.auth-hero::before {
  content: ""; display: block; width: 44px; height: 3px; border-radius: 3px;
  background: var(--grad-brand); margin-bottom: 26px;
}

/* 登录卡片：去掉顶部「登录」标签，视觉更干净 */
.auth-panel {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 22px; padding: 32px 30px 26px; box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; gap: 16px;
}
.auth-panel::before {
  content: "登录后继续观看"; display: block;
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em; color: var(--text);
  margin-bottom: 2px;
}
.auth-panel::after {
  content: "登录后继续使用本期学习功能。"; display: block;
  font-size: 13px; color: var(--muted); margin-top: -8px; margin-bottom: 4px; line-height: 1.6;
}
.auth-panel .auth-switch { margin-top: 2px; line-height: 1.7; }
.auth-tabs { display: none; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field span { font-size: 13px; font-weight: 600; color: var(--muted); }
.field input {
  height: 46px; border-radius: var(--radius-md); border: 1px solid var(--border-strong);
  background: var(--panel-2); padding: 0 14px; font-size: 15px; color: var(--text); outline: none;
  transition: 0.2s;
}
.field input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.auth-message { min-height: 20px; color: #e14a3b; font-size: 13px; margin: 0; }

/* 图形验证码 */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }
.captcha-row input {
  flex: 1; min-width: 0; height: 48px; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--panel-2);
  padding: 0 14px; font-size: 16px; letter-spacing: 4px; text-transform: uppercase;
  color: var(--text); outline: none; transition: 0.2s;
}
.captcha-row input:focus { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-soft); }
.captcha-img {
  flex: 0 0 auto; width: 140px; height: 48px; padding: 0; border: 0; border-radius: var(--radius-md);
  background: var(--panel-2); cursor: pointer; overflow: hidden; display: flex;
  align-items: center; justify-content: center; -webkit-tap-highlight-color: transparent;
}
.captcha-img svg { width: 132px; height: 44px; display: block; }
.captcha-img:disabled { opacity: .6; cursor: progress; }
.captcha-fallback { font-size: 12px; color: var(--muted); }
.invite-banner {
  border-radius: var(--radius-md); padding: 10px 14px; font-size: 13px; font-weight: 600; line-height: 1.5;
}
.invite-banner.ok { background: rgba(22, 163, 123, 0.1); color: #0f8a68; border: 1px solid rgba(22, 163, 123, 0.3); }
.invite-banner.bad { background: rgba(225, 74, 59, 0.08); color: #c0392b; border: 1px solid rgba(225, 74, 59, 0.25); }
.auth-tabs button.disabled { opacity: 0.4; cursor: not-allowed; }
.muted-tip { color: var(--muted); font-weight: 500; }
.primary-btn {
  height: 48px; border: 0; border-radius: var(--radius-md);
  background: var(--orange); color: #fff; font-size: 15px; font-weight: 700;
  transition: 0.2s; box-shadow: 0 8px 20px rgba(255,106,0,0.25);
}
.primary-btn:hover { filter: brightness(1.05); transform: translateY(-1px); }
.primary-btn:disabled { opacity: 0.6; transform: none; }
.auth-switch { text-align: center; color: var(--muted); font-size: 13px; margin: 0; }
.auth-shell-footer {
  width: 100%; max-width: 1140px; display: flex; justify-content: space-between;
  color: var(--faint); font-size: 12px; padding-top: 20px;
}
.auth-footer-links { display: flex; gap: 18px; }
.auth-footer-links a { color: var(--faint); }

/* ---------------- 应用布局 ---------------- */
/* 整页内容（侧栏 + 主区）作为一个整体在超宽屏居中 */
.app-shell { display: flex; min-height: 100vh; min-height: 100dvh; max-width: 1580px; margin: 0 auto; }
/* 侧栏自带底色：不依赖页面整幅背景，滚动时不会透出浅色
   不画右侧分隔线 —— 整页仍保持「一张纸」的通透感 */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; padding: 22px 16px 22px 34px;
  position: sticky; top: 0; height: 100vh; height: 100dvh;
  display: flex; flex-direction: column; gap: 26px;
  background: var(--sidebar-bg);
  transition: background-color 0.25s;
}
html { background: var(--bg); }
.nav-list { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 0; background: transparent; border-radius: var(--radius-md);
  color: var(--muted); font-size: 14.5px; font-weight: 500; text-align: left;
  transition: 0.18s; position: relative;
}
.nav-item:hover { background: var(--orange-softer); color: var(--text); }
.nav-item.active { background: var(--orange-soft); color: var(--orange); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -34px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; background: var(--orange); border-radius: 0 3px 3px 0;
}
.nav-item .nav-icon { color: currentColor; display: flex; }

/* 主内容：限制最大宽度并居中，避免超宽屏上元素被拉散
   顶栏外的背景铺满，内层 .topbar-inner 与 .view 使用同一宽度，保证边缘对齐 */
.main {
  flex: 1; min-width: 0; padding: 0 34px 60px;
  --content-max: 1240px;
}
.main > .view {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
}
.topbar-inner {
  display: flex; align-items: center; gap: 12px;
  width: 100%; max-width: var(--content-max); margin-inline: auto;
}

/* ---------------- 顶栏 ---------------- */
/* 顶栏与未登录提示条一起吸顶：提示条在顶栏上方，滚动时两条都固定 */
.topbar-shell {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(180deg, var(--bg) 0%, var(--bg) calc(100% - 16px), transparent 100%);
}
.topbar-shell .guest-bar { margin-bottom: 10px; }
.topbar {
  display: flex; align-items: center; gap: 12px; padding: 20px 0 22px;
}
.search-box {
  position: relative;
  display: flex; align-items: center; gap: 10px; flex: 1; max-width: 480px;
  height: 46px; padding: 0 16px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
  color: var(--faint);
}
.search-box input { flex: 1; border: 0; background: transparent; outline: none; font-size: 14.5px; color: var(--text); }

/* 搜索历史下拉：贴着胶囊下方，圆角放宽以呼应搜索框 */
.search-history-menu {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 40;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); padding: 8px; text-align: left; color: var(--text);
}
.search-history-menu[hidden] { display: none; }
.search-history-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 10px 8px; font-size: 12px; color: var(--muted);
}
.search-history-head button {
  border: 0; background: transparent; color: var(--faint); font-size: 12px; cursor: pointer; padding: 2px 4px;
}
.search-history-head button:hover { color: var(--orange); }
.search-history-list { display: flex; flex-direction: column; }
.search-history-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--text); font-size: 13.5px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.search-history-item:hover { background: var(--orange-softer); color: var(--orange); }
.search-history-icon { font-size: 12px; opacity: .7; }
.pill-btn {
  height: 46px; padding: 0 18px; display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  color: var(--text); font-weight: 600; font-size: 14px; box-shadow: var(--shadow);
  transition: 0.18s; white-space: nowrap;
}
.pill-btn:hover { border-color: var(--border-strong); }
.sort-btn { padding: 0 14px; }
.content-mode-control {
  display: flex; gap: 4px; padding: 4px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 999px; box-shadow: var(--shadow);
}
.mode-btn {
  border: 0; height: 38px; padding: 0 16px; border-radius: 999px; background: transparent;
  color: var(--muted); font-weight: 600; font-size: 14px; transition: 0.18s;
}
.mode-btn.active { background: var(--orange-soft); color: var(--orange); border: 1px solid rgba(255,106,0,0.28); }
.user-btn { padding: 0; width: 46px; justify-content: center; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--orange);
  color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 14px;
}

/* ---------------- 首页 ---------------- */
.home-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.home-head h1.home-greeting { font-size: 26px; letter-spacing: -0.02em; margin: 0; }
.home-subtitle { color: var(--muted); margin: 0; font-size: 14px; }
.home-layout { display: grid; grid-template-columns: minmax(0, 1fr) 286px; gap: 24px; align-items: start; }
.home-main-col { min-width: 0; }
.home-aside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 84px; }

/* 分类横排 */
.categories { margin-bottom: 22px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-title h2 { font-size: 15px; font-weight: 700; margin: 0; }
.section-title.row { justify-content: flex-start; }
.section-title h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0; }
.category-rail { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.category-rail::-webkit-scrollbar { display: none; }
.category-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  min-width: 92px; padding: 14px 8px 10px; border-radius: var(--radius-lg);
  border: 1px solid transparent; background: transparent; color: var(--muted);
  transition: 0.18s; font-size: 13px; font-weight: 600;
}
.category-item:hover { background: var(--panel); border-color: var(--border); }
.category-item.active { background: var(--panel); border-color: var(--border); color: var(--text); box-shadow: var(--shadow); }
.category-item .cat-icon {
  width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center;
  font-size: 24px; background: var(--orange-softer);
}
.category-item.active .cat-icon { background: var(--orange-soft); }
.category-item .cat-count { font-size: 11px; color: var(--faint); font-weight: 500; }

/* 视频网格 */
.video-section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.video-section-head h2 { font-size: 15px; }
.video-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.video-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow); cursor: pointer; transition: 0.2s;
  display: flex; flex-direction: column;
}
.video-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--border-strong); }
.thumb {
  position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .badge {
  position: absolute; top: 10px; left: 10px; padding: 3px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 700; color: #fff; background: var(--orange);
}
.thumb .badge.gate { background: rgba(24,20,12,0.72); backdrop-filter: blur(6px); }
.thumb .dur {
  position: absolute; right: 10px; bottom: 10px; padding: 2px 8px; border-radius: 6px;
  background: rgba(0,0,0,0.6); color: #fff; font-size: 11px; font-weight: 600;
}
.thumb .star-btn {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; background: rgba(0,0,0,0.32); backdrop-filter: blur(6px); color: #fff;
  display: grid; place-items: center; opacity: 0; transition: 0.18s;
}
.video-card:hover .star-btn { opacity: 1; }
.thumb .star-btn.on { opacity: 1; color: var(--orange); background: #fff; }
.thumb .star-btn svg { width: 16px; height: 16px; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-size: 15px; font-weight: 700; line-height: 1.35; margin: 0; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-channel { font-size: 12.5px; color: var(--muted); }
.card-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { font-size: 11.5px; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--border-strong); color: var(--muted); }
.video-section-head { margin-top: 4px; }
.video-section-head .section-title { margin-bottom: 0; }
.video-section-head .sort-btn { height: 34px; font-size: 13px; }
.card-meta { margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--faint); }
.stars { color: var(--orange); letter-spacing: 1px; }
.video-grid-sentinel { height: 40px; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); grid-column: 1 / -1; }

/* 右侧卡片 */
.aside-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow);
}
.aside-card h3 { font-size: 15px; margin: 0 0 14px; }
.ring-wrap { position: relative; width: 150px; height: 150px; margin: 0 auto 12px; }
.progress-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--orange-softer); stroke-width: 12; }
.ring-fg {
  fill: none; stroke: var(--orange); stroke-width: 12; stroke-linecap: round;
  stroke-dasharray: 327; stroke-dashoffset: 327; transition: stroke-dashoffset 0.6s ease;
}
.ring-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-center strong { font-size: 34px; font-weight: 800; line-height: 1; }
.ring-center span { font-size: 12px; color: var(--muted); margin-top: 2px; }
.goal-meta { font-size: 13px; color: var(--muted); }
.goal-meta strong { color: var(--text); }
.goal-bar { height: 8px; border-radius: 999px; background: var(--orange-soft); margin: 8px 0; overflow: hidden; }
.goal-bar span { display: block; height: 100%; width: 0; background: var(--orange); border-radius: 999px; transition: width 0.6s; }
.goal-week { font-size: 13px; color: var(--muted); margin: 0; }
.goal-week strong { color: var(--text); }

.recent-list { display: flex; flex-direction: column; gap: 12px; }
.recent-item { display: flex; gap: 10px; cursor: pointer; align-items: center; }
.recent-item:hover .recent-title { color: var(--orange); }
.recent-thumb { width: 64px; height: 42px; border-radius: 8px; object-fit: cover; flex-shrink: 0; background: var(--bg-2); }
.recent-info { min-width: 0; }
.recent-title { font-size: 13px; font-weight: 600; line-height: 1.35; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: .18s; }
.recent-meta { font-size: 11.5px; color: var(--faint); }
.favorite-summary { font-size: 13px; color: var(--muted); margin: 0; }

/* 筛选面板 */
.home-filters {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px;
}
.filter-grid { display: flex; flex-direction: column; gap: 14px; }
.filter-group { display: flex; align-items: flex-start; gap: 16px; }
.filter-group label { width: 64px; flex-shrink: 0; font-size: 13px; font-weight: 600; color: var(--muted); padding-top: 6px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--muted); font-size: 13px; font-weight: 500; transition: 0.16s;
}
.chip:hover { border-color: var(--orange); color: var(--orange); }
.chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.filter-actions { justify-content: flex-end; }

/* 频道筛选：77 个频道要能搜，且数值可见 */
.filter-count { font-style: normal; font-size: 11px; color: var(--orange); margin-left: 4px; }
.channel-search {
  width: 100%; max-width: 320px; height: 34px; margin-bottom: 10px;
  border: 1px solid var(--border-strong); border-radius: 999px;
  background: var(--panel-2); color: var(--text); padding: 0 14px; font-size: 13px; outline: none;
}
.channel-search:focus { border-color: var(--orange); }
.filter-group:has(#filterChannel) { flex-direction: column; align-items: stretch; gap: 0; }
.filter-group:has(#filterChannel) > label { width: auto; padding-top: 0; margin-bottom: 8px; }
.channel-chip-row { max-height: 148px; overflow-y: auto; padding-right: 4px; }
.channel-chip-row .chip em {
  font-style: normal; font-size: 11px; opacity: .65; margin-left: 6px;
}
.channel-chip-row .chip.active em { opacity: .85; }
.chip-empty { font-size: 12px; color: var(--faint); padding: 6px 2px; }
.ghost-btn {
  border: 1px solid var(--border-strong); background: transparent; color: var(--muted);
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; transition: 0.16s;
}
.ghost-btn:hover { color: var(--orange); border-color: var(--orange); }

/* ---------------- 播放页 ---------------- */
/* 播放页顶栏（返回 + 难度），桌面与移动共用 */
.watch-mobile-header { display: none; }
/* 左右结构：视频在左、字幕面板在右（对齐原站，单屏完成观看与学习）
   视频列略宽以获得更大画面、更高有效清晰度 */
.watch-layout {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(340px, 1fr);
  gap: 20px; align-items: start;
  max-width: 1360px; margin: 0 auto;
}

/* 播放页「沉浸模式」：对齐原站 —— 进播放页后隐藏侧栏与顶栏，
   只留「左上返回 + 画面 + 右侧字幕」，整页锁定高度、只有字幕列表内部滚动。 */
body.watching .sidebar,
body.watching .topbar-shell,
body.watching .guest-bar,
body.watching .mobile-tabbar { display: none; }
body.watching { height: 100dvh; overflow: hidden; }
body.watching .app-shell { height: 100dvh; overflow: hidden; }
body.watching .main {
  height: 100dvh; padding: 20px 32px 18px; overflow: hidden;
  display: flex; flex-direction: column;
}
body.watching .main > .view.active-view {
  height: 100%; max-width: 1440px; margin: 0 auto; width: 100%;
  display: flex; flex-direction: column; min-height: 0;
}
body.watching .watch-mobile-header { display: flex; flex: 0 0 auto; margin-bottom: 14px; }
body.watching .watch-layout {
  flex: 1 1 auto; min-height: 0; height: auto;
  max-width: none; margin: 0; gap: 24px;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  align-items: stretch;
}
/* 平板（641–900px）：双列会把视频压到 260px 宽、标题竖排，这里退成单列 */
@media (max-width: 900px) {
  body.watching .watch-layout {
    grid-template-columns: minmax(0, 1fr);
    flex-direction: column; gap: 0;
  }
  body.watching .player-column { flex: 0 0 auto; overflow: visible; }
  body.watching .learning-panel { flex: 1 1 auto; min-height: 0; }
  body.watching .main { padding: 12px 16px 0; }
}
body.watching .player-column { min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
body.watching .learning-panel { min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
body.watching .subtitle-list {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
body.watching .panel-head { flex: 0 0 auto; }
.player-column { min-width: 0; }
.player-stage {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; box-shadow: var(--shadow);
}
.player-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player-frame video { width: 100%; height: 100%; display: block; background: #000; }
.player-cover {
  position: absolute; inset: 0; border: 0; padding: 0; background: #000;
  display: grid; place-items: center; cursor: pointer; z-index: 2;
}
.player-cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.play-big {
  position: relative; width: 74px; height: 74px; border-radius: 50%; background: var(--orange);
  display: grid; place-items: center; color: #fff; box-shadow: 0 10px 30px rgba(255,106,0,0.45);
  transition: 0.2s;
}
.play-big svg { width: 30px; height: 30px; fill: #fff; stroke: none; margin-left: 4px; }
.player-cover:hover .play-big { transform: scale(1.06); }
.sentence-counter {
  position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px;
  background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; font-weight: 600; z-index: 3;
}
.player-tools { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); }
.play-toggle, .player-icon-btn {
  width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--text); display: grid; place-items: center; transition: 0.16s;
}
.play-toggle { background: var(--orange); border-color: var(--orange); color: #fff; }
.play-toggle svg { fill: #fff; stroke: none; }
.play-toggle:hover, .player-icon-btn:hover { filter: brightness(1.08); }
.player-icon-btn.on { background: var(--orange-soft); color: var(--orange); border-color: rgba(255,106,0,0.35); }
.watch-timeline { flex: 1; display: flex; align-items: center; gap: 10px; }
.time-readout { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 34px; text-align: center; }
.progress-bar { flex: 1; -webkit-appearance: none; appearance: none; height: 5px; border-radius: 999px; background: var(--border-strong); outline: none; }
.progress-bar::-webkit-slider-thumb {
  -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--orange);
  box-shadow: 0 0 0 3px var(--orange-soft); cursor: pointer;
}
.watch-action-buttons { display: flex; align-items: center; gap: 8px; }
.speed-menu, .panel-menu { position: relative; }
.speed-menu-options, .panel-menu-options {
  position: absolute; bottom: 46px; right: 0; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg); padding: 6px; z-index: 30;
  display: flex; flex-direction: column; min-width: 110px;
}
.speed-menu-options button, .panel-menu-options button {
  border: 0; background: transparent; padding: 8px 14px; border-radius: 8px; text-align: left;
  color: var(--text); font-size: 13px; white-space: nowrap;
}
.speed-menu-options button:hover, .panel-menu-options button:hover { background: var(--orange-softer); }
.speed-menu-options button.active, .panel-menu-options button.active { color: var(--orange); font-weight: 700; }
/* 仅播放音频：菜单里的分隔选项 */
.audio-only-option { margin-top: 4px; border-top: 1px solid var(--border) !important; border-radius: 0 0 8px 8px !important; color: var(--muted) !important; }
.audio-only-option.active { color: var(--orange) !important; font-weight: 700; }
/* 音频模式：画面隐藏，用封面图做背景板，保留音频条 */
/* 仅播放音频：封面底图（.audio-only-backdrop）盖住视频，字幕浮层仍在其上 */
.audio-only-backdrop {
  position: absolute; inset: 0; z-index: 1; background: #000; overflow: hidden;
  display: grid; place-items: center; pointer-events: none;
}
.audio-only-backdrop.hidden { display: none; }
.audio-only-backdrop img {
  position: absolute; inset: -40px; width: calc(100% + 80px); height: calc(100% + 80px);
  object-fit: cover; filter: blur(18px) brightness(0.62); transform: scale(1.06);
}
.audio-only-backdrop::after {
  content: "♪ 仅播放音频"; position: relative; z-index: 1;
  color: rgba(255,255,255,0.72); font-size: 13px; font-weight: 700; letter-spacing: 0.08em;
}

.player-frame.audio-only .video-subtitle-overlay { z-index: 4; }

.fullscreen-subtitle-overlay {
  position: absolute; left: 0; right: 0; bottom: 40px; text-align: center; z-index: 4;
  display: flex; flex-direction: column; gap: 6px; padding: 0 40px; pointer-events: none;
}
.fullscreen-subtitle-overlay .fs-en { font-size: calc(22px * var(--subtitle-size-factor)); font-weight: 700; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,0.9); }
.fullscreen-subtitle-overlay .fs-zh { font-size: calc(17px * var(--subtitle-size-factor)); color: rgba(255,255,255,0.86); text-shadow: 0 2px 10px rgba(0,0,0,0.9); }

.video-meta { padding: 18px 4px 0; }
.watch-title-row { display: flex; align-items: center; gap: 12px; }
.watch-title-row h1 { font-size: 20px; letter-spacing: -0.02em; margin: 0; flex: 1; display: flex; flex-direction: column; }
.watch-title-zh { font-size: 21px; font-weight: 800; }
.watch-title-en { font-size: 14px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.watch-favorite-btn.on { color: var(--orange); background: var(--orange-soft); }
.video-stepper { display: flex; gap: 8px; }
.video-stepper button {
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--muted);
  padding: 6px 12px; border-radius: 999px; font-size: 13px; transition: 0.16s;
}
.video-stepper button:hover:not(:disabled) { color: var(--orange); border-color: var(--orange); }
.video-stepper button:disabled { opacity: 0.4; cursor: not-allowed; }
#watchChannel { color: var(--muted); font-size: 13px; margin: 8px 0 0; }
.watch-intro { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; line-height: 1.6; }

/* 学习面板（视频右侧固定列，内部滚动）：吸顶并限制为视口高度，字幕列表内部滚动 */
.learning-panel {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); display: flex; flex-direction: column;
  overflow: hidden; min-height: 0;
  position: sticky; top: 84px; height: calc(100vh - 104px);
}
/* 面板头：单行四模式（字幕/挖空/跟读/重点），等宽铺满，对齐原站 */
.panel-head { display: flex; align-items: center; border-bottom: 1px solid var(--border); padding: 0 6px; }
.panel-tabs { display: flex; }
.tab { border: 0; background: transparent; padding: 14px 18px; color: var(--muted); font-weight: 600;
  font-size: 14px; border-bottom: 2px solid transparent; transition: 0.16s; }
.tab.active { color: var(--orange); border-bottom-color: var(--orange); }
.subtitle-practice-modes { display: flex; flex: 1; gap: 6px; padding: 8px 2px; }
.subtitle-practice-modes button {
  flex: 1; padding: 9px 4px; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted); font-size: 13.5px; font-weight: 600; transition: 0.16s;
  white-space: nowrap;
}
.subtitle-practice-modes button:hover { background: var(--orange-softer); color: var(--text); }
.subtitle-practice-modes button.active {
  background: var(--orange-soft); border-color: rgba(255,106,0,0.32); color: var(--orange); font-weight: 700;
}

/* 画面内字幕浮层：默认用于窄屏，宽屏交给右侧字幕面板 */
.video-subtitle-overlay {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
  display: none; flex-direction: column; justify-content: flex-end;
  padding: 26px 14px 14px; color: #fff;
  /* 浮层不接收指针：点视频任意位置仍然是「播放/暂停」，工具栏单独开指针 */
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,0.34) 42%, rgba(0,0,0,0.72) 100%);
  transition: opacity 0.18s;
}
.video-subtitle-overlay .vso-toggle,
.video-subtitle-overlay .vso-toolbar { pointer-events: auto; }
.video-subtitle-overlay.hidden { display: none; }
.video-subtitle-overlay .vso-toggle {
  position: absolute; top: 6px; right: 8px; width: 30px; height: 26px; padding: 0;
  border: 0; border-radius: 8px; background: rgba(0,0,0,0.42); color: #fff;
  display: grid; place-items: center; opacity: 0.85;
}
.video-subtitle-overlay .vso-toggle svg { width: 16px; height: 16px; }
.video-subtitle-overlay .vso-body { display: flex; flex-direction: column; gap: 4px; }
.video-subtitle-overlay .vso-en {
  margin: 0; font-size: 16px; font-weight: 700; line-height: 1.4;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.video-subtitle-overlay .vso-en em {
  font-style: normal; border-radius: 3px; padding: 0 2px;
  color: #ffd166; background: rgba(255,209,102,0.16);
}
.video-subtitle-overlay .vso-zh {
  margin: 0; font-size: 12.5px; color: rgba(255,255,255,0.9); line-height: 1.35;
  text-shadow: 0 1px 6px rgba(0,0,0,0.85);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.video-subtitle-overlay .vso-toolbar {
  display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 6px;
}
.video-subtitle-overlay .vso-btn {
  width: 32px; height: 30px; border-radius: 8px; border: 0; background: rgba(255,255,255,0.2);
  color: #fff; display: grid; place-items: center; transition: 0.16s;
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
/* 浮层图标统一用描边（ICONS 里是 path/circle 线稿，不设描边会渲染成实心块） */
.video-subtitle-overlay svg {
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
/* prev / next 的三角形与 star 是实心图形，保持填充 */
.video-subtitle-overlay .vso-btn[data-vso-action="prev"] svg path:first-child,
.video-subtitle-overlay .vso-btn[data-vso-action="next"] svg path:first-child,
.video-subtitle-overlay .vso-btn[data-vso-action="save"] svg path {
  fill: currentColor; stroke: currentColor; stroke-width: 1.4;
}
.video-subtitle-overlay .vso-btn svg { width: 17px; height: 17px; }
.video-subtitle-overlay .vso-toggle svg { width: 16px; height: 16px; }
.video-subtitle-overlay .vso-btn.on { background: var(--orange); }
/* 收起态：只留一个小圆钮，避免挡住画面 */
.video-subtitle-overlay.collapsed { background: none; padding: 0; }
.video-subtitle-overlay.collapsed .vso-body { display: none; }
.video-subtitle-overlay.collapsed .vso-toggle { position: absolute; top: auto; bottom: 12px; right: 12px; opacity: 0.75; }
.video-subtitle-overlay.collapsed .vso-toggle svg { transform: rotate(180deg); }

/* 「视频信息」抽屉按钮（位于控制条内）：仅手机端出现 */
.watch-action-buttons .video-meta-toggle { display: none; }
.subtitle-list { flex: 1; min-height: 0; overflow-y: auto; padding: 6px 14px 18px; }
/* 字幕行做成独立卡片（对齐原站）：每句一块，留白呼吸，长列表也不糊成一片。
   尺寸取自原站 --tune-subtitle-*：上下 12px、左右 18px、行间距 7px。 */
.subtitle-row {
  padding: 12px 18px; border-radius: 14px; cursor: pointer; position: relative;
  display: block; transition: background 0.16s, border-color 0.16s;
  border: 1px solid var(--border); background: var(--panel);
  margin-bottom: 7px;
}
.subtitle-row:last-child { margin-bottom: 0; }
.subtitle-row .sub-actions { margin: 8px 0 0 42px; }
.subtitle-main { flex: 1; min-width: 0; display: flex; gap: 10px; align-items: flex-start; }
.subtitle-row:hover { border-color: var(--border-strong); background: var(--panel-2); }
.subtitle-row.active {
  border-color: rgba(255, 106, 0, 0.5);
  background: linear-gradient(90deg, rgba(255, 114, 0, 0.10), rgba(255, 114, 0, 0.02));
}
/* 「显示句数」：当前句前后 N 句保持完整明度，其余淡出；未播放时整列保持原样 */
.subtitle-row.in-context { opacity: 1; }
.subtitle-list:has(.subtitle-row.active) .subtitle-row:not(.in-context) { opacity: 0.55; }
.subtitle-list:has(.subtitle-row.active) .subtitle-row:not(.in-context):hover { opacity: 1; }
/* 每句操作条：对齐原站 —— 平时完全隐藏，鼠标移到这一句才出现，让字幕列表保持干净。
   当前句常亮（用户正在跟这句话，操作随时要用）。 */
.sub-actions {
  display: flex; align-items: center; gap: 2px;
  opacity: 0; transition: opacity 0.16s;
}
.subtitle-row:hover .sub-actions,
.subtitle-row.active .sub-actions { opacity: 1; }
/* 触屏无 hover：常驻显示，否则永远点不到 */
@media (hover: none) {
  .sub-actions { opacity: 1; }
}
.sub-actions button {
  width: 30px; height: 30px; border: 0; border-radius: 8px; background: transparent;
  color: var(--faint); display: grid; place-items: center; transition: 0.16s;
}
.sub-actions button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sub-actions button:hover { background: var(--orange-soft); color: var(--orange); }
.sub-actions button.on { color: var(--orange); }
.subtitle-locked {
  margin: 4px 0 8px; padding: 18px 14px; text-align: center;
  border: 1px dashed var(--border-strong); border-radius: var(--radius-md);
  color: var(--muted); font-size: 13px; display: grid; gap: 10px; place-items: center;
}
.subtitle-locked p { margin: 0; }
.subtitle-row .time { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; padding-top: 2px; min-width: 38px; flex: 0 0 38px; }
.subtitle-text { flex: 1; font-size: calc(14.5px * var(--subtitle-size-factor)); line-height: 1.7; }
.subtitle-row .en { color: var(--text); }
.subtitle-row .zh { color: var(--muted); font-size: 0.92em; margin-top: 2px; }
.word {
  cursor: pointer; border-radius: 4px; padding: 0 1px; transition: background 0.12s;
  border-bottom: 1.5px solid transparent;
}
.word:hover { background: var(--orange-soft); }
/* 逐词高亮：当前正在念的词。用背景块而不是改文字色，
   避免与词性下划线、选区颜色互相干扰。 */
.word.wi-active {
  background: var(--orange);
  color: #fff;
  border-radius: 4px;
  padding: 0 2px;
  box-shadow: 0 1px 4px rgba(255, 106, 0, 0.35);
}
.subtitle-row.active .word.wi-active { color: #fff; }
.word.noun { border-bottom-color: var(--pos-noun); }
.word.verb { border-bottom-color: var(--pos-verb); }
.word.adjective { border-bottom-color: var(--pos-adjective); }
.word.adverb { border-bottom-color: var(--pos-adverb); }
.word.phrase { border-bottom-color: var(--pos-phrase); }
.word.active { background: var(--orange); color: #fff; }
/* 挖空：文字透明 + 橘色下划线（对齐原站 cloze-hidden），点击揭示答案 */
/* 用 text-decoration 而非 border-bottom：一句话只画一条连续下划线，不会被词间空格打断 */
.fill-blank {
  color: transparent; cursor: pointer; user-select: none;
  text-decoration: underline; text-decoration-color: var(--orange);
  text-decoration-thickness: 2px; text-underline-offset: 4px;
  text-shadow: none;
  transition: color 0.15s, background 0.15s;
}
.fill-blank:hover { background: var(--orange-softer); }
/* 挖空模式下整句不显示词性下划线：这里的作用是「填空」，其余词只作为上下文，
   带彩色下划线既无功能意义又干扰阅读。空格本身的下划线保留。 */
.cloze-mode .word:not(.fill-blank .word) { border-bottom-color: transparent; }
.cloze-mode .word:hover { background: transparent; }
.fill-blank .word, .fill-blank .word:hover {
  color: inherit !important; border-bottom-color: transparent !important; background: transparent !important;
}
.fill-blank.revealed { color: inherit; text-decoration: none; }
.fill-blank.revealed .word { color: inherit !important; }
.save-btn {
  border: 0; background: transparent; color: var(--faint); font-size: 15px; padding: 0 2px;
  opacity: 0; transition: 0.16s;
}
.subtitle-row:hover .save-btn { opacity: 1; }
.save-btn.on { opacity: 1; color: var(--orange); }

/* 重点列表 */
.learning-highlights-list { flex: 1; min-height: 0; overflow-y: auto; padding: 12px 16px 18px; display: flex; flex-direction: column; gap: 12px; }
.highlight-item { padding: 14px; border-radius: var(--radius-md); background: var(--panel-2); border: 1px solid var(--border); }
.highlight-type { display: inline-block; font-size: 11px; font-weight: 700; color: var(--orange); margin-bottom: 6px; }
.highlight-en { font-size: 15px; font-weight: 600; color: var(--text); }
.highlight-zh { font-size: 13px; color: var(--muted); margin-top: 4px; }

/* ---------- 重点页卡片（对齐原站 word-item / essence-card） ---------- */
.word-item,
.essence-card {
  position: relative; border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--panel-2); transition: border-color 0.16s, background 0.16s;
}
.word-item:hover,
.essence-card:hover { border-color: var(--border-strong); background: var(--panel); }
.word-item {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 12px 46px 12px 14px;
}
.word-item-body { display: grid; gap: 10px; min-width: 0; flex: 1; }
.word-core-head { display: grid; gap: 6px; min-width: 0; }
.word-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.word-title-row strong { font-size: 18px; font-weight: 700; color: var(--text); line-height: 1.35; }
.word-phonetic { color: var(--muted); font-size: 12px; font-style: italic; white-space: nowrap; }

/* 发音按钮：橙色圆形 ♪ */
.audio-dot {
  display: inline-grid; place-items: center; width: 26px; height: 26px; padding: 0;
  border: 0; border-radius: 50%; background: rgba(255, 114, 0, 0.14); color: var(--orange);
  font-size: 14px; line-height: 1; transition: 0.16s;
}
.audio-dot:hover { background: var(--orange); color: #fff; }

.word-meaning-block,
.word-example-block { display: grid; gap: 5px; margin-top: 2px; }
.word-section-title { color: var(--text); font-size: 12px; font-weight: 900; margin: 2px; }
.word-meaning-line { display: flex; align-items: flex-start; gap: 8px; }
.word-pos {
  display: inline-flex; align-items: center; flex: 0 0 auto; padding: 2px 7px; border-radius: 999px;
  background: var(--orange-soft); color: var(--orange); font-size: 11px; font-weight: 900;
  letter-spacing: 0.02em; text-transform: uppercase; line-height: 1.4;
}
.word-meaning { color: var(--text); font-weight: 800; line-height: 1.45; }
.word-example-en { margin: 0; color: var(--text); font-size: 13px; font-weight: 500; line-height: 1.5; }
.word-example-zh { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.word-example-en mark,
.essence-card-example mark {
  padding: 0 4px; border-radius: 4px; background: var(--orange-soft); color: var(--orange); font-weight: inherit;
}

/* 收藏按钮（卡片右上角圆形 ☆） */
.word-save-toggle,
.essence-save-toggle {
  position: absolute; top: 10px; right: 10px; display: grid; place-items: center;
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 50%;
  background: var(--bg-2); color: var(--faint); font-size: 17px; line-height: 1;
}
.word-save-toggle:hover,
.essence-save-toggle:hover { color: var(--orange); }
.word-save-toggle.saved,
.essence-save-toggle.saved { color: var(--orange); background: var(--orange-soft); }

/* 实用表达卡 */
.essence-card { display: grid; gap: 8px; padding: 14px 46px 14px 14px; min-width: 0; }
.essence-card-word { color: var(--text); font-size: 17px; font-weight: 700; line-height: 1.35; }
.essence-card-meaning { color: var(--orange); font-size: 14px; font-weight: 800; line-height: 1.5; }
.essence-card-example { color: var(--text); font-size: 14px; font-weight: 500; line-height: 1.55; overflow-wrap: anywhere; }
.essence-card-example-zh { color: var(--muted); font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }

/* 单词浮层 */
.word-popover {
  position: fixed; z-index: 60; width: 320px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  padding: 18px; transform-origin: top left; animation: pop 0.16s ease;
}
@keyframes pop { from { opacity: 0; transform: scale(0.96);} to { opacity: 1; transform: scale(1);} }
.wp-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px; }
.wp-word { font-size: 20px; font-weight: 800; }
.wp-phonetic { color: var(--muted); font-size: 13px; font-family: ui-monospace, monospace; }
.wp-speak { margin-left: auto; border: 0; background: var(--orange-soft); color: var(--orange);
  width: 28px; height: 28px; border-radius: 50%; font-size: 14px; display: grid; place-items: center; transition: 0.16s; }
.wp-speak:hover { background: var(--orange); color: #fff; }
.wp-pos { display: inline-block; font-size: 11px; font-weight: 700; color: var(--orange);
  background: var(--orange-soft); padding: 1px 7px; border-radius: 5px; margin-bottom: 8px; }
.wp-pos.phrase { color: var(--pos-phrase); background: rgba(90,167,255,0.14); }
.wp-pos.verb { color: var(--pos-verb); background: rgba(217,154,0,0.16); }
.wp-pos.noun { color: var(--pos-noun); background: rgba(255,138,36,0.14); }
.wp-pos.adjective { color: var(--pos-adjective); background: rgba(25,135,84,0.14); }
.wp-pos.adverb { color: var(--pos-adverb); background: rgba(185,154,255,0.16); }
.wp-section-label { font-size: 12px; font-weight: 700; color: var(--faint); margin: 12px 0 5px; }
.wp-example { background: var(--panel-2); border-radius: var(--radius-sm); padding: 10px 12px; border: 1px solid var(--border); }
.wp-example-en { font-size: 14px; font-weight: 600; color: var(--text); line-height: 1.6; }
.wp-example-zh { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.wp-meanings { font-size: 14.5px; color: var(--text); margin: 6px 0; display: flex; flex-direction: column; gap: 5px; }
.wp-meaning-row { display: flex; gap: 7px; align-items: baseline; line-height: 1.6; }
.wp-meaning-pos {
  flex: 0 0 auto; min-width: 36px; font-size: 11.5px; font-weight: 700;
  color: var(--orange); background: var(--orange-softer); border-radius: 5px;
  padding: 1px 6px; text-align: center;
}
.wp-meaning-text { flex: 1; min-width: 0; }
.wp-def { font-size: 12.5px; color: var(--muted); margin: 8px 0; line-height: 1.6; white-space: pre-wrap; }
.wp-actions { display: flex; gap: 8px; margin-top: 14px; }
.wp-actions button {
  flex: 1; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--text); font-size: 13px; font-weight: 600; transition: 0.16s;
}
.wp-actions button:hover { border-color: var(--orange); color: var(--orange); }
.wp-actions button.primary { background: var(--orange); border-color: var(--orange); color: #fff; }
.wp-actions button.primary:hover { color: #fff; filter: brightness(1.05); }
.wp-close { position: absolute; top: 12px; right: 14px; border: 0; background: transparent; color: var(--faint); font-size: 18px; }

/* ---------------- 生词本 / 收藏 / 历史 / 设置 ---------------- */
#vocabView .collection-title, #favoritesView .collection-title { margin-bottom: 22px; }
.vocab-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.vocab-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px; box-shadow: var(--shadow); transition: border-color .15s, box-shadow .15s, background .15s;
}
.vocab-card.selected { border-color: var(--orange); background: var(--orange-softer); }
.vocab-word { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.vocab-check { display: flex; align-items: center; }
.vocab-check input { width: 16px; height: 16px; accent-color: var(--orange); cursor: pointer; }
.vocab-term { font-size: 18px; font-weight: 800; }
.vocab-phonetic { color: var(--muted); font-size: 13px; }
.vocab-word .vocab-speak { margin-left: auto; }
.vocab-word button { border: 0; background: transparent; color: var(--faint); font-size: 15px; cursor: pointer; padding: 2px 5px; border-radius: 6px; }
.vocab-word button:hover { color: var(--orange); }
.vocab-meaning { color: var(--text); font-size: 14px; margin-top: 8px; line-height: 1.6; }
/* 生词本：按词性分行展示释义 */
.vocab-meanings { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.vocab-meaning-row { display: flex; gap: 6px; font-size: 13.5px; line-height: 1.6; align-items: baseline; }
.vocab-meaning-pos {
  flex: 0 0 auto; min-width: 34px; font-size: 12px; font-weight: 700;
  color: var(--orange); background: var(--orange-softer); border-radius: 5px;
  padding: 1px 6px; text-align: center;
}
.vocab-meaning-text { color: var(--text); }
.vocab-context-label {
  font-size: 11px; font-weight: 700; color: var(--faint); margin-bottom: 2px;
}
.vocab-context {
  display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left;
  margin-top: 12px; padding: 10px 12px; border-radius: var(--radius-md);
  border: 1px dashed var(--border); background: var(--panel-2); cursor: pointer;
  font: inherit; transition: border-color .15s, background .15s;
}
.vocab-context:hover { border-color: var(--orange); background: var(--orange-softer); }
.vocab-context-en { font-size: 13px; color: var(--text); line-height: 1.55; }
.vocab-context-zh { font-size: 13px; color: var(--muted); line-height: 1.55; }
.vocab-context-go { font-size: 12px; color: var(--orange); font-weight: 700; margin-top: 4px; }
.vocab-source { color: var(--faint); font-size: 12px; margin-top: 10px; }
.vocab-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vocab-filters { display: flex; gap: 6px; }
.vocab-filter {
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  border-radius: 999px; padding: 6px 14px; font-size: 13px; cursor: pointer; transition: all .15s;
}
.vocab-filter:hover { border-color: var(--orange); color: var(--orange); }
.vocab-filter.active { background: var(--orange); border-color: var(--orange); color: #fff; font-weight: 700; }
.vocab-toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.vocab-sort {
  border: 1px solid var(--border); background: var(--panel); color: var(--text);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.ghost-btn.danger { color: #d33; }
.ghost-btn.danger:hover { border-color: #d33; }
.ghost-btn:disabled { opacity: .45; cursor: not-allowed; }
.vocab-export { position: relative; }
.vocab-export-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 190px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-md);
  box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column;
}
.vocab-export-menu[hidden] { display: none; }
.vocab-export-menu button {
  border: 0; background: transparent; color: var(--text); text-align: left;
  padding: 9px 12px; border-radius: 8px; font-size: 13px; cursor: pointer;
}
.vocab-export-menu button:hover { background: var(--orange-softer); color: var(--orange); }
.vocab-summary { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.vocab-summary b { color: var(--text); }
.vocab-more { grid-column: 1 / -1; display: flex; justify-content: center; padding-top: 6px; }
.collection-title h1 { font-size: 28px; letter-spacing: -0.02em; margin: 0 0 4px; }
.collection-title p { color: var(--muted); margin: 0; }
.favorites-tabs { display: flex; gap: 8px; margin-bottom: 20px; }
.favorites-tab {
  display: flex; align-items: center; gap: 8px; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--border-strong); background: var(--panel); color: var(--muted);
  font-weight: 600; font-size: 14px; transition: 0.16s;
}
.favorites-tab.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.favorites-tab em { font-style: normal; font-size: 12px; padding: 0 7px; border-radius: 999px; background: var(--orange-softer); }
.favorites-tab.active em { background: rgba(255,255,255,0.25); color: #fff; }
.expression-list { display: flex; flex-direction: column; gap: 12px; }
.expression-item {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.expression-en { font-size: 15px; font-weight: 600; }
.expression-zh { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.expression-source { color: var(--faint); font-size: 12px; margin-top: 10px; display: flex; justify-content: space-between; }
.favorite-video-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 18px; }
.history-list { display: flex; flex-direction: column; gap: 10px; }
.history-item {
  display: flex; align-items: center; gap: 14px; padding: 12px; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow); cursor: pointer;
}
.history-item:hover { border-color: var(--border-strong); }
.history-thumb { width: 104px; height: 60px; border-radius: 8px; object-fit: cover; background: var(--bg-2); }
.history-info { flex: 1; min-width: 0; }
.history-title { font-weight: 700; }
.history-time { color: var(--faint); font-size: 12px; margin-top: 4px; }
.history-progress { width: 120px; height: 6px; border-radius: 999px; background: var(--border); overflow: hidden; }
.history-progress span { display: block; height: 100%; background: var(--orange); }
.settings-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius-lg);
  padding: 20px 22px; box-shadow: var(--shadow); margin-bottom: 16px; max-width: 720px;
}
.settings-card h3 { margin: 0 0 14px; font-size: 15px; }
.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-top: 1px solid var(--border); }
.setting-row:first-of-type { border-top: 0; }
.setting-row div { display: flex; flex-direction: column; }
.setting-row strong { font-size: 14px; font-weight: 600; }
.setting-row span { font-size: 12.5px; color: var(--muted); }
.setting-row select {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong);
  background: var(--panel-2); color: var(--text); font-size: 14px; outline: none; cursor: pointer;
}
.switch { position: relative; width: 46px; height: 26px; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border-strong); border-radius: 999px; transition: 0.2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; }
.switch input:checked + span { background: var(--orange); }
.switch input:checked + span::before { transform: translateX(20px); }
.settings-footer { color: var(--faint); font-size: 13px; max-width: 720px; text-align: center; padding: 20px 0; }

/* ---------------- 视图切换 ---------------- */
.view { display: none; animation: fade 0.2s ease; }
.view.active-view { display: block; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------------- Toast ---------------- */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 10px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; z-index: 80; box-shadow: var(--shadow-lg);
  animation: toastIn 0.2s ease;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px);} to { opacity: 1; transform: translateX(-50%);} }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .home-layout { grid-template-columns: minmax(0, 1fr); }
  .home-aside { position: static; flex-direction: row; flex-wrap: wrap; }
  .home-aside .aside-card { flex: 1; min-width: 220px; }
}
/* ============================================================
   移动端适配（平板 900px 以下 / 手机 640px 以下）
   ============================================================ */
.mobile-topbar, .mobile-tabbar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }                       /* 改用底部 Tab */
  .main { padding: 0 16px 84px; }
  /* 窄屏：播放页退回上下单列，字幕面板不再固定高度 */
  .watch-layout { grid-template-columns: minmax(0, 1fr); }
  .learning-panel { height: auto; max-height: none; min-height: 0; }
  .learning-highlights-list { max-height: 42vh; min-height: 220px; }
  .video-grid, .favorite-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-card { grid-template-columns: 1fr; gap: 24px; padding: 12px 0 0; }
  .auth-hero { max-width: none; }
  .auth-hero h1 { font-size: 30px; }
  .auth-hero p { font-size: 15px; }
  .auth-hero::before { margin-bottom: 18px; }
  .auth-panel { padding: 24px 20px 22px; }
  .auth-shell { padding: 20px 16px 16px; }
  .auth-shell-footer { flex-direction: column; gap: 6px; align-items: center; text-align: center; }
}

@media (max-width: 640px) {
  /* 顶栏：移动端精简版 */
  .topbar { display: none; }
  /* 吸顶交给外层 .topbar-shell，这里只负责内容排布 */
  .mobile-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 2px 10px;
  }
  .mobile-topbar .brand { font-size: 18px; }
  .mobile-topbar .brand strong { font-size: 18px; }
  .m-icon-btn {
    width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center;
    border: 1px solid var(--border); background: var(--panel); color: var(--text);
  }

  /* 底部 Tab 栏 */
  .mobile-tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: 62px; padding-bottom: env(safe-area-inset-bottom);
    background: var(--panel); border-top: 1px solid var(--border);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    box-shadow: 0 -6px 24px rgba(16,24,40,0.06);
  }
  body.watching .mobile-tabbar { display: none; }
  .m-tab {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; border: 0; background: transparent; color: var(--muted); font-size: 10.5px; font-weight: 600;
    position: relative; transition: color 0.16s;
  }
  .m-tab svg { width: 22px; height: 22px; }
  .m-tab.active { color: var(--brand); }
  .m-tab.active::after {
    content: ""; position: absolute; top: 6px; width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent); box-shadow: 0 0 8px var(--accent);
  }

  /* 首页 */
  .video-grid, .favorite-video-grid { grid-template-columns: 1fr; gap: 14px; }
  .home-heading { flex-direction: column; gap: 4px; align-items: flex-start; }
  .home-head h1.home-greeting { font-size: 22px; }
  .home-layout { gap: 18px; }
  .home-aside { flex-direction: column; }
  .category-rail { gap: 2px; }
  .category-item { min-width: 76px; padding: 10px 6px 8px; }
  .category-item .cat-icon { width: 40px; height: 40px; font-size: 20px; }
  .home-filters { padding: 14px; }
  .filter-group { flex-direction: column; gap: 8px; }
  .filter-group label { width: auto; padding-top: 0; }
  .card-title { font-size: 16px; }

  /* 播放页（对齐原站）：顶部「← 标题」→ 视频 → 单行四 Tab → 字幕。
     标题/简介/收藏/上下集全部收进抽屉，「视频信息」，默认收起，
     这样视频下方第一屏就是句子，不再被一堆元素挡在外面。 */
  body.watching .topbar-shell,
  body.watching .guest-bar { display: none; }
  body.watching .main { padding: 0 0 96px; }
  .watch-layout { gap: 0; }
  .watch-mobile-header {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 8px 12px 10px;
    position: sticky; top: 0; z-index: 25;
    background: var(--bg);
  }
  .watch-mobile-header .ghost-btn {
    max-width: 62vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    background: var(--panel); color: var(--text); border-color: var(--border);
  }
  .watch-difficulty-badge { display: inline-flex; align-items: center; gap: 2px; }
  .player-stage { border-radius: 0; border-left: 0; border-right: 0; box-shadow: none; }
  .player-frame { border-radius: 0; }

  /* 画面内字幕浮层：手机上常驻，跟随口播滚动 */
  .video-subtitle-overlay:not(.hidden) { display: flex; }

  /* 播放控制压成一条：播放键 + 时间轴 + 常用按钮 */
  .player-tools {
    display: flex; align-items: center; gap: 8px; padding: 6px 10px;
    border-top: 1px solid var(--border);
  }
  .play-toggle, .player-icon-btn { width: 36px; height: 36px; }
  .play-toggle svg, .player-icon-btn svg { width: 17px; height: 17px; }
  .watch-timeline { gap: 6px; }
  .time-readout { min-width: 30px; font-size: 11px; }
  .watch-action-buttons { gap: 6px; }
  /* 手机上藏掉全屏/循环图标（画面浮层里已有单句循环），保留倍速与字幕显示 */
  .watch-action-buttons #loopToggleBtn,
  .watch-action-buttons #fullscreenBtn { display: none; }

  /* 视频信息：收起时只是控制条右侧一颗小图标，不单独占行，字幕紧贴控制条 */
  .watch-action-buttons .video-meta-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent;
    color: var(--faint);
  }
  .watch-action-buttons .video-meta-toggle .vmt-label { display: none; }
  .video-meta-toggle svg { width: 16px; height: 16px; transition: transform 0.18s; }
  .video-meta.expanded .video-meta-toggle svg { transform: rotate(180deg); }
  /* 展开时信息区紧贴控制条下方；收起时整块高度为 0，不占位 */
  .video-meta { padding: 0; }
  .video-meta-body { display: none; padding: 12px 14px; border-top: 1px solid var(--border); }
  .video-meta.expanded .video-meta-body { display: block; }
  .watch-title-row { flex-wrap: wrap; gap: 8px; }
  .watch-title-row h1 { flex-basis: 100%; }
  .watch-title-zh { font-size: 18px; line-height: 1.3; }
  .watch-title-en { font-size: 13px; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }
  .video-stepper { margin-left: auto; }
  .video-stepper button { padding: 5px 10px; font-size: 12px; }

  /* 学习面板：紧贴视频，去掉圆角与边框外扩，Tab 一行铺满 */
  .learning-panel {
    border-radius: 0; border-left: 0; border-right: 0; box-shadow: none;
    background: var(--bg);
  }
  /* 手机端整页锁高：播放器区固定在屏幕上半部分，字幕列表自己在内部滚动。
     对齐原站 —— 字幕滚走时视频始终留在上面，不会被顶出屏幕。
     用 dvh 而非 vh：移动浏览器地址栏收起/展开时 vh 不变会导致底部被裁。 */
  /* .app-shell 是「sidebar + main」横排，不能改成 column，只锁 main 的高度。
     不要给 .main 加 display:flex —— .main > .view 的 max-width + margin-inline:auto
     会因此失位，表现为内容被挤到右半边。 */
  body.watching { height: 100dvh; overflow: hidden; }
  /* 沉浸模式的通用规则已在全局定义（见「播放页」段），这里只做窄屏覆写：
     单列排列，播放器固定在顶部、字幕面板吃掉剩余高度并在内部滚动。 */
  body.watching .main { padding: 0; }
  body.watching .main > .view.active-view { max-width: none; }
  body.watching .watch-layout {
    flex-direction: column; gap: 0; grid-template-columns: minmax(0, 1fr);
  }
  /* 播放器（含标题、画面、控制条）不参与滚动 */
  body.watching .player-column { flex: 0 0 auto; overflow: visible; }
  /* 学习面板吃掉剩余高度，字幕列表在其内部滚动 */
  body.watching .learning-panel { flex: 1 1 auto; }
  /* 面板头（练习模式 Tab）不随字幕滚走 */
  .panel-head { padding: 0 6px; background: var(--bg); flex: 0 0 auto; }
  .subtitle-practice-modes { padding: 8px 4px; gap: 4px; }
  .subtitle-practice-modes button { padding: 8px 2px; font-size: 13px; border-radius: 8px; }
  .subtitle-list { padding: 2px 10px 18px; display: flex; flex-direction: column; gap: 8px; }
  .subtitle-row {
    /* 选择器需压过通用的 .subtitle-row { padding: 10px 8px }，否则卡片内边距失效 */
    padding: 12px 12px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  }
  .subtitle-row.active { border-color: rgba(255,106,0,0.4); }
  .subtitle-text { font-size: calc(15px * var(--subtitle-size-factor)); }
  .subtitle-row .save-btn { opacity: 1; }  /* 移动端无 hover，常驻 */

  .thumb .star-btn { width: 40px; height: 40px; }
  .thumb .star-btn svg { width: 19px; height: 19px; }

  /* 其它页面 */
  .vocab-list { grid-template-columns: 1fr; }
  /* 生词本工具栏：手机上横向滚动成一行，别换行堆三排 */
  .vocab-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .vocab-filters { overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .vocab-filters::-webkit-scrollbar { display: none; }
  .vocab-filter { flex: 0 0 auto; }
  .vocab-toolbar-right {
    overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none;
    gap: 6px; padding-bottom: 2px;
  }
  .vocab-toolbar-right::-webkit-scrollbar { display: none; }
  .vocab-toolbar-right > * { flex: 0 0 auto; }
  .vocab-toolbar-right .ghost-btn { padding: 6px 11px; font-size: 12.5px; }
  .settings-card { padding: 16px; }
  .setting-row { flex-wrap: wrap; gap: 8px; }
  .history-thumb { width: 88px; height: 50px; }
  .history-progress { display: none; }
  .collection-title h1, .section-title h1 { font-size: 22px; }

  /* 登录页 */
  .auth-shell { padding: 16px 14px 14px; }
  .auth-card { gap: 18px; padding: 8px 0 0; }
  .auth-hero h1 { font-size: 26px; }
  .auth-panel { padding: 20px 16px 18px; }
  .auth-panel { padding: 22px; }
  .auth-shell-footer { flex-direction: column; gap: 8px; align-items: center; text-align: center; }

  /* 单词浮层：底部弹出 */
  .word-popover {
    left: 0 !important; right: 0; bottom: 0 !important; top: auto !important;
    width: 100%; max-width: none; border-radius: 20px 20px 0 0;
    animation: sheetUp 0.22s ease;
  }
}
@keyframes sheetUp { from { transform: translateY(100%);} to { transform: translateY(0);} }


/* ============================================================
   深蓝科技感 · 视觉精修层
   （覆盖式增强，不改变结构）
   ============================================================ */

/* 主按钮：品牌渐变 + 光晕 */
.primary-btn {
  background: var(--grad-brand);
  box-shadow: 0 8px 22px rgba(79, 109, 245, 0.35);
}
.primary-btn:hover { filter: brightness(1.06); box-shadow: 0 10px 28px rgba(79, 109, 245, 0.45); }

/* 品牌 logo 区：渐变压印 */
.brand strong {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}

/* 侧边导航激活态：青→靛蓝指示条 + 轻微发光 */
.nav-item.active::before {
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  height: 22px;
}
.nav-item.active { background: var(--orange-soft); color: var(--brand); }

/* 头像：渐变 */
.avatar { background: var(--grad-brand); box-shadow: 0 4px 14px rgba(79, 109, 245, 0.4); }

/* 卡片 hover：蓝色辉光 */
.video-card:hover {
  border-color: rgba(79, 109, 245, 0.45);
  box-shadow: 0 18px 40px rgba(79, 109, 245, 0.18);
}
.video-card .thumb::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(11, 16, 32, 0.35));
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.video-card:hover .thumb::after { opacity: 1; }

/* 角标用品牌色 */
.thumb .badge { background: var(--grad-brand); }

/* 分类图标底：冷色玻璃质感 */
.category-item .cat-icon { background: var(--orange-softer); border: 1px solid var(--border); }
.category-item.active {
  border-color: rgba(79, 109, 245, 0.4);
  box-shadow: 0 10px 26px rgba(79, 109, 245, 0.14);
}
.category-item.active .cat-icon { background: var(--orange-soft); }

/* 顶栏：毛玻璃 */
.topbar {
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
[data-theme="light"] .topbar { background: linear-gradient(180deg, rgba(244,247,252,0.92) 70%, transparent); }
[data-theme="dark"] .topbar { background: linear-gradient(180deg, rgba(11,16,32,0.86) 70%, transparent); }

/* 搜索框聚焦：蓝色描边光晕 */
.search-box:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--orange-soft), var(--shadow); }

/* 内容模式按钮激活 */
.mode-btn.active { background: var(--orange-soft); color: var(--brand); border: 1px solid rgba(79,109,245,0.3); }

/* 学习看板圆环：品牌色描边 */
.progress-ring .ring-fg { stroke: var(--brand); }

/* 收藏星星 */
.thumb .star-btn.on { color: var(--accent); }

/* 标签：冷色 */
.tag.accent { color: var(--brand); border-color: rgba(79,109,245,0.3); background: var(--orange-softer); }

/* 播放页播放键：渐变 + 光晕 */
.play-big { background: var(--grad-brand); box-shadow: 0 12px 34px rgba(79, 109, 245, 0.5); }
.play-toggle { background: var(--grad-brand); border-color: transparent; }

/* 字幕当前句：左侧青色指示 + 淡蓝底 */
.subtitle-row.active { background: var(--orange-soft); box-shadow: inset 3px 0 0 var(--accent); }

/* 进度条滑块 */
.progress-bar::-webkit-slider-thumb { background: var(--brand); box-shadow: 0 0 0 3px var(--orange-soft); }

/* 词性下划线：更清晰 */
.word.noun { border-bottom-color: var(--pos-noun); }
.word.verb { border-bottom-color: var(--pos-verb); }
.word.phrase { border-bottom-color: var(--pos-phrase); }
.word.active { background: var(--brand); color: #fff; }

/* 切换开关激活 */
.switch input:checked + span { background: var(--brand); }

/* 滚动条：细、冷色 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }
::-webkit-scrollbar-track { background: transparent; }

/* 登录页主视觉：渐变标题 */
.auth-hero h1 {
  background: var(--grad-brand);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   加载态 / 空态 / 交互细节
   ============================================================ */
.video-card.skeleton { pointer-events: none; }
.sk-block, .sk-line {
  background: linear-gradient(90deg, var(--bg-2) 25%, var(--panel-2) 37%, var(--bg-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
.video-card.skeleton .thumb.sk-block { aspect-ratio: 16/10; border-radius: 0; }
.sk-line { height: 12px; margin-bottom: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 48px 20px; }
.empty-emoji { font-size: 40px; line-height: 1; opacity: 0.8; }
.empty-state p { margin: 0; color: var(--muted); }

/* 焦点可见性（键盘无障碍） */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible) { outline: none; }

/* 按钮按压反馈 */
button:active { transform: translateY(0.5px) scale(0.99); }

/* 键盘快捷键提示 */
.kbd-hint {
  position: absolute; right: 12px; bottom: 10px; font-size: 11px; color: var(--muted);
  opacity: 0; transition: opacity 0.2s; pointer-events: none;
}
.player-stage:hover .kbd-hint { opacity: 0.7; }

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ============================================================
   会员与支付
   ============================================================ */
.nav-upgrade {
  margin-top: 8px; text-align: left; border: 0; cursor: pointer;
  padding: 14px 16px; border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--brand), #7c5cf5 55%, var(--accent, #22d3ee));
  color: #fff; box-shadow: 0 8px 22px rgba(79,109,245,.32);
  display: flex; flex-direction: column; gap: 3px;
  transition: transform .18s, box-shadow .18s;
}
.nav-upgrade:hover { transform: translateY(-1px); box-shadow: 0 12px 28px rgba(79,109,245,.42); }
.nav-upgrade-title { font-weight: 700; font-size: 14px; }
.nav-upgrade-sub { font-size: 11.5px; opacity: .85; }

.member-hero {
  display: grid; grid-template-columns: 1fr 280px; gap: 24px; align-items: center;
  padding: 32px; border-radius: var(--radius-xl); margin-bottom: 28px;
  background:
    radial-gradient(900px 320px at 8% -40%, rgba(124,92,245,.35), transparent 60%),
    radial-gradient(700px 300px at 92% 140%, rgba(34,211,238,.25), transparent 60%),
    linear-gradient(135deg, #101a3a, #17235a 60%, #1b2f66);
  color: #eef2ff; overflow: hidden; position: relative;
}
.member-hero::after {
  content: ""; position: absolute; inset: -40% -10% auto auto; width: 420px; height: 420px;
  background: radial-gradient(circle, rgba(255,255,255,.13), transparent 62%); pointer-events: none;
}
.member-eyebrow {
  display: inline-block; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  color: #a9b8ff; font-weight: 600; margin-bottom: 10px;
}
.member-hero-copy h1 { margin: 0 0 10px; font-size: 30px; line-height: 1.25; letter-spacing: -.02em; }
.member-hero-copy p { margin: 0; color: #b8c2e8; font-size: 14px; max-width: 46ch; line-height: 1.7; }
.member-status-card {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius-lg); padding: 18px; backdrop-filter: blur(8px);
}
.member-chip {
  display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  background: rgba(34,211,238,.18); color: #7ee7f8; margin-bottom: 10px;
}
.member-chip.dim { background: rgba(255,255,255,.12); color: #d7deff; }
.member-status-card strong { display: block; font-size: 17px; margin-bottom: 4px; }
.member-status-card p { margin: 0; font-size: 12.5px; color: #a9b3d8; }

.member-section-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 14px; }
.member-section-head h2 { margin: 0; font-size: 18px; }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.plan-grid-loading { grid-column: 1 / -1; }
.plan-card {
  position: relative; padding: 24px 22px; border-radius: var(--radius-xl);
  background: var(--panel); border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 6px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.plan-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.plan-card.featured { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand), var(--shadow-lg); }
.plan-badge {
  position: absolute; top: -10px; right: 18px; padding: 3px 12px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), #7c5cf5);
}
.plan-card h3 { margin: 0; font-size: 15px; color: var(--muted); font-weight: 600; }
.plan-price { display: flex; align-items: baseline; gap: 3px; color: var(--text); }
.plan-price .cur { font-size: 17px; font-weight: 600; }
.plan-price strong { font-size: 38px; letter-spacing: -.03em; line-height: 1.1; }
.plan-desc { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); min-height: 18px; }
.plan-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.plan-meta em { font-style: normal; color: #12b981; font-weight: 700; background: rgba(18,185,129,.12); padding: 1px 8px; border-radius: 999px; }
.plan-buy {
  margin-top: 14px; width: 100%; padding: 12px; border-radius: var(--radius-md); border: 0; cursor: pointer;
  font-size: 14.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), #6a5cf5);
  transition: filter .18s, transform .18s;
}
.plan-buy:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.plan-buy:disabled { background: var(--bg-2); color: var(--muted); cursor: not-allowed; }

.member-benefits { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-bottom: 32px; }
.benefit { display: flex; gap: 14px; padding: 16px 18px; border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--border); }
.benefit-icon { width: 38px; height: 38px; flex: none; border-radius: 11px; display: grid; place-items: center; background: var(--orange-soft); color: var(--brand); }
.benefit-icon svg { width: 19px; height: 19px; }
.benefit strong { display: block; font-size: 14px; margin-bottom: 3px; }
.benefit p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.6; }

.member-orders { padding: 22px; border-radius: var(--radius-xl); background: var(--panel); border: 1px solid var(--border); }
.member-orders h2 { margin: 0 0 14px; font-size: 16px; }
.order-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--border); }
.order-row:first-child { border-top: 0; }
.order-main { display: flex; flex-direction: column; gap: 2px; }
.order-main strong { font-size: 13.5px; }
.order-main .muted { font-size: 11.5px; }
.order-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.order-status { font-size: 11.5px; font-weight: 700; padding: 2px 9px; border-radius: 999px; }
.order-status.paid { color: #0f8a68; background: rgba(22,163,123,.12); }
.order-status.pending { color: #b25e00; background: rgba(234,138,25,.14); }
.order-status.closed, .order-status.refunded { color: var(--muted); background: var(--bg-2); }

/* 支付弹层 */
.pay-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 16, 36, .55); backdrop-filter: blur(4px); }
.pay-modal-card {
  position: relative; width: min(420px, 100%); padding: 28px; border-radius: var(--radius-xl);
  background: var(--panel); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: payModalIn .22s cubic-bezier(.2,.9,.3,1.2);
  max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
}
@keyframes payModalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.pay-modal-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; cursor: pointer; background: var(--bg-2); color: var(--text); font-size: 18px; line-height: 1; }
.pay-modal h2 { margin: 0 0 18px; font-size: 19px; }
.pay-summary { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pay-summary > div { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.pay-summary strong { color: var(--text); }
.pay-total { padding-top: 12px; border-top: 1px dashed var(--border); }
.pay-total strong { font-size: 22px; color: var(--brand); }
.pay-confirm { width: 100%; }
.pay-modal-card > .primary-btn { width: 100%; }
.pay-hint { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; text-align: center; }
.pay-success-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px;
  background: rgba(18,185,129,.14); color: #12b981; font-size: 26px; font-weight: 700;
}
.pay-success-desc { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.65; }
.invite-code-box { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-2); margin-bottom: 6px; }
.invite-code-box code { flex: 1; font-size: 17px; letter-spacing: .16em; font-weight: 700; }

@media (max-width: 900px) {
  .member-hero { grid-template-columns: 1fr; padding: 24px; }
  .member-hero-copy h1 { font-size: 24px; }
  .plan-grid { grid-template-columns: 1fr; }
  .member-benefits { grid-template-columns: 1fr; }
}

/* 设置页会员入口（移动端主要入口） */
.settings-membership {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  text-align: left; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--border);
  transition: border-color .18s, transform .18s;
}
.settings-membership:hover { border-color: var(--brand); transform: translateY(-1px); }
.settings-membership strong { display: block; font-size: 14px; margin-bottom: 3px; }
.settings-membership span { font-size: 12.5px; color: var(--muted); }
.settings-arrow { font-size: 22px; color: var(--faint); flex: none; }

/* 引流收款：微信号展示 */
.contact-box {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 22px 20px; border-radius: var(--radius-lg); background: var(--bg-2);
  border: 1px solid var(--border); margin-bottom: 16px;
}
.contact-label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.contact-id-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px 10px 18px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--border-strong);
}
.contact-wechat {
  font-size: 21px; letter-spacing: .02em; font-weight: 700; color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  user-select: all; -webkit-user-select: all;
}
.contact-copy {
  border: 0; border-radius: 999px; padding: 7px 16px; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), #6a5cf5);
  transition: filter .16s;
}
.contact-copy:hover { filter: brightness(1.08); }
.contact-copy:active { transform: scale(.96); }
.contact-note { margin: 2px 0 0; font-size: 12.5px; color: var(--muted); text-align: center; line-height: 1.6; max-width: 30ch; }

/* 支付弹层 */
.pay-modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 20px;
  background: rgba(10, 16, 36, .55); backdrop-filter: blur(4px); }
.pay-modal-card {
  position: relative; width: min(420px, 100%); padding: 28px; border-radius: var(--radius-xl);
  background: var(--panel); box-shadow: var(--shadow-lg); border: 1px solid var(--border);
  animation: payModalIn .22s cubic-bezier(.2,.9,.3,1.2);
  max-height: calc(100dvh - 40px); overflow-y: auto; overscroll-behavior: contain;
}
@keyframes payModalIn { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.pay-modal-close { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  border: 0; cursor: pointer; background: var(--bg-2); color: var(--text); font-size: 18px; line-height: 1; }
.pay-modal h2 { margin: 0 0 18px; font-size: 19px; }
.pay-summary { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.pay-summary > div { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--muted); }
.pay-summary strong { color: var(--text); }
.pay-total { padding-top: 12px; border-top: 1px dashed var(--border); }
.pay-total strong { font-size: 22px; color: var(--brand); }
.pay-confirm { width: 100%; }
.pay-modal-card > .primary-btn { width: 100%; }
.pay-hint { margin: 12px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.6; text-align: center; }
.pay-success-icon {
  width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px;
  background: rgba(18,185,129,.14); color: #12b981; font-size: 26px; font-weight: 700;
}
.pay-success-desc { margin: 0 0 18px; font-size: 13.5px; color: var(--muted); text-align: center; line-height: 1.65; }
.invite-code-box { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--bg-2); margin-bottom: 6px; }
.invite-code-box code { flex: 1; font-size: 17px; letter-spacing: .16em; font-weight: 700; }

@media (max-width: 900px) {
  .member-hero { grid-template-columns: 1fr; padding: 24px; }
  .member-hero-copy h1 { font-size: 24px; }
  .plan-grid { grid-template-columns: 1fr; }
  .member-benefits { grid-template-columns: 1fr; }
}

/* 设置页会员入口（移动端主要入口） */
.settings-membership {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px;
  text-align: left; cursor: pointer; font: inherit; color: inherit; border: 1px solid var(--border);
  transition: border-color .18s, transform .18s;
}
.settings-membership:hover { border-color: var(--brand); transform: translateY(-1px); }
.settings-membership strong { display: block; font-size: 14px; margin-bottom: 3px; }
.settings-membership span { font-size: 12.5px; color: var(--muted); }
.settings-arrow { font-size: 22px; color: var(--faint); flex: none; }


/* ============================================================
   iOS 兼容
   iOS 中字号小于 16px 的输入框在聚焦时会强制放大整页，
   这里在移动端统一提到 16px，桌面端保持原样。
   ============================================================ */
@media (max-width: 900px), (pointer: coarse) {
  input, select, textarea { font-size: 16px !important; }
  /* 范围滑块等非文本控件不需要放大，保持视觉紧凑 */
  input[type="range"], input[type="checkbox"], input[type="radio"] { font-size: inherit !important; }
}

/* 支持刘海屏/灵动岛的安全区 */
@supports (padding: env(safe-area-inset-bottom)) {
  @media (max-width: 640px) {
    .main { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
    .mobile-topbar { padding-top: env(safe-area-inset-top); }
  }
}

/* 添加到主屏幕引导 */
.install-steps {
  margin: 0 0 18px; padding-left: 22px; font-size: 13.5px; line-height: 1.9;
  color: var(--muted);
}
.install-steps strong { color: var(--text); }
.install-steps li { margin-bottom: 6px; padding-left: 2px; }
.install-steps li::marker { color: var(--orange); font-weight: 800; }
.install-then {
  margin: 14px 0 10px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 13px; font-weight: 800; color: var(--text);
}
.install-icon {
  display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; background: var(--bg-2); font-size: 12px; margin-left: 4px;
  vertical-align: middle;
}

/* ============================================================
   微信 / QQ 内置浏览器（X5 / WKWebView）
   ============================================================ */

/* 1. 关闭点击高亮与长按选中，避免微信里点按钮出现灰色方块 */
* { -webkit-tap-highlight-color: transparent; }
.subtitle-line, .video-card { -webkit-touch-callout: none; }

/* 2. 微信里双击会放大页面，锁定为仅支持滚动缩放 */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* 3. 输入框在微信中聚焦时页面会被顶起，禁用滚动链式传递 */
body { overscroll-behavior-y: contain; }

/* 4. 安全区：微信全屏模式下顶部状态栏会遮挡内容 */
@supports (padding: env(safe-area-inset-top)) {
  @media (max-width: 640px) {
    .mobile-topbar { padding-top: max(14px, env(safe-area-inset-top)); }
  }
}

/* 5. X5 内核不支持部分较新的 CSS 语法时，保证核心布局仍然成立 */
@supports not (display: grid) {
  .plan-grid, .member-benefits, .stat-grid { display: flex; flex-wrap: wrap; gap: 16px; }
  .plan-card, .benefit, .stat-card { flex: 1 1 240px; }
}

/* 播放缓冲中：独立 DOM 元素显示转圈（不用 :has()::after，兼容性更稳） */
.player-buffering-spinner {
  position: absolute; left: 50%; top: 50%; z-index: 6;
  width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%;
  border: 3px solid rgba(255,255,255,0.25); border-top-color: #fff;
  animation: spin 0.9s linear infinite; pointer-events: none;
}
.player-buffering-spinner.hidden { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 会员已到期的提示态（区别于「未开通」） */
.member-chip.warn { background: rgba(234,138,25,.2); color: #ffc97a; }

/* 密码框：右侧小眼睛切换明文（登录 / 注册 / 后台共用） */
.pwd-field { position: relative; display: flex; align-items: center; }
.pwd-field > input { width: 100%; padding-right: 46px; }
.pwd-eye {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 8px; cursor: pointer;
  color: var(--muted, #6b7183); -webkit-tap-highlight-color: transparent; transition: color .15s, background .15s;
}
.pwd-eye:hover { background: rgba(0, 0, 0, .05); color: var(--text, #1f2430); }
.pwd-eye:focus-visible { outline: 2px solid var(--orange, #4f6df5); outline-offset: 1px; }
.pwd-eye-icon { width: 18px; height: 18px; display: block; }
.pwd-eye-icon svg { width: 18px; height: 18px; display: block; }
/* 明文状态下图标带一道斜线，暗示「再点一次隐藏」 */
.pwd-eye[aria-pressed="true"] { color: var(--orange, #4f6df5); }

/* ---------------- 试看模式 ---------------- */
.guest-bar {
  /* 吸顶由外层 .topbar-shell 统一负责，这里不能再 sticky，否则会脱离文档流叠到页顶 */
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 16px; flex-wrap: wrap;
  margin: 0 0 14px; padding: 10px 16px; border-radius: 12px;
  background: linear-gradient(90deg, rgba(255, 114, 0, .16), rgba(255, 138, 36, .08));
  border: 1px solid rgba(255, 114, 0, .32); color: var(--text); font-size: 13.5px; font-weight: 600;
}
.guest-bar-btn {
  height: 32px; padding: 0 14px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--grad-brand); color: #fff; font-size: 13px; font-weight: 700;
}
body.guest-mode .logout-btn,
body.guest-mode #logoutBtn .avatar { opacity: .8; }

/* 登录引导弹窗：宽一些，左右分栏（去掉通用弹窗的内边距） */
.pay-modal-card:has(.login-prompt) {
  width: min(880px, 100%); padding: 0; overflow: hidden;
}
.login-prompt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .92fr); }
.pay-modal-card:has(.login-prompt) .pay-modal-close {
  top: 12px; right: 12px; z-index: 2; background: rgba(0,0,0,.5); color: #fff;
}
.login-prompt { text-align: left; }
.login-prompt-hero {
  padding: 40px 36px; display: flex; flex-direction: column; justify-content: center;
  background: radial-gradient(520px 260px at 20% 0%, rgba(255, 114, 0, .22), transparent 62%),
              linear-gradient(160deg, #fff5ec 0%, #fde9d8 100%);
  color: #2b2018;
}
html[data-theme="dark"] .login-prompt-hero { background: radial-gradient(520px 260px at 20% 0%, rgba(255, 114, 0, .26), transparent 62%), linear-gradient(160deg, #1a1310, #120e0b); color: var(--text); }
.login-prompt-brand { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 26px; }
.login-prompt-hero h2 { margin: 0 0 14px; font-size: 34px; line-height: 1.18; letter-spacing: -0.04em; font-weight: 900; }
.login-prompt-hero h2 em { font-style: normal; color: var(--orange); }
.login-prompt-hero p { margin: 0; font-size: 14px; opacity: .8; }
.login-prompt-body { padding: 30px 26px; display: flex; flex-direction: column; gap: 12px; }
.login-prompt-eyebrow { font-size: 12px; font-weight: 800; color: var(--orange); letter-spacing: .04em; }
.login-prompt-body h3 { margin: 0; font-size: 24px; letter-spacing: -0.03em; }
.login-prompt-body .muted { margin: 0 0 6px; font-size: 13px; }
.login-prompt-back { height: 46px; border-radius: 12px; }
.login-prompt-new {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 8px;
  padding: 14px 16px; border-radius: 14px; border: 1px solid rgba(255, 114, 0, .28);
  background: rgba(255, 114, 0, .07); text-decoration: none;
}
.login-prompt-new span { display: flex; flex-direction: column; gap: 2px; }
.login-prompt-new strong { font-size: 13px; color: var(--orange); }
.login-prompt-new em { font-style: normal; font-size: 13.5px; font-weight: 700; color: var(--text); }
.login-prompt-new b { color: var(--orange); font-size: 13px; }

/* 窄屏：列定义在 .login-prompt 子元素上，改它才生效；
   卡片限高并允许内部滚动，避免内容超出视口被裁掉 */
@media (max-width: 760px) {
  .pay-modal-card:has(.login-prompt) {
    width: min(460px, 100%); max-height: calc(100dvh - 32px); overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .login-prompt { grid-template-columns: minmax(0, 1fr); }
  .login-prompt-hero { padding: 24px 22px; }
  .login-prompt-hero h2 { font-size: 26px; }
  .login-prompt-brand { margin-bottom: 14px; }
  .login-prompt-body { padding: 22px 20px; }
  .login-prompt-body h3 { font-size: 20px; }
}

/* ---------------- 跟读练习（对齐原站 follow-along） ---------------- */
.follow-along-panel {
  margin: 8px 0 0; padding: 12px 14px; border-radius: var(--radius-md);
  background: var(--orange-softer); border: 1px solid rgba(255,106,0,0.22);
  display: flex; flex-direction: column; gap: 8px;
}
.follow-along-panel.hidden { display: none; }
.subtitle-row.follow-row-active { background: var(--orange-soft); }
.follow-card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.follow-card-title { display: flex; align-items: center; gap: 6px; font-weight: 700; color: var(--orange); font-size: 13px; }
.follow-help-toggle {
  width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--orange); background: transparent;
  color: var(--orange); font-size: 11px; font-weight: 700; line-height: 1; display: grid; place-items: center; cursor: pointer;
}
.follow-help-content { font-size: 12px; line-height: 1.6; color: var(--muted); background: var(--panel); border-radius: var(--radius-sm); padding: 10px 12px; }
.follow-help-content.hidden { display: none; }
.follow-help-content p { margin: 0 0 6px; }
.follow-help-content p:last-child { margin-bottom: 0; }
.follow-recognition-line { font-size: 13.5px; line-height: 1.7; color: var(--text); }
.follow-recognition-label { font-size: 11px; font-weight: 700; color: var(--faint); margin-right: 6px; }
.follow-word-mismatch { color: #e5484d; font-weight: 600; }
.follow-word-extra { color: #e5484d; text-decoration: underline; }
.follow-word-omission { display: inline-block; width: 26px; height: 2px; background: #e5484d; vertical-align: middle; margin: 0 2px; }
.follow-unrecognized-text { color: var(--faint); }
.follow-model-note { font-size: 11.5px; color: var(--faint); margin: 0; line-height: 1.5; }
.follow-model-progress { height: 4px; border-radius: 999px; background: var(--border); overflow: hidden; }
.follow-model-progress span { display: block; height: 100%; background: var(--orange); transition: width 0.2s; }
.follow-phase-note { font-size: 12px; color: var(--orange); margin: 0; font-weight: 600; }
.follow-save-note { font-size: 11.5px; color: var(--faint); margin: 0; }
.follow-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.follow-button {
  flex: 1; min-width: 110px; padding: 9px 14px; border-radius: 999px; border: 1px solid var(--orange);
  background: var(--orange); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; transition: 0.16s;
}
.follow-button:hover:not(:disabled) { filter: brightness(1.06); }
.follow-button:disabled { opacity: 0.6; cursor: default; }
.follow-button-secondary { background: var(--panel); color: var(--orange); }
.follow-button-danger { background: #e5484d; border-color: #e5484d; }
.follow-processing-feedback { display: flex; flex-direction: column; gap: 8px; }
.follow-processing-spinner {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255,106,0,0.25); border-top-color: var(--orange);
  animation: spin 0.8s linear infinite; vertical-align: middle; margin: 0 6px;
}
.follow-processing-stages { display: flex; gap: 10px; font-size: 11px; color: var(--faint); }
.follow-processing-stage.is-complete { color: var(--orange); }
.follow-processing-stage.is-current { color: var(--text); font-weight: 700; }

/* 跟读时：面板所在行改为纵向堆叠，面板独占整行宽度（避免挤压英文列） */
.subtitle-row.follow-row-active { display: block; }
.subtitle-row.follow-row-active > .subtitle-text { width: 100%; }
.subtitle-row.follow-row-active .follow-along-panel { margin-top: 10px; }
.subtitle-row.follow-row-active .save-btn { position: absolute; top: 8px; right: 8px; }
