:root {
  --bg: #F1F1F1;
  --bg-elevated: #FFFFFF;
  --bg-soft: #E7E7E5;
  --text: #1B1B1B;
  --text-muted: #6B6B6B;
  --text-faint: #9A9A9A;
  --border: rgba(27, 27, 27, 0.08);
  --border-strong: rgba(27, 27, 27, 0.14);
  --accent: #F97316;
  --accent-soft: rgba(249, 115, 22, 0.12);
  --sage: #16A34A;
  --sage-soft: rgba(34, 197, 94, 0.12);
  --amber: #D97706;
  --amber-soft: rgba(245, 158, 11, 0.14);
  --navy: #1F4E79;
  --word-flash: #22C55E;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.14);
  --radius: 18px;
  --radius-sm: 12px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-serif: "Iowan Old Style", "New York", "Georgia", "Songti SC", serif;
}

[data-theme="dark"] {
  --bg: #131312;
  --bg-elevated: #1C1B19;
  --bg-soft: #262421;
  --text: #F4F1EA;
  --text-muted: #A9A396;
  --text-faint: #757066;
  --border: rgba(244, 241, 234, 0.09);
  --border-strong: rgba(244, 241, 234, 0.18);
  --accent: #E87450;
  --accent-soft: rgba(232, 116, 80, 0.16);
  --sage: #48B38E;
  --sage-soft: rgba(72, 179, 142, 0.16);
  --amber: #E5A94C;
  --amber-soft: rgba(229, 169, 76, 0.16);
  --word-flash: #FDE047;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: clip;
  transition: background 0.25s ease, color 0.25s ease;
}

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

/* Top Navbar */
.navbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #D95D39, #B93E1E);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 16px;
  box-shadow: 0 4px 12px rgba(217, 93, 57, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 750;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.nav-pills {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--border);
}

.nav-pill {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--text-muted);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-pill:hover { color: var(--text); }
.nav-pill.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-ghost {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  background: var(--bg-elevated);
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.btn-primary {
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(135deg, #D95D39, #C44724);
  box-shadow: 0 4px 14px rgba(217, 93, 57, 0.28);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(217, 93, 57, 0.36);
}

.icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: all 0.18s ease;
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 28px 64px;
}

/* Continue Learning Widget (1:1 Screenshot Clean Card + Emerald Progress Bar) */
.continue-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 22px 26px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.continue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.continue-title {
  font-size: 20px;
  font-weight: 750;
  color: var(--text);
  letter-spacing: -0.01em;
}
.continue-stats {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.dashboard-link {
  color: #10B981;
  font-weight: 650;
  font-size: 13.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s ease;
}
.dashboard-link:hover { opacity: 0.78; }

.continue-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 720px) {
  .continue-grid { grid-template-columns: minmax(0, 1fr); }
}

.continue-item {
  background: color-mix(in srgb, var(--bg) 70%, var(--bg-elevated));
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 18px 15px;
  cursor: pointer;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}
.continue-item:hover {
  border-color: rgba(16, 185, 129, 0.45);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.08);
  transform: translateY(-1px);
}
.continue-item-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  min-width: 0;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.continue-item-meta {
  font-size: 13px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.continue-bar-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-soft);
  overflow: hidden;
  margin-top: 4px;
}
.continue-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: #10B981;
  transition: width 0.35s ease;
}

/* Study Dashboard Modal */
.dash-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 20px;
}
@media (max-width: 640px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
.dash-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  text-align: center;
}
.dash-kpi-val {
  font-size: 26px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.dash-kpi-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.week-bars {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  align-items: end;
  height: 110px;
  padding: 14px 16px 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  margin-bottom: 18px;
}
.week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  height: 100%;
  justify-content: flex-end;
}
.week-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 6px 6px 2px 2px;
  background: rgba(16, 185, 129, 0.25);
  transition: height 0.3s ease;
}
.week-bar.today { background: #10B981; }
.week-lbl { font-size: 11px; color: var(--text-muted); }

/* Hero Banner on Home */
.hero-banner {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 32px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.hero-left { max-width: 680px; }

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 650;
  margin-bottom: 12px;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-bottom: 8px;
}

.hero-desc {
  color: var(--text-muted);
  font-size: 14.5px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

.compare-hint {
  font-size: 12px;
  color: var(--text-muted);
}

/* Filter Row */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.filter-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.chip {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  transition: all 0.18s ease;
}
.chip:hover { color: var(--text); border-color: var(--border-strong); }
.chip.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 15px;
  min-width: 240px;
}
.search-box input {
  border: none;
  outline: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  width: 100%;
}

/* Section Label */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-sub {
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Featured Sample Grid (2 Large Side-by-Side Comparison Cards) */
.featured-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 34px;
}

.episode-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  overflow: hidden;
  min-width: 0;
  max-width: 100%;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.25s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.episode-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #1a1918;
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.episode-card:hover .card-media img { transform: scale(1.04); }

.card-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.22) 0%, rgba(0,0,0,0) 40%, rgba(0,0,0,0.62) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}

.card-top-badges {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.style-pill {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  backdrop-filter: blur(10px);
  background: rgba(20, 19, 18, 0.72);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
}

.style-pill.editorial {
  background: rgba(248, 246, 241, 0.92);
  color: #1B1A18;
  border-color: rgba(27, 26, 24, 0.14);
}

.duration-pill {
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(0,0,0,0.65);
  color: #fff;
  font-size: 11.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.card-bottom-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.level-dot {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}
.level-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #F4B942;
}
.level-dot.sage::before { background: #4CC38A; }

.play-cta-mini {
  background: #fff;
  color: #1B1A18;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.card-body {
  padding: 18px 20px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-title {
  font-size: 17px;
  font-weight: 720;
  line-height: 1.35;
}
.card-entitle {
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}
.card-summary {
  font-size: 13px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.tag-soft {
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 550;
}

.card-cost-strip {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  font-size: 11.5px;
  color: var(--sage);
  font-weight: 600;
}

/* Preview Grid (4 smaller cards) */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.preview-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  opacity: 0.9;
  transition: all 0.2s ease;
  cursor: pointer;
}
.preview-card:hover { opacity: 1; transform: translateY(-2px); box-shadow: var(--shadow-sm); }
.preview-card .card-media { aspect-ratio: 16 / 10; }
.preview-card .card-body { padding: 12px 14px; }
.preview-card .card-title { font-size: 14px; }

/* ===================== PLAYER / STUDIO VIEW ===================== */
.studio-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  gap: 12px;
  flex-wrap: wrap;
}

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
}
.back-btn:hover { color: var(--text); border-color: var(--border-strong); }

.style-switcher-banner {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  overflow-x: auto;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 999px;
}
.style-switcher-banner::-webkit-scrollbar {
  display: none;
}
.switch-opt {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}
.switch-opt.active {
  background: var(--accent);
  color: #fff;
}

.studio-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 24px;
  align-items: start;
  transition: grid-template-columns 0.25s ease;
}
.studio-layout.wide-mode {
  grid-template-columns: 1.32fr 0.68fr;
}

/* Blind Listening Subtitle Blur (Enjoy Speak subtitleBlur feature) */
.stage-bottom-hud.blur-subs .cinema-sub-en,
.stage-bottom-hud.blur-subs .cinema-sub-zh {
  filter: blur(8px);
  opacity: 0.72;
  transition: filter 0.2s ease, opacity 0.2s ease;
  user-select: none;
  cursor: pointer;
}
.stage-bottom-hud.blur-subs:hover .cinema-sub-en,
.stage-bottom-hud.blur-subs:hover .cinema-sub-zh {
  filter: blur(0px);
  opacity: 1;
}

/* Enjoy Speak Settings Popover */
.settings-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.settings-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 320px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 16px 18px;
  z-index: 60;
  display: none;
  flex-direction: column;
  gap: 14px;
  text-align: left;
}
.settings-popover.open {
  display: flex;
}
.set-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.set-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.set-title {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--text);
}
.set-desc {
  font-size: 11.5px;
  color: var(--text-muted);
}
.toggle-switch {
  width: 40px;
  height: 22px;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border-strong);
  position: relative;
  flex-shrink: 0;
  transition: background 0.18s ease, border-color 0.18s ease;
}
.toggle-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.18s ease;
}
.toggle-switch.on {
  background: var(--accent);
  border-color: var(--accent);
}
.toggle-switch.on::after {
  transform: translateX(18px);
}
.speed-grid-6 {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 3px;
  background: var(--bg-soft);
  padding: 3px;
  border-radius: 999px;
}
.speed-opt {
  padding: 5px 0;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}
.speed-opt.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.color-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}
.color-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid transparent;
  transition: transform 0.15s ease;
}
.color-dot:hover { transform: scale(1.12); }
.color-dot.active {
  border-color: var(--text);
  box-shadow: 0 0 0 2px var(--bg-elevated) inset;
}

/* Left Visual Stage */
.stage-column {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.stage-theater-wrap {
  position: relative;
  width: 100%;
}
.stage-theater-wrap.is-portrait-wrap {
  width: min(100%, 384px);
  margin: 0 auto;
}

.stage-frame {
  position: relative;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  overflow: hidden;
  background: #141312;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.stage-frame.editorial-frame {
  background: #F6F1E6;
  border: 2px solid rgba(27, 26, 24, 0.12);
}

.stage-frame.portrait-frame {
  aspect-ratio: 9 / 16;
  max-height: 680px;
  width: min(100%, 384px);
  margin: 0 auto;
  background: #0e0e10;
}
/* Clean-video episodes (Ep.15/10/09): keep top graphics & whiteboard 100% clear, place compact toggleable subs neatly at very bottom edge */
.stage-frame.clean-video-frame .stage-top-hud,
.stage-frame.clean-video-frame .speaker-wave-row,
.stage-frame.clean-video-frame .stage-bottom-hud {
  display: none !important;
}
.stage-frame.clean-video-frame .stage-vignette {
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 76%, rgba(0,0,0,0.78) 100%);
}
.stage-frame.clean-video-frame .stage-bottom-hud {
  left: 12px;
  right: 12px;
  bottom: 8px;
  gap: 2px;
  text-align: center;
}
.stage-frame.clean-video-frame .cinema-sub-en {
  font-size: clamp(11px, 3.6cqi, 14px);
  line-height: 1.28;
}
.stage-frame.clean-video-frame .cinema-sub-zh {
  font-size: clamp(9.5px, 2.8cqi, 11.5px);
  line-height: 1.25;
}
.stage-frame.portrait-frame .cinema-sub-en {
  font-size: clamp(11px, 3.6cqi, 14.5px);
  line-height: 1.3;
}
.stage-frame.portrait-frame .cinema-sub-zh {
  font-size: clamp(9.5px, 2.8cqi, 11.8px);
  line-height: 1.28;
}
.stage-frame.video-subs-hidden .stage-vignette,
.stage-frame.video-subs-hidden .stage-top-hud,
.stage-frame.video-subs-hidden .stage-bottom-hud {
  display: none !important;
}
.stage-frame.clean-video-frame .stage-video {
  object-fit: contain;
}
/* Floating 1-tap CC subtitle toggle pill on video corner (works in portrait & landscape) */
.stage-sub-toggle-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 8;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(16, 15, 14, 0.56);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.94);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.18s ease, opacity 0.18s ease;
}
.stage-sub-toggle-btn:hover {
  background: rgba(16, 15, 14, 0.8);
}
.stage-sub-toggle-btn:not(.on) {
  background: rgba(16, 15, 14, 0.42);
  color: rgba(255, 255, 255, 0.72);
}

.stage-img,
.stage-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.65s ease;
}
.stage-img {
  transform: scale(1.03);
}
.stage-img.active {
  opacity: 1;
  animation: kenBurns 18s ease-in-out infinite alternate;
}
.stage-video.active {
  opacity: 1;
}
.stage-frame { cursor: pointer; }

@keyframes kenBurns {
  0% { transform: scale(1.0) translate(0%, 0%); }
  100% { transform: scale(1.09) translate(-1.5%, -1%); }
}

.stage-frame.editorial-frame .stage-img.active {
  animation: gentleFloat 14s ease-in-out infinite alternate;
}
@keyframes gentleFloat {
  0% { transform: scale(1.0) translateY(0%); }
  100% { transform: scale(1.04) translateY(-1%); }
}

/* Subtle cinema vignette + subtitle overlay */
.stage-vignette {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.28) 0%, rgba(0,0,0,0) 32%, rgba(0,0,0,0.12) 60%, rgba(0,0,0,0.82) 100%);
  pointer-events: none;
}

.stage-top-hud {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 102px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 2;
}

.scene-caption-pill {
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(16, 15, 14, 0.62);
  backdrop-filter: blur(10px);
  color: rgba(255, 255, 255, 0.92);
  font-size: 11.5px;
  font-weight: 550;
  letter-spacing: 0.02em;
}

.scene-dots {
  display: flex;
  gap: 6px;
}
.scene-dot {
  width: 20px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255,255,255,0.35);
  transition: all 0.25s ease;
  cursor: pointer;
}
.scene-dot.active {
  width: 34px;
  background: #fff;
}

/* Cinema Subtitle & Live Waveform Overlay */
.stage-bottom-hud {
  position: absolute;
  container-type: inline-size;
  container-name: stage;
  left: 18px;
  right: 18px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.speaker-wave-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.speaker-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.16);
  backdrop-filter: blur(10px);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
}
.speaker-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.wave-canvas {
  width: 140px;
  height: 24px;
}

.cinema-sub-en {
  color: #fff;
  font-size: clamp(12px, 3.0cqi, 18.5px);
  font-weight: 650;
  line-height: 1.35;
  text-shadow: 0 2px 10px rgba(0,0,0,0.78);
}
.cinema-sub-zh {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(10.5px, 2.2cqi, 13.5px);
  line-height: 1.32;
  text-shadow: 0 1px 6px rgba(0,0,0,0.75);
}

/* Controls Deck */
.controls-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.progress-track {
  flex: 1;
  height: 6px;
  border-radius: 99px;
  background: var(--bg-soft);
  overflow: hidden;
  cursor: pointer;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 99px;
  width: 0%;
  transition: width 0.2s linear;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.ctrl-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.play-main-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--text);
  color: var(--bg);
  display: grid;
  place-items: center;
  font-size: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.play-main-btn:hover { transform: scale(1.06); }

.ctrl-pill {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.18s ease;
}
.ctrl-pill:hover { color: var(--text); border-color: var(--border-strong); }
.ctrl-pill.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: var(--accent);
}

/* Info Box under Stage */
.episode-brief-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}
.brief-title { font-size: 15.5px; font-weight: 700; margin-bottom: 6px; }
.brief-desc { font-size: 13px; color: var(--text-muted); margin-bottom: 10px; }
.linking-box {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.linking-label { font-weight: 700; color: var(--accent); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.04em; }

/* Right Panel: Borderless Floating Layout (1:1 Enjoy Speak Zen Style) */
.right-panel {
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  overflow: visible;
  min-height: 640px;
}

.panel-tabs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 0 0 14px;
  border-bottom: none;
}

.main-tabs {
  display: inline-flex;
  gap: 4px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
}

.main-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.15s ease;
}
.main-tab.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.sub-mode-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-soft);
  padding: 4px;
  border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}
.sub-mode-btn {
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 550;
  color: var(--text-muted);
  border: none;
  transition: all 0.15s ease;
}
.sub-mode-btn:hover { color: var(--text); }
.sub-mode-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

/* Transcript List — 1:1 Enjoy Speak Silky Smooth Transition + Top/Bottom Soft Fade Mask */
.transcript-scroll {
  position: relative;
  padding: 20px 8px 64px 2px;
  max-height: calc(100vh - 15rem);
  min-height: 520px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 5%, #000 90%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0%, #000 5%, #000 90%, transparent 100%);
}

.line-card {
  display: block;
  width: 100%;
  padding: 16px 20px;
  border-radius: 22px;
  border: 1.5px solid transparent;
  background: transparent;
  text-align: left;
  transition: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
}
.line-card:hover {
  background: var(--bg-elevated);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.line-card.active {
  background: #FEF3C7;
  border-color: transparent;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
}
[data-theme="dark"] .line-card.active {
  background: rgba(254, 243, 199, 0.12);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.line-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}
.line-meta-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.line-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-faint);
  transition: color 0.15s ease;
}
.line-card.active .line-time {
  color: #EA580C;
  opacity: 0.78;
}
[data-theme="dark"] .line-card.active .line-time {
  color: #FDBA74;
}
.line-speaker {
  font-weight: 550;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  opacity: 0.85;
}
.line-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.line-num {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-faint);
  min-width: 18px;
  text-align: right;
  transition: color 0.15s ease;
}
.line-card.active .line-num {
  color: #EA580C;
  opacity: 0.78;
}
.mini-action {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.line-card:hover .mini-action,
.line-card.active .mini-action { opacity: 1; }
.mini-action:hover { color: var(--accent); border-color: var(--accent); }

.line-en {
  font-size: 16px;
  font-weight: 500;
  line-height: 1.75;
  color: #1B1B1B;
  margin-bottom: 6px;
}
[data-theme="dark"] .line-en {
  color: var(--text);
}
.line-zh {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Instant millisecond-locked word-flash animation (crisp attack at 8%, smooth liquid fade) */
@keyframes subtitle-word-flash {
  0% {
    background-color: transparent;
  }
  8% {
    background-color: color-mix(in srgb, var(--word-flash) 52%, transparent);
  }
  100% {
    background-color: transparent;
  }
}

.kw {
  display: inline;
  border-radius: 4px;
  padding: 1px 1px;
}
.kw.animate-subtitle-word-flash,
.cloze-underline.animate-subtitle-word-flash {
  animation: subtitle-word-flash 0.35s ease-out;
}

/* Stage subtitle: same crisp golden wave */
@keyframes stage-word-flash {
  0% {
    background-color: transparent;
  }
  8% {
    background-color: rgba(253, 224, 71, 0.48);
  }
  100% {
    background-color: transparent;
  }
}
.stage-kw {
  display: inline;
  color: #FFFFFF;
  border-radius: 4px;
  padding: 0 2px;
}
.stage-kw.animate-subtitle-word-flash {
  animation: stage-word-flash 0.45s ease-out;
}

/* Layer 1: Subtitle-Native Highlights — Purple (expression) & Orange (word) */
.hl-token {
  display: inline;
  padding: 1px 3px 3px;
  border-radius: 5px;
  background-repeat: no-repeat;
  background-size: calc(100% - 4px) 2.5px;
  background-position: center bottom;
  font-weight: 550;
  cursor: pointer;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.hl-purple {
  background-color: rgba(124, 58, 237, 0.11);
  background-image: linear-gradient(rgba(124, 58, 237, 0.52), rgba(124, 58, 237, 0.52));
  color: #6D28D9;
}
.hl-purple:hover {
  background-color: rgba(124, 58, 237, 0.21);
}
.hl-orange {
  background-color: rgba(249, 115, 22, 0.12);
  background-image: linear-gradient(rgba(249, 115, 22, 0.48), rgba(249, 115, 22, 0.48));
  color: #C2410C;
}
.hl-orange:hover {
  background-color: rgba(249, 115, 22, 0.22);
}
[data-theme="dark"] .hl-purple {
  background-color: rgba(167, 139, 250, 0.18);
  background-image: linear-gradient(rgba(167, 139, 250, 0.58), rgba(167, 139, 250, 0.58));
  color: #C4B5FD;
}
[data-theme="dark"] .hl-orange {
  background-color: rgba(251, 146, 60, 0.18);
  background-image: linear-gradient(rgba(251, 146, 60, 0.55), rgba(251, 146, 60, 0.55));
  color: #FDBA74;
}
.highlights-off .hl-token {
  background: transparent !important;
  background-image: none !important;
  color: inherit !important;
  font-weight: inherit !important;
  padding: 0 !important;
}

/* Cloze Mode: Highlighted words become clean clickable ______ underlines */
.cloze-underline {
  display: inline-block;
  min-width: 64px;
  padding: 0 6px 1px;
  margin: 0 2px;
  border-bottom: 2px solid #7C3AED;
  color: transparent;
  user-select: none;
  cursor: pointer;
  border-radius: 4px 4px 0 0;
  background: rgba(124, 58, 237, 0.06);
  transition: all 0.18s ease;
  position: relative;
}
.cloze-underline.cloze-orange {
  border-bottom-color: #EA580C;
  background: rgba(249, 115, 22, 0.06);
}
.cloze-underline::after {
  content: "______";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--text-faint);
  font-size: 12px;
  letter-spacing: 0.05em;
}
.cloze-underline.revealed {
  color: #6D28D9;
  background: rgba(124, 58, 237, 0.12);
  font-weight: 650;
}
.cloze-underline.cloze-orange.revealed {
  color: #C2410C;
  background: rgba(249, 115, 22, 0.12);
}
.cloze-underline.revealed::after {
  display: none;
}
.cinema-sub-en .cloze-underline {
  background: rgba(255, 255, 255, 0.14);
  border-bottom-color: #FDE047;
}
.cinema-sub-en .cloze-underline::after {
  color: rgba(255, 255, 255, 0.72);
}
.cinema-sub-en .cloze-underline.revealed {
  color: #FDE047;
  background: rgba(253, 224, 71, 0.22);
}

/* Layer 2: Inline Vocabulary Capsules Expanded Directly Under Sentence */
.capsule-drawer {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(27, 27, 27, 0.12);
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: capsuleSlideIn 0.2s ease-out;
}
[data-theme="dark"] .capsule-drawer {
  border-top-color: rgba(255, 255, 255, 0.12);
}
@keyframes capsuleSlideIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.capsule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
@media (max-width: 640px) {
  .capsule-grid { grid-template-columns: 1fr; }
}

.vocab-capsule {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 9px 12px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.vocab-capsule:hover {
  border-color: var(--border-strong);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
  transform: translateY(-1px);
}
.vocab-capsule.selected.cap-purple {
  border-color: #7C3AED;
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}
.vocab-capsule.selected.cap-orange {
  border-color: #EA580C;
  box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.12);
}

.cap-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.cap-title-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.cap-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cap-purple .cap-dot { background: #7C3AED; }
.cap-orange .cap-dot { background: #EA580C; }

.cap-phrase {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cap-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.cap-icon-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg-soft);
  transition: all 0.14s ease;
}
.cap-icon-btn:hover { color: var(--text); }
.cap-icon-btn.starred {
  color: #F59E0B;
  background: rgba(245, 158, 11, 0.16);
}
.cap-ipa {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  color: var(--text-faint);
}
.cap-meaning {
  font-size: 12px;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pitfall-mini {
  padding: 8px 11px;
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-elevated) 85%, transparent);
  border: 1px solid var(--border);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pitfall-wrong { color: var(--text-muted); text-decoration: line-through; }
.pitfall-right { color: #15803D; font-weight: 650; }
[data-theme="dark"] .pitfall-right { color: #6EE7B7; }

.freq-stars {
  color: #F59E0B;
  letter-spacing: 1px;
  font-size: 13.5px;
}

/* Interactive Cloze Blank */
.cloze-blank {
  display: inline-block;
  min-width: 74px;
  padding: 1px 10px;
  margin: 0 2px;
  border-radius: 6px;
  background: var(--text);
  color: transparent;
  user-select: none;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}
.cloze-blank::after {
  content: "点击揭晓";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
}
.cloze-blank.revealed {
  background: var(--sage-soft);
  color: var(--sage);
  font-weight: 700;
}
.cloze-blank.revealed::after { display: none; }

/* ===================== SHADOWING / PRONUNCIATION PANEL ===================== */
.shadow-panel {
  padding: 20px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.shadow-target-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}
.shadow-target-box .mini-action {
  opacity: 1;
}
.shadow-sentence {
  font-size: 19px;
  font-weight: 680;
  line-height: 1.45;
  margin: 8px 0;
}
.shadow-linking {
  font-size: 12.5px;
  color: var(--accent);
  font-weight: 550;
}

.mic-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px;
  border-radius: 18px;
  background: var(--bg-soft);
  text-align: center;
}

.mic-btn {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  background: linear-gradient(135deg, #D95D39, #B93E1E);
  color: #fff;
  font-size: 28px;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(217, 93, 57, 0.35);
  transition: transform 0.15s ease;
}
.mic-btn:hover { transform: scale(1.05); }
.mic-btn.recording {
  animation: pulseMic 1.2s infinite;
  background: #E03131;
}
.mic-btn.mic-needs-setup {
  background: linear-gradient(135deg, #9A9A9A, #6B6B6B);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.16);
}
@keyframes pulseMic {
  0% { box-shadow: 0 0 0 0 rgba(224, 49, 49, 0.55); }
  70% { box-shadow: 0 0 0 20px rgba(224, 49, 49, 0); }
  100% { box-shadow: 0 0 0 0 rgba(224, 49, 49, 0); }
}

.mic-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
}
.mic-status-pill.ok {
  background: var(--sage-soft);
  border-color: rgba(22, 163, 74, 0.28);
  color: var(--sage);
}
.mic-status-pill.warn {
  background: var(--amber-soft);
  border-color: rgba(217, 119, 6, 0.28);
  color: var(--amber);
}
.mic-status-pill.live {
  background: rgba(224, 49, 49, 0.12);
  border-color: rgba(224, 49, 49, 0.32);
  color: #E03131;
  font-variant-numeric: tabular-nums;
}

.mic-level-bars {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 32px;
}
.mic-level-bars span {
  display: block;
  width: 4px;
  height: 8px;
  border-radius: 999px;
  background: #E03131;
  transition: height 0.08s linear;
}

.mic-guide-card {
  width: 100%;
  text-align: left;
  padding: 11px 13px;
  border-radius: 13px;
  background: var(--bg-elevated);
  border: 1px solid rgba(217, 119, 6, 0.35);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.mic-guide-card.mic-guide-info {
  border-color: var(--border-strong);
}
.mic-guide-title {
  font-size: 12.5px;
  font-weight: 750;
  color: var(--text);
}
.mic-guide-text {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
}
.mic-guide-text code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  font-size: 11px;
  word-break: break-all;
}
.mic-guide-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.score-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.score-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.score-big {
  font-size: 40px;
  font-weight: 800;
  color: var(--sage);
  line-height: 1;
}
.score-metrics {
  display: flex;
  gap: 14px;
}
.metric-pill {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 12px;
  text-align: center;
}
.metric-val { font-size: 16px; font-weight: 750; }
.metric-lbl { font-size: 11px; color: var(--text-muted); }

.word-diagnosis {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 12px;
  background: var(--bg-elevated);
  border-radius: 12px;
}
.w-good { padding: 3px 8px; border-radius: 6px; background: var(--sage-soft); color: var(--sage); font-weight: 650; }
.w-ok { padding: 3px 8px; border-radius: 6px; background: var(--amber-soft); color: var(--amber); font-weight: 650; }
.w-fix { padding: 3px 8px; border-radius: 6px; background: var(--accent-soft); color: var(--accent); font-weight: 650; text-decoration: underline wavy; }

/* ===================== AI ROLEPLAY PANEL ===================== */
.roleplay-panel {
  display: flex;
  flex-direction: column;
  height: 600px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.mission-strip {
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.target-chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.target-chip {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
}
.target-chip.hit {
  background: var(--sage-soft);
  border-style: solid;
  border-color: var(--sage);
  color: var(--sage);
}

.chat-feed {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bubble-row {
  display: flex;
  gap: 10px;
  max-width: 88%;
}
.bubble-row.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.bubble-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.bubble {
  padding: 11px 14px;
  border-radius: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 14px;
}
.bubble-row.user .bubble {
  background: var(--text);
  color: var(--bg);
  border-color: transparent;
}
.bubble-zh {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.bubble-upgrade {
  margin-top: 6px;
  padding: 7px 10px;
  border-radius: 10px;
  background: var(--sage-soft);
  color: var(--sage);
  font-size: 12px;
  font-weight: 550;
}

.quick-replies {
  padding: 8px 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.quick-chip {
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-align: left;
}
.quick-chip:hover { border-color: var(--accent); color: var(--accent); }

.chat-input-bar {
  padding: 12px 16px;
  display: flex;
  gap: 8px;
  border-top: 1px solid var(--border);
  background: var(--bg-elevated);
}
.chat-input-bar input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  outline: none;
}

/* ===================== VOCAB LAB VIEW ===================== */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.vocab-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.vocab-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.vocab-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.vocab-term { font-size: 18px; font-weight: 750; }
.vocab-ipa { font-size: 12.5px; color: var(--text-muted); font-family: ui-monospace, monospace; }

.compare-box {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-soft);
  font-size: 12.5px;
}
.chinglish-line { color: var(--text-muted); text-decoration: line-through; }
.native-line { color: var(--sage); font-weight: 650; }

.vocab-example {
  font-size: 13px;
  color: var(--text);
  padding-top: 6px;
  border-top: 1px dashed var(--border);
}
.vocab-example-zh { font-size: 12px; color: var(--text-muted); }

/* ===================== MODALS & DRAWERS ===================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 14, 13, 0.58);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  place-items: center;
  padding: 20px;
}
.modal-backdrop.open { display: grid; }

.modal-box {
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-radius: 24px;
  max-width: 720px;
  width: 100%;
  min-width: 0;
  max-height: 90vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 26px 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-soft);
  display: grid;
  place-items: center;
  font-size: 16px;
}

.pricing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 18px;
}
.plan-card {
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 20px;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-card.pro {
  border: 2px solid var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 35%, var(--bg-elevated));
}
.plan-price {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.1;
}
.plan-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 13px;
  color: var(--text-muted);
}

/* Export Study Sheet Studio Modal (PDF / HD Image / Print) */
.export-modal-box {
  max-width: 1080px !important;
  width: 96vw !important;
  padding: 22px 24px !important;
}
.export-studio {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 20px;
  margin-top: 14px;
  align-items: start;
}
@media (max-width: 880px) {
  .export-studio { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .export-controls { max-height: none; overflow: visible; padding-right: 0; }
  .export-preview-stage { max-height: 46vh; min-height: 240px; padding: 12px; }
  .sheet-paper { padding: 16px 14px; }
  .sheet-vocab-grid { grid-template-columns: minmax(0, 1fr); }
}
.export-controls {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 68vh;
  overflow-y: auto;
  padding-right: 4px;
}
.exp-group {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.exp-group-title {
  font-size: 12px;
  font-weight: 750;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.exp-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  background: var(--bg-soft);
  padding: 3px;
  border-radius: 11px;
}
.exp-seg-2 {
  grid-template-columns: repeat(2, 1fr);
}
.exp-seg-btn {
  padding: 6px 6px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
  transition: all 0.15s ease;
}
.exp-seg-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.exp-check-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  cursor: pointer;
}
.exp-line-picker {
  display: flex;
  flex-direction: column;
  gap: 5px;
  max-height: 155px;
  overflow-y: auto;
  padding-right: 2px;
}
.exp-line-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  cursor: pointer;
}
.exp-line-opt:hover { border-color: var(--border-strong); }
.exp-line-opt input { accent-color: var(--accent); flex-shrink: 0; }
.exp-line-opt span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

/* Live Paper Preview on Right */
.export-preview-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.export-preview-stage {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  max-height: 60vh;
  overflow-y: auto;
}
.sheet-paper {
  background: #FFFFFF;
  color: #1B1B1B;
  border-radius: 12px;
  padding: 28px 30px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.sheet-paper.warm-paper {
  background: #FAF7F0;
  border: 1px solid rgba(27, 26, 24, 0.1);
}
.sheet-header {
  border-bottom: 2px solid #1B1B1B;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.sheet-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 4px;
}
.sheet-meta {
  font-size: 11.5px;
  color: #6B7280;
}
.sheet-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  line-height: 1.65;
}
.sheet-table th {
  text-align: left;
  color: #0F766E;
  border-bottom: 1.5px solid #E5E7EB;
  padding: 7px 8px;
  font-weight: 700;
  font-size: 12px;
}
.sheet-table td {
  border-bottom: 1px solid #F1F5F9;
  padding: 9px 8px;
  vertical-align: top;
}
.sheet-card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sheet-note-item {
  padding: 10px 13px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(27, 27, 27, 0.08);
}
.sheet-hl-purple {
  background: rgba(124, 58, 237, 0.13);
  color: #6D28D9;
  border-bottom: 2px solid rgba(124, 58, 237, 0.55);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}
.sheet-hl-orange {
  background: rgba(249, 115, 22, 0.13);
  color: #C2410C;
  border-bottom: 2px solid rgba(249, 115, 22, 0.55);
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}
.sheet-blank {
  display: inline-block;
  min-width: 58px;
  border-bottom: 1.8px solid #6D28D9;
  color: transparent;
  margin: 0 2px;
}
.sheet-section-h {
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 800;
  color: #0F766E;
  display: flex;
  align-items: center;
  gap: 6px;
}
.sheet-vocab-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.sheet-vocab-item {
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(241, 245, 249, 0.7);
  border: 1px solid #E5E7EB;
  font-size: 11.5px;
  line-height: 1.5;
}
.export-action-bar {
  display: grid;
  grid-template-columns: 1fr 1fr 0.9fr auto;
  gap: 8px;
  align-items: stretch;
}
@media (max-width: 920px) {
  .export-action-bar {
    position: sticky;
    bottom: -16px;
    background: var(--bg-elevated);
    padding: 10px 0 4px;
    border-top: 1px solid var(--border);
    z-index: 6;
  }
}
@media (max-width: 640px) {
  .export-action-bar {
    grid-template-columns: 1fr 1fr;
  }
}

.cloze-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 14px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: rgba(124, 58, 237, 0.08);
  font-size: 12px;
  color: #6D28D9;
}
.cloze-toolbar > span:first-child {
  min-width: 0;
  line-height: 1.35;
}
.cloze-toolbar > span:last-child {
  flex-shrink: 0;
}
.cloze-toolbar .mini-action {
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .cloze-toolbar {
  background: rgba(167, 139, 250, 0.14);
  color: #C4B5FD;
}

/* Mobile Bottom Tab Bar */
.mobile-tabbar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-elevated) 92%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(4, 1fr);
}
.m-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 0;
  font-size: 17px;
  color: var(--text-muted);
  border-radius: 10px;
}
.m-tab small { font-size: 10.5px; font-weight: 600; }
.m-tab.active { color: var(--accent); }

/* Poster Preview */
.poster-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}
#posterCanvas {
  max-width: 340px;
  width: 100%;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===================== CLEAN LIBRARY HEADER (1:1 ENJOY SPEAK) ===================== */
.library-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 8px 0 14px;
}
.library-h1 {
  font-size: 28px;
  font-weight: 850;
  letter-spacing: -0.02em;
  color: var(--text);
}
.vip-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 650;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}
.vip-status-pill.guest {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
}
.vip-status-pill.guest:hover { border-color: var(--text); color: var(--text); }

.library-search-wide {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 11px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease;
}
.library-search-wide:focus-within { border-color: var(--text-muted); }
.library-search-wide input {
  width: 100%;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text);
}

/* Navbar Auth Area & User Avatar (1:1 Enjoy Speak) */
.nav-auth-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.auth-nav-btn {
  padding: 8px 16px;
  border-radius: 999px;
  background: var(--text);
  color: var(--bg);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}
.auth-nav-btn:hover { opacity: 0.86; }

.user-avatar-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1B1B1B;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 750;
  display: grid;
  place-items: center;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease;
}
[data-theme="dark"] .user-avatar-btn {
  background: #F4F4F5;
  color: #18181B;
}
.user-avatar-btn:hover { transform: scale(1.04); }
.avatar-vip-dot {
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #10B981;
  border: 2px solid var(--bg-elevated);
}

.account-popover {
  position: absolute;
  top: 46px;
  right: 0;
  width: 248px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.16);
  display: none;
  flex-direction: column;
  gap: 10px;
  z-index: 80;
}
.account-popover.open { display: flex; }
.acc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.acc-id { font-size: 14.5px; font-weight: 750; color: var(--text); }
.acc-vip-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.14);
  color: #059669;
}
.acc-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.acc-menu-btn {
  width: 100%;
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.12s ease;
}
.acc-menu-btn:hover { background: var(--bg-soft); }
.acc-menu-btn.danger { color: #DC2626; }

/* ===================== AUTH MODAL (1:1 ENJOY SPEAK LOGIN & INVITE-CODE REGISTER) ===================== */
.auth-backdrop {
  background: rgba(24, 24, 24, 0.72);
  backdrop-filter: blur(4px);
}
.auth-float-close {
  position: fixed;
  top: 22px;
  right: 26px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  color: #1B1B1B;
  font-size: 15px;
  font-weight: 600;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
  z-index: 120;
}
.auth-float-close:hover { transform: scale(1.06); }

.auth-card {
  width: 100%;
  max-width: 430px;
  background: var(--bg-elevated);
  border-radius: 26px;
  padding: 44px 36px 38px;
  box-shadow: 0 28px 64px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.auth-title {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 28px;
}
.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.auth-field {
  position: relative;
  width: 100%;
}
.auth-field-label {
  position: absolute;
  top: -9px;
  left: 20px;
  padding: 0 6px;
  background: var(--bg-elevated);
  font-size: 12px;
  font-weight: 650;
  color: var(--text);
  z-index: 2;
}
.auth-field-hint-right {
  position: absolute;
  top: -9px;
  right: 18px;
  padding: 0 6px;
  background: var(--bg-elevated);
  font-size: 11.5px;
  color: var(--text-muted);
  cursor: pointer;
  z-index: 2;
}
.auth-input {
  width: 100%;
  height: 50px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: transparent;
  padding: 0 46px 0 22px;
  font-size: 14.5px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.auth-input:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--text) 8%, transparent);
}
.auth-eye-btn {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 15px;
}
.auth-eye-btn:hover { color: var(--text); }
.auth-error {
  font-size: 12.5px;
  color: #DC2626;
  background: rgba(220, 38, 38, 0.08);
  padding: 8px 14px;
  border-radius: 12px;
  display: none;
}
.auth-error.show { display: block; }
.auth-submit-btn {
  width: 100%;
  height: 48px;
  border-radius: 999px;
  background: #202020;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 650;
  margin-top: 6px;
  transition: opacity 0.15s ease, transform 0.12s ease;
}
[data-theme="dark"] .auth-submit-btn {
  background: #F4F4F5;
  color: #18181B;
}
.auth-submit-btn:hover { opacity: 0.9; }
.auth-submit-btn:active { transform: scale(0.99); }
.auth-switch-row {
  margin-top: 18px;
  font-size: 13px;
  color: var(--text-muted);
}
.auth-switch-link {
  color: var(--text);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  margin-left: 4px;
}
.auth-invite-tip {
  margin-top: 18px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--bg-soft);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
  width: 100%;
}
.auth-fill-test {
  color: #059669;
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  margin-left: 4px;
}
.vip-lock-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(24, 24, 24, 0.72);
  color: #FDE68A;
  backdrop-filter: blur(8px);
}
.free-trial-badge {
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.9);
  color: #FFFFFF;
}

/* ===================== MULTI-SENSE DICTIONARY UI (LAYER 2 / 3 / VOCAB LAB) ===================== */
.cap-senses-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 700;
  background: rgba(16, 185, 129, 0.13);
  color: #059669;
  margin-left: 4px;
}
.context-meaning-box {
  padding: 11px 14px;
  border-radius: 13px;
  background: rgba(249, 115, 22, 0.08);
  border-left: 3.5px solid #F97316;
  margin-bottom: 12px;
}
.context-meaning-box.is-expr {
  background: rgba(124, 58, 237, 0.08);
  border-left-color: #7C3AED;
}
.context-meaning-lbl {
  font-size: 11px;
  font-weight: 750;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.senses-card-box {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.senses-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  font-weight: 750;
  color: var(--text-muted);
}
.sense-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px dashed var(--border);
}
.sense-row:first-of-type {
  padding-top: 2px;
  border-top: none;
}
.sense-pos {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  margin-top: 1px;
}
.sense-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sense-def {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.sense-ex {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.vocab-more-senses {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg-soft);
  font-size: 12px;
  line-height: 1.45;
}
.vocab-more-item {
  display: flex;
  align-items: baseline;
  gap: 6px;
  color: var(--text-muted);
}
.vocab-more-pos {
  flex-shrink: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 10.5px;
  font-weight: 700;
  color: #059669;
  background: rgba(16, 185, 129, 0.12);
  padding: 1px 5px;
  border-radius: 4px;
}

/* Responsive — Tablet (720px–1080px, tall screens min-height: 521px): keep 2-column Video + Bilingual Transcript split! */
@media (max-width: 1080px) and (min-height: 521px) {
  .featured-grid, .pricing-grid { grid-template-columns: minmax(0, 1fr); }
  .preview-grid, .vocab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .studio-layout,
  .studio-layout.wide-mode {
    grid-template-columns: minmax(280px, 44%) minmax(0, 1fr);
    gap: 18px;
  }
  .stage-column {
    position: sticky;
    top: 70px;
    gap: 12px;
    min-width: 0;
  }
  .stage-theater-wrap.is-portrait-wrap {
    width: min(100%, 315px);
  }
  .stage-frame.portrait-frame {
    max-height: 560px;
    width: 100%;
  }
  /* Tablet: keep video faces 100% clear (hide top chapter & speaker wave row), compact proportional bottom subs */
  .stage-frame .stage-top-hud,
  .stage-frame .speaker-wave-row {
    display: none !important;
  }
  .stage-frame .stage-vignette {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 54%, rgba(0,0,0,0.82) 100%);
  }
  .stage-frame .stage-bottom-hud {
    left: 10px;
    right: 10px;
    bottom: 8px;
    gap: 2px;
    text-align: center;
  }
  .stage-frame .cinema-sub-en {
    font-size: clamp(10.5px, 3.6cqi, 13.5px);
    line-height: 1.28;
    font-weight: 600;
  }
  .stage-frame .cinema-sub-zh {
    font-size: clamp(9.5px, 2.8cqi, 11.2px);
    line-height: 1.25;
  }
  .controls-card { padding: 10px 12px; gap: 9px; }
  .controls-row { gap: 6px; }
  .ctrl-group { gap: 5px; flex-wrap: wrap; }
  .play-main-btn { width: 38px; height: 38px; font-size: 14px; }
  .ctrl-group .icon-btn { width: 32px; height: 32px; font-size: 13px; }
  .ctrl-pill { padding: 5px 9px; font-size: 11.5px; gap: 3px; }
  .episode-brief-card { padding: 12px 14px; }
  .transcript-scroll {
    max-height: calc(100vh - 13.5rem);
    min-height: 440px;
  }
  .line-card { padding: 13px 15px; }
  .line-en { font-size: 16.5px; }
  .line-zh { font-size: 13.5px; }
}

/* Responsive — Mobile Phone Portrait (<= 719px): native-app theater dock + zero wasted header chrome! */
@media (max-width: 719px) {
  .navbar { padding: 7px 12px; }
  body.in-player-view .navbar { display: none !important; }
  .nav-pills { display: none; }
  .nav-actions { gap: 8px; }
  .mobile-tabbar { display: grid; }
  body.in-player-view .mobile-tabbar { display: none !important; }
  .container { padding: 8px 12px calc(96px + env(safe-area-inset-bottom)); }
  body.in-player-view .container { padding: 0 10px calc(100px + env(safe-area-inset-bottom)); }
  .toast { bottom: 80px; max-width: calc(100vw - 24px); text-align: center; }
  body.in-player-view .toast { bottom: calc(16px + env(safe-area-inset-bottom)); }

  /* Mobile Home / Vocab / Dashboard clean polish */
  .filter-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
    gap: 6px;
  }
  .filter-chips::-webkit-scrollbar { display: none; }
  .chip {
    white-space: nowrap;
    flex-shrink: 0;
    padding: 6px 12px;
    font-size: 12.5px;
  }
  .vocab-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
  .vocab-card {
    padding: 14px 16px;
    border-radius: 16px;
  }
  .continue-card {
    padding: 14px 14px 16px;
    border-radius: 18px;
    margin-bottom: 16px;
  }
  .continue-head {
    margin-bottom: 10px;
    gap: 6px;
  }
  .continue-title { font-size: 17px; }
  .continue-stats { font-size: 12px; gap: 8px; flex-wrap: wrap; }
  .continue-grid { gap: 8px; }
  .free-trial-badge,
  .vip-lock-badge,
  .play-cta-mini,
  .style-pill {
    white-space: nowrap;
    font-size: 11px;
    padding: 4px 9px;
  }
  .card-top-badges {
    flex-wrap: nowrap;
    gap: 6px;
  }
  .card-top-badges .style-pill {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 56%;
  }
  .modal-backdrop { padding: 12px; }
  .modal-box {
    padding: 18px 16px calc(22px + env(safe-area-inset-bottom));
    border-radius: 20px;
    max-height: 86dvh;
  }
  .modal-close { top: 14px; right: 14px; }
  .dash-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin: 12px 0 14px;
  }
  .dash-kpi { padding: 10px 8px; border-radius: 12px; }
  .dash-kpi-val { font-size: 22px; }
  .week-bars { gap: 4px; padding: 12px 8px 8px; height: 106px; }
  .week-lbl { white-space: nowrap; font-size: 10.5px; }
  .continue-item { padding: 11px 12px; }
  .continue-item-title { font-size: 13.5px; }

  /* Player: collapse top chrome into ONE single 38px row! */
  .studio-topbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin: 0 -10px;
    padding: 6px 10px;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
  }
  .studio-topbar > div:first-child {
    width: auto;
    flex-shrink: 0;
    flex-wrap: nowrap !important;
    gap: 4px !important;
  }
  /* Keep compact ← Back button visible; move export/download into slim icon-compact pills */
  .studio-topbar #btnPrintSubs,
  .studio-topbar a.back-btn {
    display: none;
  }
  .back-btn {
    padding: 5px 10px;
    font-size: 12px;
    gap: 3px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .style-switcher-banner {
    flex: 1;
    min-width: 0;
    width: auto;
    padding: 2px;
    gap: 4px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: none;
  }
  .switch-opt {
    padding: 4px 10px;
    font-size: 11.5px;
  }

  .studio-layout,
  .studio-layout.wide-mode {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  /* Pinned full-bleed dark theater video stage + ultra-slim 1-row controls */
  .stage-column {
    position: sticky;
    top: 0;
    z-index: 30;
    background: var(--bg);
    margin: 0 -10px;
    padding: 0;
    gap: 0;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  }
  .stage-frame {
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 31dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    background: #0d0d0f;
  }
  /* Mobile Portrait: keep in-video subtitles proportionally sized & toggleable (hide top chapter & wave row so faces stay 100% clear!) */
  .stage-frame .stage-top-hud,
  .stage-frame .speaker-wave-row {
    display: none !important;
  }
  .stage-frame .stage-vignette {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 52%, rgba(0,0,0,0.78) 100%);
  }
  .stage-frame .stage-bottom-hud {
    left: 10px;
    right: 10px;
    bottom: 7px;
    gap: 2px;
    text-align: center;
  }
  .stage-frame .cinema-sub-en {
    font-size: clamp(11px, 3.15cqi, 13px);
    line-height: 1.28;
    font-weight: 600;
  }
  .stage-frame .cinema-sub-zh {
    font-size: clamp(9.5px, 2.55cqi, 11px);
    line-height: 1.25;
  }
  .stage-frame.portrait-frame {
    width: 100%;
    height: min(44dvh, 340px);
    max-width: 100%;
    max-height: 44dvh;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 0;
    background: #0d0d0f;
  }
  .stage-frame.portrait-frame .stage-bottom-hud {
    left: 10px;
    right: 10px;
    bottom: 7px;
  }
  .stage-frame.portrait-frame .cinema-sub-en {
    font-size: clamp(10.5px, 4.7cqi, 12.8px);
    line-height: 1.26;
  }
  .stage-frame.portrait-frame .cinema-sub-zh {
    font-size: clamp(9px, 3.8cqi, 10.6px);
    line-height: 1.24;
  }
  .stage-sub-toggle-btn {
    top: 7px;
    right: 7px;
    padding: 3px 7.5px;
    font-size: 10px;
  }
  .stage-frame.portrait-frame .stage-video {
    object-fit: contain;
  }
  .stage-column .episode-brief-card {
    display: none;
  }

  /* Ultra-slim integrated controls strip (thin edge progress + 1 compact row) */
  .controls-card {
    padding: 5px 10px 7px;
    border-radius: 0;
    border: none;
    box-shadow: none;
    gap: 5px;
    background: var(--bg-elevated);
  }
  .progress-row {
    font-size: 10.5px;
    gap: 6px;
  }
  .progress-track { height: 4px; }
  .controls-row {
    gap: 4px;
    flex-wrap: nowrap;
  }
  .ctrl-group { gap: 4px; }
  .play-main-btn { width: 32px; height: 32px; font-size: 12.5px; }
  .ctrl-group .icon-btn { width: 28px; height: 28px; font-size: 12px; }
  .ctrl-pill { padding: 4px 8px; font-size: 11px; gap: 3px; white-space: nowrap; }

  /* Right Panel: compact 1-bar tabs + generous EN/ZH subtitle reading zone */
  .right-panel {
    min-height: 0;
    padding-top: 6px;
  }
  .panel-tabs {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 2px 0 6px;
    gap: 6px;
  }
  .main-tabs { padding: 3px; gap: 2px; }
  .main-tab { padding: 4px 8px; font-size: 11.5px; gap: 3px; }
  .sub-mode-pills { padding: 3px; gap: 1px; }
  .sub-mode-btn { padding: 4px 8px; font-size: 11.5px; }
  .transcript-scroll {
    max-height: none;
    min-height: 0;
    overflow: visible;
    -webkit-mask-image: none;
    mask-image: none;
    padding: 4px 0 28px;
    gap: 6px;
  }
  .line-card {
    padding: 10px 12px;
    border-radius: 14px;
    scroll-margin-top: 360px;
  }
  .line-en { font-size: 15.5px; line-height: 1.48; }
  .line-zh { font-size: 13px; line-height: 1.45; }
  .cloze-toolbar {
    padding: 5px 9px;
    font-size: 11px;
    gap: 6px;
    margin-bottom: 4px;
    border-radius: 10px;
  }
  .cloze-toolbar > span:last-child { gap: 4px !important; }
  .cloze-toolbar .mini-action { padding: 3px 8px; font-size: 11px; }
  .cinema-sub-en .cloze-underline { min-width: 40px; padding: 0 4px 1px; }
  .shadow-panel {
    padding: 12px;
    gap: 10px;
    border-radius: 16px;
  }
  .shadow-target-box { padding: 11px 12px; border-radius: 12px; }
  .shadow-sentence { font-size: 15.5px; line-height: 1.4; margin: 5px 0; }
  .shadow-linking { font-size: 11.5px; }
  .mic-stage { padding: 12px; gap: 8px; border-radius: 14px; }
  .mic-btn { width: 54px; height: 54px; font-size: 22px; }
  .roleplay-panel {
    height: min(460px, 56dvh);
    border-radius: 16px;
  }
  .mission-strip { padding: 8px 10px; gap: 5px; font-size: 11.5px; }
  .target-chip { padding: 2.5px 8px; font-size: 11px; }
  .chat-feed { padding: 10px; gap: 8px; }
  .bubble { padding: 8px 11px; font-size: 13px; }
  .quick-replies { padding: 6px 10px; gap: 4px; }
  .quick-chip { padding: 4px 9px; font-size: 11.5px; }
  .chat-input-bar { padding: 8px 10px; gap: 6px; }
  .chat-input-bar input { padding: 7px 11px; font-size: 13px; }
  .settings-popover.open {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(332px, calc(100vw - 24px));
    max-height: 80dvh;
    overflow-y: auto;
    z-index: 220;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(0, 0, 0, 0.42);
  }
  .auth-card { padding: 36px 24px 30px; margin: 0 14px; }
}

/* Responsive — Mobile Portrait + Portrait Video (9:16): locked 100dvh native layout, large balanced video + crisp 2-row scrolling transcript! */
@media (max-width: 719px) and (orientation: portrait) {
  body.in-player-view.portrait-ep {
    height: 100dvh;
    max-height: 100dvh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }
  body.in-player-view.portrait-ep .container {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: 100%;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.in-player-view.portrait-ep .studio-topbar {
    flex-shrink: 0;
    margin: 0;
    padding: 5px 10px;
  }
  body.in-player-view.portrait-ep .studio-layout,
  body.in-player-view.portrait-ep .studio-layout.wide-mode {
    flex: 1;
    min-height: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
  }
  body.in-player-view.portrait-ep .stage-column {
    position: static;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: none;
    border-bottom: 1px solid var(--border);
  }
  body.in-player-view.portrait-ep .stage-theater-wrap,
  body.in-player-view.portrait-ep .stage-theater-wrap.is-portrait-wrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    margin: 0;
    background: radial-gradient(ellipse at 50% 42%, #1d1f26 0%, #0c0d11 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px 8px;
    overflow: hidden;
  }
  body.in-player-view.portrait-ep .stage-frame.portrait-frame {
    height: 100%;
    width: auto;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    border-radius: 11px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #0d0d0f;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.52);
  }
  body.in-player-view.portrait-ep .stage-frame.portrait-frame .stage-video {
    object-fit: cover;
  }
  body.in-player-view.portrait-ep .stage-frame.portrait-frame.clean-video-frame .stage-video {
    object-fit: contain;
  }
  body.in-player-view.portrait-ep .stage-frame.portrait-frame .stage-bottom-hud {
    left: 7px;
    right: 7px;
    bottom: 6px;
  }
  body.in-player-view.portrait-ep .stage-frame.portrait-frame .cinema-sub-en {
    font-size: clamp(10px, 4.7cqi, 12.6px);
    line-height: 1.24;
  }
  body.in-player-view.portrait-ep .stage-frame.portrait-frame .cinema-sub-zh {
    font-size: clamp(8.8px, 3.8cqi, 10.6px);
    line-height: 1.22;
  }
  /* Sit cleanly in the top-left dark studio margin so it never touches video titles or iOS right-edge tabs */
  body.in-player-view.portrait-ep .stage-sub-toggle-btn {
    top: 8px;
    left: 8px;
    right: auto;
    padding: 3px 7px;
    font-size: 9.5px;
  }
  body.in-player-view.portrait-ep .controls-card {
    flex-shrink: 0;
    width: 100%;
    padding: 4px 10px 5px;
    gap: 4px;
  }
  body.in-player-view.portrait-ep .play-main-btn { width: 30px; height: 30px; font-size: 12px; }
  body.in-player-view.portrait-ep .ctrl-group .icon-btn { width: 26px; height: 26px; font-size: 11.5px; }
  body.in-player-view.portrait-ep .ctrl-pill { padding: 3.5px 7px; font-size: 11px; gap: 3px; }

  /* Right panel: ultra-clean compact header + strictly 2-row smooth-scrolling transcript (2 full uncut cards) */
  body.in-player-view.portrait-ep .right-panel {
    flex-shrink: 0;
    width: 100%;
    padding: 3px 10px calc(6px + env(safe-area-inset-bottom));
    background: var(--bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.in-player-view.portrait-ep .panel-tabs {
    flex-shrink: 0;
    padding: 1px 0 3px;
    gap: 3px;
  }
  body.in-player-view.portrait-ep .main-tabs { padding: 2px; gap: 2px; }
  body.in-player-view.portrait-ep .main-tab { padding: 3px 8px; font-size: 11.5px; }
  body.in-player-view.portrait-ep .sub-mode-pills { padding: 2px; gap: 1px; }
  body.in-player-view.portrait-ep .sub-mode-btn { padding: 2.5px 7.5px; font-size: 11px; }
  body.in-player-view.portrait-ep #btnOpenSettings {
    width: 26px !important;
    height: 26px !important;
    font-size: 12.5px !important;
  }
  body.in-player-view.portrait-ep .cloze-banner {
    padding: 3px 9px;
    font-size: 11px;
    margin-bottom: 3px;
    border-radius: 9px;
  }
  body.in-player-view.portrait-ep #rightPanelBody {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  body.in-player-view.portrait-ep .transcript-scroll {
    height: clamp(182px, 24.5dvh, 196px);
    max-height: clamp(182px, 24.5dvh, 196px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding: 2px 2px 6px 0;
    gap: 5px;
    -webkit-mask-image: none;
    mask-image: none;
  }
  body.in-player-view.portrait-ep .line-card {
    padding: 5px 10px;
    border-radius: 11px;
    scroll-margin-top: 4px;
  }
  body.in-player-view.portrait-ep .line-meta {
    margin-bottom: 1px;
    font-size: 10px;
    gap: 5px;
  }
  body.in-player-view.portrait-ep .line-meta .mini-action {
    padding: 1.5px 6px;
    font-size: 10px;
  }
  body.in-player-view.portrait-ep .line-en {
    font-size: 13.5px;
    line-height: 1.3;
  }
  body.in-player-view.portrait-ep .hl-token {
    padding: 0 2px 1.5px;
  }
  body.in-player-view.portrait-ep .line-zh {
    font-size: 11.5px;
    line-height: 1.28;
    margin-top: 1.5px;
  }
  body.in-player-view.portrait-ep .shadow-panel,
  body.in-player-view.portrait-ep .roleplay-panel {
    height: clamp(235px, 34dvh, 290px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  body.in-player-view.portrait-ep .roleplay-panel .chat-feed {
    min-height: 82px;
  }
}

/* Responsive — Mobile Phone LANDSCAPE (e.g. iPhone sideways 844x350, Android landscape): locked 100dvh 2-column split! */
@media (max-height: 520px) and (orientation: landscape) {
  .modal-backdrop { padding: 8px 14px; }
  .modal-box {
    padding: 14px 18px;
    max-height: 92dvh;
    border-radius: 18px;
  }
  .dash-kpi-grid { margin: 10px 0 12px; gap: 8px; }
  .dash-kpi { padding: 8px 6px; border-radius: 12px; }
  .dash-kpi-val { font-size: 20px; }
  .week-bars { height: 92px; padding: 10px 12px 8px; margin-bottom: 12px; }

  body.in-player-view .navbar,
  body.in-player-view .mobile-tabbar {
    display: none !important;
  }
  body.in-player-view .container {
    max-width: 100%;
    padding: 4px 10px 6px;
  }
  body.in-player-view .studio-topbar {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
    margin-bottom: 6px;
  }
  body.in-player-view .studio-topbar > div:first-child {
    width: auto;
    flex-shrink: 0;
    flex-wrap: nowrap !important;
  }
  body.in-player-view .studio-topbar #btnPrintSubs,
  body.in-player-view .studio-topbar a.back-btn {
    display: none;
  }
  body.in-player-view .back-btn {
    padding: 3px 9px;
    font-size: 11.5px;
    white-space: nowrap;
  }
  body.in-player-view .style-switcher-banner {
    flex: 1;
    min-width: 0;
    padding: 2px;
    gap: 4px;
  }
  body.in-player-view .switch-opt {
    padding: 3px 9px;
    font-size: 11px;
  }

  body.in-player-view .studio-layout,
  body.in-player-view .studio-layout.wide-mode {
    grid-template-columns: minmax(220px, 42%) 1fr;
    gap: 12px;
    height: calc(100dvh - 44px);
    align-items: stretch;
  }
  body.in-player-view .stage-column {
    position: static;
    height: 100%;
    margin: 0;
    padding: 0;
    gap: 6px;
    border: none;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }
  body.in-player-view .stage-theater-wrap,
  body.in-player-view .stage-theater-wrap.is-portrait-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    width: 100%;
    margin: 0;
    background: #0d0d0f;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  body.in-player-view .stage-frame {
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: none;
    max-width: 100%;
    aspect-ratio: auto;
    margin: 0;
    border-radius: 12px;
    border: none;
    background: #0d0d0f;
  }
  body.in-player-view .stage-frame.portrait-frame {
    height: 100%;
    width: auto;
    aspect-ratio: 9 / 16;
    max-width: 100%;
    max-height: 100%;
    margin: 0 auto;
    border-radius: 0;
  }
  body.in-player-view .stage-frame .stage-video {
    object-fit: contain;
  }
  body.in-player-view .stage-frame .stage-top-hud,
  body.in-player-view .stage-frame .speaker-wave-row,
  body.in-player-view .stage-column .episode-brief-card {
    display: none !important;
  }
  body.in-player-view .stage-frame .stage-vignette {
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0) 50%, rgba(0,0,0,0.82) 100%);
  }
  body.in-player-view .stage-frame .stage-bottom-hud {
    left: 10px;
    right: 10px;
    bottom: 6px;
    gap: 2px;
    text-align: center;
  }
  body.in-player-view .stage-frame .cinema-sub-en {
    font-size: clamp(10.5px, 3.6cqi, 13px);
    line-height: 1.26;
    font-weight: 600;
  }
  body.in-player-view .stage-frame .cinema-sub-zh {
    font-size: clamp(9.5px, 2.9cqi, 11px);
    line-height: 1.24;
  }
  body.in-player-view .stage-frame.portrait-frame .stage-bottom-hud {
    left: 5px;
    right: 5px;
    bottom: 4px;
    gap: 1px;
  }
  body.in-player-view .stage-frame.portrait-frame .cinema-sub-en {
    font-size: clamp(8.5px, 5.2cqi, 10.5px);
    line-height: 1.2;
  }
  body.in-player-view .stage-frame.portrait-frame .cinema-sub-zh {
    font-size: clamp(7.5px, 4.4cqi, 9px);
    line-height: 1.18;
  }
  body.in-player-view .stage-sub-toggle-btn {
    top: 6px;
    right: 7px;
    padding: 3px 7px;
    font-size: 10px;
  }
  body.in-player-view.portrait-ep .stage-sub-toggle-btn {
    left: 6px;
    right: auto;
    padding: 2.5px 6px;
    font-size: 9.5px;
  }
  body.in-player-view .controls-card {
    flex-shrink: 0;
    padding: 5px 8px;
    border-radius: 10px;
    gap: 4px;
  }
  body.in-player-view .progress-row { font-size: 10px; gap: 5px; }
  body.in-player-view .progress-track { height: 4px; }
  body.in-player-view .play-main-btn { width: 28px; height: 28px; font-size: 11.5px; }
  body.in-player-view .ctrl-group .icon-btn { width: 26px; height: 26px; font-size: 11px; }
  body.in-player-view .ctrl-pill { padding: 3px 6px; font-size: 10.5px; gap: 2px; }
  body.in-player-view #btnFavEp { display: none; }

  body.in-player-view .right-panel {
    height: 100%;
    min-height: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.in-player-view .panel-tabs {
    flex-shrink: 0;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    padding: 0 0 6px;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body.in-player-view .panel-tabs::-webkit-scrollbar { display: none; }
  body.in-player-view .main-tabs,
  body.in-player-view .sub-mode-pills { padding: 2px; gap: 2px; flex-shrink: 0; }
  body.in-player-view .main-tab,
  body.in-player-view .sub-mode-btn { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
  body.in-player-view #rightPanelBody {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  body.in-player-view .transcript-scroll {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-mask-image: none;
    mask-image: none;
    padding: 2px 4px 24px 0;
    gap: 6px;
  }
  body.in-player-view .line-card { padding: 8px 11px; border-radius: 12px; }
  body.in-player-view .line-meta { margin-bottom: 4px; font-size: 11px; }
  body.in-player-view .line-en { font-size: 14.5px; line-height: 1.42; }
  body.in-player-view .line-zh { font-size: 12px; line-height: 1.4; }
  body.in-player-view .cloze-toolbar { padding: 4px 10px; font-size: 11px; margin-bottom: 4px; }
  body.in-player-view .shadow-panel {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 10px 12px;
    gap: 8px;
    border-radius: 14px;
  }
  body.in-player-view .shadow-target-box { padding: 10px 12px; border-radius: 12px; }
  body.in-player-view .shadow-sentence { font-size: 14.5px; line-height: 1.35; margin: 4px 0; }
  body.in-player-view .shadow-linking { font-size: 11px; }
  body.in-player-view .mic-stage { padding: 8px; gap: 6px; border-radius: 12px; }
  body.in-player-view .mic-btn { width: 46px; height: 46px; font-size: 20px; }
  body.in-player-view .roleplay-panel {
    flex: 1;
    height: 100%;
    min-height: 0;
    border-radius: 14px;
  }
  body.in-player-view .mission-strip { padding: 6px 10px; gap: 4px; font-size: 11px; }
  body.in-player-view .target-chip { padding: 2px 7px; font-size: 10.5px; }
  body.in-player-view .chat-feed { padding: 8px 10px; gap: 6px; }
  body.in-player-view .bubble { padding: 7px 10px; font-size: 12.5px; }
  body.in-player-view .quick-replies { padding: 5px 10px; gap: 4px; }
  body.in-player-view .quick-chip { padding: 3.5px 8px; font-size: 11px; }
  body.in-player-view .chat-input-bar { padding: 6px 10px; gap: 6px; }
  body.in-player-view .chat-input-bar input { padding: 6px 10px; font-size: 12.5px; }
  body.in-player-view .settings-popover.open {
    position: fixed;
    left: 50%;
    top: 50%;
    right: auto;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100vw - 32px));
    max-height: 86dvh;
    overflow-y: auto;
    z-index: 220;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35), 0 0 0 100vmax rgba(0, 0, 0, 0.42);
  }
}

@media (max-width: 600px) {
  .vocab-grid, .preview-grid { grid-template-columns: minmax(0, 1fr); }
}


/* ===================== AI CATALOG TOOLBAR, HEAT/FAV METRICS & 2/3/4/5 COL SWITCHER ===================== */
.container.grid-wide-4 { max-width: 1420px; }
.container.grid-wide-5 { max-width: 1580px; }

.chip-count {
  display: inline-block;
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.72;
  font-variant-numeric: tabular-nums;
}

.library-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 20px;
  padding: 10px 14px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.toolbar-left, .toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sort-segmented, .col-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  padding: 3px;
  border-radius: 11px;
  border: 1px solid var(--border);
  gap: 2px;
}

.sort-btn, .col-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.sort-btn:hover, .col-btn:hover {
  color: var(--text);
}
.sort-btn.active, .col-btn.active {
  background: var(--bg-elevated);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.09);
}

.toolbar-select {
  appearance: none;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 26px 6px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.toolbar-select:focus {
  outline: none;
  border-color: var(--accent);
}

.toolbar-count {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-right: 4px;
  font-variant-numeric: tabular-nums;
}

.empty-catalog-box {
  padding: 40px 24px;
  text-align: center;
  border-radius: 20px;
  background: var(--bg-elevated);
  border: 1px dashed var(--border-strong);
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 30px;
}

/* 2 / 3 / 4 / 5 Column Grid Modes */
.featured-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.featured-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.featured-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.featured-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 13px; }

/* Balanced Card Metrics Footer (Heat + Duration + Clickable Favorite) */
.card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-metrics-row {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.metric-heat {
  font-weight: 700;
  color: #EA580C;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.metric-dur {
  font-weight: 500;
  opacity: 0.85;
}
.card-fav-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  padding: 3px 9px;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.16s ease;
  font-variant-numeric: tabular-nums;
}
.card-fav-btn:hover {
  border-color: #F43F5E;
  color: #F43F5E;
}
.card-fav-btn.active {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.4);
  color: #E11D48;
}
.tag-soft.tag-cat {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 650;
}

/* Adaptive Compact Density for 3 / 4 / 5 Columns */
.featured-grid.cols-3 .episode-card { border-radius: 18px; }
.featured-grid.cols-3 .card-body { padding: 14px 16px 13px; }
.featured-grid.cols-3 .card-title {
  font-size: 15px;
  line-height: 1.38;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-grid.cols-3 .card-summary {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12.5px;
}

.featured-grid.cols-4 .episode-card,
.featured-grid.cols-5 .episode-card { border-radius: 15px; }
.featured-grid.cols-4 .card-media-overlay,
.featured-grid.cols-5 .card-media-overlay { padding: 9px 10px; }
.featured-grid.cols-4 .style-pill,
.featured-grid.cols-5 .style-pill { font-size: 10.5px; padding: 3px 8px; max-width: 65%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-grid.cols-4 .free-trial-badge,
.featured-grid.cols-5 .free-trial-badge,
.featured-grid.cols-4 .duration-pill,
.featured-grid.cols-5 .duration-pill { font-size: 10.5px; padding: 3px 7px; }
.featured-grid.cols-4 .level-dot,
.featured-grid.cols-5 .level-dot { font-size: 10.5px; }
.featured-grid.cols-4 .play-cta-mini,
.featured-grid.cols-5 .play-cta-mini { font-size: 10.5px; padding: 3px 8px; }

.featured-grid.cols-4 .card-body { padding: 11px 12px 10px; }
.featured-grid.cols-5 .card-body { padding: 9px 10px 9px; }

.featured-grid.cols-4 .card-title {
  font-size: 13.5px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.featured-grid.cols-5 .card-title {
  font-size: 12.5px;
  line-height: 1.32;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.featured-grid.cols-4 .card-entitle,
.featured-grid.cols-4 .card-summary,
.featured-grid.cols-5 .card-entitle,
.featured-grid.cols-5 .card-summary,
.featured-grid.cols-5 .tag-extra {
  display: none;
}
.featured-grid.cols-4 .card-tags,
.featured-grid.cols-5 .card-tags {
  margin-bottom: 8px;
  gap: 4px;
}
.featured-grid.cols-4 .tag-soft,
.featured-grid.cols-5 .tag-soft {
  font-size: 10.5px;
  padding: 2px 7px;
}
.featured-grid.cols-5 .card-metrics-row {
  padding-top: 7px;
  font-size: 11px;
}
.featured-grid.cols-5 .metric-dur { display: none; }
.featured-grid.cols-5 .card-fav-btn { padding: 2px 7px; font-size: 11px; }

/* Responsive fallbacks for 2/3/4/5 grids */
@media (max-width: 1280px) {
  .featured-grid.cols-5 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .featured-grid.cols-4,
  .featured-grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 780px) {
  .featured-grid.cols-2,
  .featured-grid.cols-3,
  .featured-grid.cols-4,
  .featured-grid.cols-5 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .col-switcher { display: none; }
}
@media (max-width: 520px) {
  .featured-grid.cols-2,
  .featured-grid.cols-3,
  .featured-grid.cols-4,
  .featured-grid.cols-5 { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
  .library-toolbar { padding: 8px 10px; max-width: 100%; overflow: hidden; }
  .toolbar-left, .toolbar-right { width: 100%; max-width: 100%; }
  .sort-segmented { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .sort-segmented::-webkit-scrollbar { display: none; }
  .sort-btn { font-size: 11.5px; padding: 5px 8px; flex-shrink: 0; }
  .filter-chips { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .filter-chips::-webkit-scrollbar { display: none; }
  .filter-chips .chip { flex-shrink: 0; }
  .library-head-row { flex-direction: column; align-items: flex-start; gap: 8px; }
  .vip-status-pill { max-width: 100%; white-space: normal; text-align: left; }
  .navbar { padding-left: 12px; padding-right: 12px; gap: 8px; }
  .brand-name { font-size: 15px; }
  .auth-nav-btn { padding: 6px 10px; font-size: 12px; }
}


/* ===================== SVG NAV ICONS & FLOATING MINI-PLAYER (小窗播放) ===================== */
.nav-pill { display: inline-flex; align-items: center; gap: 6px; }
.nav-pill .sx-icon { width: 15px; height: 15px; opacity: 0.85; }
.m-tab .sx-icon { width: 19px; height: 19px; margin-bottom: 2px; }
#btnTheme .sx-icon { width: 17px; height: 17px; }
.library-search-wide .sx-icon { width: 17px; height: 17px; color: var(--text-muted); }

/* Card Mini-Play Trigger Pill */
.card-cta-group { display: inline-flex; align-items: center; gap: 6px; }
.mini-launch-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(16, 31, 27, 0.72);
  color: #F2EFE6;
  backdrop-filter: blur(8px);
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.16s ease;
}
.mini-launch-btn:hover { background: var(--sx-skin-control, #173F36); border-color: rgba(210, 177, 111, 0.7); }
.featured-grid.cols-4 .mini-launch-btn,
.featured-grid.cols-5 .mini-launch-btn { padding: 3px 7px; font-size: 10.5px; }

/* Floating Mini-Player Window */
.mini-player-root {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 396px;
  max-width: calc(100vw - 24px);
  background: var(--bg-elevated, #F8F6F0);
  border: 1px solid var(--border-strong, #BCB6A7);
  border-radius: 18px;
  box-shadow: 0 22px 54px rgba(10, 24, 19, 0.28), 0 4px 14px rgba(10, 24, 19, 0.12);
  overflow: hidden;
  z-index: 320;
  display: flex;
  flex-direction: column;
  user-select: none;
}
.mini-player-root.hidden { display: none; }
.mini-player-root.size-sm { width: 320px; }
.mini-player-root.size-md { width: 400px; }
.mini-player-root.size-lg { width: 490px; }

.mp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  background: var(--bg-soft, #E9E4D8);
  border-bottom: 1px solid var(--border, #D6D1C6);
  cursor: grab;
  touch-action: none;
}
.mp-header:active { cursor: grabbing; }
.mp-title-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}
.mp-drag-dots { opacity: 0.45; font-size: 13px; flex-shrink: 0; }
.mp-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text, #173F36);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mp-head-actions { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.mp-icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted, #66736A);
  font-size: 12px;
  font-weight: 700;
  height: 26px;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 7px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.14s ease;
}
.mp-icon-btn:hover { background: var(--bg-elevated, #fff); color: var(--text, #173F36); border-color: var(--border); }
.mp-icon-btn.active { background: var(--sx-skin-control, #173F36); color: var(--sx-skin-on-control, #F2EFE6); }

.mp-stage {
  position: relative;
  background: #0B1411;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.mp-stage.portrait-stage { aspect-ratio: 4 / 3; }
.mp-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  cursor: pointer;
}
.mp-sub-overlay {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  background: rgba(11, 20, 17, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(210, 177, 111, 0.28);
  border-radius: 10px;
  padding: 6px 10px;
  text-align: center;
  pointer-events: none;
  transition: opacity 0.16s ease;
}
.mp-sub-overlay.hidden { opacity: 0; visibility: hidden; }
.mp-sub-en {
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.mp-sub-zh {
  color: #E7DFC9;
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1.35;
  margin-top: 2px;
}

.mp-progress-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 11px 2px;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.mp-seek {
  flex: 1;
  accent-color: var(--sx-skin-control, #173F36);
  height: 4px;
  cursor: pointer;
}

.mp-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 10px 9px;
  flex-wrap: wrap;
}
.mp-ctrl-group { display: inline-flex; align-items: center; gap: 4px; }
.mp-play-btn {
  border: none;
  background: var(--sx-skin-control, #173F36);
  color: var(--sx-skin-on-control, #F2EFE6);
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mp-pill-btn {
  border: 1px solid var(--border, #D6D1C6);
  background: var(--bg-soft, #E9E4D8);
  color: var(--text, #173F36);
  font-size: 11px;
  font-weight: 650;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.mp-pill-btn:hover { border-color: var(--border-strong); }
.mp-pill-btn.active {
  background: var(--sx-skin-control, #173F36);
  color: var(--sx-skin-on-control, #F2EFE6);
  border-color: var(--sx-skin-control, #173F36);
}
.mp-vol-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.mp-vol-slider {
  width: 58px;
  accent-color: var(--sx-skin-control, #173F36);
  height: 4px;
  cursor: pointer;
}
@media (max-width: 640px) {
  .mini-player-root,
  .mini-player-root.size-sm,
  .mini-player-root.size-md,
  .mini-player-root.size-lg {
    right: 10px;
    left: 10px;
    bottom: 68px;
    width: auto;
    max-width: none;
  }
  .mp-vol-slider { width: 46px; }
}


/* ===================== IN-CARD INLINE VIDEO PLAYER (卡片视窗内直接播放) ===================== */
.card-media.is-inline-playing {
  background: #0B1411;
}
.card-media.is-inline-playing > img,
.card-media.is-inline-playing > .card-media-overlay {
  display: none;
}
.card-inline-wrap {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: #0B1411;
  z-index: 6;
}
.card-inline-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0B1411;
  cursor: pointer;
}
.card-inline-sub {
  position: relative;
  z-index: 2;
  margin: 0 10px 6px;
  padding: 5px 9px;
  border-radius: 9px;
  background: rgba(11, 20, 17, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(210, 177, 111, 0.25);
  text-align: center;
  pointer-events: none;
}
.card-inline-sub.hidden { display: none; }
.card-inline-sub-en {
  color: #FFFFFF;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1.32;
  text-shadow: 0 1px 3px rgba(0,0,0,0.85);
}
.card-inline-sub-zh {
  color: #E7DFC9;
  font-size: 11px;
  line-height: 1.3;
  margin-top: 2px;
}
.card-inline-bar {
  position: relative;
  z-index: 3;
  background: linear-gradient(180deg, rgba(11,20,17,0.15) 0%, rgba(11,20,17,0.92) 45%);
  padding: 6px 8px 7px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.card-inline-seek {
  width: 100%;
  height: 3.5px;
  accent-color: #D2B16F;
  cursor: pointer;
  margin: 0;
}
.card-inline-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
}
.card-inline-grp {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.ci-btn {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(25, 53, 44, 0.8);
  color: #F2EFE6;
  font-size: 11px;
  font-weight: 650;
  height: 24px;
  padding: 0 7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  transition: all 0.14s ease;
}
.ci-btn:hover { background: #173F36; border-color: #D2B16F; }
.ci-btn.active { background: #D2B16F; color: #101F1B; border-color: #D2B16F; }
.ci-vol {
  width: 44px;
  height: 3px;
  accent-color: #D2B16F;
  cursor: pointer;
}
.featured-grid.cols-4 .ci-vol,
.featured-grid.cols-5 .ci-vol { display: none; }
.featured-grid.cols-5 .ci-btn { font-size: 10px; padding: 0 5px; height: 22px; }


/* ===================== EDITORIAL SHIXING VOCABULARY VAULT (地道词卡库美学升级) ===================== */
.vocab-hero-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.vocab-h1 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  margin: 0;
}
.vocab-h1 .sx-icon { width: 22px; height: 22px; color: var(--sx-skin-gold, #986E2C); }
.vocab-subtitle {
  margin: 6px 0 0;
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.5;
}
.vocab-total-badge {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--sx-skin-link, #276249);
  background: var(--sage-soft, rgba(39, 98, 73, 0.1));
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}

.vocab-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  margin-bottom: 22px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}
.vocab-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: flex-end;
  min-width: 260px;
  flex-wrap: wrap;
}
.vocab-search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px 12px;
  flex: 1;
  min-width: 190px;
  max-width: 320px;
}
.vocab-search-box .sx-icon { width: 15px; height: 15px; color: var(--text-muted); }
.vocab-search-box input {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  width: 100%;
  outline: none;
}
.vocab-search-box input::placeholder { color: var(--text-muted); }
.vocab-ep-select { max-width: 240px; }

.vocab-grid-editorial {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
@media (max-width: 1040px) { .vocab-grid-editorial { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .vocab-grid-editorial { grid-template-columns: minmax(0, 1fr); gap: 14px; } }

.vocab-card-v2 {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px 18px 15px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.vocab-card-v2:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--sx-skin-gold, #986E2C);
}
.vocab-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vocab-meta-left { display: inline-flex; align-items: center; gap: 8px; }
.vocab-type-pill {
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.01em;
}
.vocab-type-pill.is-expr {
  background: var(--sage-soft, rgba(39, 98, 73, 0.1));
  color: var(--sx-skin-link, #276249);
  border: 1px solid rgba(39, 98, 73, 0.18);
}
.vocab-type-pill.is-word {
  background: var(--amber-soft, rgba(152, 110, 44, 0.12));
  color: var(--sx-skin-gold, #986E2C);
  border: 1px solid rgba(152, 110, 44, 0.22);
}
.vocab-card-v2 .freq-stars {
  font-size: 11.5px;
  color: var(--sx-skin-gold, #986E2C);
  letter-spacing: 1px;
}
.vocab-actions-right { display: inline-flex; align-items: center; gap: 6px; }
.vocab-icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}
.vocab-icon-btn .sx-icon { width: 15px; height: 15px; }
.vocab-icon-btn:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-elevated); }
.vocab-icon-btn.is-fav {
  color: var(--sx-skin-gold, #986E2C);
  border-color: var(--sx-skin-gold, #986E2C);
  background: var(--amber-soft, rgba(152, 110, 44, 0.12));
}

.vocab-term-block { display: flex; flex-direction: column; gap: 3px; }
.vocab-term-v2 {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.vocab-ipa-v2 {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.vocab-note-v2 {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
  opacity: 0.92;
}
.vocab-more-head {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.vocab-example-v2 {
  background: var(--bg-soft);
  border-left: 2.5px solid var(--sx-skin-gold, #986E2C);
  border-radius: 0 10px 10px 0;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.vocab-ex-en {
  font-size: 12.8px;
  line-height: 1.5;
  color: var(--text);
  font-weight: 500;
}
.vocab-ex-zh {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted);
}

.vocab-card-foot {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.vocab-ep-pill {
  font-size: 11.5px;
  font-weight: 650;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 3px 9px;
  border-radius: 999px;
}
.vocab-jump-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--sx-skin-link, #276249);
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.16s ease;
}
.vocab-jump-btn:hover {
  background: var(--sx-skin-control, #173F36);
  color: var(--sx-skin-on-control, #F2EFE6);
  border-color: var(--sx-skin-control, #173F36);
}
