/* ==============================
   SceneLearn — Design System
   ============================== */

:root {
  /* Color Palette — Dark (default) */
  --bg-primary: #0a0e1a;
  --bg-secondary: #111827;
  --bg-card: #1a2238;
  --bg-card-hover: #1f2a42;
  --bg-surface: rgba(26, 34, 56, 0.6);
  --bg-glass: rgba(26, 34, 56, 0.45);

  --text-primary: #f0f4ff;
  --text-secondary: #94a3c4;
  --text-muted: #7b8db5;
  --text-chinese: #b0bfdb;

  --accent-primary: #6d5aff;
  --accent-primary-light: #8577ff;
  --accent-primary-dark: #5444d9;
  --accent-secondary: #00d4aa;
  --accent-tertiary: #ff6b9d;
  --accent-warning: #ffb347;
  --accent-info: #5bc0eb;

  --gradient-primary: linear-gradient(135deg, #6d5aff 0%, #00d4aa 100%);
  --gradient-hero: linear-gradient(135deg, #0a0e1a 0%, #1a1040 30%, #0d1f3c 70%, #0a0e1a 100%);
  --gradient-card: linear-gradient(135deg, rgba(109, 90, 255, 0.08) 0%, rgba(0, 212, 170, 0.08) 100%);
  --gradient-text: linear-gradient(135deg, #6d5aff, #00d4aa, #5bc0eb);

  --border-color: rgba(109, 90, 255, 0.15);
  --border-color-hover: rgba(109, 90, 255, 0.35);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 24px rgba(109, 90, 255, 0.25);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  --font-main: 'Inter', 'Noto Sans TC', -apple-system, BlinkMacSystemFont, sans-serif;

  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  --nav-height: 72px;
  --nav-bg: rgba(10, 14, 26, 0.75);
  --nav-bg-scrolled: rgba(10, 14, 26, 0.92);
}

/* ===== Light Theme ===== */
[data-theme="light"] {
  --bg-primary: #f5f7fb;
  --bg-secondary: #eef1f8;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f2fa;
  --bg-surface: rgba(255, 255, 255, 0.8);
  --bg-glass: rgba(255, 255, 255, 0.65);

  --text-primary: #1a1e2e;
  --text-secondary: #4a5568;
  --text-muted: #6b7a94;
  --text-chinese: #3a4a64;

  --gradient-hero: linear-gradient(135deg, #f5f7fb 0%, #e8e0ff 30%, #dff0f7 70%, #f5f7fb 100%);
  --gradient-card: linear-gradient(135deg, rgba(109, 90, 255, 0.05) 0%, rgba(0, 212, 170, 0.05) 100%);

  --border-color: rgba(109, 90, 255, 0.12);
  --border-color-hover: rgba(109, 90, 255, 0.28);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-glow: 0 0 24px rgba(109, 90, 255, 0.12);

  --nav-bg: rgba(245, 247, 251, 0.8);
  --nav-bg-scrolled: rgba(245, 247, 251, 0.95);
}

/* ===== Reset ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-main);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

a {
  text-decoration: none;
  color: inherit;
}

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

img {
  max-width: 100%;
  display: block;
}

/* ===== Utility ===== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.text-gradient {
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ===== Navigation ===== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
  transition: var(--transition-base);
}

.nav.scrolled {
  background: var(--nav-bg-scrolled);
  box-shadow: var(--shadow-md);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 32px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.4rem;
  font-weight: 800;
}

.brand-icon {
  font-size: 1.6rem;
}

.brand-accent {
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  gap: 8px;
}

.nav-link {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: var(--transition-base);
  position: relative;
}

.nav-link:hover {
  color: var(--text-primary);
  background: rgba(109, 90, 255, 0.08);
}

.nav-link.active {
  color: var(--text-primary);
  background: rgba(109, 90, 255, 0.12);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2px;
  background: var(--gradient-primary);
  border-radius: 2px;
}

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

.btn-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  color: var(--text-secondary);
}

.btn-icon:hover {
  background: rgba(109, 90, 255, 0.12);
  color: var(--text-primary);
}

.icon-moon { display: none; }
[data-theme="light"] .icon-sun { display: none; }
[data-theme="light"] .icon-moon { display: block; }

/* Light theme particle visibility */
[data-theme="light"] .particle {
  opacity: 0.5;
}

.level-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 20px;
  background: var(--gradient-primary);
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: white;
}

.btn-level {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
}

.btn-level:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: var(--transition-base);
  cursor: pointer;
  border: none;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 16px rgba(109, 90, 255, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(109, 90, 255, 0.5);
}

.btn-ghost {
  background: rgba(109, 90, 255, 0.08);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn-ghost:hover {
  background: rgba(109, 90, 255, 0.15);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-outline:hover {
  background: rgba(109, 90, 255, 0.08);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

/* ===== Pages ===== */
.page {
  display: none;
  padding-top: var(--nav-height);
}

.page.active {
  display: block;
}

.page-header {
  padding: 48px 0 32px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb a {
  color: var(--accent-primary-light);
  transition: var(--transition-fast);
}

.breadcrumb a:hover {
  color: var(--accent-primary);
}

.page-title {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: var(--gradient-hero);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 50% at 20% 50%, rgba(109, 90, 255, 0.15) 0%, transparent 70%),
    radial-gradient(ellipse 50% 40% at 80% 40%, rgba(0, 212, 170, 0.1) 0%, transparent 70%),
    radial-gradient(ellipse 40% 30% at 50% 80%, rgba(91, 192, 235, 0.08) 0%, transparent 60%);
}

.hero-particles {
  position: absolute;
  inset: 0;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(109, 90, 255, 0.4);
  animation: float-particle linear infinite;
}

@keyframes float-particle {
  0% { transform: translateY(100vh) scale(0); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) scale(1); opacity: 0; }
}

.hero-content {
  position: relative;
  text-align: center;
  z-index: 2;
  padding: 0 24px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  background: rgba(109, 90, 255, 0.1);
  border: 1px solid rgba(109, 90, 255, 0.2);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--accent-primary-light);
  margin-bottom: 28px;
  animation: fade-in-up 0.6s ease-out;
}

.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.2rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
  animation: fade-in-up 0.6s ease-out 0.1s both;
}

.hero-desc {
  font-size: 1.15rem;
  color: var(--text-secondary);
  line-height: 1.7;
  max-width: 600px;
  margin: 0 auto 40px;
  animation: fade-in-up 0.6s ease-out 0.2s both;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 64px;
  animation: fade-in-up 0.6s ease-out 0.3s both;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 56px;
  animation: fade-in-up 0.6s ease-out 0.4s both;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-size: 2.4rem;
  font-weight: 800;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
}

@keyframes fade-in-up {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== Features Section ===== */
.features-section {
  padding: 100px 0;
  position: relative;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 56px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: var(--transition-slow);
  animation: fade-in-up 0.5s ease-out calc(var(--delay) * 0.1s) both;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
  background: var(--bg-card-hover);
}

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ===== Show Section ===== */
.show-section {
  padding: 60px 0 120px;
}

.show-showcase {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.show-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: var(--transition-slow);
  cursor: pointer;
}

.show-card-featured {
  background: var(--bg-card);
}

.show-card-featured:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.show-card-image {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-secondary);
}

.show-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: var(--transition-slow);
}

.show-card-featured:hover .show-card-image img {
  transform: scale(1.05);
}

.show-card-overlay {
  position: absolute;
  top: 16px;
  right: 16px;
}

.show-badge {
  padding: 4px 12px;
  background: var(--accent-secondary);
  color: #0a0e1a;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
}

.show-card-info {
  padding: 28px;
}

.show-card-info h3 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.show-meta {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 12px;
}

.show-desc {
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.6;
  margin-bottom: 18px;
}

.show-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  background: rgba(109, 90, 255, 0.1);
  border: 1px solid rgba(109, 90, 255, 0.15);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-primary-light);
}

.show-card-coming {
  background: var(--gradient-card);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

.show-card-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.show-card-placeholder span {
  font-size: 3rem;
  display: block;
  margin-bottom: 12px;
}

.show-card-placeholder p {
  font-size: 1rem;
  font-weight: 500;
}

/* ===== Season Tabs ===== */
.season-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.season-tab {
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
  white-space: nowrap;
}

.season-tab:hover {
  color: var(--text-primary);
  background: rgba(109, 90, 255, 0.08);
}

.season-tab.active {
  color: white;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  box-shadow: 0 2px 12px rgba(109, 90, 255, 0.3);
}

/* ===== Episodes Grid ===== */
.episodes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding-bottom: 80px;
}

.episode-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition-base);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.episode-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-primary);
  opacity: 0;
  transition: var(--transition-base);
}

.episode-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.episode-card:hover::before {
  opacity: 1;
}

.episode-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--gradient-primary);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 700;
  color: white;
  margin-bottom: 16px;
}

.episode-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 8px;
  line-height: 1.4;
}

.episode-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.episode-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ===== Transcript Layout (Single Column) ===== */
.transcript-container {
  max-width: 900px;
  padding-bottom: 80px;
}

.transcript-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 0 16px;
}

.btn-back {
  flex-shrink: 0;
}

/* Toggle Controls */
.toggle-control {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-secondary);
  padding: 6px 0;
}

.toggle-control input {
  display: none;
}

.toggle-slider {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--bg-card);
  border-radius: 100px;
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
  flex-shrink: 0;
}

.toggle-slider::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: var(--text-muted);
  border-radius: 50%;
  transition: var(--transition-base);
}

.toggle-control input:checked + .toggle-slider {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

.toggle-control input:checked + .toggle-slider::after {
  transform: translateX(20px);
  background: white;
}

/* Progress */
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.progress-bar {
  height: 6px;
  background: var(--bg-card);
  border-radius: 100px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 100px;
  transition: width 0.5s ease;
}

.transcript-progress {
  margin-top: 16px;
  max-width: 360px;
}

/* Vocab Pills */
.vocab-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vocab-pill {
  padding: 4px 12px;
  background: rgba(109, 90, 255, 0.1);
  border: 1px solid rgba(109, 90, 255, 0.15);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent-primary-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.vocab-pill:hover {
  background: rgba(109, 90, 255, 0.2);
  border-color: rgba(109, 90, 255, 0.3);
}

/* Settings Panel — collapsible */
.settings-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
  opacity: 0;
}

.settings-panel.open {
  max-height: 320px;
  opacity: 1;
}

.settings-panel-inner {
  display: flex;
  gap: 40px;
  padding: 20px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  margin-bottom: 24px;
}

.settings-toggles {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 220px;
}

.settings-vocab-summary {
  flex: 1;
}

.settings-vocab-summary h4 {
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-secondary);
}

/* Transcript Header */
.transcript-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.transcript-info h2 {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.ep-title {
  color: var(--accent-primary-light);
}

.transcript-meta {
  display: flex;
  gap: 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.transcript-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

#btn-settings.active {
  background: rgba(109, 90, 255, 0.15);
  color: var(--accent-primary-light);
  border-color: var(--accent-primary);
}

/* ===== Transcript Lines ===== */
.transcript-lines {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.transcript-line {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  padding: 16px;
  border-radius: var(--radius-md);
  transition: var(--transition-base);
  position: relative;
}

.transcript-line:hover {
  background: rgba(109, 90, 255, 0.04);
}

.transcript-line.active {
  background: rgba(109, 90, 255, 0.08);
  border: 1px solid rgba(109, 90, 255, 0.15);
}

.line-controls {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
}

.line-number {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.btn-play {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(109, 90, 255, 0.1);
  color: var(--accent-primary-light);
  transition: var(--transition-base);
  flex-shrink: 0;
}

.btn-play:hover {
  background: var(--accent-primary);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 0 16px rgba(109, 90, 255, 0.4);
}

.btn-play svg {
  width: 14px;
  height: 14px;
}

.line-content {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.line-english {
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-primary);
}

.line-chinese {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-chinese);
  transition: var(--transition-base);
}
/* B1 Vocabulary Highlight */
.vocab-highlight {
  background: rgba(109, 90, 255, 0.15);
  color: var(--accent-primary-light);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 2px solid rgba(109, 90, 255, 0.3);
  font-weight: 500;
}

.vocab-highlight:hover {
  background: rgba(109, 90, 255, 0.25);
  border-bottom-color: var(--accent-primary);
}

/* Phrase Highlight */
.phrase-highlight {
  background: rgba(0, 212, 170, 0.12);
  color: var(--accent-secondary);
  padding: 1px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 2px solid rgba(0, 212, 170, 0.3);
  font-weight: 500;
}

.phrase-highlight:hover {
  background: rgba(0, 212, 170, 0.22);
  border-bottom-color: var(--accent-secondary);
}

.transcript-container.hide-vocab .vocab-highlight {
  background: none;
  color: inherit;
  padding: 0;
  border-bottom: none;
  cursor: default;
  font-weight: inherit;
}

.transcript-container.hide-phrases .phrase-highlight {
  background: none;
  color: inherit;
  padding: 0;
  border-bottom: none;
  cursor: default;
  font-weight: inherit;
}

.transcript-container.hide-chinese .line-chinese {
  opacity: 0;
  height: 0;
  overflow: hidden;
}

/* ===== Vocabulary Popup ===== */
.vocab-popup {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
}

.vocab-popup.show {
  display: flex;
  animation: fade-in 0.2s ease-out;
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.vocab-popup-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  max-width: 480px;
  width: 90%;
  position: relative;
  animation: popup-in 0.3s var(--transition-spring);
  box-shadow: var(--shadow-lg);
}

@keyframes popup-in {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.vocab-popup-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.vocab-popup-close:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.vocab-word {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 4px;
  background: var(--gradient-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.vocab-phonetic {
  font-size: 0.92rem;
  color: var(--text-muted);
  margin-bottom: 12px;
  font-style: italic;
}

.vocab-pos {
  display: inline-block;
  padding: 3px 10px;
  background: rgba(109, 90, 255, 0.1);
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--accent-primary-light);
  margin-bottom: 16px;
}

.vocab-definition {
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.6;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
}

.vocab-examples {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.vocab-example {
  padding: 12px 16px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent-secondary);
}

.vocab-example .example-en {
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.vocab-example .example-zh {
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* ===== Vocabulary Page ===== */
.vocab-filters {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  transition: var(--transition-base);
  flex: 1;
  min-width: 240px;
  color: var(--text-muted);
}

.search-box:focus-within {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(109, 90, 255, 0.1);
}

.search-box input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.92rem;
  width: 100%;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.filter-group {
  display: flex;
  gap: 6px;
}

.filter-btn {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  transition: var(--transition-base);
}

.filter-btn:hover {
  color: var(--text-primary);
  background: rgba(109, 90, 255, 0.08);
}

.filter-btn.active {
  color: white;
  background: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* Vocab Grid */
.vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  padding-bottom: 80px;
}

.vocab-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: var(--transition-base);
  cursor: pointer;
}

.vocab-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.vocab-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.vocab-card-word {
  font-size: 1.3rem;
  font-weight: 700;
}

.vocab-card-pos {
  padding: 2px 8px;
  background: rgba(109, 90, 255, 0.1);
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-primary-light);
}

.vocab-card-phonetic {
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 8px;
  font-style: italic;
}

.vocab-card-def {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: 16px;
}

.vocab-card-episode {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.vocab-card-episode .ep-tag {
  padding: 2px 8px;
  background: rgba(0, 212, 170, 0.1);
  border-radius: 4px;
  color: var(--accent-secondary);
  font-weight: 500;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .features-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .show-showcase {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .settings-panel-inner {
    flex-direction: column;
    gap: 20px;
  }

  .transcript-header {
    flex-direction: column;
    gap: 16px;
  }

  .transcript-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .nav-links {
    display: none;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    gap: 32px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .page-title {
    font-size: 1.8rem;
  }

  .vocab-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .transcript-container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* ===== Light theme overrides ===== */
[data-theme="light"] .btn-primary {
  box-shadow: 0 4px 16px rgba(109, 90, 255, 0.2);
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 6px 24px rgba(109, 90, 255, 0.3);
}

[data-theme="light"] .vocab-popup-content {
  background: var(--bg-card);
  box-shadow: var(--shadow-lg);
}

[data-theme="light"] .vocab-example {
  background: rgba(109, 90, 255, 0.04);
}

[data-theme="light"] .settings-panel-inner {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .episode-card {
  box-shadow: var(--shadow-sm);
}

[data-theme="light"] .toggle-slider {
  background: #d1d5de;
}

[data-theme="light"] .toggle-slider::after {
  background: white;
}
