/* Know My Level — 95/5 Adaptive Reading Studio */

:root {
  --theme-name: "light";
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-soft: #f1f5f9;
  --bg-hover: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-hover: #1d4ed8;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --radius: 14px;
  --radius-sm: 8px;
  --font: "Segoe UI", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --mono: "JetBrains Mono", "SF Mono", ui-monospace, monospace;

  --tag-unset: #94a3b8;
  --tag-unset-bg: transparent;
  --tag-mastered: #16a34a;
  --tag-mastered-bg: #dcfce7;
  --tag-familiar: #65a30d;
  --tag-familiar-bg: #ecfccb;
  --tag-shaky: #ca8a04;
  --tag-shaky-bg: #fef9c3;
  --tag-learning: #ea580c;
  --tag-learning-bg: #ffedd5;
  --tag-unknown: #dc2626;
  --tag-unknown-bg: #fee2e2;

  --tag-mastered-fg: #14532d;
  --tag-familiar-fg: #3f6212;
  --tag-shaky-fg: #854d0e;
  --tag-learning-fg: #9a3412;
  --tag-unknown-fg: #991b1b;
  --tag-unset-fg: var(--text);

  /* Cinema Viewport Tokens */
  --cinema-bg: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  --cinema-surface: rgba(255, 255, 255, 0.94);
  --cinema-surface-soft: rgba(241, 245, 249, 0.9);
  --cinema-border: rgba(0, 0, 0, 0.12);
  --cinema-text: #0f172a;
  --cinema-text-muted: #475569;
  --cinema-text-subtle: #64748b;
  --cinema-sub-bg: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.94) 22%, #ffffff 100%);
  --cinema-sub-target: #0f172a;
  --cinema-sub-source: #334155;
  --cinema-sub-shadow: none;
  --cinema-word-color: #0f172a;
  --cinema-active-word: #c2410c;
  --cinema-active-word-bg: rgba(234, 88, 12, 0.12);
  --cinema-active-word-border: #ea580c;
  --cinema-active-word-shadow: none;
  --cinema-panel-bg: rgba(255, 255, 255, 0.96);
  --cinema-panel-border: rgba(0, 0, 0, 0.12);
  --cinema-panel-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);

  /* Subtitle Tokens Contrast Defaults */
  --cinema-token-color: #0f172a;
  --cinema-token-mastered: #0f172a;
  --cinema-token-familiar: #0f172a;
  --cinema-token-punct: #475569;
  --cinema-token-hover-bg: rgba(15, 23, 42, 0.08);
  --cinema-token-shaky: #92400e;
  --cinema-token-shaky-border: #d97706;
  --cinema-token-learning: #c2410c;
  --cinema-token-learning-border: #ea580c;
  --cinema-token-unknown: #b91c1c;
  --cinema-token-unknown-border: #dc2626;
  --cinema-token-lu: #0369a1;
  --cinema-token-lu-border: #0284c7;
  --cinema-token-sep: #0284c7;

  /* Badges Defaults */
  --cinema-badge-cefr-bg: #e0f2fe;
  --cinema-badge-cefr-color: #0369a1;
  --cinema-badge-cefr-border: #bae6fd;
  --cinema-badge-review-bg: #f3e8ff;
  --cinema-badge-review-color: #7e22ce;
  --cinema-badge-review-border: #e9d5ff;
  --cinema-dots-color: #d97706;

  /* Annotation Badge Defaults */
  --cinema-annot-badge-bg: #fef3c7;
  --cinema-annot-badge-color: #92400e;
  --cinema-annot-badge-border: #fcd34d;
  --cinema-annot-underline: #d97706;
  --cinema-annot-hover-bg: rgba(245, 158, 11, 0.14);

  color-scheme: light dark;
}

/* Material Light */
[data-theme="light"],
html[data-theme="light"],
body[data-theme="light"] {
  --theme-name: "light";
  --bg: #f8fafc;
  --bg-elev: #ffffff;
  --bg-soft: #f1f5f9;
  --bg-hover: #e2e8f0;
  --text: #0f172a;
  --text-muted: #475569;
  --text-subtle: #64748b;
  --border: #e2e8f0;
  --border-focus: #3b82f6;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --accent-hover: #1d4ed8;
  --shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);

  --tag-mastered: #16a34a;
  --tag-mastered-bg: #dcfce7;
  --tag-mastered-fg: #14532d;
  --tag-familiar: #65a30d;
  --tag-familiar-bg: #ecfccb;
  --tag-familiar-fg: #3f6212;
  --tag-shaky: #ca8a04;
  --tag-shaky-bg: #fef9c3;
  --tag-shaky-fg: #854d0e;
  --tag-learning: #ea580c;
  --tag-learning-bg: #ffedd5;
  --tag-learning-fg: #9a3412;
  --tag-unknown: #dc2626;
  --tag-unknown-bg: #fee2e2;
  --tag-unknown-fg: #991b1b;
  --tag-unset: #94a3b8;
  --tag-unset-fg: var(--text);

  --cinema-bg: linear-gradient(145deg, #f1f5f9 0%, #e2e8f0 100%);
  --cinema-surface: rgba(255, 255, 255, 0.94);
  --cinema-surface-soft: rgba(241, 245, 249, 0.9);
  --cinema-border: rgba(0, 0, 0, 0.12);
  --cinema-text: #0f172a;
  --cinema-text-muted: #475569;
  --cinema-text-subtle: #64748b;
  --cinema-sub-bg: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.94) 22%, #ffffff 100%);
  --cinema-sub-target: #0f172a;
  --cinema-sub-source: #334155;
  --cinema-sub-shadow: none;
  --cinema-word-color: #0f172a;
  --cinema-active-word: #c2410c;
  --cinema-active-word-bg: rgba(234, 88, 12, 0.12);
  --cinema-active-word-border: #ea580c;
  --cinema-active-word-shadow: none;
  --cinema-panel-bg: rgba(255, 255, 255, 0.96);
  --cinema-panel-border: rgba(0, 0, 0, 0.12);
  --cinema-panel-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);

  /* Subtitle Tokens Contrast - Light Theme */
  --cinema-token-color: #0f172a;
  --cinema-token-mastered: #0f172a;
  --cinema-token-familiar: #0f172a;
  --cinema-token-punct: #475569;
  --cinema-token-hover-bg: rgba(15, 23, 42, 0.08);
  --cinema-token-shaky: #92400e;
  --cinema-token-shaky-border: #d97706;
  --cinema-token-learning: #c2410c;
  --cinema-token-learning-border: #ea580c;
  --cinema-token-unknown: #b91c1c;
  --cinema-token-unknown-border: #dc2626;
  --cinema-token-lu: #0369a1;
  --cinema-token-lu-border: #0284c7;
  --cinema-token-sep: #0284c7;

  /* Badges - Light Theme */
  --cinema-badge-cefr-bg: #e0f2fe;
  --cinema-badge-cefr-color: #0369a1;
  --cinema-badge-cefr-border: #bae6fd;
  --cinema-badge-review-bg: #f3e8ff;
  --cinema-badge-review-color: #7e22ce;
  --cinema-badge-review-border: #e9d5ff;
  --cinema-dots-color: #d97706;

  /* Annotation Badge - Light Theme */
  --cinema-annot-badge-bg: #fef3c7;
  --cinema-annot-badge-color: #92400e;
  --cinema-annot-badge-border: #fcd34d;
  --cinema-annot-underline: #d97706;
  --cinema-annot-hover-bg: rgba(245, 158, 11, 0.14);

  color-scheme: light;
}

/* Material Dark */
[data-theme="dark"],
html[data-theme="dark"],
body[data-theme="dark"] {
  --theme-name: "dark";
  --bg: #0f1419;
  --bg-elev: #1a222d;
  --bg-soft: #243041;
  --bg-hover: #2e3d52;
  --text: #e8eef7;
  --text-muted: #9aabbd;
  --text-subtle: #64748b;
  --border: #2f3d4f;
  --border-focus: #60a5fa;
  --accent: #60a5fa;
  --accent-soft: #1e3a5f;
  --accent-hover: #93c5fd;
  --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.3);

  --tag-mastered-bg: #14532d;
  --tag-familiar-bg: #3f6212;
  --tag-shaky-bg: #713f12;
  --tag-learning-bg: #7c2d12;
  --tag-unknown-bg: #7f1d1d;
  --tag-mastered-fg: #bbf7d0;
  --tag-familiar-fg: #d9f99d;
  --tag-shaky-fg: #fde68a;
  --tag-learning-fg: #fdba74;
  --tag-unknown-fg: #fecaca;
  --tag-mastered: #4ade80;
  --tag-familiar: #a3e635;
  --tag-shaky: #facc15;
  --tag-learning: #fb923c;
  --tag-unknown: #f87171;
  --tag-unset: #94a3b8;
  --tag-unset-fg: var(--text);

  --cinema-bg: radial-gradient(circle at 50% 18%, #1e293b 0%, #090d16 100%);
  --cinema-surface: rgba(15, 23, 42, 0.85);
  --cinema-surface-soft: rgba(30, 41, 59, 0.7);
  --cinema-border: rgba(255, 255, 255, 0.14);
  --cinema-text: #f8fafc;
  --cinema-text-muted: #94a3b8;
  --cinema-text-subtle: #64748b;
  --cinema-sub-bg: linear-gradient(180deg, rgba(9, 13, 22, 0) 0%, rgba(9, 13, 22, 0.82) 25%, rgba(9, 13, 22, 0.96) 100%);
  --cinema-sub-target: #ffffff;
  --cinema-sub-source: #f8fafc;
  --cinema-sub-shadow: 0 2px 12px rgba(0, 0, 0, 0.92);
  --cinema-word-color: #8ecbc1;
  --cinema-active-word: #f6ad7b;
  --cinema-active-word-bg: rgba(184, 115, 68, 0.38);
  --cinema-active-word-border: #f6ad7b;
  --cinema-active-word-shadow: 0 0 16px rgba(246, 173, 123, 0.75), 0 2px 8px rgba(0, 0, 0, 0.9);
  --cinema-panel-bg: rgba(15, 23, 42, 0.85);
  --cinema-panel-border: rgba(255, 255, 255, 0.15);
  --cinema-panel-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);

  /* Subtitle Tokens Contrast - Dark Theme */
  --cinema-token-color: #f8fafc;
  --cinema-token-mastered: #f8fafc;
  --cinema-token-familiar: #f8fafc;
  --cinema-token-punct: #94a3b8;
  --cinema-token-hover-bg: rgba(255, 255, 255, 0.16);
  --cinema-token-shaky: #fef08a;
  --cinema-token-shaky-border: rgba(250, 204, 21, 0.75);
  --cinema-token-learning: #fed7aa;
  --cinema-token-learning-border: rgba(251, 146, 60, 0.85);
  --cinema-token-unknown: #fecaca;
  --cinema-token-unknown-border: rgba(248, 113, 113, 0.85);
  --cinema-token-lu: #e0f2fe;
  --cinema-token-lu-border: #38bdf8;
  --cinema-token-sep: #38bdf8;

  /* Badges - Dark Theme */
  --cinema-badge-cefr-bg: rgba(56, 189, 248, 0.18);
  --cinema-badge-cefr-color: #38bdf8;
  --cinema-badge-cefr-border: rgba(56, 189, 248, 0.35);
  --cinema-badge-review-bg: rgba(168, 85, 247, 0.18);
  --cinema-badge-review-color: #c084fc;
  --cinema-badge-review-border: rgba(168, 85, 247, 0.35);
  --cinema-dots-color: #ca8a04;

  /* Annotation Badge - Dark Theme */
  --cinema-annot-badge-bg: rgba(245, 158, 11, 0.16);
  --cinema-annot-badge-color: #fbbf24;
  --cinema-annot-badge-border: rgba(245, 158, 11, 0.4);
  --cinema-annot-underline: #f59e0b;
  --cinema-annot-hover-bg: rgba(245, 158, 11, 0.22);

  color-scheme: dark;
}

/* Solarized Dark (日蝕青) */
[data-theme="solarized"],
html[data-theme="solarized"],
body[data-theme="solarized"] {
  --theme-name: "solarized";
  --bg: #002b36;
  --bg-elev: #073642;
  --bg-soft: #0a4452;
  --bg-hover: #0e5263;
  --text: #839496;
  --text-muted: #93a1a1;
  --text-subtle: #586e75;
  --border: #0e4c5b;
  --border-focus: #2aa198;
  --accent: #2aa198;
  --accent-soft: #003847;
  --accent-hover: #3bc7bd;
  --shadow: 0 12px 36px rgba(0, 20, 26, 0.55);
  --shadow-sm: 0 4px 12px rgba(0, 20, 26, 0.4);

  --tag-mastered: #859900;
  --tag-mastered-bg: #073642;
  --tag-mastered-fg: #859900;
  --tag-familiar: #2aa198;
  --tag-familiar-bg: #073642;
  --tag-familiar-fg: #2aa198;
  --tag-shaky: #b58900;
  --tag-shaky-bg: #073642;
  --tag-shaky-fg: #b58900;
  --tag-learning: #cb4b16;
  --tag-learning-bg: #073642;
  --tag-learning-fg: #cb4b16;
  --tag-unknown: #dc322f;
  --tag-unknown-bg: #073642;
  --tag-unknown-fg: #dc322f;
  --tag-unset: #586e75;
  --tag-unset-fg: var(--text);

  --cinema-bg: radial-gradient(circle at 50% 18%, #073642 0%, #001f27 100%);
  --cinema-surface: rgba(7, 54, 66, 0.9);
  --cinema-surface-soft: rgba(10, 68, 82, 0.75);
  --cinema-border: rgba(42, 161, 152, 0.25);
  --cinema-text: #93a1a1;
  --cinema-text-muted: #839496;
  --cinema-text-subtle: #586e75;
  --cinema-sub-bg: linear-gradient(180deg, rgba(0, 31, 39, 0) 0%, rgba(0, 31, 39, 0.85) 25%, rgba(0, 31, 39, 0.98) 100%);
  --cinema-sub-target: #fdf6e3;
  --cinema-sub-source: #93a1a1;
  --cinema-sub-shadow: 0 2px 10px rgba(0, 15, 20, 0.85);
  --cinema-word-color: #2aa198;
  --cinema-active-word: #b58900;
  --cinema-active-word-bg: rgba(181, 137, 0, 0.28);
  --cinema-active-word-border: #b58900;
  --cinema-active-word-shadow: 0 0 14px rgba(181, 137, 0, 0.6);
  --cinema-panel-bg: rgba(7, 54, 66, 0.9);
  --cinema-panel-border: rgba(42, 161, 152, 0.3);
  --cinema-panel-shadow: 0 16px 40px rgba(0, 20, 26, 0.65);

  /* Subtitle Tokens Contrast - Solarized Dark */
  --cinema-token-color: #fdf6e3;
  --cinema-token-mastered: #fdf6e3;
  --cinema-token-familiar: #fdf6e3;
  --cinema-token-punct: #839496;
  --cinema-token-hover-bg: rgba(42, 161, 152, 0.18);
  --cinema-token-shaky: #b58900;
  --cinema-token-shaky-border: #b58900;
  --cinema-token-learning: #cb4b16;
  --cinema-token-learning-border: #cb4b16;
  --cinema-token-unknown: #dc322f;
  --cinema-token-unknown-border: #dc322f;
  --cinema-token-lu: #268bd2;
  --cinema-token-lu-border: #268bd2;
  --cinema-token-sep: #2aa198;

  /* Badges - Solarized Dark */
  --cinema-badge-cefr-bg: rgba(38, 139, 210, 0.22);
  --cinema-badge-cefr-color: #268bd2;
  --cinema-badge-cefr-border: rgba(38, 139, 210, 0.4);
  --cinema-badge-review-bg: rgba(108, 113, 196, 0.22);
  --cinema-badge-review-color: #6c71c4;
  --cinema-badge-review-border: rgba(108, 113, 196, 0.4);
  --cinema-dots-color: #b58900;

  /* Annotation Badge - Solarized Dark */
  --cinema-annot-badge-bg: rgba(181, 137, 0, 0.2);
  --cinema-annot-badge-color: #b58900;
  --cinema-annot-badge-border: rgba(181, 137, 0, 0.4);
  --cinema-annot-underline: #b58900;
  --cinema-annot-hover-bg: rgba(181, 137, 0, 0.25);

  color-scheme: dark;
}

/* Solarized Light (羊皮紙暖光) */
[data-theme="solarized-light"],
html[data-theme="solarized-light"],
body[data-theme="solarized-light"] {
  --theme-name: "solarized-light";
  --bg: #fdf6e3;
  --bg-elev: #eee8d5;
  --bg-soft: #e4dcbe;
  --bg-hover: #d8ceaa;
  --text: #073642;
  --text-muted: #586e75;
  --text-subtle: #657b83;
  --border: #d3c7a6;
  --border-focus: #268bd2;
  --accent: #268bd2;
  --accent-soft: #e2e7d7;
  --accent-hover: #1e70a8;
  --shadow: 0 10px 30px rgba(101, 123, 131, 0.12);
  --shadow-sm: 0 2px 8px rgba(101, 123, 131, 0.08);

  --tag-mastered: #859900;
  --tag-mastered-bg: #e5ecd1;
  --tag-mastered-fg: #5f6e00;
  --tag-familiar: #2aa198;
  --tag-familiar-bg: #d8eeeb;
  --tag-familiar-fg: #196f69;
  --tag-shaky: #b58900;
  --tag-shaky-bg: #f5eed3;
  --tag-shaky-fg: #806000;
  --tag-learning: #cb4b16;
  --tag-learning-bg: #f9e2d7;
  --tag-learning-fg: #94340c;
  --tag-unknown: #dc322f;
  --tag-unknown-bg: #fcdbd8;
  --tag-unknown-fg: #9e1f1c;
  --tag-unset: #93a1a1;
  --tag-unset-fg: var(--text);

  --cinema-bg: linear-gradient(145deg, #eee8d5 0%, #e4dcbe 100%);
  --cinema-surface: rgba(253, 246, 227, 0.94);
  --cinema-surface-soft: rgba(238, 232, 213, 0.9);
  --cinema-border: rgba(101, 123, 131, 0.22);
  --cinema-text: #073642;
  --cinema-text-muted: #586e75;
  --cinema-text-subtle: #657b83;
  --cinema-sub-bg: linear-gradient(180deg, rgba(253, 246, 227, 0) 0%, rgba(253, 246, 227, 0.94) 22%, #fdf6e3 100%);
  --cinema-sub-target: #073642;
  --cinema-sub-source: #586e75;
  --cinema-sub-shadow: none;
  --cinema-word-color: #073642;
  --cinema-active-word: #cb4b16;
  --cinema-active-word-bg: rgba(203, 75, 22, 0.14);
  --cinema-active-word-border: #cb4b16;
  --cinema-active-word-shadow: none;
  --cinema-panel-bg: rgba(253, 246, 227, 0.96);
  --cinema-panel-border: rgba(101, 123, 131, 0.25);
  --cinema-panel-shadow: 0 12px 36px rgba(101, 123, 131, 0.12);

  /* Subtitle Tokens Contrast - Solarized Light */
  --cinema-token-color: #073642;
  --cinema-token-mastered: #073642;
  --cinema-token-familiar: #073642;
  --cinema-token-punct: #586e75;
  --cinema-token-hover-bg: rgba(101, 123, 131, 0.12);
  --cinema-token-shaky: #b58900;
  --cinema-token-shaky-border: #b58900;
  --cinema-token-learning: #cb4b16;
  --cinema-token-learning-border: #cb4b16;
  --cinema-token-unknown: #dc322f;
  --cinema-token-unknown-border: #dc322f;
  --cinema-token-lu: #268bd2;
  --cinema-token-lu-border: #268bd2;
  --cinema-token-sep: #2aa198;

  /* Badges - Solarized Light */
  --cinema-badge-cefr-bg: #e2e7d7;
  --cinema-badge-cefr-color: #268bd2;
  --cinema-badge-cefr-border: #b9d8ee;
  --cinema-badge-review-bg: #eee8d5;
  --cinema-badge-review-color: #6c71c4;
  --cinema-badge-review-border: #c9cae8;
  --cinema-dots-color: #b58900;

  /* Annotation Badge - Solarized Light */
  --cinema-annot-badge-bg: #f5eed3;
  --cinema-annot-badge-color: #806000;
  --cinema-annot-badge-border: #d8ca97;
  --cinema-annot-underline: #b58900;
  --cinema-annot-hover-bg: rgba(181, 137, 0, 0.15);

  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="solarized-light"]) {
    --theme-name: "dark";
    --bg: #0f1419;
    --bg-elev: #1a222d;
    --bg-soft: #243041;
    --border: #2f3d4f;
    --text: #e8eef7;
    --text-muted: #9aabbd;
    --accent: #60a5fa;
    --accent-soft: #1e3a5f;
    --shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
    --tag-mastered-bg: #14532d;
    --tag-familiar-bg: #3f6212;
    --tag-shaky-bg: #713f12;
    --tag-learning-bg: #7c2d12;
    --tag-unknown-bg: #7f1d1d;
    --tag-mastered-fg: #bbf7d0;
    --tag-familiar-fg: #d9f99d;
    --tag-shaky-fg: #fde68a;
    --tag-learning-fg: #fdba74;
    --tag-unknown-fg: #fecaca;
    --tag-mastered: #4ade80;
    --tag-familiar: #a3e635;
    --tag-shaky: #facc15;
    --tag-learning: #fb923c;
    --tag-unknown: #f87171;
    --tag-unset: #94a3b8;
    --cinema-bg: radial-gradient(circle at 50% 18%, #1e293b 0%, #090d16 100%);
    --cinema-surface: rgba(15, 23, 42, 0.78);
    --cinema-surface-soft: rgba(30, 41, 59, 0.7);
    --cinema-border: rgba(255, 255, 255, 0.14);
    --cinema-text: #f8fafc;
    --cinema-text-muted: #94a3b8;
    --cinema-sub-bg: linear-gradient(180deg, rgba(9, 13, 22, 0) 0%, rgba(9, 13, 22, 0.82) 25%, rgba(9, 13, 22, 0.96) 100%);
    --cinema-sub-target: #ffffff;
    --cinema-sub-source: #f8fafc;
    --cinema-sub-shadow: 0 2px 12px rgba(0, 0, 0, 0.92);
    --cinema-word-color: #8ecbc1;
    --cinema-active-word: #f6ad7b;
    --cinema-active-word-bg: rgba(184, 115, 68, 0.38);
    --cinema-active-word-border: #f6ad7b;
    --cinema-panel-bg: rgba(15, 23, 42, 0.78);
    --cinema-panel-border: rgba(255, 255, 255, 0.15);
    --cinema-panel-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg-elev) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  border-radius: 10px;
}
.brand:hover { text-decoration: none; }
.brand:hover .brand-title { color: var(--accent); }
.brand-compact { gap: 0.4rem; flex: 0 0 auto; }
.brand-compact .brand-mark { width: 28px; height: 28px; font-size: 0.72rem; border-radius: 8px; }
.brand-compact .brand-title { font-size: 0.92rem; }
.brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  display: grid; place-items: center;
  color: #fff; font-size: 0.85rem; font-weight: 800;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-title { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; }
.brand-sub { font-size: 0.72rem; color: var(--text-muted); font-weight: 500; }

.nav-tabs {
  display: flex;
  gap: 0.35rem;
  flex: 1;
  flex-wrap: wrap;
}
.nav-tabs button {
  border: none;
  background: transparent;
  color: var(--text-muted);
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
}
.nav-tabs button:hover { background: var(--bg-soft); color: var(--text); }
.nav-tabs button.active {
  background: var(--accent-soft);
  color: var(--accent);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.save-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  min-width: 4.5rem;
}

.btn {
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover { filter: brightness(1.05); }
.btn.ghost { border-color: transparent; background: transparent; }
.back-btn { margin-bottom: 0.75rem; }

main { max-width: 1180px; margin: 0 auto; padding: 1.25rem 1.25rem 3rem; }
.panel { display: none; }
.panel.active { display: block; animation: fadeIn 0.25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1.25rem;
  margin-bottom: 1rem;
}
.help-box {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, var(--border));
  border-radius: var(--radius);
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
  font-size: 0.92rem;
}
.muted { color: var(--text-muted); }
.small { font-size: 0.85rem; }
.mono { font-family: var(--mono); }
.empty { color: var(--text-muted); text-align: center; padding: 1rem; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
}
.legend-item { display: inline-flex; align-items: center; gap: 0.35rem; }
.swatch {
  width: 14px; height: 14px; border-radius: 4px;
  border: 1px solid var(--border);
  display: inline-block;
}
.swatch.mastered { background: var(--tag-mastered-bg); border-color: var(--tag-mastered); }
.swatch.familiar { background: var(--tag-familiar-bg); border-color: var(--tag-familiar); }
.swatch.shaky { background: var(--tag-shaky-bg); border-color: var(--tag-shaky); }
.swatch.learning { background: var(--tag-learning-bg); border-color: var(--tag-learning); }
.swatch.unknown { background: var(--tag-unknown-bg); border-color: var(--tag-unknown); }
.swatch.unset { background: transparent; border-style: dashed; border-color: var(--tag-unset); }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.9rem;
}
.article-card {
  display: block;
  text-decoration: none;
  color: inherit;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  border-radius: var(--radius);
  padding: 1rem;
  cursor: pointer;
  font: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}
.article-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.article-card .title { font-weight: 700; margin-bottom: 0.25rem; color: var(--text); }
.article-card .meta { font-size: 0.8rem; color: var(--text-muted); }
.article-card-wrap { position: relative; }
.article-card-wrap .article-card { padding-right: 7.8rem; }
.article-card-wrap .article-card-actions {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.reader-top-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.reader-top-actions .back-btn { margin-bottom: 0; }

.reader-top-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.reader-nav-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.reader-nav-divider {
  width: 1px;
  height: 1.25rem;
  background: var(--border);
  margin: 0 0.15rem;
}
.reader-nav-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-left: auto;
}
.reader-btn-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 2px 4px;
}
.reader-utility-group a,
.reader-utility-group button {
  padding: 0.25rem 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.reader-utility-group a:hover,
.reader-utility-group button:hover {
  color: var(--text);
  background: var(--bg-soft);
}
.danger-hover:hover {
  color: #dc2626 !important;
  background: #fee2e2 !important;
}

.article-view-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  align-items: flex-start;
}

.ped-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  max-width: 100%;
  transition: all 0.2s ease;
}
.ped-chip.is-collapsed {
  flex-wrap: nowrap;
  overflow: hidden;
  white-space: nowrap;
  max-height: 34px;
}
.ped-chip.is-expanded {
  flex-wrap: wrap;
  max-height: none;
}
.ped-chip .chip-main {
  background: linear-gradient(135deg, #dbeafe, #e0f2fe);
  color: #1e40af;
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .ped-chip .chip-main { background: #1e3a5f; color: #93c5fd; }
}
.ped-chip .levelup-pill {
  background: var(--tag-learning-bg);
  color: var(--tag-learning);
  border: 1px solid color-mix(in srgb, var(--tag-learning) 40%, transparent);
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-weight: 600;
  font-size: 0.78rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.ped-chip .levelup-pill.mastered { background: var(--tag-mastered-bg); color: var(--tag-mastered); border-color: var(--tag-mastered); }
.ped-chip .levelup-pill.familiar { background: var(--tag-familiar-bg); color: var(--tag-familiar); border-color: var(--tag-familiar); }
.ped-chip .levelup-pill.shaky { background: var(--tag-shaky-bg); color: var(--tag-shaky-fg); border-color: var(--tag-shaky); }
.ped-chip .levelup-pill.unknown { background: var(--tag-unknown-bg); color: var(--tag-unknown); border-color: var(--tag-unknown); }
.ped-chip-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--accent);
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}
.ped-chip-toggle-btn:hover {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
}
.ped-chip-toggle-btn.is-expanded {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  color: var(--text-muted);
}

/* Optimized compact header and stable viewport in Slide Mode */
#articleReaderView.is-slide-mode .reader-top-actions {
  margin-bottom: 0.25rem;
}
#articleReaderView.is-slide-mode .article-view-header {
  margin-bottom: 0.35rem;
  gap: 0.5rem;
}
#articleReaderView.is-slide-mode #readerTitle {
  font-size: 1.35rem;
  line-height: 1.3;
}
#articleReaderView.is-slide-mode #readerMeta {
  margin: 0.15rem 0 0.25rem;
  font-size: 0.76rem;
}
#articleReaderView.is-slide-mode .slide-deck-container {
  margin: 0.45rem auto 1.5rem;
  gap: 0.75rem;
}
#articleReaderView.is-slide-mode .slide-deck-header {
  padding: 0.45rem 1rem;
}
#articleReaderView.is-slide-mode .slide-stage {
  min-height: 360px;
}
#articleReaderView.is-slide-mode .slide-card {
  padding: 1.25rem 1.65rem;
  gap: 0.85rem;
  min-height: 360px;
}
#articleReaderView.is-slide-mode .slide-sentence-text {
  font-size: 1.45rem;
  line-height: 1.55;
}

/* Optimized zero-scroll immersive layout in Cinema Mode */
body.is-cinema-mode {
  overflow: hidden !important;
}

body.is-cinema-mode .app-header {
  display: none !important;
}

body.is-cinema-mode .app-footer {
  display: none !important;
}

body.is-cinema-mode main {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 !important;
  margin: 0 auto !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  overflow: hidden !important;
}

#articleReaderView.is-cinema-mode {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0.35rem 0.85rem 0.35rem;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

#articleReaderView.is-cinema-mode .reader-top-actions,
#articleReaderView.is-cinema-mode .article-view-header,
#articleReaderView.is-cinema-mode .reader-view-mode-bar {
  display: none !important;
}

.reader-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 1rem;
  align-items: start;
}
.reader-col { min-width: 0; }
.reader-main { min-height: 200px; }
.reader-sidebar { position: sticky; top: 76px; }

.sentence-block {
  padding: 0.85rem 0;
  border-bottom: 1px dashed var(--border);
}
.sentence-block:last-child { border-bottom: none; }
.de-line {
  font-size: 1.12rem;
  line-height: 1.85;
  margin-bottom: 0.35rem;
}
.zh-line {
  font-size: 0.92rem;
  color: var(--text-muted);
}
.gloss {
  display: none;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--tag-learning);
  background: var(--tag-learning-bg);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
}
.gloss.visible { display: block; }

.token {
  cursor: pointer;
  padding: 0.05rem 0.12rem;
  margin: 0 0.02rem;
  border-radius: 4px;
  border-bottom: 2px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}
.token.punct { cursor: default; padding: 0; margin: 0; border: none; }
.token.phrase, .token.structure {
  border-bottom-style: dotted;
  border-bottom-width: 2px;
  border-bottom-color: color-mix(in srgb, var(--accent) 45%, transparent);
}
.token.structure::after {
  content: "∥";
  font-size: 0.65em;
  vertical-align: super;
  color: var(--accent);
  margin-left: 1px;
  opacity: 0.7;
}

/* status_gradient: green→red familiarity paint (incl. mastered green) */
.token[data-status="mastered"] {
  background: var(--tag-mastered-bg);
  border-bottom-color: var(--tag-mastered);
  color: var(--tag-mastered-fg);
}
.token[data-status="familiar"] {
  background: var(--tag-familiar-bg);
  border-bottom-color: var(--tag-familiar);
  color: var(--tag-familiar-fg);
}
.token[data-status="shaky"] {
  background: var(--tag-shaky-bg);
  border-bottom-color: var(--tag-shaky);
  color: var(--tag-shaky-fg);
}
.token[data-status="learning"] {
  background: var(--tag-learning-bg);
  border-bottom-color: var(--tag-learning);
  color: var(--tag-learning-fg);
}
.token[data-status="unknown"] {
  background: var(--tag-unknown-bg);
  border-bottom-color: var(--tag-unknown);
  color: var(--tag-unknown-fg);
}
.token[data-status="unset"] {
  background: transparent;
  border-bottom-style: dashed;
  border-bottom-color: var(--tag-unset);
  color: var(--text);
}
.token.phrase[data-status="unset"],
.token.structure[data-status="unset"] {
  border-bottom-color: color-mix(in srgb, var(--accent) 35%, transparent);
}
.token.is-levelup::before {
  content: "▲";
  font-size: 0.55em;
  color: var(--tag-learning);
  margin-right: 1px;
  vertical-align: super;
  font-weight: 800;
}
.token.is-focused { outline: 2px solid var(--accent); outline-offset: 1px; }

.sidebar-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  padding: 1rem 0;
  text-align: center;
}
.sidebar-lemma {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0.35rem 0;
}
.sidebar-lemma.mono { font-family: var(--mono); font-size: 1.05rem; }
.sidebar-meta { margin-bottom: 0.75rem; font-size: 0.88rem; }
.sidebar-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.sidebar-select, .status-control, select {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  margin-bottom: 0.55rem;
}

.seg-control {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.3rem;
  margin-bottom: 0.6rem;
}
.seg {
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  padding: 0.35rem 0.2rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-muted);
}
.seg.is-selected { outline: 2px solid var(--accent); }
.seg.mastered-c { background: var(--tag-mastered-bg); border-color: var(--tag-mastered); color: var(--tag-mastered); }
.seg.familiar-c { background: var(--tag-familiar-bg); border-color: var(--tag-familiar); color: var(--tag-familiar); }
.seg.shaky-c { background: var(--tag-shaky-bg); border-color: var(--tag-shaky); color: var(--tag-shaky-fg); }
.seg.learning-c { background: var(--tag-learning-bg); border-color: var(--tag-learning); color: var(--tag-learning); }
.seg.unknown-c { background: var(--tag-unknown-bg); border-color: var(--tag-unknown); color: var(--tag-unknown); }

.type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
}
.type-badge.phrase { background: #ede9fe; color: #6d28d9; }
.type-badge.structure { background: #fce7f3; color: #be185d; }
@media (prefers-color-scheme: dark) {
  .type-badge.phrase { background: #4c1d95; color: #ddd6fe; }
  .type-badge.structure { background: #831843; color: #fbcfe8; }
}

.status-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}
.status-pill.mastered { background: var(--tag-mastered-bg); color: var(--tag-mastered); }
.status-pill.familiar { background: var(--tag-familiar-bg); color: var(--tag-familiar); }
.status-pill.shaky { background: var(--tag-shaky-bg); color: var(--tag-shaky-fg); }
.status-pill.learning { background: var(--tag-learning-bg); color: var(--tag-learning); }
.status-pill.unknown { background: var(--tag-unknown-bg); color: var(--tag-unknown); }
.status-pill.unset { background: transparent; border: 1px dashed var(--border); color: var(--text-muted); }

.production-card h3 { margin-top: 0; }
.production-card textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  padding: 0.65rem 0.75rem;
  resize: vertical;
  min-height: 80px;
}
.production-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}
.level-card {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}
.level-card .label { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 0.3rem; }
.level-card input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.35rem 0.5rem;
  font: inherit;
  font-weight: 700;
  background: var(--bg-elev);
  color: var(--text);
}

.dashboard-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 900px) {
  .dashboard-split {
    grid-template-columns: 1fr;
  }
}
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}
.cal-label { font-weight: 700; }
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 0.25rem;
}
.cal-dow {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  padding: 0.25rem;
}
.cal-day {
  aspect-ratio: 1;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  position: relative;
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.cal-day.out { visibility: hidden; }
.cal-day.has-activity { background: var(--accent-soft); font-weight: 700; }
.cal-day.selected { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 35%, transparent); }
.cal-day .dot {
  position: absolute;
  bottom: 3px; left: 50%;
  transform: translateX(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.cal-day.has-breakthrough {
  border-color: #f59e0b;
}
.cal-day .cal-star {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.65rem;
  color: #f59e0b;
  line-height: 1;
}

.cal-filter-tabs {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  margin-bottom: 0.6rem;
}
.cal-filter-btn {
  border: 1px solid var(--border);
  background: var(--surface2, rgba(255, 255, 255, 0.05));
  color: var(--text-muted);
  border-radius: 9999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.cal-filter-btn:hover {
  color: var(--text);
  border-color: var(--accent);
}
.cal-filter-btn.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.timeline-list {
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-right: 0.25rem;
}
.timeline-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}
.timeline-item .date { font-weight: 700; }
.timeline-item .detail { font-size: 0.85rem; color: var(--text-muted); }

/* Rich practice item cards */
.practice-item-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.practice-item-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}
.practice-item-card.is-breakthrough-card {
  border-color: rgba(245, 158, 11, 0.55);
  background: color-mix(in srgb, rgba(245, 158, 11, 0.06) 50%, var(--card-bg, rgba(255, 255, 255, 0.03)));
}
.practice-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.practice-item-lemma-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.practice-item-lemma {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.practice-item-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.btn-item-drill {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background: var(--surface2, transparent);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: 600;
  transition: all 0.15s ease;
}
.btn-item-drill:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.practice-item-meta {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-size: 0.8rem;
  color: var(--text-muted);
}
.practice-chip-count {
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft, rgba(56, 189, 248, 0.12));
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
}
.practice-chip-type {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.4rem;
  border-radius: 6px;
  background: var(--surface2, rgba(148, 163, 184, 0.15));
  color: var(--text-muted);
}
.practice-item-impact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.15rem;
}
.practice-impact-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
}
.practice-badge-breakthrough {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #d97706;
  font-size: 0.78rem;
  font-weight: 700;
  animation: pulseGold 2s infinite ease-in-out;
}
@keyframes pulseGold {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.3); }
  50% { box-shadow: 0 0 0 4px rgba(245, 158, 11, 0); }
}

.practice-milestone-toggle {
  font-size: 0.75rem;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}
.practice-milestone-trail {
  margin-top: 0.4rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--surface2, rgba(0, 0, 0, 0.03));
  border: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.milestone-step {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.78rem;
  line-height: 1.4;
  position: relative;
}
.milestone-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 4px;
  flex-shrink: 0;
}
.milestone-step.is-breakthrough .milestone-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.4);
}
.milestone-text {
  flex: 1;
}

.charts-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1rem;
}
.chart-wrap { height: 220px; position: relative; }
.chart-wrap-tall { height: 260px; }

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.items-table th, .items-table td {
  padding: 0.5rem 0.55rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.items-table th { color: var(--text-muted); font-weight: 600; font-size: 0.78rem; }
.lemma-mono { font-family: var(--mono); }

.toolbar { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; flex-wrap: wrap; }
.toolbar input[type="search"] {
  flex: 1;
  min-width: 180px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.65rem; }
.filter-chip {
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.filter-chip.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
}

.vocab-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.75rem;
}
.vocab-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  cursor: pointer;
  background: var(--bg);
  transition: border-color 0.15s;
}
.vocab-card:hover { border-color: var(--accent); }
.vocab-card .word { font-weight: 700; margin-bottom: 0.35rem; }
.vocab-card .word.mono { font-family: var(--mono); font-size: 0.92rem; }
.vocab-card .meta { font-size: 0.78rem; color: var(--text-muted); margin: 0.35rem 0; }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 1rem;
  align-items: start;
}
.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.5rem;
}
.map-layout-switcher {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background: var(--bg-soft);
  padding: 0.2rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}
.map-layout-switcher .btn {
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.map-layout-switcher .btn:hover {
  color: var(--text);
}
.map-layout-switcher .btn.is-active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.cy-container {
  height: min(70vh, 560px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.map-sidebar { position: sticky; top: 76px; }

.chip-picker {
  display: none;
  position: fixed;
  z-index: 100;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.4rem;
  gap: 0.3rem;
  flex-wrap: wrap;
  max-width: 320px;
}
.chip-picker.open { display: flex; }
.chip {
  border: none;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.chip.unset { background: var(--bg-soft); color: var(--text-muted); }
.chip.mastered { background: var(--tag-mastered-bg); color: var(--tag-mastered); }
.chip.familiar { background: var(--tag-familiar-bg); color: var(--tag-familiar); }
.chip.shaky { background: var(--tag-shaky-bg); color: var(--tag-shaky-fg); }
.chip.learning { background: var(--tag-learning-bg); color: var(--tag-learning); }
.chip.unknown { background: var(--tag-unknown-bg); color: var(--tag-unknown); }

.toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: #0f172a;
  color: #fff;
  padding: 0.65rem 1.1rem;
  border-radius: 999px;
  font-size: 0.9rem;
  opacity: 0;
  transition: transform 0.25s, opacity 0.25s;
  z-index: 200;
  pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }


/* Import / news search */
.import-panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}
.import-panel h3 { margin: 0 0 0.65rem; font-size: 1rem; }
.import-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 0.55rem;
  align-items: center;
}
.import-row input[type="search"],
.import-row input[type="url"],
.import-row input[type="text"] {
  flex: 1;
  min-width: 160px;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.news-results {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 260px;
  overflow-y: auto;
  margin-top: 0.5rem;
}
.news-result {
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  font: inherit;
}
.news-result:hover, .news-result.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.news-result .nr-title { font-weight: 700; font-size: 0.9rem; }
.news-result .nr-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.15rem; }
.news-result .nr-snip { font-size: 0.8rem; color: var(--text-muted); margin-top: 0.25rem; }
.import-status { font-size: 0.82rem; color: var(--text-muted); min-height: 1.2em; }

/* Clickable recent table */
.items-table tbody tr.clickable-row { cursor: pointer; }
.items-table tbody tr.clickable-row:hover { background: var(--accent-soft); }

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 100005;
  background: rgba(15, 23, 42, 0.45);
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}
.modal-backdrop.open { display: flex; }
.modal-sheet {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 12px 12px;
  box-shadow: var(--shadow);
  width: min(480px, 100%);
  max-height: min(90vh, 640px);
  overflow-y: auto;
  padding: 1.1rem 1.2rem 1.25rem;
}
@media (min-width: 640px) {
  .modal-backdrop { align-items: center; }
  .modal-sheet { border-radius: var(--radius); }
}
.modal-sheet h3 { margin: 0 0 0.5rem; }
.modal-actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
  flex-wrap: wrap;
}

/* Confirm & Alert Dialog Modal */
#confirmModal {
  z-index: 150;
  backdrop-filter: blur(2px);
}
.confirm-modal-sheet {
  width: min(440px, 100%);
  padding: 1.35rem 1.4rem 1.25rem;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 8px 10px -6px rgba(0, 0, 0, 0.25);
  animation: confirmSheetIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes confirmSheetIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}
.confirm-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  margin-bottom: 0.85rem;
}
.confirm-modal-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
  background: var(--surface2, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--border);
}
.confirm-modal-icon.is-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.confirm-modal-icon.is-warning {
  background: #fef3c7;
  border-color: #fde68a;
  color: #92400e;
}
body[data-theme="dark"] .confirm-modal-icon.is-danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fca5a5;
}
body[data-theme="dark"] .confirm-modal-icon.is-warning {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.35);
  color: #fcd34d;
}
.confirm-modal-heading h3 {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}
.confirm-modal-body {
  margin: 0.5rem 0 1rem;
}
.confirm-modal-msg {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
  margin: 0;
}
.confirm-modal-detail {
  margin-top: 0.75rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
}
.confirm-modal-detail.is-danger {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.06);
  color: var(--text);
}
body[data-theme="dark"] .confirm-modal-detail.is-danger {
  background: rgba(239, 68, 68, 0.12);
  color: var(--text);
}
body[data-theme="dark"] .btn.danger {
  background: rgba(239, 68, 68, 0.18);
  border-color: rgba(239, 68, 68, 0.45);
  color: #fca5a5;
}
body[data-theme="dark"] .btn.danger:hover {
  background: rgba(239, 68, 68, 0.28);
  border-color: rgba(239, 68, 68, 0.65);
  color: #fee2e2;
}
body.flashcards-mode > #confirmModal.open,
body.drill-mode-active > #confirmModal.open {
  display: flex !important;
}

/* Podcast Studio Modal */
#podcastModal {
  z-index: 140;
  backdrop-filter: blur(2px);
}
.podcast-modal-sheet {
  width: min(580px, 100%);
  padding: 1.4rem 1.5rem 1.4rem;
  max-height: min(92vh, 720px);
  animation: confirmSheetIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.podcast-modal-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.9rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.podcast-badge-icon {
  width: 2.85rem;
  height: 2.85rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.15), rgba(147, 51, 234, 0.15));
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.45rem;
  flex-shrink: 0;
}
.podcast-header-text {
  flex: 1;
  min-width: 0;
}
.podcast-header-text h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}
.podcast-outline-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
}
.podcast-outline-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.65rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.podcast-step-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.5rem;
}
.podcast-step-row:last-child {
  margin-bottom: 0;
}
.podcast-step-row .step-num {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.podcast-step-row .step-desc strong {
  font-size: 0.84rem;
  color: var(--text);
}
.podcast-step-row .step-desc p {
  margin: 0.1rem 0 0;
  font-size: 0.76rem;
  line-height: 1.35;
}
.podcast-status-box {
  background: var(--surface2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.podcast-hint {
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
  margin: 0 0 0.85rem;
}
.podcast-action-row {
  display: flex;
  justify-content: center;
}
.btn-lg {
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
}
.podcast-progress-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.65rem;
}
.podcast-spin-icon {
  animation: podcastSpin 1.5s linear infinite;
  display: inline-block;
}
@keyframes podcastSpin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}
.podcast-progress-track {
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 0.45rem;
}
.podcast-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9333ea);
  border-radius: 999px;
  transition: width 0.25s ease;
}
.podcast-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
}
.podcast-ready-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.ready-title-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.02rem;
  color: #10b981;
}
.podcast-download-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.65rem;
}
.btn-download-mp3 {
  background: #059669;
  border-color: #047857;
  color: #fff;
  font-weight: 700;
  padding: 0.55rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-decoration: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-download-mp3:hover {
  background: #047857;
  color: #fff;
}
body.flashcards-mode > #podcastModal.open,
body.drill-mode-active > #podcastModal.open {
  display: flex !important;
}
.yt-embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 0.85rem;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #000;
}
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Cytoscape drop preview */
.cy-drop-hint {
  position: absolute;
  pointer-events: none;
  background: rgba(37, 99, 235, 0.9);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  z-index: 5;
  display: none;
}

@media (max-width: 900px) {
  .reader-layout, .map-layout, .dashboard-split, .charts-row {
    grid-template-columns: 1fr;
  }
  .reader-sidebar, .map-sidebar { position: static; }
  .cy-container { height: 420px; }
  .app-header { padding: 0.65rem 0.85rem; }
  main { padding: 1rem 0.85rem 2.5rem; }
  .header-actions .btn { padding: 0.35rem 0.6rem; font-size: 0.8rem; }
}
@media (max-width: 520px) {
  .brand-sub { display: none; }
  .nav-tabs button { padding: 0.4rem 0.65rem; font-size: 0.82rem; }
}

.badge-tutor {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  vertical-align: middle;
  margin-left: 0.35rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  color: #5b21b6;
  background: #ede9fe;
  border: 1px solid #c4b5fd;
}
.session-feedback-card h3 { margin-top: 0; }
.session-feedback-card textarea {
  width: 100%;
  box-sizing: border-box;
  margin-top: 0.25rem;
}
.feedback-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 0.75rem;
  align-items: center;
  margin: 0.5rem 0 0.75rem;
}
.feedback-row .sidebar-label { margin: 0; }
.de-plain { white-space: pre-wrap; }

/* Profile Switcher & Profile Modal */
.profile-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.15rem 0.35rem;
  gap: 0.25rem;
}
.theme-switcher {
  display: inline-flex;
  align-items: center;
}
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.55rem;
  color: var(--text);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}
.profile-avatar {
  font-size: 0.95rem;
  user-select: none;
}
.profile-select {
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  outline: none;
  cursor: pointer;
  max-width: 130px;
}
.icon-btn {
  padding: 0.2rem 0.35rem !important;
  border: none !important;
  background: transparent !important;
  cursor: pointer;
  font-size: 0.95rem;
  border-radius: 4px;
}
.icon-btn:hover {
  background: var(--bg-soft) !important;
}
.profile-modal-sheet {
  max-width: 540px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  box-sizing: border-box;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.85rem;
}
.btn-close {
  border: none;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
}
.btn-close:hover {
  background: var(--bg-soft);
  color: var(--text);
}
.profile-modal-section {
  margin-bottom: 0.65rem;
}
.profile-modal-section h4 {
  margin: 0 0 0.45rem;
  font-size: 0.95rem;
  color: var(--text);
}
.modal-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0.85rem 0;
}
.section-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}
.accent-text {
  color: var(--accent);
  font-weight: 700;
}
.styled-input {
  width: 100%;
  box-sizing: border-box;
  padding: 0.45rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.88rem;
  background: var(--bg);
  color: var(--text);
}
.input-with-btn {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  width: 100%;
}
.btn.sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.8rem;
}
.btn.danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #991b1b;
}
.btn.danger:hover {
  background: #fecaca;
  border-color: #f87171;
}
.profile-stats-card {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.84rem;
  line-height: 1.5;
  color: var(--text-muted);
}
.profile-actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.profile-init-options {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 0.45rem;
  font-size: 0.85rem;
}
.radio-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
}
.profile-delete-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

/* Multi-language & Diagnostic Quiz Styling */
.lang-flag {
  font-size: 1.15rem;
  cursor: default;
  display: inline-flex;
  align-items: center;
}
.lang-picker-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.lang-radio-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.88rem;
  transition: all 0.15s ease;
}
.lang-radio-btn:hover {
  background: var(--bg-soft);
  border-color: var(--accent);
}
.lang-radio-btn.active, .lang-radio-btn:has(input:checked) {
  background: #f0fdf4;
  border-color: var(--accent);
  color: #166534;
  font-weight: 600;
}
.badge-lang {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
  margin-right: 0.35rem;
}
.badge-lang.de { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.badge-lang.ja { background: #fce7f3; color: #9d174d; border-color: #fbcfe8; }
.badge-lang.en { background: #e0e7ff; color: #3730a3; border-color: #c7d2fe; }

/* Diagnostic Quiz Card */
.diag-quiz-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.9rem;
  transition: all 0.2s ease;
}
.diag-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.diag-title {
  font-weight: 600;
  color: var(--text);
}
.diag-progress {
  font-family: var(--mono);
  font-size: 0.78rem;
}
.diag-question {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 0.6rem;
  color: var(--text);
}
.diag-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.diag-opt-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  font-size: 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.diag-opt-btn:hover:not(:disabled) {
  background: #f1f5f9;
  border-color: var(--accent);
}
.diag-opt-btn.picked {
  border-color: var(--accent);
  background: #eff6ff;
  font-weight: 600;
}
.diag-result-banner {
  margin-top: 0.6rem;
  padding: 0.65rem 0.8rem;
  border-radius: var(--radius-sm);
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 0.86rem;
  line-height: 1.5;
}
.diag-result-banner strong {
  color: #14532d;
}
.diag-result-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.45rem;
}

/* Vocab Bank Meaning Card */
.vocab-card .vocab-meaning {
  font-size: 0.88rem;
  color: #0369a1;
  background: #f0f9ff;
  border: 1px solid #e0f2fe;
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  margin: 0.35rem 0;
  line-height: 1.4;
  word-break: break-word;
}
@media (prefers-color-scheme: dark) {
  .vocab-card .vocab-meaning {
    background: #082f49;
    color: #7dd3fc;
    border-color: #0369a1;
  }
}

/* Sidebar Meaning Card */
.sidebar-meaning-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.8rem;
  margin-bottom: 0.75rem;
}
.meaning-label {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.sidebar-ctx-meaning {
  margin-bottom: 0.5rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border);
}
.sidebar-ctx-meaning .meaning-text {
  font-size: 1rem;
  font-weight: 700;
  color: #15803d;
  margin-top: 0.2rem;
  line-height: 1.4;
}
.sidebar-common-meaning .meaning-text {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-top: 0.2rem;
  line-height: 1.4;
}
.btn-edit-meaning {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
.btn-edit-meaning:hover {
  background: var(--border);
  color: var(--text);
}

/* Floating Hover Tooltip */
.token-tooltip {
  position: absolute;
  z-index: 1000;
  pointer-events: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  border-radius: var(--radius);
  padding: 0.6rem 0.8rem;
  min-width: 160px;
  max-width: 300px;
  font-size: 0.84rem;
  line-height: 1.4;
  transform: translate(-50%, -100%);
  margin-top: -10px;
  transition: opacity 0.12s ease;
  opacity: 0;
}
.token-tooltip.visible {
  opacity: 1;
}
.token-tooltip.is-sticky {
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  border-color: var(--accent, #3b82f6);
}
.token-tooltip.pos-bottom {
  transform: translate(-50%, 0);
  margin-top: 10px;
}
.token-tooltip .tt-word {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.25rem;
  margin-bottom: 0.35rem;
}
.token-tooltip .tt-ctx-meaning {
  font-size: 0.92rem;
  font-weight: 700;
  color: #16a34a;
  margin-bottom: 0.25rem;
  line-height: 1.35;
}
.token-tooltip .tt-common-meaning {
  font-size: 0.84rem;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}
.token-tooltip .tt-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-right: 0.3rem;
}
.token-tooltip .tt-footer {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
}
.token-tooltip .badge-lu {
  font-weight: 700;
  color: var(--tag-learning);
  font-size: 0.72rem;
}

/* Reader Audio Toolbar */
.reader-audio-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.audio-controls-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.audio-speed-group {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.audio-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.speed-chips {
  display: flex;
  gap: 0.25rem;
}
.speed-chip {
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.speed-chip.is-active, .speed-chip:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.audio-now-playing {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: #16a34a;
  font-weight: 600;
}
.now-playing-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #16a34a;
  animation: pulse-dot 1.2s infinite ease-in-out;
}
@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.4); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

/* Sentence Speaking Highlight */
.sentence-block.is-speaking-sentence {
  background: #f0fdf4 !important;
  border-left: 4px solid #16a34a !important;
  box-shadow: 0 3px 12px rgba(22, 163, 74, 0.15);
  transition: background 0.15s ease, border-left 0.15s ease;
}
@media (prefers-color-scheme: dark) {
  .sentence-block.is-speaking-sentence {
    background: #052e16 !important;
    border-left: 4px solid #4ade80 !important;
  }
}

/* Wordwise TTS Speaking Highlight */
.token.is-speaking-word {
  background: #fef08a !important;
  color: #854d0e !important;
  outline: 2px solid #ca8a04 !important;
  border-radius: 3px !important;
  font-weight: 700 !important;
  transform: scale(1.08);
  display: inline-block;
  transition: transform 0.06s ease;
}
@media (prefers-color-scheme: dark) {
  .token.is-speaking-word {
    background: #713f12 !important;
    color: #fef08a !important;
    outline: 2px solid #eab308 !important;
  }
}

/* Sentence Header Bar & Audio / Mic Buttons */
.sentence-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.35rem;
}
.sentence-idx-tag {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.sentence-audio-btns {
  display: flex;
  gap: 0.3rem;
}
.btn-sentence-speak, .btn-sentence-mic, .btn-sentence-copy, .btn-sentence-drill {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.15rem 0.35rem;
  line-height: 1;
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.btn-sentence-drill {
  background: var(--accent-soft, rgba(99, 102, 241, 0.08));
  border-color: var(--accent, #6366f1);
  color: var(--accent-strong, #4f46e5);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
}
.btn-sentence-drill:hover {
  background: var(--accent, #6366f1) !important;
  color: #fff !important;
}
.btn-sentence-speak:hover, .btn-sentence-mic:hover, .btn-sentence-copy:hover {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--text-muted);
}
.btn-sentence-mic.is-recording {
  background: #fee2e2;
  border-color: #ef4444;
  color: #dc2626;
  animation: pulse-mic 1s infinite alternate;
}
@keyframes pulse-mic {
  0% { transform: scale(1); }
  100% { transform: scale(1.1); }
}
.speech-feedback {
  font-size: 0.82rem;
  padding: 0.35rem 0.6rem;
  margin: 0.4rem 0;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  line-height: 1.4;
}

/* Quizzes Section */
.quiz-card {
  margin-top: 1.25rem;
  padding: 1.25rem;
}
.quiz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.quiz-score-badge {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
@media (prefers-color-scheme: dark) {
  .quiz-score-badge {
    background: #052e16;
    color: #4ade80;
    border-color: #166534;
  }
}
.quiz-tabs {
  display: flex;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  overflow-x: auto;
}
.quiz-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.4rem 0.75rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
}
.quiz-tab-btn.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
}
.quiz-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin-bottom: 0.85rem;
}
.quiz-q-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.4rem;
  line-height: 1.4;
}
.quiz-prompt-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}
.quiz-options {
  display: grid;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.quiz-option-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.12s ease;
}
.quiz-option-label:hover {
  border-color: var(--brand);
}
.quiz-option-label.is-correct {
  background: #dcfce7 !important;
  border-color: #22c55e !important;
  color: #15803d !important;
  font-weight: 600;
}
.quiz-option-label.is-wrong {
  background: #fee2e2 !important;
  border-color: #ef4444 !important;
  color: #b91c1c !important;
}
@media (prefers-color-scheme: dark) {
  .quiz-option-label.is-correct {
    background: #052e16 !important;
    border-color: #22c55e !important;
    color: #4ade80 !important;
  }
  .quiz-option-label.is-wrong {
    background: #450a0a !important;
    border-color: #ef4444 !important;
    color: #f87171 !important;
  }
}
.quiz-input-field {
  width: 100%;
  max-width: 440px;
  padding: 0.45rem 0.65rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  margin-top: 0.35rem;
}
.quiz-result-feedback {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.4;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-sm);
}
.quiz-result-feedback.is-correct {
  background: #dcfce7;
  color: #15803d;
}
.quiz-result-feedback.is-wrong {
  background: #fee2e2;
  color: #b91c1c;
}
@media (prefers-color-scheme: dark) {
  .quiz-result-feedback.is-correct {
    background: #052e16;
    color: #4ade80;
  }
  .quiz-result-feedback.is-wrong {
    background: #450a0a;
    color: #f87171;
  }
}
.quiz-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

/* Quiz Stepper & Progress */
.quiz-step-pill {
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  letter-spacing: 0.02em;
}
.quiz-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.quiz-progress-wrap {
  margin: 0.6rem 0 1rem;
}
.quiz-progress-track {
  height: 6px;
  width: 100%;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.quiz-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #10b981);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.quiz-stepper-card {
  animation: fadeIn 0.2s ease-in-out;
}
.quiz-stepper-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.quiz-stepper-center {
  flex: 1;
  text-align: center;
}
.quiz-stem-box {
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  font-family: var(--font-mono, monospace);
  line-height: 1.6;
  margin: 0.65rem 0;
}
.quiz-stem-blank {
  color: var(--brand);
  font-weight: 700;
  text-decoration: underline;
  padding: 0 0.25rem;
}
.quiz-stem-target {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
  border-bottom: 2px solid var(--accent);
}
.quiz-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.quiz-option-label.is-selected .quiz-opt-letter {
  background: var(--brand);
  color: #fff;
}

/* Results & Stats Summary Card */
.quiz-results-card {
  text-align: center;
  padding: 1.25rem 0.5rem;
  animation: fadeIn 0.3s ease-out;
}
.results-trophy {
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 0.5rem;
}
.results-score-row {
  margin: 1rem 0 1.25rem;
}
.results-score-big {
  font-size: 3.2rem;
  font-weight: 800;
  color: #16a34a;
  line-height: 1;
  letter-spacing: -0.02em;
}
@media (prefers-color-scheme: dark) {
  .results-score-big { color: #4ade80; }
}
.results-score-detail {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-top: 0.35rem;
  font-weight: 500;
}
.results-breakdown-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0;
  text-align: left;
}
.breakdown-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
}
.breakdown-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.breakdown-stat {
  font-size: 1.1rem;
  font-weight: 800;
}
.breakdown-pct {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}
.results-transitions-box {
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin: 1rem 0 1.5rem;
  text-align: left;
}
.results-sub-title {
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: var(--text-muted);
}
.results-tags-list {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.transition-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
}
.results-actions {
  display: flex;
  justify-content: center;
  gap: 0.85rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}





/* —— 練習區 quizzes —— */
.quiz-card h3 { margin-top: 0; }
.quiz-list { display: flex; flex-direction: column; gap: 0.85rem; }
.quiz-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
}
.quiz-item-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.45rem;
}
.quiz-type-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: #1e3a5f;
  color: #bfdbfe;
}
.quiz-type-badge.cloze { background: #1e3a5f; color: #bfdbfe; }
.quiz-type-badge.mcq { background: #365314; color: #d9f99d; }
.quiz-type-badge.sub { background: #581c87; color: #e9d5ff; }
.quiz-num {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
}
.quiz-prompt {
  font-size: 0.95rem;
  margin: 0.25rem 0 0.5rem;
  line-height: 1.45;
}
.quiz-stem {
  font-family: var(--font-mono, ui-monospace, monospace);
  font-size: 1.02rem;
  line-height: 1.55;
  margin: 0.35rem 0 0.65rem;
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border);
  word-break: break-word;
}
.quiz-stem .quiz-blank-mark {
  display: inline-block;
  min-width: 4.5rem;
  border-bottom: 2px solid var(--accent, #3b82f6);
  color: var(--accent, #3b82f6);
  font-weight: 700;
  text-align: center;
  margin: 0 0.15rem;
}
.quiz-input-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  align-items: stretch;
  margin-top: 0.35rem;
}
.quiz-input {
  flex: 1 1 12rem;
  min-height: 48px;
  font-size: 1.05rem;
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
.quiz-check-btn {
  min-height: 48px;
  min-width: 5.5rem;
  padding: 0.65rem 1.1rem;
  font-size: 1rem;
  font-weight: 700;
}
.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.quiz-option {
  min-height: 48px;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  line-height: 1.35;
  -webkit-tap-highlight-color: transparent;
}
.quiz-option:hover { border-color: var(--accent, #3b82f6); }
.quiz-option.is-selected {
  border-color: var(--accent, #3b82f6);
  background: color-mix(in srgb, var(--accent, #3b82f6) 12%, var(--bg));
  font-weight: 600;
}
.quiz-option.is-correct {
  border-color: #16a34a;
  background: color-mix(in srgb, #16a34a 18%, var(--bg));
}
.quiz-option.is-wrong {
  border-color: #dc2626;
  background: color-mix(in srgb, #dc2626 14%, var(--bg));
}
.quiz-feedback {
  margin-top: 0.55rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  line-height: 1.4;
  display: none;
}
.quiz-feedback.visible { display: block; }
.quiz-feedback.ok {
  background: color-mix(in srgb, #16a34a 16%, var(--bg));
  color: #166534;
  border: 1px solid #86efac;
}
.quiz-feedback.bad {
  background: color-mix(in srgb, #dc2626 12%, var(--bg));
  color: #991b1b;
  border: 1px solid #fca5a5;
}
@media (prefers-color-scheme: dark) {
  .quiz-feedback.ok { color: #bbf7d0; border-color: #166534; }
  .quiz-feedback.bad { color: #fecaca; border-color: #7f1d1d; }
  .quiz-type-badge.cloze { background: #1e3a5f; color: #93c5fd; }
  .quiz-type-badge.mcq { background: #365314; color: #bef264; }
  .quiz-type-badge.sub { background: #581c87; color: #d8b4fe; }
}

.app-footer {
  text-align: center;
  padding: 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
}
.build-stamp {
  opacity: 0.7;
  font-family: var(--font-mono, ui-monospace, monospace);
}

/* Quiz Resume & Progress */
.quiz-resume-badge {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  border-radius: 999px;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .quiz-resume-badge { background: #78350f; color: #fde68a; border-color: #92400e; }
}

/* Quiz Listening Box */
.quiz-listen-box {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem;
  margin: 0.65rem 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.btn-listen-play {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: all 0.2s ease;
}
.btn-listen-play.is-playing {
  animation: pulseGlow 1.5s infinite;
  background: #2563eb;
  color: #fff;
}
@keyframes pulseGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  70% { transform: scale(1.02); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.quiz-listen-status {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Listening transcript reveal (default hidden) */
.quiz-transcript-wrap {
  flex: 1 1 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  width: 100%;
  min-width: 0;
  margin-top: 0.15rem;
}
.btn-quiz-transcript {
  align-self: flex-start;
  min-height: 44px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-weight: 650;
  touch-action: manipulation;
}
.quiz-transcript-panel {
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius-sm, 8px);
  border: 1px dashed var(--border);
  background: var(--bg, #fff);
  line-height: 1.55;
}
.quiz-transcript-panel[hidden] {
  display: none !important;
}
.quiz-transcript-de {
  font-size: 1.02rem;
  font-weight: 650;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.quiz-transcript-zh {
  margin-top: 0.35rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  word-break: break-word;
  overflow-wrap: anywhere;
}
@media (max-width: 640px) {
  .btn-quiz-transcript {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* Visual Diff for Minor Errors & Feedback */
.diff-box {
  margin: 0.6rem 0;
  padding: 0.65rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono, monospace);
  font-size: 0.92rem;
  line-height: 1.6;
}
.diff-row {
  margin-bottom: 0.35rem;
}
.diff-row:last-child { margin-bottom: 0; }
.diff-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-block;
  width: 75px;
}
.diff-user {
  background: #fee2e2;
  color: #991b1b;
  text-decoration: line-through;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin: 0 0.15rem;
}
.diff-expected {
  background: #dcfce7;
  color: #166534;
  font-weight: 700;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  margin: 0 0.15rem;
}
.diff-punct {
  background: #e0e7ff;
  color: #3730a3;
  font-weight: 700;
  padding: 0.1rem 0.25rem;
  border-radius: 3px;
  text-decoration: underline;
}
.diff-minor-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fef3c7;
  color: #92400e;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.35rem;
}
@media (prefers-color-scheme: dark) {
  .diff-user { background: #7f1d1d; color: #fecaca; }
  .diff-expected { background: #14532d; color: #bbf7d0; }
  .diff-punct { background: #312e81; color: #c7d2fe; }
  .diff-minor-badge { background: #78350f; color: #fde68a; }
}

/* Challenging Vocab Section */
.challenging-vocab-card {
  margin-bottom: 1.5rem;
  border-left: 4px solid #f59e0b;
}
.challenging-vocab-header {
  margin-bottom: 1rem;
}
.challenging-vocab-pill {
  font-size: 0.78rem;
  font-weight: 700;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
@media (prefers-color-scheme: dark) {
  .challenging-vocab-pill { background: #78350f; color: #fde68a; border-color: #92400e; }
}
.challenging-vocab-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 0.9rem;
}
.vocab-focus-card {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
}
.vocab-focus-card:hover {
  border-color: #f59e0b;
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.vocab-focus-card:active {
  transform: scale(0.985);
}
.vocab-focus-card.is-speaking {
  border-color: var(--brand, #0284c7) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 4px 14px rgba(2, 132, 199, 0.2);
  animation: cardSpeakPulse 0.6s ease-in-out infinite alternate;
}
@keyframes cardSpeakPulse {
  from { transform: translateY(-2px) scale(1); }
  to { transform: translateY(-2px) scale(1.015); }
}
.vocab-focus-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.vocab-focus-word {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.vocab-focus-meaning {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.15rem;
}
.vocab-focus-grammar {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  background: var(--bg);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  border-left: 2px solid var(--brand);
}
.vocab-focus-example {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px dashed var(--border);
  font-size: 0.85rem;
}
.vocab-focus-example-target {
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
}
.vocab-focus-example-zh {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-top: 0.15rem;
}
.vocab-focus-actions {
  margin-top: auto;
  padding-top: 0.5rem;
  display: flex;
  gap: 0.4rem;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Dictionary Card & Lookup Results */
.dict-card {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  font-size: 0.85rem;
  animation: fadeIn 0.2s ease-in-out;
}
.dict-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.45rem;
}
.dict-word-title {
  font-size: 1.15rem;
  font-weight: 800;
}
.dict-illustration {
  width: 100%;
  max-height: 140px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 0.6rem;
  border: 1px solid var(--border);
}
.dict-def-item {
  margin-bottom: 0.45rem;
}
.dict-def-text {
  font-weight: 700;
  color: var(--text);
  font-size: 0.92rem;
}
.dict-example-box {
  background: var(--bg);
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  border-left: 2px solid #3b82f6;
}
.dict-collocation-chip {
  display: inline-block;
  font-size: 0.75rem;
  padding: 0.1rem 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  margin-right: 0.3rem;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}

/* ========================================================
   Duolingo / PowerPoint Slide Deck Practice Mode
   ======================================================== */

.view-mode-toggle {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2px;
  gap: 2px;
}
.mode-toggle-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.75rem;
  border-radius: calc(var(--radius) - 3px);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.mode-toggle-btn:hover:not(.is-active) {
  color: var(--text);
}
.mode-toggle-btn.is-active {
  background: var(--bg-elev);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.slide-deck-container {
  max-width: 860px;
  margin: 1.25rem auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  animation: fadeIn 0.2s ease-out;
}

.slide-deck-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.slide-deck-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.slide-deck-mode-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}
.slide-page-badge {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text-muted);
}
.slide-progress-wrap {
  flex: 1;
  min-width: 100px;
}
.slide-progress-track {
  height: 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
}
.slide-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #10b981, #059669);
  border-radius: 999px;
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide-header-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}
.slide-hotkey-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: none;
}
@media (min-width: 768px) {
  .slide-hotkey-hint { display: inline-block; }
}

.slide-stage {
  position: relative;
  width: 100%;
  min-height: 380px;
}

.slide-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 14px 40px -8px rgba(0, 0, 0, 0.08), 0 4px 16px -2px rgba(0, 0, 0, 0.04);
  padding: 1.75rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  min-height: 380px;
  box-sizing: border-box;
  animation: slideCardIn 0.16s ease-out;
}
@keyframes slideCardIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes correctGlow {
  0% { transform: scale(1); box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
  40% { transform: scale(1.015); box-shadow: 0 0 22px rgba(16, 185, 129, 0.45); }
  100% { transform: scale(1); box-shadow: 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes shakeWrong {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-7px); }
  40%, 80% { transform: translateX(7px); }
}

.anim-correct {
  animation: correctGlow 0.48s cubic-bezier(0.16, 1, 0.3, 1) !important;
  border-color: #10b981 !important;
}

.anim-incorrect {
  animation: shakeWrong 0.38s ease-in-out !important;
  border-color: #f59e0b !important;
}

/* Slide Substep Navigation Tabs */
.slide-substep-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding-bottom: 0.25rem;
}
.slide-substep-tabs {
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.25rem;
  gap: 0.25rem;
}
.slide-substep-tab {
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.slide-substep-tab.is-active {
  background: var(--bg-elev);
  color: var(--accent);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.slide-substep-tab:hover:not(.is-active) {
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

/* Pillar 1: Sentence Focus */
.slide-section-sentence {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.slide-sentence-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.slide-sentence-tag {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
.slide-sentence-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.slide-sentence-text {
  font-size: 1.65rem;
  line-height: 1.6;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--text);
  word-break: break-word;
  margin: 0.4rem 0 0.2rem;
}
.slide-sentence-text .token {
  display: inline-block;
  cursor: pointer;
  border-radius: 4px;
  padding: 0 0.25rem;
  margin: 0 0.08rem;
  transition: all 0.15s ease;
}
.slide-sentence-text .token:hover {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.slide-translation-box {
  background: var(--bg-soft);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.65rem 0.9rem;
  font-size: 1.02rem;
  color: var(--text);
  line-height: 1.55;
  animation: fadeIn 0.2s ease-in-out;
}

/* Pillar 2: Vocab Spotlight & Collapsible Drawer */
.slide-vocab-drawer {
  background: color-mix(in srgb, #f59e0b 6%, var(--bg-elev));
  border: 1.5px solid color-mix(in srgb, #f59e0b 35%, var(--border));
  border-radius: 16px;
  padding: 1.1rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  max-height: 320px;
  overflow-y: auto;
  animation: fadeIn 0.2s ease-in-out;
}
.slide-vocab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
}
.slide-vocab-badge-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.slide-vocab-pill {
  font-size: 0.75rem;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  border: 1px solid #fde68a;
}
.slide-vocab-word-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.slide-vocab-word {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
.slide-vocab-pos {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
}
.slide-vocab-cefr {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
}
.slide-vocab-meaning {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
}
.slide-vocab-grammar {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.slide-vocab-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.25rem;
  padding-top: 0.65rem;
  border-top: 1px dashed color-mix(in srgb, #f59e0b 25%, var(--border));
}
.slide-vocab-status-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}
.slide-vocab-status-select {
  padding: 0.25rem 0.5rem;
  font-size: 0.82rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
}
.slide-dict-box-inline {
  margin-top: 0.5rem;
  animation: fadeIn 0.2s ease-in-out;
}

/* Multi-word Vocab Hub in Slide Deck */
.slide-vocab-chips-bar {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed color-mix(in srgb, #f59e0b 25%, var(--border));
}
.slide-vocab-chips-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.slide-vocab-chips-scroll {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.slide-vocab-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--bg-elev);
  border: 1.5px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.slide-vocab-chip:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.slide-vocab-chip.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-elev));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.slide-vocab-chip-status {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
.slide-vocab-chip-status.mastered { background: var(--tag-mastered-bg); color: var(--tag-mastered-fg); }
.slide-vocab-chip-status.familiar { background: var(--tag-familiar-bg); color: var(--tag-familiar-fg); }
.slide-vocab-chip-status.shaky { background: var(--tag-shaky-bg); color: var(--tag-shaky-fg); }
.slide-vocab-chip-status.learning { background: var(--tag-learning-bg); color: var(--tag-learning-fg); }
.slide-vocab-chip-status.unknown { background: var(--tag-unknown-bg); color: var(--tag-unknown-fg); }
.slide-vocab-chip-status.unset { background: var(--bg-soft); color: var(--text-muted); }

/* Fast Segmented Status Selector */
.slide-vocab-status-seg {
  margin: 0.65rem 0 0.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.slide-vocab-status-seg .seg-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
}
.slide-vocab-status-seg .seg-buttons {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.slide-seg-btn {
  padding: 0.32rem 0.7rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  border: 1.5px solid var(--border);
  background: var(--bg-elev);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.slide-seg-btn:hover {
  transform: translateY(-1px);
}
.slide-seg-btn.is-active.mastered { background: var(--tag-mastered-bg); border-color: var(--tag-mastered); color: var(--tag-mastered-fg); }
.slide-seg-btn.is-active.familiar { background: var(--tag-familiar-bg); border-color: var(--tag-familiar); color: var(--tag-familiar-fg); }
.slide-seg-btn.is-active.shaky { background: var(--tag-shaky-bg); border-color: var(--tag-shaky); color: var(--tag-shaky-fg); }
.slide-seg-btn.is-active.learning { background: var(--tag-learning-bg); border-color: var(--tag-learning); color: var(--tag-learning-fg); }
.slide-seg-btn.is-active.unknown { background: var(--tag-unknown-bg); border-color: var(--tag-unknown); color: var(--tag-unknown-fg); }
.slide-seg-btn.is-active.unset { background: var(--bg-soft); border-color: var(--text-muted); color: var(--text); }

/* Personal Slide Note (隨堂個人筆記與自製字卡) */
.slide-user-note-container {
  margin: 0.65rem 0 0.45rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  background: var(--bg-soft);
  border: 1px dashed color-mix(in srgb, var(--accent) 40%, var(--border));
  transition: all 0.2s ease;
}
.slide-note-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.slide-note-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}
.slide-note-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.1rem 0.42rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.slide-note-textarea {
  width: 100%;
  min-height: 72px;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  margin-top: 0.35rem;
  box-sizing: border-box;
}
.slide-note-form-actions,
.slide-note-footer-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.45rem;
  flex-wrap: wrap;
}
.slide-note-text {
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.55;
  white-space: pre-wrap;
  padding: 0.2rem 0;
}

/* Separable Verbs Pairing Highlights (Trennbare Verben) */
.token.is-separable-part {
  border-bottom: 2px dashed #0284c7;
  position: relative;
}
.token.is-separable-part::after {
  content: "↔";
  font-size: 0.65rem;
  color: #0284c7;
  vertical-align: super;
  margin-left: 1px;
}
.token.is-separable-part:hover,
.token.is-separable-linked {
  background: rgba(2, 132, 199, 0.15) !important;
  color: #0369a1 !important;
  border-radius: 4px;
}

/* Translation Quiz AI Evaluation & Manual Override */
.quiz-trans-override-bar {
  margin-top: 0.65rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
}
.quiz-eval-ai-box {
  margin-top: 0.5rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.25);
  font-size: 0.88rem;
  line-height: 1.5;
}
.quiz-eval-ai-header {
  font-weight: 700;
  color: #6366f1;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

/* Pillar 3: Interactive Quiz */
.slide-section-quiz {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.slide-quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.slide-quiz-type-pill {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
.slide-quiz-prompt {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
}
.slide-quiz-stem {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
  background: var(--bg-soft);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
  border: 1px solid var(--border);
}
.slide-quiz-stem .cloze-blank {
  display: inline-block;
  min-width: 80px;
  border-bottom: 2.5px solid var(--accent);
  color: var(--accent);
  text-align: center;
  font-weight: 700;
  padding: 0 0.35rem;
}
.slide-quiz-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}
@media (min-width: 640px) {
  .slide-quiz-options {
    grid-template-columns: 1fr 1fr;
  }
}
.slide-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.15rem;
  background: var(--bg-elev);
  border: 2px solid var(--border);
  border-radius: 14px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
  user-select: none;
}
.slide-opt-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: var(--bg-soft);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06);
}
.slide-opt-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all 0.15s ease;
}
.slide-opt-btn.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, var(--bg-elev));
  font-weight: 600;
}
.slide-opt-btn.is-selected .slide-opt-letter {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.slide-opt-btn.is-correct {
  border-color: #10b981 !important;
  background: color-mix(in srgb, #10b981 12%, var(--bg-elev)) !important;
  color: #065f46 !important;
}
.slide-opt-btn.is-correct .slide-opt-letter {
  background: #10b981 !important;
  color: #fff !important;
  border-color: #10b981 !important;
}
.slide-opt-btn.is-wrong {
  border-color: #ef4444 !important;
  background: color-mix(in srgb, #ef4444 12%, var(--bg-elev)) !important;
  color: #991b1b !important;
}
.slide-opt-btn.is-wrong .slide-opt-letter {
  background: #ef4444 !important;
  color: #fff !important;
  border-color: #ef4444 !important;
}

.slide-quiz-input {
  width: 100%;
  padding: 0.85rem 1.1rem;
  font-size: 1.1rem;
  border: 2px solid var(--border);
  border-radius: 12px;
  background: var(--bg-elev);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s ease;
}
.slide-quiz-input:focus {
  border-color: var(--accent);
}

.slide-quiz-feedback {
  padding: 1rem 1.25rem;
  border-radius: 14px;
  animation: fadeIn 0.2s ease-out;
}
.slide-quiz-feedback.is-correct {
  background: color-mix(in srgb, #10b981 12%, var(--bg-elev));
  border: 1.5px solid #10b981;
  color: #065f46;
}
.slide-quiz-feedback.is-wrong {
  background: color-mix(in srgb, #ef4444 10%, var(--bg-elev));
  border: 1.5px solid #ef4444;
  color: #991b1b;
}

/* Card Footer & Action Row */
.slide-card-footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.slide-card-hint {
  font-size: 0.84rem;
  color: var(--text-muted);
}
.slide-card-hint code {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* Dedicated Quiz Card */
.slide-card-quiz {
  border-left: 4px solid var(--accent);
}
.slide-quiz-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.slide-quiz-type-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* Bottom Navigation Bar */
.slide-deck-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
.btn-slide-nav {
  min-width: 110px;
  font-weight: 700;
  padding: 0.65rem 1.25rem;
  border-radius: 12px;
}
.slide-dots-container {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: nowrap;
  overflow: hidden;
  justify-content: center;
  max-width: 60%;
  height: 20px;
  flex-shrink: 0;
}
.slide-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--border);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.slide-dot:hover {
  background: var(--text-muted);
}
.slide-dot.active {
  background: var(--accent);
  width: 24px;
}
.slide-dot.completed {
  background: #10b981;
}

/* Celebration Finish Card & Comprehensive Stats */
.slide-celebration-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: 0 16px 44px -8px rgba(0, 0, 0, 0.1);
  padding: 2.25rem 2rem;
  max-width: 900px;
  margin: 0 auto;
  box-sizing: border-box;
  animation: slideCardIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-celeb-header {
  text-align: center;
  margin-bottom: 1.5rem;
}
.slide-celebration-trophy {
  font-size: 3.5rem;
  margin-bottom: 0.3rem;
  animation: bounce 1s infinite alternate;
}
@keyframes bounce {
  from { transform: translateY(0); }
  to { transform: translateY(-8px); }
}
.slide-celebration-score {
  font-size: 2.8rem;
  font-weight: 900;
  color: #10b981;
  margin: 0.2rem 0;
}
.slide-celebration-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.85rem;
  margin: 1.25rem 0 1.75rem;
}
.slide-stat-item {
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 0.85rem 0.6rem;
  border: 1px solid var(--border);
  text-align: center;
}
.slide-stat-num {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
}
.slide-stat-lbl {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Sections for Vocab, Phrases, Grammar */
.slide-celeb-section {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
  text-align: left;
}
.slide-celeb-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text);
  margin-bottom: 0.85rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent);
}
.slide-celeb-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}

/* Type-X Distribution Bar */
.slide-celeb-types-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.slide-type-pill {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--bg-elev);
}
.slide-type-pill.verb { border-color: #3b82f6; color: #2563eb; background: rgba(59, 130, 246, 0.08); }
.slide-type-pill.noun { border-color: #10b981; color: #059669; background: rgba(16, 185, 129, 0.08); }
.slide-type-pill.adj { border-color: #8b5cf6; color: #7c3aed; background: rgba(139, 92, 246, 0.08); }
.slide-type-pill.phrase { border-color: #f59e0b; color: #d97706; background: rgba(245, 158, 11, 0.08); }

/* Vocab Cards Grid */
.slide-celeb-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.75rem;
}
.slide-celeb-vocab-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: all 0.15s ease;
}
.slide-celeb-vocab-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.slide-celeb-vocab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.slide-celeb-vocab-word {
  font-size: 1.05rem;
  font-weight: 750;
  color: var(--text);
}
.slide-celeb-vocab-meaning {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.4;
}
.slide-celeb-vocab-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: 0.15rem;
}
.slide-celeb-vocab-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 0.35rem;
}

/* Phrases & Grammar Cards */
.slide-celeb-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.slide-celeb-item-row {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.75rem 0.95rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.slide-celeb-item-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.slide-celeb-item-name {
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--text);
}
.slide-celeb-item-desc {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.45;
}
.slide-celeb-item-example {
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-soft);
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-style: italic;
  margin-top: 0.2rem;
}

/* Spaced Repetition (SRS) Banner */
.slide-celeb-srs-banner {
  background: linear-gradient(135deg, color-mix(in srgb, #6366f1 12%, var(--bg-elev)), color-mix(in srgb, #8b5cf6 8%, var(--bg-elev)));
  border: 1.5px solid color-mix(in srgb, #6366f1 40%, var(--border));
  border-radius: 18px;
  padding: 1.5rem 1.6rem;
  margin: 1.75rem 0 1.25rem;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.slide-srs-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.slide-srs-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text);
}
.slide-srs-tag {
  font-size: 0.72rem;
  font-weight: 750;
  color: #4f46e5;
  background: #e0e7ff;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
}
.slide-srs-desc {
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--text);
}
.slide-srs-actions-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.4rem;
}
.btn-srs-hero {
  font-size: 1rem;
  font-weight: 750;
  padding: 0.65rem 1.4rem;
  border-radius: 12px;
  background: #6366f1;
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  cursor: pointer;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.btn-srs-hero:hover {
  background: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.45);
}
.slide-celebration-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.slide-label-short { display: none; }
.slide-label-full { display: inline; }

.slide-zh-label {
  font-weight: 700;
  color: var(--accent);
  margin-right: 0.35rem;
}

@media (max-width: 640px) {
  .slide-deck-container {
    max-width: 100%;
    margin: 0.35rem auto 1rem;
    gap: 0.55rem;
    padding: 0 0.35rem;
    box-sizing: border-box;
  }
  .slide-deck-header {
    flex-wrap: wrap;
    gap: 0.45rem 0.65rem;
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
  }
  .slide-deck-mode-badge {
    font-size: 0.7rem;
    padding: 0.12rem 0.45rem;
  }
  .slide-page-badge {
    font-size: 0.78rem;
  }
  .slide-progress-wrap {
    min-width: 60px;
    order: 3;
    flex: 1 1 100%;
  }
  .slide-progress-track {
    height: 7px;
  }
  .slide-header-meta .btn {
    padding: 0.28rem 0.55rem;
    font-size: 0.75rem;
  }
  .slide-card {
    padding: 0.85rem 0.85rem 1rem;
    gap: 0.75rem;
    border-radius: 14px;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.08);
  }
  .slide-section-sentence {
    gap: 0.45rem;
    padding-bottom: 0.7rem;
  }
  .slide-sentence-header {
    gap: 0.35rem;
  }
  .slide-sentence-tag {
    font-size: 0.7rem;
    padding: 0.12rem 0.45rem;
  }
  .slide-sentence-actions {
    gap: 0.25rem;
  }
  .slide-sentence-actions .btn.xs {
    padding: 0.22rem 0.45rem;
    font-size: 0.72rem;
  }
  .slide-action-label {
    display: none;
  }
  .slide-label-full { display: none; }
  .slide-label-short { display: inline; }
  .slide-sentence-text {
    font-size: 1.12rem;
    line-height: 1.45;
  }
  .slide-translation-box {
    padding: 0.45rem 0.65rem;
    font-size: 0.95rem;
    line-height: 1.4;
    border-radius: 0 6px 6px 0;
  }
  .slide-section-vocab {
    padding: 0.7rem 0.75rem;
    gap: 0.45rem;
    border-radius: 12px;
  }
  .slide-vocab-chips-bar {
    gap: 0.3rem;
    padding-bottom: 0.45rem;
  }
  .slide-vocab-chips-label {
    font-size: 0.7rem;
  }
  .slide-vocab-chip {
    padding: 0.2rem 0.5rem;
    font-size: 0.78rem;
  }
  .slide-vocab-pill {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
  }
  .slide-vocab-word {
    font-size: 1.12rem;
  }
  .slide-vocab-pos,
  .slide-vocab-grammar {
    font-size: 0.78rem;
  }
  .slide-vocab-meaning {
    font-size: 0.95rem;
    line-height: 1.35;
  }
  .slide-vocab-status-seg {
    margin: 0.35rem 0 0.15rem;
    gap: 0.25rem;
  }
  .slide-vocab-status-seg .seg-title {
    font-size: 0.7rem;
  }
  .slide-seg-btn {
    padding: 0.22rem 0.5rem;
    font-size: 0.72rem;
    border-radius: 6px;
  }
  .slide-vocab-footer {
    margin-top: 0.1rem;
    padding-top: 0.4rem;
    gap: 0.4rem;
  }
  .slide-section-quiz {
    gap: 0.55rem;
  }
  .slide-quiz-type-pill {
    font-size: 0.7rem;
    padding: 0.12rem 0.45rem;
  }
  .slide-quiz-prompt {
    font-size: 0.98rem;
    line-height: 1.35;
  }
  .slide-quiz-stem {
    font-size: 0.95rem;
    padding: 0.55rem 0.75rem;
    border-radius: 8px;
  }
  .slide-quiz-options {
    gap: 0.4rem;
  }
  .slide-opt-btn {
    padding: 0.55rem 0.7rem;
    gap: 0.5rem;
    border-radius: 10px;
    font-size: 0.9rem;
  }
  .slide-opt-letter {
    width: 22px;
    height: 22px;
    font-size: 0.75rem;
    border-radius: 6px;
  }
  .slide-quiz-input {
    padding: 0.55rem 0.75rem;
    font-size: 1rem;
    border-radius: 10px;
  }
  .slide-quiz-feedback {
    padding: 0.65rem 0.8rem;
    border-radius: 10px;
    font-size: 0.9rem;
  }
  .slide-deck-nav {
    gap: 0.45rem;
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    position: sticky;
    bottom: 0.35rem;
    z-index: 5;
  }
  .btn-slide-nav {
    min-width: 0;
    flex: 0 0 auto;
    padding: 0.5rem 0.7rem;
    font-size: 0.82rem;
    border-radius: 10px;
  }
  .slide-dots-container {
    max-width: 42%;
    gap: 0.28rem;
    flex-wrap: nowrap;
    overflow: hidden;
    height: 18px;
    flex-shrink: 0;
  }
  .slide-dot {
    width: 8px;
    height: 8px;
  }
  .slide-dot.active {
    width: 18px;
  }
  .slide-celebration-card {
    padding: 1.5rem 1rem;
    border-radius: 14px;
  }
  .slide-celebration-trophy {
    font-size: 2.4rem;
  }
  .slide-celebration-score {
    font-size: 2rem;
  }
}

@media (max-width: 430px) {
  .slide-deck-container {
    margin: 0.2rem auto 0.75rem;
    gap: 0.4rem;
    padding: 0 0.2rem;
  }
  .slide-card {
    padding: 0.7rem 0.7rem 0.85rem;
    gap: 0.6rem;
  }
  .slide-sentence-text {
    font-size: 1.05rem;
    line-height: 1.4;
  }
  .slide-translation-box {
    font-size: 0.9rem;
    padding: 0.4rem 0.55rem;
  }
  .slide-vocab-word {
    font-size: 1.05rem;
  }
  .slide-quiz-prompt {
    font-size: 0.92rem;
  }
}


/* ========== Flashcard practice mode (字卡) ========== */
/* Author display:flex/grid/block otherwise overrides HTML [hidden] (same specificity,
   author sheet wins over UA). Without this, meaning + grade buttons stay visible
   before flip, and #flashcardsMode can remain in document flow on the home page. */
.fc-mode[hidden],
.fc-card[hidden],
.fc-empty[hidden],
.fc-actions[hidden],
.fc-review[hidden],
#fcReviewSession[hidden],
#fcReviewCal[hidden],
#fcHint[hidden],
.fc-rev-actions .btn[hidden] {
  display: none !important;
}

body.flashcards-mode > .app-header,
body.flashcards-mode > main,
body.flashcards-mode > .app-footer,
body.flashcards-mode > .chip-picker,
body.flashcards-mode > .modal-backdrop,
body.flashcards-mode > #tokenTooltip {
  display: none !important;
}
body.flashcards-mode {
  min-height: 100dvh;
  background: var(--bg);
}
@media (min-width: 960px) {
  body.flashcards-mode {
    height: 100dvh;
    overflow: hidden;
  }
}
.fc-mode {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  box-sizing: border-box;
}
@media (min-width: 960px) {
  .fc-mode {
    height: 100dvh;
    overflow: hidden;
  }
}
.fc-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
  border-bottom: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg-elev) 94%, transparent);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
  width: 100%;
  box-sizing: border-box;
  flex-shrink: 0;
}
.fc-topbar-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}
.fc-topbar-title {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  flex: 1 1 auto;
  min-width: 0;
}
.fc-topbar-title strong {
  font-size: 1.12rem;
  font-weight: 750;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.fc-topbar-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 480px;
}
.fc-topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}
.fc-topbar-meta .save-status {
  white-space: nowrap;
  font-size: 0.76rem;
  color: var(--text-muted);
}
.btn-fc-exit {
  padding-left: 0.55rem;
  padding-right: 0.55rem;
  flex-shrink: 0;
  white-space: nowrap;
}
.fc-progress-wrap {
  height: 4px;
  background: var(--bg-soft);
  flex-shrink: 0;
  width: 100%;
}
.fc-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #22c55e);
  transition: width 0.28s ease;
}

/* Responsive Workspace */
.fc-workspace {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}

/* Desktop 2-Column Grid (>= 960px) */
@media (min-width: 960px) {
  .fc-workspace {
    display: grid;
    grid-template-columns: 295px 1fr;
    height: calc(100dvh - 58px);
    overflow: hidden;
  }
  .fc-sidebar {
    background: var(--bg-elev);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }
  .fc-sidebar-header {
    padding: 0.85rem 1rem 0.55rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 60%, transparent);
    flex-shrink: 0;
  }
  .fc-sidebar-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .fc-sidebar-label {
    font-size: 0.8rem;
    font-weight: 750;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }
  .fc-sidebar-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg-soft);
    padding: 0.12rem 0.45rem;
    border-radius: 999px;
    border: 1px solid var(--border);
  }
  .fc-filter-chips {
    flex: 1 1 auto;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.75rem 0.85rem;
    scrollbar-width: thin;
    min-height: 0;
  }
  .fc-chip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 10px;
    padding: 0.45rem 0.75rem;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    box-sizing: border-box;
    text-align: left;
  }
  .fc-chip:hover {
    border-color: var(--accent);
    color: var(--text);
    background: var(--bg-soft);
  }
  .fc-chip.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 55%, var(--border));
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    font-weight: 750;
  }
  .fc-chip-count {
    font-size: 0.75rem;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
  }
  .fc-chip.active .fc-chip-count {
    background: color-mix(in srgb, var(--accent) 24%, transparent);
    color: var(--accent);
    font-weight: 700;
  }
  .fc-sidebar-bottom {
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--bg-soft) 40%, var(--bg-elev));
    padding: 0.85rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
  }
  .fc-stats {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-muted);
    padding: 0;
    line-height: 1.45;
  }
  .fc-results-launch {
    display: flex;
  }
  .fc-results-launch .btn {
    width: 100%;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    font-weight: 700;
    font-size: 0.84rem;
    border-radius: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
  }
  .fc-results-launch .btn:hover {
    border-color: var(--accent);
    color: var(--accent);
  }
  .fc-shortcuts-panel {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding-top: 0.6rem;
    border-top: 1px dashed color-mix(in srgb, var(--border) 60%, transparent);
  }
  .fc-shortcuts-title {
    font-size: 0.72rem;
    font-weight: 750;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-bottom: 0.15rem;
  }
  .fc-shortcut-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.73rem;
    color: var(--text-muted);
  }
  .fc-shortcut-row .tag-hotkey {
    font-size: 0.68rem;
    padding: 1px 5px;
    font-family: var(--mono, monospace);
  }
  .fc-main-stage {
    flex: 1 1 auto;
    height: 100%;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem 1.5rem;
    box-sizing: border-box;
  }
  .fc-stage {
    width: 100%;
    max-width: 660px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
  }
  .fc-main-stage .fc-card {
    min-height: 440px;
    max-height: calc(100dvh - 170px);
    border-radius: 20px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.2);
    padding: 1.4rem 1.6rem 1.25rem;
    gap: 0.9rem;
  }
  .fc-main-stage .fc-lemma {
    font-size: clamp(2.1rem, 4.5vw, 2.9rem);
  }
}

/* Mobile & Tablet Styles (< 960px) */
@media (max-width: 959px) {
  .fc-workspace {
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .fc-sidebar {
    width: 100%;
    border-bottom: 1px solid var(--border);
    background: var(--bg-elev);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }
  .fc-sidebar-header,
  .fc-shortcuts-panel {
    display: none !important;
  }
  .fc-filter-chips {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 0.45rem;
    padding: 0.5rem 0.85rem;
    border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  }
  .fc-filter-chips::-webkit-scrollbar {
    display: none;
  }
  .fc-chip {
    flex-shrink: 0;
    white-space: nowrap;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    border-radius: 999px;
    padding: 0.28rem 0.72rem;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.15s ease;
  }
  .fc-chip:hover {
    border-color: var(--accent);
    color: var(--text);
  }
  .fc-chip.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  }
  .fc-chip-count {
    font-size: 0.74rem;
    padding: 0.05rem 0.42rem;
    border-radius: 999px;
    background: var(--bg-soft);
    color: var(--text-muted);
    font-weight: 500;
  }
  .fc-chip.active .fc-chip-count {
    background: color-mix(in srgb, var(--accent) 22%, transparent);
    color: var(--accent);
  }
  .fc-sidebar-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.35rem 0.85rem;
    gap: 0.5rem;
  }
  .fc-stats {
    padding: 0;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
  }
  .fc-results-launch {
    flex-shrink: 0;
    margin: 0;
  }
  .fc-results-launch .btn {
    padding: 0.2rem 0.55rem;
    font-size: 0.74rem;
  }
  .fc-main-stage {
    width: 100%;
    padding: 0.65rem 0.75rem 1.5rem;
    box-sizing: border-box;
  }
  .fc-stage {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    padding: 0;
  }
  .fc-card {
    min-height: min(65vh, 480px);
  }
}
/* 3D flip. Faces share one grid cell so height follows content.
   Back text stays visibility:hidden until mid-flip so the meaning is not
   readable before the turn (backface-visibility alone fails on some phones). */
.fc-card {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.15rem 1.1rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-height: min(62vh, 480px);
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}
.fc-flip {
  appearance: none;
  -webkit-appearance: none;
  flex: 1 1 auto;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: inherit;
  cursor: pointer;
  perspective: 1200px;
  -webkit-perspective: 1200px;
  min-height: 14.5rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.fc-card.is-revealed .fc-flip { cursor: pointer; }
.fc-flip-inner {
  display: grid;
  width: 100%;
  min-height: 14.5rem;
  height: 100%;
  transform-style: preserve-3d;
  -webkit-transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.2, 1);
  will-change: transform;
}
.fc-card.is-revealed .fc-flip-inner,
.fc-flip.is-revealed .fc-flip-inner {
  transform: rotateY(180deg);
  -webkit-transform: rotateY(180deg);
}
.fc-face {
  grid-area: 1 / 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 14.5rem;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform: translateZ(0.1px);
  -webkit-transform: translateZ(0.1px);
}
.fc-front {
  transform: rotateY(0deg) translateZ(1px);
  -webkit-transform: rotateY(0deg) translateZ(1px);
}
.fc-face.fc-back {
  transform: rotateY(180deg) translateZ(1px);
  -webkit-transform: rotateY(180deg) translateZ(1px);
  justify-content: flex-start;
}
.fc-back .fc-meaning,
.fc-back .fc-example {
  visibility: hidden;
}
.fc-card.is-revealed .fc-back .fc-meaning,
.fc-card.is-revealed .fc-back .fc-example,
.fc-flip.is-revealed .fc-back .fc-meaning,
.fc-flip.is-revealed .fc-back .fc-example {
  animation: fcUnhide 0.01s linear 0.27s forwards;
}
@keyframes fcUnhide {
  to { visibility: visible; }
}
.fc-card-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.fc-card-type {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
}
.fc-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem;
}
.fc-meta-chip {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.18rem 0.65rem;
  line-height: 1.35;
}
.fc-lemma {
  font-size: clamp(1.65rem, 7vw, 2.35rem);
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  letter-spacing: 0.01em;
  margin: 0;
  word-break: break-word;
  font-family: var(--mono), var(--font);
}
.fc-lemma-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: auto 0;
  flex: 1 1 auto;
  min-height: 5.5rem;
}
.fc-front-hint {
  color: var(--accent);
  font-size: 0.95rem;
  font-weight: 650;
  text-align: center;
}
.fc-audio-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0.2rem 0;
  flex-wrap: wrap;
  align-self: center;
}
.fc-speak {
  min-height: 2.6rem;
  padding: 0.45rem 1rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-soft) 70%, var(--bg-elev));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  align-self: center;
  transition: all 0.15s ease;
}
.fc-speak:hover { border-color: var(--accent); }
@keyframes audioPulseRing {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.45); }
  70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.fc-speak.is-playing {
  opacity: 1 !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
  animation: audioPulseRing 1.1s cubic-bezier(0.24, 0, 0.38, 1) infinite;
}
.fc-speak:disabled { opacity: 0.45; cursor: not-allowed; }
.fc-autoplay-toggle {
  min-height: 2.6rem;
  padding: 0.4rem 0.9rem;
  font-size: 0.84rem;
  font-weight: 650;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text-muted);
  cursor: pointer;
  touch-action: manipulation;
  transition: all 0.15s ease;
  user-select: none;
}
.fc-autoplay-toggle:hover {
  color: var(--text);
  border-color: var(--accent);
}
.fc-autoplay-toggle.is-active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: color-mix(in srgb, var(--accent) 45%, transparent);
  font-weight: 750;
}
.fc-meaning {
  display: block;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.45;
  color: var(--text);
  text-align: center;
}
.fc-example {
  margin-top: auto;
  text-align: left;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem 0.85rem;
}
.fc-back-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.5rem;
}
.fc-example-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.fc-example-label {
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.btn-fc-audio-mini {
  background: var(--surface2, rgba(255, 255, 255, 0.08));
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.25;
  transition: all 0.15s ease;
}
.btn-fc-audio-mini:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn-fc-audio-mini.is-playing {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.fc-example-de {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--text);
}
.fc-example-zh {
  margin: 0.4rem 0 0;
  font-size: 0.95rem;
  font-weight: 550;
  line-height: 1.5;
  color: var(--text-muted);
}
.fc-ex-tok {
  display: inline-block;
  cursor: pointer;
  border-radius: 4px;
  padding: 0.05rem 0.2rem;
  margin: 0 -0.05rem;
  transition: all 0.15s ease;
  position: relative;
  text-decoration: underline dotted 1.5px rgba(148, 163, 184, 0.4);
  text-underline-offset: 3px;
}
.fc-ex-tok:hover {
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
  text-decoration: none;
}
.fc-ex-tok.is-target-word {
  color: var(--accent);
  font-weight: 750;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}
.fc-ex-tok.is-active {
  background: var(--accent) !important;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 4px;
  box-shadow: 0 0 0 2px var(--accent);
}
.fc-ex-punct {
  opacity: 0.85;
}

/* Floating Word Inspector Drawer inside fc-example */
.fc-word-inspector {
  margin-top: 0.75rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  animation: slideUpWp 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.fc-word-inspector[hidden] {
  display: none !important;
}

@keyframes slideUpWp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.fc-wi-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.fc-wi-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.fc-wi-word {
  font-size: 1.15rem;
  font-weight: 750;
  color: var(--text);
  font-family: var(--mono), var(--font);
}
.fc-wi-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  line-height: 1;
}
.fc-wi-close:hover {
  color: var(--text);
  background: var(--bg-soft);
}
.fc-wi-meaning-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.88rem;
  color: var(--text);
}
.fc-wi-label {
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.76rem;
  flex-shrink: 0;
}
.fc-wi-meaning {
  font-weight: 650;
  color: var(--accent);
}
.fc-wi-status-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.fc-wi-segs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
}
.fc-wi-seg {
  border: 1px solid var(--border);
  background: var(--surface2, rgba(255, 255, 255, 0.05));
  color: var(--text);
  padding: 0.35rem 0;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
  transition: all 0.12s ease;
  text-align: center;
}
.fc-wi-seg:hover {
  border-color: var(--accent);
}
.fc-wi-seg.is-selected {
  font-weight: 800;
  border-color: transparent !important;
}
.fc-wi-seg.unknown-c.is-selected { background: #dc2626 !important; color: #fff !important; }
.fc-wi-seg.learning-c.is-selected { background: #ea580c !important; color: #fff !important; }
.fc-wi-seg.shaky-c.is-selected { background: #eab308 !important; color: #000 !important; }
.fc-wi-seg.familiar-c.is-selected { background: #16a34a !important; color: #fff !important; }
.fc-wi-seg.mastered-c.is-selected { background: #2563eb !important; color: #fff !important; }

.fc-wi-actions {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0.5rem;
  margin-top: 0.2rem;
}
.fc-wi-btn-add {
  font-weight: 700;
  font-size: 0.82rem;
  white-space: nowrap;
}
.fc-wi-btn-srs {
  font-size: 0.82rem;
  white-space: nowrap;
}
.fc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-top: auto;
}
.fc-btn-shaky,
.fc-btn-known {
  min-height: 3.1rem;
  font-size: 1.05rem;
  font-weight: 700;
  border-radius: 12px;
}
.fc-btn-shaky {
  background: var(--tag-shaky-bg);
  border-color: color-mix(in srgb, var(--tag-shaky) 45%, var(--border));
  color: var(--tag-shaky-fg);
}
.fc-btn-shaky:hover {
  border-color: var(--tag-shaky);
  color: var(--tag-shaky-fg);
  filter: brightness(1.02);
}
.fc-btn-known {
  background: var(--tag-mastered);
  border-color: var(--tag-mastered);
}
.fc-empty {
  width: 100%;
  text-align: center;
  padding: 2.5rem 1.25rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fc-empty-icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.fc-empty h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.fc-empty p { margin: 0 0 1.25rem; }
.fc-hint {
  text-align: center;
  padding: 0.35rem 1rem 0;
  margin: 0;
}
@media (max-width: 430px) {
  .fc-topbar { padding: 0.65rem 0.75rem; }
  .fc-stage { padding: 0.55rem 0.75rem; }
  .fc-card { padding: 1rem 0.85rem 0.9rem; min-height: min(58vh, 440px); }
  .fc-flip, .fc-flip-inner, .fc-face { min-height: 13rem; }
  .fc-actions { gap: 0.55rem; }
  .fc-btn-shaky, .fc-btn-known { min-height: 2.9rem; font-size: 1rem; }
  .fc-example-de { font-size: 0.98rem; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-flip-inner { transition: none; }
  .fc-card.is-revealed .fc-back .fc-meaning,
  .fc-card.is-revealed .fc-back .fc-example,
  .fc-flip.is-revealed .fc-back .fc-meaning,
  .fc-flip.is-revealed .fc-back .fc-example {
    animation: none;
    visibility: visible;
  }
}
@media (prefers-color-scheme: dark) {
  .fc-example {
    background: color-mix(in srgb, var(--bg-soft) 80%, var(--bg-elev));
  }
}

.fc-results-launch {
  display: flex;
  justify-content: center;
  padding: 0.15rem 1rem 0.35rem;
}
.fc-empty-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  align-items: center;
}
.fc-review {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 0.9rem 0.85rem 1rem;
}
.fc-rev-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.fc-rev-tab {
  min-height: 2.6rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  color: var(--text);
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  touch-action: manipulation;
}
.fc-rev-tab.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fc-rev-title {
  margin: 0 0 0.25rem;
  font-size: 1.2rem;
}
.fc-rev-note {
  margin: 0 0 0.75rem;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}
.fc-rev-h {
  margin: 0.85rem 0 0.4rem;
  font-size: 0.92rem;
}
.fc-bars { display: flex; flex-direction: column; gap: 0.4rem; }
.fc-bar-row {
  display: grid;
  grid-template-columns: 5.6rem 1fr auto;
  gap: 0.45rem;
  align-items: center;
}
.fc-bar-label { font-size: 0.82rem; font-weight: 700; }
.fc-bar-track {
  height: 0.55rem;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}
.fc-bar-fill { display: block; height: 100%; border-radius: 999px; }
.fc-bar-word { background: var(--accent); }
.fc-bar-phrase { background: #65a30d; }
.fc-bar-structure { background: #ea580c; }
.fc-bar-n { font-size: 0.8rem; font-variant-numeric: tabular-nums; color: var(--text-muted); min-width: 3.2rem; text-align: right; }
.fc-rev-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.fc-rev-item {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.6rem 0.7rem;
  background: var(--bg);
}
.fc-rev-item-top, .fc-rev-item-bot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}
.fc-rev-lemma {
  font-size: 1.02rem;
  line-height: 1.3;
  word-break: break-word;
}
.fc-rev-seen {
  margin: 0.28rem 0;
  font-size: 0.86rem;
  font-weight: 650;
}
.fc-rev-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}
.fc-rev-status .status-pill { font-size: 0.72rem; }
.fc-rev-same { font-size: 0.78rem; color: var(--text-muted); }
.fc-rev-time {
  flex-shrink: 0;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  text-align: right;
}
.fc-rev-dateonly {
  display: block;
  font-style: normal;
  font-size: 0.68rem;
}
.fc-rev-empty { margin: 0.25rem 0 0.4rem; }
.fc-rev-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
  margin-top: 0.9rem;
}
.fc-rev-actions .btn { min-height: 2.8rem; font-weight: 700; }
.fc-cal-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}
.fc-cal-title { flex: 1; text-align: center; font-size: 1rem; }
.fc-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.28rem;
}
.fc-cal-dow, .fc-cal-pad {
  text-align: center;
  font-size: 0.72rem;
  color: var(--text-muted);
  min-height: 1.2rem;
}
.fc-cal-day {
  position: relative;
  min-height: 2.55rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  touch-action: manipulation;
  padding: 0.2rem 0 0.7rem;
}
.fc-cal-day i {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.12rem;
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 700;
  color: var(--accent);
}
.fc-cal-day.has-act { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.fc-cal-day.is-today { box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--accent) 45%, transparent); }
.fc-cal-day.is-sel {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.fc-cal-day.is-sel i { color: #fff; }
@media (max-width: 430px) {
  .fc-bar-row { grid-template-columns: 4.8rem 1fr auto; }
  .fc-review { padding: 0.75rem 0.65rem 0.85rem; }
  .fc-cal-day { min-height: 2.4rem; font-size: 0.82rem; }
  .fc-rev-actions { grid-template-columns: 1fr; }
}

/* Flashcard Substitution Drill action button */
.fc-drill-bar {
  margin-top: 0.85rem;
  text-align: center;
  width: 100%;
}
.btn-fc-drill {
  width: 100%;
  min-height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 10px;
  background: var(--surface2, rgba(255, 255, 255, 0.05));
  border: 1px dashed color-mix(in srgb, var(--accent) 50%, var(--border));
  color: var(--text);
  transition: all 0.18s ease;
}
.btn-fc-drill:hover {
  background: var(--accent-soft, rgba(56, 189, 248, 0.15));
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Breakthrough star on flashcard review calendar */
.fc-cal-day.has-breakthrough {
  border-color: #f59e0b;
}
.fc-cal-day .fc-cal-star {
  position: absolute;
  top: 1px;
  right: 2px;
  font-size: 0.65rem;
  color: #f59e0b;
  line-height: 1;
}

/* ========== Substitution Drill Mode (句型替換操練) ========== */
.drill-mode[hidden] {
  display: none !important;
}
body.drill-mode-active {
  min-height: 100dvh;
  background: var(--bg);
}
body.drill-mode-active > .app-header,
body.drill-mode-active > .app-main,
body.drill-mode-active > .app-footer,
body.drill-mode-active > .fc-mode,
body.drill-mode-active > .modal-backdrop,
body.drill-mode-active > #tokenTooltip,
body.drill-mode-active > #podcastMiniPlayer {
  display: none !important;
}
.drill-mode {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 1rem 2rem;
}
.drill-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border);
}
.drill-back {
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
}
.drill-topbar-title {
  text-align: center;
  flex: 1;
}
.drill-title-main {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}
.drill-title-sub {
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.1rem;
}
.drill-step-indicator {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--surface2, rgba(255, 255, 255, 0.05));
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
}
.drill-progress-wrap {
  width: 100%;
  height: 4px;
  background: var(--border);
  overflow: hidden;
  margin-bottom: 1.2rem;
}
.drill-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transition: width 0.25s ease;
}
.drill-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.drill-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  padding: 1.25rem 1.4rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.drill-type-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.drill-type-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--brand);
  background: rgba(37, 99, 235, 0.1);
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
}
.drill-prompt-box {
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.55;
  color: var(--text);
}
.drill-stem-box {
  padding: 0.95rem 1.1rem;
  border-radius: 10px;
  background: var(--surface2, rgba(255, 255, 255, 0.05));
  border: 1px dashed var(--border);
  font-size: 1.15rem;
  font-family: inherit;
  line-height: 1.6;
}
.drill-input-field {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  font-size: 1.05rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.drill-input-field:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.drill-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.drill-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  font-size: 0.98rem;
  transition: all 0.15s ease;
}
.drill-opt-btn:hover:not(:disabled) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 6%, var(--bg));
}
.drill-opt-btn.is-selected {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg));
  font-weight: 600;
}
.drill-opt-btn.is-correct {
  border-color: #16a34a !important;
  background: rgba(22, 163, 74, 0.15) !important;
  color: var(--text) !important;
}
.drill-opt-btn.is-wrong {
  border-color: #dc2626 !important;
  background: rgba(220, 38, 38, 0.15) !important;
  color: var(--text) !important;
}
.drill-opt-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface2, rgba(148, 163, 184, 0.2));
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.drill-feedback {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  margin-top: 0.4rem;
  line-height: 1.5;
}
.drill-feedback.is-correct {
  background: rgba(22, 163, 74, 0.12);
  border: 1px solid rgba(22, 163, 74, 0.4);
}
.drill-feedback.is-wrong {
  background: rgba(220, 38, 38, 0.12);
  border: 1px solid rgba(220, 38, 38, 0.4);
}
.drill-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}
.drill-summary-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  padding: 2rem 1.5rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
}
.drill-summary-icon {
  font-size: 3rem;
  line-height: 1;
}
.drill-summary-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text);
  margin: 0;
}
.drill-summary-score {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
}
.drill-level-impact-box {
  width: 100%;
  max-width: 480px;
  padding: 1rem 1.2rem;
  border-radius: 12px;
  background: var(--surface2, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drill-summary-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

/* Podcast Studio: options row */
.podcast-option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  margin: 0 0 0.85rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
}
.podcast-option-row input { margin-top: 0.2rem; accent-color: var(--accent); }

/* Sentence Comments & Feedback */
.btn-sentence-comment {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-sentence-comment:hover {
  background: var(--bg-soft);
  color: var(--text);
  border-color: var(--accent);
}
.btn-sentence-comment.has-comments {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.comment-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.25rem;
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
}

.sentence-comments-wrap {
  margin-top: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn 0.15s ease-out;
}
.comments-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border);
}
.comments-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
}
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.comment-item {
  padding: 0.45rem 0.6rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.82rem;
}
.comment-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.comment-tag-badge {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.comment-tag-badge.grammar { background: #ede9fe; color: #6d28d9; }
.comment-tag-badge.vocab { background: #dbeafe; color: #1d4ed8; }
.comment-tag-badge.speed { background: #fef3c7; color: #b45309; }
.comment-tag-badge.suggestion { background: #dcfce7; color: #15803d; }
.btn-del-comment {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.1rem 0.25rem;
  font-size: 0.75rem;
  border-radius: 4px;
}
.btn-del-comment:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.comment-item-body {
  line-height: 1.4;
  color: var(--text);
}
.comment-input-box {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.comment-textarea {
  width: 100%;
  min-height: 54px;
  max-height: 120px;
  resize: vertical;
  padding: 0.45rem 0.6rem;
  font-size: 0.84rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface, #fff);
  color: var(--text);
  font-family: inherit;
}
.comment-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 20%, transparent);
}
.comment-actions-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.comment-tag-chips {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.tag-chip {
  padding: 0.2rem 0.45rem;
  font-size: 0.74rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}
.tag-chip.active, .tag-chip:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* Custom Podcast Player */
.podcast-modal-sheet {
  width: min(760px, 95vw) !important;
}
.custom-podcast-player {
  width: 100%;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  margin: 0.75rem 0 1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}
.player-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}
.player-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.live-dot.is-playing {
  animation: pulseDot 1.2s infinite;
}
@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.75; }
}
.player-meta-info {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.podcast-scrubber-wrap {
  margin-bottom: 0.85rem;
}
.podcast-progress-container {
  position: relative;
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: 999px;
  cursor: pointer;
  touch-action: none;
  overflow: visible;
}
.podcast-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), #9333ea);
  border-radius: 999px;
  transition: width 0.05s linear;
  pointer-events: none;
}
.podcast-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: left 0.05s linear;
}
.podcast-time-row {
  display: flex;
  justify-content: space-between;
  margin-top: 0.35rem;
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
}

.podcast-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.podcast-ctrl-speed-group,
.podcast-ctrl-actions-group {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.podcast-ctrl-main-group {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}
.btn-ctrl-play {
  width: 3.1rem;
  height: 3.1rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.35);
  transition: all 0.15s ease;
}
.btn-ctrl-play:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.45);
}
.btn-ctrl-play:active {
  transform: scale(0.97);
}
.btn-ctrl-skip {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-ctrl-skip:hover {
  background: var(--surface);
  border-color: var(--accent);
}
.btn-ctrl-speed {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 2.8rem;
}
.btn-ctrl-speed:hover {
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

/* AI Script Update Banner */
.podcast-script-update-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.15), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  margin-bottom: 0.85rem;
}
.update-banner-icon { font-size: 1.4rem; flex-shrink: 0; }
.update-banner-text { flex: 1; min-width: 0; font-size: 0.86rem; color: var(--text); }

/* Podcast Tabs */
.podcast-view-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 0.75rem 0 0.65rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.4rem;
}
.podcast-view-tab {
  background: transparent;
  border: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.4rem 0.75rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.podcast-view-tab:hover {
  color: var(--text);
  background: var(--bg-soft);
}
.podcast-view-tab.active {
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  font-weight: 700;
}

/* Interactive Synchronized Transcript */
.podcast-transcript-panel {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-bottom: 0.75rem;
  border-radius: var(--radius-sm);
}
.podcast-transcript-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.pt-segment-card {
  padding: 0.65rem 0.85rem;
  background: var(--surface, #fff);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.pt-segment-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.pt-segment-card.is-active-sentence {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent), 0 2px 8px rgba(37, 99, 235, 0.15);
}
.pt-segment-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.3rem;
  font-size: 0.75rem;
}
.pt-tag {
  font-weight: 700;
  color: var(--text-muted);
}
.pt-time-btn {
  background: transparent;
  border: none;
  font-size: 0.74rem;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  padding: 0.1rem 0.3rem;
  border-radius: 4px;
}
.pt-segment-body {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--text);
}
.pt-atom {
  padding: 0.1rem 0.15rem;
  border-radius: 3px;
  transition: background 0.12s ease;
}
.pt-atom.is-target-lang {
  font-weight: 600;
  color: #1e40af;
}
.pt-atom.is-active-atom {
  background: #fde047;
  color: #000;
  border-radius: 3px;
  box-shadow: 0 0 0 1px #eab308;
}

/* AI lesson paste/import box */
.ai-lesson-box { margin-top: .75rem; padding: .6rem .8rem; border: 1px dashed var(--border, #c9d1d9); border-radius: 10px; background: rgba(99,102,241,.05); }
.ai-lesson-box > summary { cursor: pointer; font-weight: 600; }
.ai-lesson-help { margin: .4rem 0; font-size: .85rem; opacity: .8; }
.ai-lesson-box textarea { width: 100%; box-sizing: border-box; margin: .4rem 0; font-family: ui-monospace, Menlo, monospace; font-size: .8rem; border-radius: 8px; padding: .5rem; }
.ai-lesson-report { white-space: pre-wrap; font-size: .82rem; line-height: 1.5; background: rgba(0,0,0,.05); border-radius: 8px; padding: .6rem .8rem; margin: .4rem 0 0; }

/* =====================================================================
   Top-Level Flashcard Nav Tab & Collapsible Sentence Annotations
   ===================================================================== */

/* Top-Level Flashcard App Tab in Header */
.nav-tabs button.nav-tab-flashcard {
  color: #b45309;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 700;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-tabs button.nav-tab-flashcard:hover {
  background: rgba(245, 158, 11, 0.22);
  border-color: #f59e0b;
  color: #92400e;
  transform: translateY(-1px);
}
.nav-tabs button.nav-tab-flashcard.active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

@media (prefers-color-scheme: dark) {
  .nav-tabs button.nav-tab-flashcard {
    color: #fde68a;
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.35);
  }
  .nav-tabs button.nav-tab-flashcard:hover {
    background: rgba(245, 158, 11, 0.25);
    color: #ffffff;
  }
  .nav-tabs button.nav-tab-flashcard.active {
    background: #d97706;
    color: #ffffff;
    border-color: #f59e0b;
  }
}

.nav-tab-badge {
  display: inline-block;
  background: #e11d48;
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 5px;
  line-height: 1.2;
  box-shadow: 0 1px 3px rgba(225, 29, 72, 0.4);
}
.fc-srs-chip {
  background: rgba(16, 185, 129, 0.12) !important;
  color: #059669 !important;
  border: 1px solid rgba(16, 185, 129, 0.3) !important;
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .fc-srs-chip {
    background: rgba(16, 185, 129, 0.2) !important;
    color: #6ee7b7 !important;
    border-color: rgba(16, 185, 129, 0.4) !important;
  }
}

/* Target Word Annotation Indicator */
.token.has-annotation {
  text-decoration-line: underline;
  text-decoration-style: dotted;
  text-decoration-color: #f59e0b;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.token.has-annotation:hover {
  text-decoration-style: solid;
  text-decoration-color: #d97706;
}

/* Inline Annotation Hint Badge next to target word */
.token-annot-badge {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  padding: 1px 7px;
  margin-left: 4px;
  margin-right: 2px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: #b45309;
  border: 1px solid rgba(245, 158, 11, 0.35);
  font-weight: 600;
  cursor: pointer;
  vertical-align: baseline;
  line-height: 1.3;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.token-annot-badge:hover {
  background: rgba(245, 158, 11, 0.24);
  border-color: #d97706;
  color: #92400e;
  transform: translateY(-1px);
}
.token-annot-badge.is-active {
  background: #f59e0b;
  color: #ffffff;
  border-color: #d97706;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

@media (prefers-color-scheme: dark) {
  .token-annot-badge {
    background: rgba(245, 158, 11, 0.18);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.4);
  }
  .token-annot-badge:hover {
    background: rgba(245, 158, 11, 0.28);
    color: #fde68a;
  }
  .token-annot-badge.is-active {
    background: #d97706;
    color: #ffffff;
    border-color: #f59e0b;
  }
}

/* Collapsible Sentence Annotation Container & Card */
.sentence-annotations-container {
  margin: 0.75rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.annotation-card {
  border-left: 4px solid #f59e0b;
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.45) 0%, rgba(255, 251, 235, 0.7) 100%);
  border-top: 1px solid rgba(245, 158, 11, 0.25);
  border-right: 1px solid rgba(245, 158, 11, 0.25);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 10px;
  padding: 0.9rem 1.15rem;
  box-shadow: 0 3px 12px rgba(245, 158, 11, 0.08);
  animation: annotFadeIn 0.24s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (prefers-color-scheme: dark) {
  .annotation-card {
    background: linear-gradient(135deg, rgba(41, 37, 36, 0.75) 0%, rgba(28, 25, 23, 0.85) 100%);
    border-top: 1px solid rgba(245, 158, 11, 0.32);
    border-right: 1px solid rgba(245, 158, 11, 0.32);
    border-bottom: 1px solid rgba(245, 158, 11, 0.32);
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.35);
  }
}

@keyframes annotFadeIn {
  from { opacity: 0; transform: translateY(-5px); }
  to { opacity: 1; transform: translateY(0); }
}

.annotation-card.highlight-pulse {
  animation: annotPulse 1.2s ease-out;
}

@keyframes annotPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.65); }
  40% { box-shadow: 0 0 0 8px rgba(245, 158, 11, 0.15); }
  100% { box-shadow: 0 3px 12px rgba(245, 158, 11, 0.08); }
}

.annotation-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.35);
}

.annotation-card-title-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.annotation-card-badge {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: #f59e0b;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.annotation-card-title {
  font-size: 0.98rem;
  color: var(--text);
  font-weight: 700;
}

.btn-close-annotation {
  cursor: pointer;
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  transition: all 0.15s ease;
}
.btn-close-annotation:hover {
  background: var(--bg-soft);
  color: var(--text);
  border-color: #f59e0b;
}

.annotation-card-body {
  font-size: 0.93rem;
  line-height: 1.62;
  color: var(--text);
}

.annotation-card-body .annot-p {
  margin: 0.35rem 0;
}

.annotation-card-body .annot-spacer {
  height: 0.45rem;
}

.annotation-card-body ul.annot-list {
  margin: 0.35rem 0 0.45rem 1.25rem;
  padding: 0;
  list-style-type: disc;
}

.annotation-card-body ul.annot-sublist {
  margin: 0.2rem 0 0.3rem 1.2rem;
  padding: 0;
  list-style-type: circle;
}

.annotation-card-body li {
  margin: 0.22rem 0;
}

.annotation-card-body strong {
  color: #b45309;
}
@media (prefers-color-scheme: dark) {
  .annotation-card-body strong {
    color: #fbbf24;
  }
}

.annotation-card-body em {
  font-style: italic;
  color: var(--accent);
}

.annotation-card-body code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.06);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}
@media (prefers-color-scheme: dark) {
  .annotation-card-body code {
    background: rgba(255, 255, 255, 0.1);
  }
}

/* =====================================================================
   Mobile Friendly Enhancements (Podcast On-The-Go & Mobile Flashcards)
   ===================================================================== */

/* Top Navigation Bar on Mobile */
@media (max-width: 640px) {
  .app-header {
    padding: 0.5rem 0.75rem;
    flex-wrap: wrap;
    gap: 0.45rem;
  }
  .nav-tabs {
    order: 3;
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding-bottom: 3px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-tabs::-webkit-scrollbar {
    display: none;
  }
  .nav-tabs button {
    flex-shrink: 0;
    padding: 0.4rem 0.75rem;
    font-size: 0.84rem;
  }
  .header-actions {
    margin-left: auto;
    gap: 0.4rem;
  }
  .header-actions .btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
  }
}

/* Flashcard Swipe Gesture Feedback & Indicators */
.fc-card {
  position: relative;
  will-change: transform, opacity;
  touch-action: pan-y;
}

.fc-card::before,
.fc-card::after {
  position: absolute;
  top: 1.2rem;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.02em;
  opacity: 0;
  transform: scale(0.8);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  z-index: 25;
}

/* Left swipe indicator: 還不穩 */
.fc-card::before {
  content: "← 還不穩";
  right: 1.2rem;
  background: #ea580c;
  color: #fff;
  box-shadow: 0 4px 14px rgba(234, 88, 12, 0.45);
}

/* Right swipe indicator: 會了 ✓ */
.fc-card::after {
  content: "會了 ✓ →";
  left: 1.2rem;
  background: #16a34a;
  color: #fff;
  box-shadow: 0 4px 14px rgba(22, 163, 74, 0.45);
}

.fc-card.swipe-hint-shaky {
  border-color: #ea580c !important;
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.35), 0 8px 24px rgba(234, 88, 12, 0.25) !important;
}
.fc-card.swipe-hint-shaky::before {
  opacity: 1;
  transform: scale(1.05);
}

.fc-card.swipe-hint-known {
  border-color: #16a34a !important;
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.35), 0 8px 24px rgba(22, 163, 74, 0.25) !important;
}
.fc-card.swipe-hint-known::after {
  opacity: 1;
  transform: scale(1.05);
}

/* Flashcard Mode Mobile Sizing & Thumb Ergonomics */
@media (max-width: 640px) {
  .fc-mode {
    padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  }
  .fc-topbar {
    padding: 0.45rem 0.65rem;
    gap: 0.4rem;
  }
  .fc-topbar-left {
    gap: 0.35rem;
  }
  .fc-topbar .brand-text {
    display: none;
  }
  .btn-fc-exit {
    padding: 0.22rem 0.45rem;
    font-size: 0.8rem;
  }
  .fc-topbar-title strong {
    font-size: 0.96rem;
  }
  .fc-topbar-sub {
    font-size: 0.7rem;
    max-width: 130px;
  }
  .fc-topbar-meta {
    gap: 0.35rem;
  }
  .fc-topbar-meta .save-status {
    display: none !important;
  }
  .fc-topbar-meta #btnOpenFcDrivingPodcast {
    padding: 0.22rem 0.45rem;
    font-size: 0.76rem;
  }
  .fc-topbar-meta #btnFcSave {
    padding: 0.22rem 0.55rem;
    font-size: 0.8rem;
  }
  .fc-stage {
    padding: 0.4rem 0.7rem 1.2rem;
    max-width: 100%;
  }
  .fc-card {
    padding: 1.15rem 0.95rem 1rem;
    min-height: min(65vh, 460px);
    border-radius: 18px;
  }
  .fc-flip, .fc-flip-inner, .fc-face {
    min-height: 13.5rem;
  }
  .fc-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
    margin-top: 0.75rem;
  }
  .fc-btn-shaky, .fc-btn-known {
    min-height: 3.3rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 12px;
  }
  .btn-fc-drill {
    min-height: 2.85rem;
    font-size: 0.9rem;
    width: 100%;
    justify-content: center;
  }
  .fc-speak {
    min-height: 2.65rem;
    padding: 0.45rem 1.1rem;
    font-size: 0.95rem;
  }
}

/* Podcast Studio Mobile Sheet & Controls */
@media (max-width: 640px) {
  .podcast-modal-sheet {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 92vh !important;
    padding: 1.1rem 0.95rem max(1rem, env(safe-area-inset-bottom)) !important;
    border-radius: 20px 20px 0 0 !important;
    margin-top: auto !important;
    box-sizing: border-box;
  }
  .podcast-controls-bar {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }
  .podcast-ctrl-main-group {
    width: 100%;
    justify-content: center;
    order: 1;
    gap: 1rem;
  }
  .btn-ctrl-play {
    width: 3.4rem;
    height: 3.4rem;
    font-size: 1.35rem;
  }
  .btn-ctrl-skip {
    padding: 0.5rem 0.85rem;
    font-size: 0.85rem;
  }
  .podcast-ctrl-speed-group {
    order: 2;
    justify-content: center;
  }
  .podcast-ctrl-actions-group {
    order: 3;
    width: 100%;
    justify-content: space-between;
  }
  .podcast-transcript-panel {
    max-height: 42vh;
  }
}

/* Floating Podcast Mini-Player (随身听底部悬浮播放器) */
.podcast-mini-player {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 135;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  padding: 0 0.85rem max(0.45rem, env(safe-area-inset-bottom)) 0.85rem;
  animation: slideUpMini 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@media (prefers-color-scheme: dark) {
  .podcast-mini-player {
    background: rgba(20, 26, 36, 0.95);
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5);
  }
}

@keyframes slideUpMini {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.mini-player-track {
  width: 100%;
  height: 4px;
  background: var(--border);
  cursor: pointer;
  position: relative;
  margin-bottom: 0.45rem;
  border-radius: 2px;
}
.mini-player-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #9333ea);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.08s linear;
}

.mini-player-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 3.25rem;
}

.mini-player-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}
.mini-player-info:hover .mini-player-title {
  color: var(--accent);
}

.mini-player-wave {
  display: flex;
  align-items: flex-end;
  gap: 2.5px;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}
.wave-bar {
  width: 3.5px;
  height: 6px;
  background: var(--accent);
  border-radius: 2px;
  transition: height 0.15s ease;
}
.mini-player-wave.is-playing .wave-bar:nth-child(1) {
  animation: miniWave 0.8s ease-in-out infinite alternate;
}
.mini-player-wave.is-playing .wave-bar:nth-child(2) {
  animation: miniWave 0.8s ease-in-out 0.2s infinite alternate;
}
.mini-player-wave.is-playing .wave-bar:nth-child(3) {
  animation: miniWave 0.8s ease-in-out 0.4s infinite alternate;
}

@keyframes miniWave {
  0% { height: 4px; }
  100% { height: 18px; }
}

.mini-player-text {
  flex: 1;
  min-width: 0;
}
.mini-player-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
}
.mini-player-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  margin-top: 1px;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}
.btn-mini-play {
  width: 2.65rem;
  height: 2.65rem;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #7c3aed);
  color: #fff;
  border: none;
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(37, 99, 235, 0.35);
  transition: transform 0.15s ease;
}
.btn-mini-play:active {
  transform: scale(0.93);
}
.btn-mini-skip,
.btn-mini-expand,
.btn-mini-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem 0.5rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.btn-mini-skip:hover,
.btn-mini-expand:hover {
  color: var(--text);
  background: var(--bg-soft);
}
.btn-mini-close:hover {
  color: #dc2626;
  background: rgba(220, 38, 38, 0.1);
}

body.has-podcast-mini-player main {
  padding-bottom: 5.5rem;
}
body.has-podcast-mini-player .fc-stage {
  padding-bottom: 5.5rem;
}
body.has-podcast-mini-player .fc-mode {
  padding-bottom: 6rem;
}

/* ========================================================
   Dual-Subtitle Video-Like Cinema Player Mode (影音劇院)
   ======================================================== */
.cinema-player-container {
  max-width: 980px;
  margin: 1.25rem auto 3rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: fadeIn 0.2s ease-out;
  position: relative;
}

#articleReaderView.is-cinema-mode .cinema-player-container {
  margin: 0 auto;
  width: 100%;
  max-width: 1560px;
  height: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.cinema-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  flex-wrap: nowrap;
  flex: 0 0 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.cinema-header::-webkit-scrollbar {
  display: none;
}

#articleReaderView.is-cinema-mode .cinema-header {
  height: 42px;
  min-height: 42px;
  padding: 0 0.85rem;
  border-radius: 12px;
}

.cinema-header-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.cinema-mode-pills {
  display: inline-flex;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.cinema-mode-pill {
  background: transparent;
  border: none;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 0.2rem 0.5rem;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cinema-mode-pill:hover {
  color: var(--text);
}

.cinema-mode-pill.is-active {
  background: #8b5cf6;
  color: #ffffff;
  box-shadow: 0 1px 4px rgba(139, 92, 246, 0.3);
}

.cinema-mode-badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.12);
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
}

.cinema-page-badge {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
  max-width: clamp(140px, 18vw, 240px);
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-block;
  vertical-align: middle;
}

.cinema-progress-wrap {
  flex: 1;
  min-width: 30px;
}

.cinema-progress-track {
  height: 8px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform 0.1s ease;
}

.cinema-progress-track:hover {
  transform: scaleY(1.3);
}

.cinema-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #8b5cf6, #ec4899);
  border-radius: 999px;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.cinema-header-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  justify-content: flex-end;
}
.cinema-action-group {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 2px 4px;
  border-radius: 8px;
  flex-shrink: 0;
}

.cinema-tool-btn {
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}
.cinema-tool-btn:hover {
  color: var(--text);
  background: var(--bg-soft);
}

/* Floating Title & Metadata Overlay (On-Demand HUD) */
.cinema-meta-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 25;
  padding: 0.85rem 1.25rem;
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  animation: cinemaMetaSlideDown 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

@keyframes cinemaMetaSlideDown {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.cinema-meta-overlay-card {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.cinema-meta-overlay-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cinema-meta-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
}

.cinema-meta-sub {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 0.15rem;
}

.cinema-meta-close-btn {
  color: #94a3b8 !important;
  font-size: 1.1rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}
.cinema-meta-close-btn:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

.cinema-meta-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
}

/* Cinema Viewport / 16:9 Screen (Zero-scroll responsive viewport) */
.cinema-viewport {
  background: var(--cinema-bg, radial-gradient(circle at 50% 18%, #1e293b 0%, #090d16 100%));
  border: 1px solid var(--cinema-border, rgba(255, 255, 255, 0.12));
  border-radius: 20px;
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all 0.3s ease;
  flex: 1 1 auto;
  min-height: 0;
}

#articleReaderView.is-cinema-mode .cinema-viewport {
  height: auto;
  max-height: none;
  border-radius: 16px;
}

.cinema-player-container.is-fullscreen {
  position: fixed;
  inset: 0;
  max-width: 100vw;
  width: 100vw;
  height: 100vh;
  margin: 0;
  z-index: 99999;
  background: var(--bg, #090d16);
  border-radius: 0;
  padding: 1rem;
  box-sizing: border-box;
}

.cinema-player-container.is-fullscreen .cinema-viewport {
  height: calc(100vh - 140px);
  max-height: none;
  border-radius: 16px;
}

/* Visual Asset Stage */
.cinema-visual-stage {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 0.65rem 1.25rem 0.2rem;
  min-height: 70px;
  max-height: calc(100% - 130px);
}

.cinema-visual-frame {
  max-height: 100%;
  max-width: 88%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  animation: fadeIn 0.25s ease-out;
  position: relative;
}

.cinema-visual-img {
  max-height: clamp(80px, 18vh, 150px);
  max-width: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.18);
  transition: transform 0.2s ease, max-height 0.2s ease;
  background: rgba(0, 0, 0, 0.3);
}

.cinema-viewport.has-dense-subtitle .cinema-visual-img {
  max-height: clamp(70px, 14vh, 110px);
}

.cinema-visual-img:hover {
  transform: scale(1.02);
}

.cinema-visual-caption {
  font-size: 0.82rem;
  font-weight: 500;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.cinema-visual-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.3);
  color: #c4b5fd;
}

/* ========================================================
   Multi-Card Deck in Cinema Visual Stage (Adaptive Grid / Snap Carousel)
   ======================================================== */
.cinema-multi-vocab-deck {
  width: 100%;
  max-width: 1040px;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  animation: fadeIn 0.2s ease-out;
}

.cinema-deck-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-shrink: 0;
  padding: 0 0.25rem;
  min-height: 26px;
}

.cinema-deck-nav-left {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.cinema-deck-nav-left::-webkit-scrollbar {
  display: none;
}

.cinema-deck-badge {
  font-size: 0.72rem;
  font-weight: 700;
  color: #c4b5fd;
  background: rgba(139, 92, 246, 0.22);
  border: 1px solid rgba(139, 92, 246, 0.35);
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  white-space: nowrap;
}

.cinema-deck-pill-tabs {
  display: inline-flex;
  gap: 0.25rem;
  align-items: center;
}

.cinema-deck-pill-tab {
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.12rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cinema-deck-pill-tab:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.cinema-deck-pill-tab.is-active {
  background: rgba(99, 102, 241, 0.35);
  border-color: #818cf8;
  color: #ffffff;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.cinema-deck-nav-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

.cinema-deck-arrows {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  background: rgba(15, 23, 42, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 1px 4px;
}

.cinema-deck-arrow {
  background: transparent !important;
  border: none !important;
  color: #cbd5e1 !important;
  font-size: 0.95rem !important;
  font-weight: 700;
  padding: 0 0.35rem !important;
  cursor: pointer;
  line-height: 1;
}

.cinema-deck-arrow:hover {
  color: #ffffff !important;
}

.cinema-deck-counter {
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
  padding: 0 0.15rem;
  user-select: none;
}

/* Cards Track: Adaptive Grid on Desktop, Horizontal Snap on Mobile */
.cinema-cards-track {
  width: 100%;
  display: flex;
  gap: 0.65rem;
  align-items: stretch;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

@media (min-width: 769px) {
  .cinema-cards-track[data-count="1"] {
    display: flex;
    justify-content: center;
  }
  .cinema-cards-track[data-count="1"] .cinema-card-item {
    max-width: 620px;
    width: 100%;
  }

  .cinema-cards-track[data-count="2"] {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    max-width: 860px;
    margin: 0 auto;
  }

  .cinema-cards-track[data-mode="carousel"],
  .cinema-cards-track[data-count="3"],
  .cinema-cards-track[data-count="4"],
  .cinema-cards-track[data-count="5"],
  .cinema-cards-track[data-count="6"] {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    padding: 8px 12px 10px;
    gap: 0.85rem;
    scroll-behavior: smooth;
  }
  .cinema-cards-track[data-mode="carousel"] .cinema-card-item,
  .cinema-cards-track[data-count="3"] .cinema-card-item,
  .cinema-cards-track[data-count="4"] .cinema-card-item,
  .cinema-cards-track[data-count="5"] .cinema-card-item,
  .cinema-cards-track[data-count="6"] .cinema-card-item {
    flex: 0 0 clamp(290px, 48%, 440px);
    min-width: 280px;
    scroll-snap-align: center;
  }
}

.cinema-card-item {
  width: 100%;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.4rem;
  box-sizing: border-box;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
}

.cinema-card-item:hover {
  border-color: rgba(255, 255, 255, 0.28);
}

/* Active vs inactive card (all layout modes): inactive = dim + desaturated + flat;
   active = translucent indigo glass, bright border, outer glow, slight lift. */
.cinema-card-item {
  opacity: 0.5;
  filter: saturate(0.6);
  transition: opacity 0.25s ease, filter 0.25s ease, transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.cinema-card-item.is-focused-card {
  opacity: 1;
  filter: none;
  transform: translateY(-2px) scale(1.015);
  border-color: #a5b4fc;
  background: linear-gradient(145deg, rgba(99, 102, 241, 0.34), rgba(56, 189, 248, 0.16) 60%, rgba(30, 41, 59, 0.62));
  box-shadow: 0 0 0 2px rgba(165, 180, 252, 0.9), 0 0 26px 4px rgba(129, 140, 248, 0.55), 0 12px 32px rgba(0, 0, 0, 0.45);
  z-index: 2;
}

.cinema-card-item:hover:not(.is-focused-card) {
  opacity: 0.8;
}

.cinema-card-item.is-hover-linked {
  border-color: rgba(129, 140, 248, 0.75);
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.3);
}

.cinema-deck-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.45rem;
  margin-top: 0.35rem;
}

.cinema-deck-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transition: all 0.25s ease;
  cursor: pointer;
}

.cinema-deck-dot.is-active {
  width: 20px;
  border-radius: 4px;
  background: #818cf8;
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.7);
}

/* Subtitle token highlighted when linked to active card */
.cinema-token.is-card-linked-token {
  background: rgba(129, 140, 248, 0.32) !important;
  color: #e0e7ff !important;
  box-shadow: 0 0 12px rgba(129, 140, 248, 0.45);
  border-radius: 4px;
}
.cinema-viewport.is-stream-layout .cinema-token.is-card-linked-token {
  background: transparent !important;
  box-shadow: none !important;
}

/* Vocabulary Spotlight Card in Cinema Visual Stage (Single card fallback) */
.cinema-vocab-card {
  width: 100%;
  max-width: 660px;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-radius: 14px;
  padding: 0.75rem 1.15rem;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  animation: fadeIn 0.2s ease-out;
  box-sizing: border-box;
}

.cinema-vocab-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.cinema-vocab-word-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.cinema-vocab-word {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.01em;
}

.cinema-vocab-pos {
  font-size: 0.72rem;
  font-weight: 600;
  color: #cbd5e1;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cinema-vocab-pos.is-separable {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.35);
  font-weight: 700;
}

.cinema-vocab-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}
.cinema-vocab-badge.is-levelup {
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.cinema-vocab-audio-btn {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cinema-vocab-audio-btn:hover {
  background: rgba(255, 255, 255, 0.22) !important;
}

.cinema-visual-mode-toggle {
  display: inline-flex;
  gap: 0.2rem;
  background: rgba(15, 23, 42, 0.65);
  padding: 0.15rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cinema-visual-mode-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  padding: 0.18rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cinema-visual-mode-btn:hover {
  color: #f1f5f9;
}
.cinema-visual-mode-btn.is-active {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.cinema-vocab-meaning-box {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #818cf8;
  border-radius: 8px;
  padding: 0.45rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.cinema-vocab-zh {
  font-size: 0.95rem;
  font-weight: 600;
  color: #f8fafc;
  line-height: 1.4;
}

.cinema-vocab-colloc {
  font-size: 0.78rem;
  color: #94a3b8;
  line-height: 1.35;
}

.cinema-vocab-chips-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.76rem;
}

.cinema-vocab-chips-label {
  color: #94a3b8;
  font-weight: 600;
}

.cinema-vocab-chip {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}
.cinema-vocab-chip:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.cinema-vocab-chip.is-active {
  background: rgba(99, 102, 241, 0.35);
  border-color: #818cf8;
  color: #ffffff;
}

.cinema-vocab-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  flex-wrap: wrap;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.45rem;
}

.cinema-vocab-tag-group {
  display: flex;
  gap: 0.25rem;
}

.cinema-vocab-tag-pill {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.cinema-vocab-tag-pill:hover {
  filter: brightness(1.2);
}
.cinema-vocab-tag-pill.tag-mastered.is-selected { background: rgba(22, 163, 74, 0.35); color: #4ade80; border-color: #22c55e; }
.cinema-vocab-tag-pill.tag-familiar.is-selected { background: rgba(101, 163, 13, 0.35); color: #a3e635; border-color: #84cc16; }
.cinema-vocab-tag-pill.tag-shaky.is-selected { background: rgba(202, 138, 4, 0.35); color: #facc15; border-color: #eab308; }
.cinema-vocab-tag-pill.tag-learning.is-selected { background: rgba(234, 88, 12, 0.35); color: #fb923c; border-color: #f97316; }
.cinema-vocab-tag-pill.tag-unknown.is-selected { background: rgba(220, 38, 38, 0.35); color: #f87171; border-color: #ef4444; }

.cinema-vocab-btn-dict {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #e2e8f0 !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  font-size: 0.74rem !important;
  padding: 0.2rem 0.55rem !important;
  border-radius: 6px !important;
  cursor: pointer;
}
.cinema-vocab-btn-dict:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
}

/* Fallback Animated Audio Visualizer Placeholder */
.cinema-waveform-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  opacity: 0.9;
}

.cinema-waveform-bars {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 40px;
}

.cinema-wave-bar {
  width: 5px;
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #38bdf8, #818cf8);
  transition: height 0.15s ease;
}

.cinema-viewport.is-speaking .cinema-wave-bar:nth-child(1) { animation: cinemaWave 0.8s infinite 0.1s; }
.cinema-viewport.is-speaking .cinema-wave-bar:nth-child(2) { animation: cinemaWave 0.8s infinite 0.3s; }
.cinema-viewport.is-speaking .cinema-wave-bar:nth-child(3) { animation: cinemaWave 0.8s infinite 0.0s; }
.cinema-viewport.is-speaking .cinema-wave-bar:nth-child(4) { animation: cinemaWave 0.8s infinite 0.4s; }
.cinema-viewport.is-speaking .cinema-wave-bar:nth-child(5) { animation: cinemaWave 0.8s infinite 0.2s; }

@keyframes cinemaWave {
  0%, 100% { height: 10px; opacity: 0.4; }
  50% { height: 38px; opacity: 1; }
}

.cinema-topic-card {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: #94a3b8;
  font-size: 0.82rem;
  backdrop-filter: blur(6px);
}

/* Dual Subtitles Area */
.cinema-subtitles-container {
  flex: 0 0 auto;
  background: linear-gradient(180deg, rgba(9, 13, 22, 0) 0%, rgba(9, 13, 22, 0.85) 20%, rgba(9, 13, 22, 0.98) 100%);
  padding: 0.65rem 1.25rem 0.85rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-top: auto;
  z-index: 5;
  box-sizing: border-box;
  cursor: default;
  position: relative;
}

.cinema-subtitles-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  max-width: 900px;
  margin-bottom: 0.35rem;
  position: relative;
  z-index: 10;
}

.cinema-sub-size-widget {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 1px 5px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cinema-sub-size-btn {
  background: transparent;
  border: none;
  color: #cbd5e1;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.15rem 0.38rem;
  border-radius: 999px;
  cursor: pointer;
  line-height: 1;
  transition: all 0.15s ease;
}

.cinema-sub-size-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
}

.cinema-sub-size-btn:active {
  transform: scale(0.92);
}

.cinema-sub-size-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: #94a3b8;
  padding: 0 0.25rem;
  min-width: 36px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cinema-sub-size-label:hover {
  color: #38bdf8;
}

.cinema-sub-copy-btn {
  font-size: 0.72rem;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.18);
  cursor: pointer;
  transition: all 0.15s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  position: relative;
  z-index: 10;
  pointer-events: auto;
}

.cinema-sub-copy-btn:hover {
  background: rgba(0, 0, 0, 0.75);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.45);
  transform: translateY(-1px);
}

.cinema-sub-copy-btn:active {
  transform: scale(0.96);
}

.cinema-sub-target {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: calc(clamp(1.2rem, 2vw, 1.55rem) * var(--cinema-sub-scale, 1));
  font-weight: 600;
  color: var(--cinema-sub-target, #f8fafc);
  line-height: 1.45;
  text-shadow: var(--cinema-sub-shadow, 0 2px 8px rgba(0, 0, 0, 0.8));
  display: block;
  text-align: center;
  user-select: text;
  transition: opacity 0.2s ease, font-size 0.15s ease;
}

.cinema-sub-target.is-dense-subtitle {
  font-size: calc(clamp(1.05rem, 1.65vw, 1.28rem) * var(--cinema-sub-scale, 1));
  line-height: 1.38;
}

.cinema-sub-source {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  font-size: calc(clamp(0.92rem, 1.25vw, 1.05rem) * var(--cinema-sub-scale, 1));
  font-weight: 400;
  color: var(--cinema-sub-source, rgba(226, 232, 240, 0.88));
  line-height: 1.4;
  text-shadow: var(--cinema-sub-shadow, 0 2px 6px rgba(0, 0, 0, 0.85));
  max-width: 90%;
  margin-top: 0.2rem;
  text-align: center;
  display: block;
  transition: opacity 0.2s ease, font-size 0.15s ease;
}

/* Cinema Token Typography & Colors */
.cinema-token {
  display: inline-block;
  padding: 0.05rem 0.16rem;
  margin: 0 0.06rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: text;
  color: var(--cinema-token-color, var(--cinema-sub-target, #f8fafc));
  font-weight: 600;
  border-bottom: 2px solid transparent;
}

.cinema-token.punct {
  cursor: default;
  padding: 0;
  margin-left: 0 !important;
  margin-right: 0.12rem;
  border: none !important;
  color: var(--cinema-token-punct, #cbd5e1);
}

.cinema-token:hover:not(.punct) {
  background: var(--cinema-token-hover-bg, rgba(255, 255, 255, 0.16));
  transform: translateY(-1px);
}

/* Mastered & Familiar: Crisp, clean, calm text without visual clutter */
.cinema-token.status-mastered,
.cinema-token[data-status="mastered"],
.cinema-token.status-familiar,
.cinema-token[data-status="familiar"] {
  color: var(--cinema-token-mastered, var(--cinema-token-color, var(--cinema-sub-target, #f8fafc)));
  border-bottom-color: transparent;
}

/* Unset / Unverified words: Clean neutral text without green mastered glow */
.cinema-token.status-unset,
.cinema-token[data-status="unset"] {
  color: var(--cinema-sub-target, #f8fafc);
  border-bottom: 1.5px dotted rgba(255, 255, 255, 0.22);
  opacity: 0.95;
}
.cinema-token.status-unset:hover,
.cinema-token[data-status="unset"]:hover {
  opacity: 1;
  border-bottom-color: rgba(255, 255, 255, 0.6);
}

/* Shaky (不穩): Gentle warm yellow underline */
.cinema-token.status-shaky,
.cinema-token[data-status="shaky"] {
  color: var(--cinema-token-shaky, #fef08a);
  border-bottom: 2px dashed var(--cinema-token-shaky-border, rgba(250, 204, 21, 0.7));
}

/* Learning (剛學): Soft warm amber underline */
.cinema-token.status-learning,
.cinema-token[data-status="learning"] {
  color: var(--cinema-token-learning, #fed7aa);
  border-bottom: 2px dashed var(--cinema-token-learning-border, rgba(251, 146, 60, 0.85));
}

/* Unknown (不會): Soft coral underline */
.cinema-token.status-unknown,
.cinema-token[data-status="unknown"] {
  color: var(--cinema-token-unknown, #fecaca);
  border-bottom: 2px dashed var(--cinema-token-unknown-border, rgba(248, 113, 113, 0.85));
}

/* LevelUp Indicator: Sky-blue accent */
.cinema-token.is-levelup {
  border-bottom: 2.5px solid var(--cinema-token-lu-border, #38bdf8) !important;
  color: var(--cinema-token-lu, #e0f2fe);
}

/* Karaoke Spoken Word Highlight */
.cinema-token.is-speaking-word {
  background: #facc15 !important;
  color: #0f172a !important;
  font-weight: 700;
  transform: none !important;
  box-shadow: 0 0 10px rgba(250, 204, 21, 0.75);
  border-radius: 4px;
  border-bottom-color: transparent !important;
}

/* Already-spoken words (script player read state) */
.cinema-token.is-read-word:not(.is-speaking-word) {
  opacity: 0.72;
}

/* Whiteboard Animation Overlay (Phase 3) */
.cinema-whiteboard-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cinema-wb-item {
  pointer-events: auto;
  animation: wbPop 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.cinema-wb-emoji {
  font-size: clamp(3rem, 6vw, 4.5rem);
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.65));
}
.cinema-wb-callout {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--cinema-surface, rgba(15, 23, 42, 0.94));
  border: 1.5px solid var(--primary, #38bdf8);
  border-radius: 12px;
  padding: 0.6rem 1.15rem;
  color: var(--cinema-text, #f8fafc);
  font-weight: 600;
  font-size: clamp(0.88rem, 1.3vw, 1.05rem);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35);
}
@keyframes wbPop {
  0% { opacity: 0; transform: scale(0.65) translateY(12px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

/* Scene-Level Subtitles (Phase 0b) */
.cinema-scene-sentences {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}
.cinema-scene-sentence {
  background: var(--cinema-surface, rgba(15, 23, 42, 0.42));
  border: 1px solid var(--cinema-border, rgba(255, 255, 255, 0.08));
  border-radius: 10px;
  padding: 0.45rem 0.75rem;
  transition: all 0.22s ease;
  cursor: pointer;
  text-align: left;
}
.cinema-scene-sentence:hover:not(.is-active-sentence) {
  background: var(--cinema-surface-soft, rgba(30, 41, 59, 0.6));
  border-color: var(--border-focus, rgba(255, 255, 255, 0.16));
}
.cinema-scene-sentence.is-active-sentence {
  background: var(--cinema-surface, rgba(30, 41, 59, 0.88));
  border-color: #818cf8;
  box-shadow: 0 0 0 1px #818cf8, 0 6px 20px rgba(99, 102, 241, 0.25);
  transform: translateY(-1px);
}
.cinema-scene-sentence.is-past-sentence {
  opacity: 0.7;
}
.cinema-scene-sentence.is-upcoming-sentence {
  opacity: 0.55;
}
.cinema-scene-sentence-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}
.cinema-scene-sentence-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--cinema-text-muted, #94a3b8);
  background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.08));
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
}
.cinema-scene-speaker {
  font-size: 0.74rem;
  color: var(--cinema-token-lu, #38bdf8);
  font-weight: 600;
}
.cinema-scene-tokens {
  font-size: clamp(1.15rem, 1.85vw, 1.4rem);
  line-height: 1.45;
}
.cinema-scene-zh {
  font-size: clamp(0.85rem, 1.15vw, 0.95rem);
  color: var(--cinema-sub-source, var(--cinema-text-muted, rgba(226, 232, 240, 0.85)));
  margin-top: 0.25rem;
  font-weight: 400;
}

/* Separable verb indicator (Cinema Mode) */
.cinema-token.is-separable-part {
  border-bottom: 2px dashed var(--cinema-token-sep, #38bdf8) !important;
  color: var(--cinema-token-sep, #38bdf8);
  position: relative;
}
.cinema-token.is-separable-part::after {
  content: "↔";
  font-size: 0.72rem;
  color: var(--cinema-token-sep, #38bdf8);
  vertical-align: super;
  margin-left: 2px;
  font-weight: 700;
  opacity: 0.9;
}
.cinema-token.is-separable-part:hover,
.cinema-token.is-separable-hover {
  background: color-mix(in srgb, var(--cinema-token-sep, #38bdf8) 20%, transparent) !important;
  color: var(--cinema-token-sep, #38bdf8) !important;
  border-bottom-color: var(--cinema-token-sep, #38bdf8) !important;
  box-shadow: 0 0 10px color-mix(in srgb, var(--cinema-token-sep, #38bdf8) 35%, transparent);
  border-radius: 4px;
}

/* Cinema Token Annotation Indicator & Badge */
.cinema-token.has-annotation {
  border-bottom: 2.5px dashed var(--cinema-annot-underline, #f59e0b) !important;
  cursor: pointer;
  transition: all 0.2s ease;
}
.cinema-token.has-annotation:hover {
  border-bottom-style: solid !important;
  border-bottom-color: var(--cinema-annot-underline, #fbbf24) !important;
  background-color: var(--cinema-annot-hover-bg, rgba(245, 158, 11, 0.22)) !important;
  border-radius: 4px;
}
.cinema-annot-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 1px 7px;
  margin-left: 3px;
  margin-right: 2px;
  border-radius: 999px;
  background: var(--cinema-annot-badge-bg, rgba(245, 158, 11, 0.16));
  color: var(--cinema-annot-badge-color, #fbbf24);
  border: 1px solid var(--cinema-annot-badge-border, rgba(245, 158, 11, 0.4));
  cursor: pointer;
  vertical-align: middle;
  line-height: 1.3;
  user-select: none;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
.cinema-annot-badge-btn:hover {
  background: var(--cinema-annot-badge-color, #f59e0b);
  color: var(--bg-elev, #0f172a);
  border-color: var(--cinema-annot-badge-border, #d97706);
  transform: translateY(-1px) scale(1.06);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}
.cinema-annot-badge-btn:active {
  transform: translateY(0) scale(0.97);
}

/* Cinema Slide-in Annotation Drawer */
.cinema-annotation-drawer {
  position: absolute;
  inset: 0;
  z-index: 75;
  display: flex;
  justify-content: flex-end;
  pointer-events: auto;
}
.cinema-annot-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 15, 29, 0.68);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 0.28s ease;
  cursor: pointer;
}
.cinema-annotation-drawer.is-open .cinema-annot-backdrop {
  opacity: 1;
}
.cinema-annot-panel {
  position: relative;
  z-index: 2;
  width: min(580px, 94vw);
  height: 100%;
  background: #0f172a;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.cinema-annotation-drawer.is-open .cinema-annot-panel {
  transform: translateX(0);
}
.cinema-annot-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem 0.9rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(30, 41, 59, 0.4);
}
.cinema-annot-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}
.cinema-annot-badge {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}
.cinema-annot-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #f8fafc;
  line-height: 1.35;
  word-break: break-word;
}
.cinema-annot-close-btn {
  font-size: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #94a3b8;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: all 0.2s ease;
}
.cinema-annot-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transform: scale(1.05);
}
.cinema-annot-body {
  padding: 1.25rem;
  overflow-y: auto;
  flex: 1;
  color: #cbd5e1;
  font-size: 0.92rem;
  line-height: 1.65;
}
.cinema-annot-body p {
  margin: 0 0 0.85rem;
}
.cinema-annot-body strong {
  color: #f8fafc;
  font-weight: 700;
}
.cinema-annot-body em {
  color: #38bdf8;
  font-style: normal;
}
.cinema-annot-body code {
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
  color: #fbbf24;
  font-size: 0.85em;
}

/* Rich Markdown Typography in Annotations */
.cinema-annot-body h3, .annot-h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #f8fafc;
  margin: 1.25rem 0 0.65rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.cinema-annot-body h4, .annot-h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #f1f5f9;
  margin: 1.1rem 0 0.55rem;
}
.cinema-annot-body h5, .annot-h5 {
  font-size: 0.96rem;
  font-weight: 700;
  color: #38bdf8;
  margin: 1rem 0 0.45rem;
}
.cinema-annot-body h6, .annot-h6 {
  font-size: 0.88rem;
  font-weight: 700;
  color: #94a3b8;
  margin: 0.85rem 0 0.4rem;
}
.annot-hr {
  border: none;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  margin: 1.25rem 0;
}
.annot-quote {
  border-left: 3px solid #38bdf8;
  background: rgba(56, 189, 248, 0.08);
  padding: 0.75rem 1rem;
  border-radius: 0 8px 8px 0;
  margin: 0.85rem 0;
  color: #e2e8f0;
}
.annot-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 1rem 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(15, 23, 42, 0.5);
}
.annot-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.annot-table th {
  background: rgba(30, 41, 59, 0.8);
  color: #f8fafc;
  font-weight: 700;
  text-align: left;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.annot-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  color: #cbd5e1;
}
.annot-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}
.annot-figure {
  margin: 1rem 0;
  text-align: center;
}
.annot-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.annot-figcaption {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.35rem;
}
.annot-link {
  color: #38bdf8;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.annot-link:hover {
  color: #7dd3fc;
}

/* Visual Concept Cards Grid (Directional Prefixes & Morphological Families) */
.annot-concept-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1rem;
  margin: 1.25rem 0;
}
.annot-concept-card {
  background: #ffffff;
  color: #0f172a;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
  padding: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.annot-concept-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}
.annot-concept-card.is-fullwidth {
  grid-column: 1 / -1;
}
.annot-concept-diagram {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.85rem;
}
.annot-concept-diagram svg {
  width: 100%;
  height: 100%;
  max-height: 140px;
  display: block;
}
.annot-concept-card.is-fullwidth .annot-concept-diagram {
  height: 150px;
}
.annot-concept-card.is-fullwidth .annot-concept-diagram svg {
  max-height: 150px;
}
.annot-concept-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.annot-concept-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
}
.annot-concept-audio-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 6px;
  padding: 2px 8px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.annot-concept-audio-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
}
.annot-concept-target {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1e293b;
  margin-bottom: 0.2rem;
  line-height: 1.45;
}
.annot-concept-zh {
  font-size: 0.86rem;
  color: #64748b;
  line-height: 1.45;
}

/* In-Depth Annotation Ladder Cards (A1-B2 CEFR Progression) */
.cinema-annot-ladder-wrap {
  margin-top: 1.25rem;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}
.cinema-annot-ladder-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-bright, #f8fafc);
}
.cinema-annot-ladder-cards {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.cinema-annot-ladder-card {
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: border-color 0.2s, background 0.2s;
}
.cinema-annot-ladder-card:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(99, 102, 241, 0.4);
}
.cinema-annot-level-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  margin-bottom: 0.35rem;
}
.cinema-annot-level-badge.a1 { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.4); }
.cinema-annot-level-badge.a2 { background: rgba(20, 184, 166, 0.2); color: #2dd4bf; border: 1px solid rgba(20, 184, 166, 0.4); }
.cinema-annot-level-badge.b1 { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.4); }
.cinema-annot-level-badge.b2 { background: rgba(168, 85, 247, 0.2); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.4); }

.cinema-annot-ladder-de {
  font-size: 1.02rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.5;
  margin-top: 0.2rem;
}
.cinema-annot-ladder-zh {
  font-size: 0.88rem;
  color: #94a3b8;
  margin-top: 0.25rem;
  line-height: 1.45;
}
.cinema-annot-ladder-nuance {
  font-size: 0.82rem;
  color: #cbd5e1;
  margin-top: 0.45rem;
  padding-top: 0.35rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.1);
  line-height: 1.45;
}
.cinema-annot-media-wrap {
  margin: 0.85rem 0 1.15rem;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: #000;
}
.cinema-annot-media-img {
  width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  display: block;
}
.cinema-annot-media-caption {
  padding: 0.45rem 0.75rem;
  font-size: 0.78rem;
  color: #94a3b8;
  background: rgba(15, 23, 42, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.cinema-annot-body ul {
  margin: 0.5rem 0 1rem 1.2rem;
  padding: 0;
}
/* ========================================================
   Cinema Stream UI Mode (Top-Right Vocab List + Top-Left Annot + Serif Subtitles)
   ======================================================== */

/* Top-Left / Center Annotation Glassmorphism Box */
.cinema-stream-annot-box {
  position: absolute;
  top: 1.25rem;
  left: 1.5rem;
  max-width: clamp(280px, 32vw, 420px);
  z-index: 25;
  pointer-events: auto;
  background: var(--cinema-surface, rgba(30, 48, 58, 0.78));
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--cinema-border, rgba(255, 255, 255, 0.16));
  border-radius: 12px;
  padding: 0.65rem 1rem;
  color: var(--cinema-text, #ffffff);
  box-shadow: var(--cinema-panel-shadow, 0 8px 32px rgba(0, 0, 0, 0.45));
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  animation: fadeIn 0.25s ease-out;
}
.cinema-stream-annot-box:hover {
  background: var(--cinema-surface-soft, rgba(38, 62, 75, 0.88));
  border-color: var(--cinema-border, rgba(255, 255, 255, 0.28));
  transform: translateY(-1px);
  box-shadow: var(--cinema-panel-shadow, 0 12px 36px rgba(0, 0, 0, 0.55));
}
.cinema-stream-annot-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--cinema-text, rgba(255, 255, 255, 0.75));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--cinema-text, #ffffff);
  flex-shrink: 0;
  margin-top: 2px;
  background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.08));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.cinema-stream-annot-content {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.cinema-stream-annot-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cinema-text, #ffffff);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.cinema-stream-annot-sub {
  font-size: 0.84rem;
  color: var(--cinema-text-muted, #cbd5e1);
  line-height: 1.35;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Top-Right Scrolling Vocab Stream Table */
.cinema-stream-vocab-panel {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: clamp(280px, 28vw, 360px);
  max-height: calc(100% - var(--cinema-sub-height, 240px) - 2rem);
  z-index: 25;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  background: var(--cinema-panel-bg, rgba(15, 23, 42, 0.72));
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--cinema-panel-border, rgba(255, 255, 255, 0.15));
  border-radius: 16px;
  padding: 0.75rem 0.85rem;
  box-shadow: var(--cinema-panel-shadow, 0 16px 40px rgba(0, 0, 0, 0.55));
  transition: all 0.3s ease;
  box-sizing: border-box;
  animation: fadeIn 0.25s ease-out;
  color: var(--cinema-text, #f8fafc);
}
.cinema-stream-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.45rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--cinema-border, rgba(255, 255, 255, 0.1));
  flex-shrink: 0;
}
.cinema-stream-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--cinema-text-muted, #94a3b8);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.cinema-stream-counter {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--cinema-active-word, #f6ad7b);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  letter-spacing: 0.04em;
}
.cinema-stream-full-btn {
  font-size: 0.72rem;
  padding: 0.15rem 0.45rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--cinema-text-muted, #cbd5e1);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.cinema-stream-full-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}
.cinema-stream-list {
  flex: 1 1 auto;
  position: relative;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.25rem 0.25rem 0.25rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.cinema-stream-list::-webkit-scrollbar {
  width: 4px;
}
.cinema-stream-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}

.cinema-stream-row {
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  border-left: 3px solid transparent;
  user-select: none;
}
.cinema-stream-row:hover:not(.is-active-word) {
  background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.08));
}
.cinema-stream-row.is-active-word {
  background: var(--cinema-active-word-bg, rgba(184, 115, 68, 0.38)) !important;
  border-left: 3.5px solid var(--cinema-active-word-border, #f6ad7b) !important;
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  box-shadow: 0 4px 20px var(--cinema-active-word-bg, rgba(246, 173, 123, 0.25));
}

.cinema-stream-word-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.cinema-stream-word {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--cinema-word-color, #8ecbc1);
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}
.cinema-stream-row.is-active-word .cinema-stream-word {
  font-size: 1.16rem;
  font-weight: 800;
  color: var(--cinema-active-word, #f6ad7b);
  text-shadow: 0 0 12px var(--cinema-active-word-bg, rgba(246, 173, 123, 0.45));
}
.cinema-stream-pos {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--cinema-text-subtle, #cbd5e1);
  margin-left: 0.35rem;
  font-style: italic;
}
.cinema-stream-meta {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.cinema-stream-count {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--cinema-text-muted, #64748b);
  font-family: ui-monospace, monospace;
}
.cinema-stream-row.is-active-word .cinema-stream-count {
  color: var(--cinema-active-word, #f6ad7b);
  font-weight: 700;
}
.cinema-stream-dots {
  font-size: 0.65rem;
  color: var(--cinema-dots-color, #ca8a04);
  letter-spacing: -0.05em;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.12s ease;
}
.cinema-stream-dots:hover {
  background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.14));
  color: var(--cinema-active-word, #facc15);
  transform: scale(1.15);
}
.cinema-stream-dots:active {
  transform: scale(0.95);
}
.cinema-stream-row.is-active-word .cinema-stream-dots {
  color: var(--cinema-active-word, #f6ad7b);
}

.cinema-stream-edit-btn {
  background: transparent;
  border: none;
  color: var(--cinema-text-muted, #64748b);
  font-size: 0.72rem;
  padding: 0.1rem 0.25rem;
  border-radius: 4px;
  cursor: pointer;
  opacity: 0.75;
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.cinema-stream-edit-btn:hover {
  opacity: 1;
  color: var(--cinema-text, #f8fafc);
  background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.15));
  transform: scale(1.2);
}
.cinema-stream-row.is-active-word .cinema-stream-edit-btn {
  opacity: 0.9;
  color: var(--cinema-active-word, #f6ad7b);
}

.cinema-stream-meaning-line {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  flex-wrap: wrap;
}
.cinema-stream-meaning {
  font-size: 0.84rem;
  color: var(--cinema-text-muted, #94a3b8);
  line-height: 1.35;
}
.cinema-stream-row.is-active-word .cinema-stream-meaning {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--cinema-text, #ffffff);
}
.cinema-stream-ipa {
  font-size: 0.8rem;
  color: var(--cinema-text-subtle, #cbd5e1);
  font-family: ui-sans-serif, sans-serif;
  opacity: 0.9;
}

/* Stream Layout Subtitle Typography: Serif font + Amber highlighting like Screenshot */
.cinema-viewport.is-stream-layout .cinema-subtitles-container {
  background: var(--cinema-sub-bg, linear-gradient(180deg, rgba(9, 13, 22, 0) 0%, rgba(9, 13, 22, 0.82) 25%, rgba(9, 13, 22, 0.96) 100%));
  padding: 1.25rem 2rem 1.25rem;
  z-index: 20;
}
.cinema-viewport.is-stream-layout .cinema-sub-target {
  font-family: "Merriweather", Georgia, "Libre Baskerville", "Times New Roman", serif !important;
  font-size: calc(clamp(1.4rem, 2.3vw, 1.95rem) * var(--cinema-sub-scale, 1)) !important;
  font-weight: 700 !important;
  line-height: 1.42 !important;
  color: var(--cinema-sub-target, #ffffff) !important;
  text-shadow: var(--cinema-sub-shadow, 0 2px 12px rgba(0, 0, 0, 0.92)) !important;
  letter-spacing: -0.01em;
}
.cinema-viewport.is-stream-layout .cinema-sub-source {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", sans-serif;
  font-size: calc(clamp(1.05rem, 1.45vw, 1.25rem) * var(--cinema-sub-scale, 1)) !important;
  color: var(--cinema-sub-source, #f8fafc);
  margin-top: 0.45rem;
  text-shadow: var(--cinema-sub-shadow, 0 2px 8px rgba(0, 0, 0, 0.9));
  letter-spacing: 0.02em;
}
.cinema-viewport.is-stream-layout .cinema-token.is-speaking-word,
.cinema-viewport.is-stream-layout .cinema-token.is-stream-active {
  color: var(--cinema-active-word, #f6ad7b) !important;
  font-weight: 800 !important;
  text-shadow: 0 0 10px rgba(246, 173, 123, 0.45) !important;
  background: rgba(246, 173, 123, 0.16) !important;
  box-shadow: 0 0 8px rgba(246, 173, 123, 0.25) !important;
  border-radius: 4px;
  transform: none !important;
}

.cinema-stream-word-group {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  min-width: 0;
  overflow: hidden;
  flex-wrap: wrap;
}
.cinema-stream-cat-badge {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
  line-height: 1.15;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.cinema-stream-cat-badge:hover {
  filter: brightness(1.25);
  transform: scale(1.08);
}
.cinema-stream-cat-badge:active {
  transform: scale(0.96);
}
.cinema-stream-cat-badge.status-mastered {
  background: var(--tag-mastered-bg, rgba(34, 197, 94, 0.2));
  color: var(--tag-mastered-fg, #4ade80);
  border: 1px solid color-mix(in srgb, var(--tag-mastered, #22c55e) 40%, transparent);
}
.cinema-stream-cat-badge.status-familiar {
  background: var(--tag-familiar-bg, rgba(132, 204, 22, 0.2));
  color: var(--tag-familiar-fg, #a3e635);
  border: 1px solid color-mix(in srgb, var(--tag-familiar, #84cc16) 40%, transparent);
}
.cinema-stream-cat-badge.status-shaky {
  background: var(--tag-shaky-bg, rgba(234, 179, 8, 0.2));
  color: var(--tag-shaky-fg, #facc15);
  border: 1px solid color-mix(in srgb, var(--tag-shaky, #eab308) 40%, transparent);
}
.cinema-stream-cat-badge.status-learning {
  background: var(--tag-learning-bg, rgba(249, 115, 22, 0.2));
  color: var(--tag-learning-fg, #fb923c);
  border: 1px solid color-mix(in srgb, var(--tag-learning, #f97316) 40%, transparent);
}
.cinema-stream-cat-badge.status-unknown {
  background: var(--tag-unknown-bg, rgba(239, 68, 68, 0.2));
  color: var(--tag-unknown-fg, #f87171);
  border: 1px solid color-mix(in srgb, var(--tag-unknown, #ef4444) 40%, transparent);
}
.cinema-stream-cat-badge.status-unset {
  background: var(--bg-soft, rgba(148, 163, 184, 0.15));
  color: var(--text-muted, #cbd5e1);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.3));
}

.cinema-stream-cefr-badge {
  font-size: 0.64rem;
  font-weight: 800;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  background: var(--cinema-badge-cefr-bg, rgba(56, 189, 248, 0.18));
  color: var(--cinema-badge-cefr-color, #38bdf8);
  border: 1px solid var(--cinema-badge-cefr-border, rgba(56, 189, 248, 0.35));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.cinema-stream-review-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.05rem 0.28rem;
  border-radius: 3px;
  background: var(--cinema-badge-review-bg, rgba(168, 85, 247, 0.18));
  color: var(--cinema-badge-review-color, #c084fc);
  border: 1px solid var(--cinema-badge-review-border, rgba(168, 85, 247, 0.35));
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  white-space: nowrap;
}

.cinema-stream-seen-count {
  font-size: 0.8rem;
  font-weight: 700;
  color: #94a3b8;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}
.cinema-stream-row.is-active-word .cinema-stream-seen-count {
  color: #f6ad7b;
}

.cinema-stream-sent-divider {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 0.35rem 0.2rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  letter-spacing: 0.05em;
  user-select: none;
  cursor: pointer;
  transition: color 0.15s ease;
}
.cinema-stream-sent-divider:hover {
  color: #94a3b8;
}
.cinema-stream-sent-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.cinema-stream-colloc {
  font-size: 0.78rem;
  color: #94a3b8;
  font-style: italic;
  margin-left: 0.35rem;
}
.cinema-viewport.is-stream-layout .cinema-visual-stage {
  padding: 0;
  max-height: 100%;
}
.cinema-viewport.is-stream-layout .cinema-visual-frame {
  max-width: 100%;
  width: 100%;
  height: 100%;
}
.cinema-viewport.is-stream-layout .cinema-visual-img {
  width: 100%;
  height: 100%;
  max-height: 100% !important;
  object-fit: cover;
  opacity: 0.55;
  filter: brightness(0.72) contrast(1.08);
  border-radius: 16px;
  border: none;
}
.cinema-viewport.is-stream-layout .cinema-visual-caption {
  position: absolute;
  bottom: 120px;
  left: 2rem;
  z-index: 10;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .cinema-stream-annot-box {
    top: 0.75rem;
    left: 0.75rem;
    max-width: 240px;
    padding: 0.45rem 0.7rem;
  }
  .cinema-stream-annot-title { font-size: 0.9rem; }
  .cinema-stream-annot-sub { font-size: 0.75rem; }
  .cinema-stream-vocab-panel {
    top: 0.75rem;
    right: 0.75rem;
    width: 260px;
    max-height: calc(100% - var(--cinema-sub-height, 240px) - 1.5rem);
    padding: 0.5rem 0.65rem;
  }
  .cinema-stream-word { font-size: 0.95rem; }
  .cinema-stream-meaning { font-size: 0.78rem; }
}

/* Bottom Player Controls Bar */
.cinema-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.75rem 1.25rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.cinema-ctrl-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cinema-controls-bar button,
.btn-cinema-ctrl,
.btn-cinema-play,
.cinema-speed-pill,
.cinema-switch-label {
  white-space: nowrap !important;
  flex-shrink: 0;
  min-width: max-content;
}

.btn-cinema-ctrl {
  padding: 0.45rem 0.75rem;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.18s ease;
}

.btn-cinema-ctrl.is-sticky {
  background: var(--brand-subtle, rgba(2, 132, 199, 0.18)) !important;
  border-color: var(--brand, #0284c7) !important;
  color: var(--brand, #0284c7) !important;
  box-shadow: 0 0 10px rgba(2, 132, 199, 0.35);
  font-weight: 700;
  position: relative;
}

.btn-cinema-ctrl.is-sticky::after {
  content: "•";
  color: #ef4444;
  position: absolute;
  top: 1px;
  right: 5px;
  font-size: 1.1rem;
  line-height: 1;
  animation: stickyBlink 1.2s ease-in-out infinite alternate;
}

.btn-voice-source-toggle {
  font-weight: 600;
  border: 1px solid var(--border);
  transition: all 0.2s ease;
}

.btn-voice-source-toggle.is-original {
  background: var(--brand-subtle, rgba(2, 132, 199, 0.15)) !important;
  color: var(--brand, #0284c7) !important;
  border-color: var(--brand, #0284c7) !important;
  font-weight: 700;
}

.btn-cinema-ctrl.is-original {
  background: var(--brand-subtle, rgba(2, 132, 199, 0.18)) !important;
  border-color: var(--brand, #0284c7) !important;
  color: var(--brand, #0284c7) !important;
  font-weight: 700;
}

.krashen-pill-orig-audio {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.15rem 0.5rem;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 9999px;
  font-size: 0.72rem;
  font-weight: 600;
}

@keyframes stickyBlink {
  from { opacity: 0.3; }
  to { opacity: 1; }
}

.btn-cinema-play {
  font-weight: 700;
  padding: 0.45rem 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border-radius: 999px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  border: none;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
  color: #ffffff;
}
.btn-cinema-play:hover {
  background: linear-gradient(135deg, #6d28d9, #4338ca);
  transform: translateY(-1px);
}

.btn-cinema-finish {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 700 !important;
  padding: 0.45rem 1.15rem !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  animation: pulseFinishBtn 2.2s infinite ease-in-out;
}
.btn-cinema-finish:hover {
  background: linear-gradient(135deg, #059669, #047857) !important;
  transform: translateY(-1px) scale(1.04);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.5) !important;
}

@keyframes pulseFinishBtn {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}

/* Cinema Lesson Completion Modal */
.cinema-completion-modal-overlay {
  position: absolute;
  inset: 0;
  z-index: 65;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cinema-completion-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.cinema-completion-modal-card {
  position: relative;
  z-index: 2;
  width: 520px;
  max-width: 92vw;
  background: var(--bg-elev, #0f172a);
  border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
  border-radius: 16px;
  padding: 1.75rem;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
  color: var(--text, #f8fafc);
  animation: zoomInModal 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes zoomInModal {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
.cinema-cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.cinema-cm-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.cinema-cm-icon {
  font-size: 1.8rem;
}
.cinema-cm-title {
  margin: 0;
  font-size: 1.3rem;
  font-weight: 700;
  color: #f8fafc;
}
.cinema-cm-close-btn {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.cinema-cm-desc {
  font-size: 0.95rem;
  color: #94a3b8;
  margin: 0 0 1.25rem;
  line-height: 1.5;
}
.cinema-cm-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.25rem;
}
.cinema-cm-stat-item {
  background: var(--bg-soft, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 0.4rem;
  text-align: center;
}
.cinema-cm-stat-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: #f8fafc;
  line-height: 1.2;
}
.cinema-cm-stat-val.text-success { color: #34d399; }
.cinema-cm-stat-val.text-warning { color: #38bdf8; }
.cinema-cm-stat-val.text-info { color: #fbbf24; }
.cinema-cm-stat-label {
  font-size: 0.72rem;
  color: #94a3b8;
  margin-top: 0.25rem;
}
.cinema-cm-tagged-wrap {
  background: var(--bg-soft, #1e293b);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.75rem 0.9rem;
  margin-bottom: 1.25rem;
  max-height: 120px;
  overflow-y: auto;
}
.cinema-cm-tagged-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #94a3b8;
  margin-bottom: 0.45rem;
}
.cinema-cm-tagged-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.cinema-cm-pill {
  font-size: 0.78rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fbbf24;
  white-space: nowrap;
}
.cinema-cm-status-bar {
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 8px;
  padding: 0.6rem 0.85rem;
  margin-bottom: 1.5rem;
  font-size: 0.88rem;
  color: #34d399;
  text-align: center;
}
.cinema-cm-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.cinema-speed-pill {
  border-radius: 999px !important;
  background: rgba(245, 158, 11, 0.14) !important;
  border: 1px solid rgba(245, 158, 11, 0.42) !important;
  color: #fbbf24 !important;
  font-weight: 700 !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  padding: 0.35rem 0.8rem !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.cinema-speed-pill:hover {
  background: rgba(245, 158, 11, 0.26) !important;
  border-color: rgba(245, 158, 11, 0.7) !important;
  color: #fef3c7 !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.cinema-ctrl-center {
  display: flex;
  align-items: center;
}

.cinema-hotkey-tips {
  font-size: 0.75rem;
  color: var(--text-muted);
  display: none;
}
@media (min-width: 900px) {
  .cinema-hotkey-tips { display: inline-block; }
}

.cinema-ctrl-right {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cinema-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

/* Playlist / Sentence Directory Drawer */
.cinema-playlist-drawer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 360px;
  max-width: 85vw;
  background: var(--bg-elev);
  border-left: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  z-index: 35;
  box-shadow: -8px 0 28px rgba(0, 0, 0, 0.16);
  display: flex;
  flex-direction: column;
  animation: slideLeft 0.18s ease-out;
}

@keyframes slideLeft {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

.cinema-playlist-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.15rem;
  border-bottom: 1px solid var(--border);
}

.cinema-playlist-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cinema-playlist-item {
  padding: 0.6rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.82rem;
  transition: all 0.15s ease;
  border: 1px solid transparent;
}

.cinema-playlist-item:hover {
  background: var(--bg-elev);
  border-color: var(--border);
}

.cinema-playlist-item.is-active {
  background: rgba(139, 92, 246, 0.12);
  border-color: #8b5cf6;
}

.cinema-playlist-item-target {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cinema-playlist-item-zh {
  color: var(--text-muted);
  font-size: 0.76rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .cinema-header {
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 0.45rem !important;
    gap: 0.35rem !important;
    overflow-x: auto !important;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cinema-header::-webkit-scrollbar {
    display: none;
  }
  .cinema-header-left {
    gap: 0.35rem;
  }
  .cinema-mode-pill {
    font-size: 0.72rem;
    padding: 0.15rem 0.35rem;
  }
  .cinema-page-badge {
    font-size: 0.74rem;
  }
  .cinema-tool-btn {
    font-size: 0.74rem;
    padding: 0.18rem 0.38rem;
  }
  .cinema-viewport {
    min-height: 0 !important;
    height: auto !important;
    border-radius: 14px;
    flex: 1 1 auto;
  }
  .cinema-visual-stage {
    min-height: 48px;
    max-height: calc(100% - 95px);
    padding: 0.25rem 0.5rem 0.1rem;
  }
  .cinema-vocab-card,
  .cinema-card-item {
    padding: 0.4rem 0.65rem;
    gap: 0.3rem;
    border-radius: 10px;
    max-width: 100%;
  }
  .cinema-cards-track {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 0.5rem !important;
    padding: 5px 2px 6px !important;
  }
  .cinema-cards-track::-webkit-scrollbar {
    display: none !important;
  }
  .cinema-card-item {
    flex: 0 0 92% !important;
    min-width: 92% !important;
    max-width: 92% !important;
    scroll-snap-align: center !important;
    box-sizing: border-box !important;
  }
  .cinema-deck-dots {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 5px !important;
    margin-top: 2px !important;
  }
  .cinema-deck-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    transition: all 0.2s ease;
    cursor: pointer;
  }
  .cinema-deck-dot.is-active {
    width: 16px;
    border-radius: 999px;
    background: #818cf8;
  }
  .cinema-vocab-word {
    font-size: 1.08rem;
  }
  .cinema-vocab-zh {
    font-size: 0.88rem;
  }
  .cinema-vocab-meaning-box {
    padding: 0.35rem 0.6rem;
    gap: 0.15rem;
  }
  .cinema-subtitles-container {
    padding: 0.35rem 0.65rem 0.45rem;
    gap: 0.15rem;
  }
  .cinema-sub-target {
    font-size: calc(clamp(1.05rem, 3.8vw, 1.25rem) * var(--cinema-sub-scale, 1));
    line-height: 1.32;
  }
  .cinema-sub-source {
    font-size: calc(clamp(0.8rem, 2.8vw, 0.92rem) * var(--cinema-sub-scale, 1));
    line-height: 1.25;
    margin-top: 0.1rem;
  }

  /* Mobile Stream Layout: Vocab list occupies the whole main content */
  .cinema-viewport.is-stream-layout .cinema-visual-stage {
    display: none !important;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-vocab-panel {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100% !important;
    border-radius: 14px !important;
    border: none !important;
    background: var(--cinema-bg, #090d16) !important;
    padding: 0.65rem 0.75rem calc(82px + 0.5rem) 0.75rem !important;
    box-shadow: none !important;
    z-index: 10 !important;
  }
  .cinema-viewport.is-stream-layout.has-stream-annot .cinema-stream-vocab-panel {
    padding-top: 60px !important;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-list {
    flex: 1 1 auto;
    width: 100%;
    overflow-y: auto;
    gap: 0.35rem;
    scrollbar-width: thin;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-row {
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.03));
  }
  .cinema-viewport.is-stream-layout .cinema-stream-row.is-active-word {
    background: var(--cinema-active-word-bg, rgba(184, 115, 68, 0.35)) !important;
    border-left: 4px solid var(--cinema-active-word-border, #f6ad7b) !important;
    padding: 0.6rem 0.85rem;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-word {
    font-size: 1.14rem;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-row.is-active-word .cinema-stream-word {
    font-size: 1.25rem;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-meaning {
    font-size: 0.88rem;
    color: var(--cinema-text-muted, #cbd5e1);
    line-height: 1.4;
  }
  .cinema-viewport.is-stream-layout .cinema-subtitles-container {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 20 !important;
    padding: 0.45rem 0.75rem 0.55rem !important;
    background: var(--cinema-sub-bg, linear-gradient(180deg, rgba(9, 13, 22, 0) 0%, rgba(9, 13, 22, 0.92) 22%, rgba(9, 13, 22, 0.98) 100%)) !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-bottom-left-radius: 14px;
    border-bottom-right-radius: 14px;
  }
  .cinema-viewport.is-stream-layout .cinema-sub-target {
    font-size: calc(1.15rem * var(--cinema-sub-scale, 1)) !important;
    line-height: 1.35 !important;
  }
  .cinema-viewport.is-stream-layout .cinema-sub-source {
    font-size: calc(0.85rem * var(--cinema-sub-scale, 1)) !important;
    line-height: 1.25 !important;
  }
  .cinema-viewport.is-stream-layout .cinema-stream-annot-box {
    top: 0.45rem !important;
    left: 0.5rem !important;
    right: 0.5rem !important;
    max-width: calc(100% - 1rem) !important;
    width: auto !important;
    z-index: 25 !important;
    padding: 0.45rem 0.7rem !important;
    border-radius: 10px !important;
    background: var(--cinema-surface, rgba(30, 48, 58, 0.92)) !important;
  }

  /* Responsive Non-Distorting Mobile Cinema Controls Bar */
  .cinema-controls-bar {
    padding: 0.3rem 0.45rem;
    height: 48px;
    min-height: 48px;
    border-radius: 12px;
    gap: 0.35rem;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .cinema-controls-bar::-webkit-scrollbar {
    display: none;
  }
  .cinema-ctrl-left,
  .cinema-ctrl-right {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-shrink: 0;
  }
  .cinema-btn-label {
    display: none !important;
  }
  .cinema-controls-bar button,
  .btn-cinema-ctrl,
  .btn-cinema-play,
  .cinema-speed-pill,
  .cinema-switch-label {
    white-space: nowrap !important;
    flex-shrink: 0;
    min-width: max-content;
  }
  .btn-cinema-ctrl {
    padding: 0.32rem 0.45rem !important;
    font-size: 0.82rem !important;
    min-width: 32px;
    text-align: center;
  }
  .btn-cinema-play {
    padding: 0.32rem 0.75rem !important;
    font-size: 0.82rem !important;
  }
  .cinema-speed-pill {
    padding: 0.28rem 0.55rem !important;
    font-size: 0.78rem !important;
  }
  .cinema-switch-label {
    font-size: 0.74rem;
    gap: 0.2rem;
  }
}

/* Cinema Word Inspector & Level Tagger Drawer (Collapsible Right-Side Slide-Over) */
.cinema-word-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  padding: 0;
  pointer-events: none;
  overflow: hidden;
}

.cinema-word-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.cinema-word-modal-card {
  --cinema-wm-bg: var(--bg-elev, #0f172a);
  --cinema-wm-surface: var(--bg-soft, #1e293b);
  --cinema-wm-border: var(--border, rgba(255, 255, 255, 0.1));
  --cinema-wm-text: var(--text, #f8fafc);
  --cinema-wm-muted: var(--text-muted, #94a3b8);

  position: relative;
  z-index: 2;
  width: 420px;
  max-width: 88vw;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: var(--cinema-wm-bg);
  border-left: 1px solid var(--cinema-wm-border);
  box-shadow: -10px 0 35px var(--cinema-panel-shadow, rgba(0, 0, 0, 0.6));
  display: flex;
  flex-direction: column;
  animation: cinemaDrawerSlide 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  color: var(--cinema-wm-text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang TC", "Noto Sans TC", sans-serif;
}

@keyframes cinemaDrawerSlide {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@media (max-width: 640px) {
  .cinema-word-modal-card {
    width: 100%;
    max-width: 100vw;
  }
}

.cinema-wm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--cinema-wm-border);
  background: var(--cinema-wm-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cinema-wm-title-wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cinema-wm-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--cinema-wm-text) !important;
  line-height: 1.2;
}

.cinema-wm-audio-btn {
  padding: 0.2rem 0.55rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: 999px;
  background: var(--cinema-wm-surface) !important;
  color: var(--cinema-wm-text) !important;
  border: 1px solid var(--cinema-wm-border) !important;
  transition: all 0.15s ease;
}
.cinema-wm-audio-btn:hover {
  background: var(--cinema-surface-soft, rgba(255, 255, 255, 0.2)) !important;
  color: var(--cinema-wm-text) !important;
}

.cinema-wm-type-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: var(--cinema-wm-surface);
  color: var(--cinema-wm-muted);
  border: 1px solid var(--cinema-wm-border);
}

.cinema-wm-type-badge.is-separable {
  background: var(--cinema-badge-cefr-bg, rgba(56, 189, 248, 0.18)) !important;
  color: var(--cinema-badge-cefr-color, #38bdf8) !important;
  border-color: var(--cinema-badge-cefr-border, rgba(56, 189, 248, 0.4)) !important;
  font-weight: 700;
}

.cinema-wm-close-btn {
  color: var(--cinema-wm-muted) !important;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.cinema-wm-close-btn:hover {
  color: var(--cinema-wm-text) !important;
  background: var(--cinema-wm-surface) !important;
}

.cinema-wm-body {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.cinema-wm-meanings {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--cinema-wm-surface);
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--cinema-wm-border);
}

.cinema-wm-meaning-row {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  font-size: 0.92rem;
  line-height: 1.45;
}

.cinema-wm-label {
  font-weight: 600;
  font-size: 0.78rem;
  color: var(--cinema-wm-muted);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.cinema-wm-meaning-val {
  color: var(--cinema-wm-text);
  font-weight: 600;
  flex: 1;
}

.cinema-wm-sentence-box {
  background: var(--cinema-wm-surface);
  border: 1px solid var(--cinema-wm-border);
  border-left: 3px solid #818cf8;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.55;
}

.cinema-wm-sent-target {
  font-weight: 600;
  color: var(--cinema-wm-text);
  margin-bottom: 0.35rem;
}

.cinema-wm-sent-target mark {
  background: var(--tag-shaky-bg, rgba(234, 179, 8, 0.28));
  color: var(--tag-shaky-fg, #fde047);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-weight: 700;
}

.cinema-wm-sent-zh {
  color: var(--cinema-wm-muted);
  font-size: 0.84rem;
}

.cinema-wm-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--cinema-wm-muted);
  letter-spacing: 0.03em;
  margin-bottom: 0.4rem;
}

.cinema-wm-tag-buttons {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
}

@media (max-width: 480px) {
  .cinema-wm-tag-buttons {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cinema-wm-tag-btn {
  border: 1px solid var(--cinema-wm-border);
  background: var(--cinema-wm-surface);
  color: var(--cinema-wm-muted);
  padding: 0.45rem 0.2rem;
  border-radius: 8px;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  text-align: center;
  white-space: nowrap;
}

.cinema-wm-tag-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-focus, var(--cinema-wm-border));
  color: var(--cinema-wm-text);
}

.cinema-wm-tag-btn.tag-mastered.is-selected {
  background: var(--tag-mastered-bg, rgba(22, 163, 74, 0.25));
  color: var(--tag-mastered-fg, #4ade80);
  border-color: var(--tag-mastered, #22c55e);
  font-weight: 700;
}

.cinema-wm-tag-btn.tag-familiar.is-selected {
  background: var(--tag-familiar-bg, rgba(101, 163, 13, 0.25));
  color: var(--tag-familiar-fg, #a3e635);
  border-color: var(--tag-familiar, #84cc16);
  font-weight: 700;
}

.cinema-wm-tag-btn.tag-shaky.is-selected {
  background: var(--tag-shaky-bg, rgba(202, 138, 4, 0.25));
  color: var(--tag-shaky-fg, #facc15);
  border-color: var(--tag-shaky, #eab308);
  font-weight: 700;
}

.cinema-wm-tag-btn.tag-learning.is-selected {
  background: var(--tag-learning-bg, rgba(234, 88, 12, 0.25));
  color: var(--tag-learning-fg, #fb923c);
  border-color: var(--tag-learning, #f97316);
  font-weight: 700;
}

.cinema-wm-tag-btn.tag-unknown.is-selected {
  background: var(--tag-unknown-bg, rgba(220, 38, 38, 0.25));
  color: var(--tag-unknown-fg, #f87171);
  border-color: var(--tag-unknown, #ef4444);
  font-weight: 700;
}

.cinema-wm-actions {
  display: flex;
  gap: 0.6rem;
}

.cinema-wm-actions .btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  background: var(--cinema-wm-surface) !important;
  color: var(--cinema-wm-text) !important;
  border: 1px solid var(--cinema-wm-border) !important;
  border-radius: 10px;
  padding: 0.5rem 0.75rem;
  font-weight: 600;
  font-size: 0.85rem;
  transition: all 0.15s ease;
}

.cinema-wm-actions .btn:hover {
  background: var(--bg-soft, rgba(51, 65, 85, 0.85)) !important;
  border-color: var(--border-focus, rgba(255, 255, 255, 0.25)) !important;
  color: var(--cinema-wm-text) !important;
  transform: translateY(-1px);
}

.cinema-wm-dict-box {
  border-top: 1px dashed var(--cinema-wm-border);
  padding-top: 0.5rem;
}

.cinema-wm-dict-box .dict-card {
  background: var(--cinema-wm-surface);
  border: 1px solid var(--cinema-wm-border);
  color: var(--cinema-wm-text);
  border-radius: 12px;
  padding: 0.85rem 1rem;
}

.cinema-wm-dict-box .dict-word-title {
  color: var(--cinema-wm-text);
}

.cinema-wm-dict-box .dict-def-text {
  color: var(--cinema-wm-text);
}

.cinema-wm-dict-box .dict-example-box {
  background: var(--bg-card, rgba(0, 0, 0, 0.25));
  border-left: 2px solid var(--primary, #38bdf8);
  color: var(--cinema-wm-muted);
}

.cinema-wm-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--cinema-wm-border);
  background: var(--cinema-wm-bg);
}

.cinema-wm-footer .btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  font-weight: 700;
  border-radius: 8px;
}

/* Audio Loading Shimmer Progress Bar (Edge Azure TTS fetch) */
.cinema-audio-loading-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #6366f1, #ec4899, #38bdf8, #6366f1);
  background-size: 300% 100%;
  animation: cinemaLoadingShimmer 1.2s infinite linear;
  z-index: 40;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
}

@keyframes cinemaLoadingShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

/* Cinema Note Modal (Personal Notes Drawer) */
.cinema-note-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 55;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  pointer-events: none;
  overflow: hidden;
}

.cinema-note-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.cinema-note-modal-card {
  --cinema-nm-bg: var(--bg-elev, #0f172a);
  --cinema-nm-surface: var(--bg-soft, #1e293b);
  --cinema-nm-border: var(--border, rgba(255, 255, 255, 0.12));
  --cinema-nm-text: var(--text, #f8fafc);
  --cinema-nm-muted: var(--text-muted, #94a3b8);

  position: relative;
  z-index: 2;
  width: 440px;
  max-width: 90vw;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: var(--cinema-nm-bg);
  border-left: 1px solid var(--cinema-nm-border);
  box-shadow: -10px 0 35px var(--cinema-panel-shadow, rgba(0, 0, 0, 0.6));
  display: flex;
  flex-direction: column;
  animation: cinemaDrawerSlide 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  color: var(--cinema-nm-text);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .cinema-note-modal-card {
    width: 100%;
    max-width: 100vw;
  }
}

.cinema-nm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--cinema-nm-border);
  background: var(--cinema-nm-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cinema-nm-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cinema-nm-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--cinema-nm-text);
}

.cinema-nm-sent-index {
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--cinema-badge-review-bg, rgba(139, 92, 246, 0.25));
  color: var(--cinema-badge-review-color, #c4b5fd);
  border: 1px solid var(--cinema-badge-review-border, rgba(139, 92, 246, 0.4));
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
}

.cinema-nm-close-btn {
  color: var(--cinema-nm-muted) !important;
  font-size: 1.1rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.cinema-nm-close-btn:hover {
  color: var(--cinema-nm-text) !important;
  background: var(--cinema-nm-surface) !important;
}

.cinema-nm-body {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1;
}

.cinema-nm-sentence-preview {
  background: var(--cinema-nm-surface);
  border: 1px solid var(--cinema-nm-border);
  border-left: 3px solid #818cf8;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.cinema-nm-sent-de {
  font-weight: 600;
  color: var(--cinema-nm-text);
}

.cinema-nm-sent-zh {
  color: var(--cinema-nm-muted);
  font-size: 0.84rem;
}

.cinema-nm-editor-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1;
}

.cinema-nm-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cinema-nm-muted);
}

.cinema-nm-textarea {
  width: 100%;
  flex: 1;
  min-height: 120px;
  background: var(--cinema-nm-surface);
  border: 1px solid var(--cinema-nm-border);
  border-radius: 10px;
  color: var(--cinema-nm-text);
  padding: 0.75rem 0.85rem;
  font-size: 0.92rem;
  line-height: 1.5;
  resize: vertical;
  box-sizing: border-box;
  font-family: inherit;
  transition: border-color 0.15s ease;
}

.cinema-nm-textarea:focus {
  outline: none;
  border-color: #818cf8;
  box-shadow: 0 0 0 2px rgba(129, 140, 248, 0.25);
}

.cinema-nm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--cinema-nm-border);
  background: var(--cinema-nm-bg);
}

.cinema-nm-footer .btn.primary {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #ffffff;
  border: none;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
  font-weight: 700;
  border-radius: 8px;
}

.cinema-nm-footer-right {
  display: flex;
  gap: 0.5rem;
}

/* =========================================================================
   Cinema Checkpoint Quiz Modal (Section / Scene Interruption)
   ========================================================================= */
.cinema-checkpoint-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  pointer-events: none;
  overflow: hidden;
}

.cinema-checkpoint-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: auto;
  transition: opacity 0.2s ease;
}

.cinema-checkpoint-modal-card {
  --cinema-cm-bg: var(--bg-elev, #0f172a);
  --cinema-cm-surface: var(--bg-soft, #1e293b);
  --cinema-cm-border: var(--border, rgba(255, 255, 255, 0.12));
  --cinema-cm-text: var(--text, #f8fafc);
  --cinema-cm-muted: var(--text-muted, #94a3b8);

  position: relative;
  z-index: 2;
  width: 520px;
  max-width: 92vw;
  height: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: var(--cinema-cm-bg);
  border-left: 1px solid var(--cinema-cm-border);
  box-shadow: -10px 0 35px var(--cinema-panel-shadow, rgba(0, 0, 0, 0.6));
  display: flex;
  flex-direction: column;
  animation: cinemaDrawerSlide 0.24s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: auto;
  color: var(--cinema-cm-text);
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .cinema-checkpoint-modal-card {
    width: 100%;
    max-width: 100vw;
  }
}

.cinema-cm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem 0.85rem;
  border-bottom: 1px solid var(--cinema-cm-border);
  background: var(--cinema-cm-bg);
  position: sticky;
  top: 0;
  z-index: 10;
}

.cinema-cm-title-wrap {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.cinema-cm-badge {
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--tag-learning-bg, rgba(249, 115, 22, 0.2));
  color: var(--tag-learning-fg, #fb923c);
  border: 1px solid color-mix(in srgb, var(--tag-learning, #f97316) 40%, transparent);
}

.cinema-cm-title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--cinema-cm-text);
}

.cinema-cm-close-btn {
  color: var(--cinema-cm-muted) !important;
  font-size: 1.15rem;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.cinema-cm-close-btn:hover {
  color: var(--cinema-cm-text) !important;
  background: var(--cinema-cm-surface) !important;
}

.cinema-cm-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  flex: 1;
}

.cinema-cm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--cinema-cm-border);
  background: var(--cinema-cm-bg);
}

/* =========================================================================
   Shadowing & Echo Method Interactive Styles
   ========================================================================= */
.quiz-shadowing-box {
  background: var(--bg-soft, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shadowing-pattern-badge {
  display: inline-flex;
  align-self: flex-start;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  background: var(--cinema-badge-cefr-bg, rgba(56, 189, 248, 0.16));
  color: var(--cinema-badge-cefr-color, #0284c7);
  border: 1px solid var(--cinema-badge-cefr-border, rgba(56, 189, 248, 0.35));
}

.shadowing-sentence-card {
  background: var(--bg-card, var(--bg-elev, #ffffff));
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary, #6366f1);
  border-radius: 10px;
  padding: 0.95rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.shadowing-sent-de {
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--text, #0f172a);
}

.shadowing-sent-de .quiz-stem-target {
  color: var(--primary, #4f46e5);
  font-weight: 750;
  background: rgba(99, 102, 241, 0.12);
  padding: 0.08rem 0.35rem;
  border-radius: 4px;
}

.shadowing-sent-zh {
  font-size: 0.9rem;
  color: var(--text-muted, #64748b);
  line-height: 1.45;
}

.shadowing-listen-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: var(--bg-elev, rgba(0, 0, 0, 0.05));
  border-radius: 8px;
  border: 1px dashed var(--border);
}

.shadow-listen-tip {
  font-size: 0.78rem;
}

.shadowing-action-area {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.shadowing-record-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn-shadow-record-start {
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
  transition: all 0.18s ease;
}
.btn-shadow-record-start:hover {
  transform: translateY(-1px);
}

.btn-shadow-record-stop {
  padding: 0.6rem 1.25rem;
  font-weight: 700;
  font-size: 0.92rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #dc2626 !important;
  color: #ffffff !important;
  border: none;
  box-shadow: 0 0 16px rgba(220, 38, 38, 0.5);
  animation: recPulse 1.2s infinite ease-in-out;
}

@keyframes recPulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.6); }
  50% { transform: scale(1.03); box-shadow: 0 0 0 10px rgba(220, 38, 38, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}

.shadow-pulse-dot {
  width: 10px;
  height: 10px;
  background: #ffffff;
  border-radius: 50%;
  display: inline-block;
}

.shadow-rec-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.shadowing-compare-panel {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 0.85rem 1rem;
  border-radius: 10px;
  background: var(--bg-card, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
}

.shadowing-compare-btn-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.shadowing-status-line {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--primary, #4f46e5);
  line-height: 1.4;
  padding-left: 0.2rem;
}

/* ==========================================================================
   Lesson Vocab Preview Modal & Quick Links
   ========================================================================== */
#lessonVocabModal {
  z-index: 150;
  backdrop-filter: blur(3px);
}
.lesson-vocab-modal-sheet {
  width: min(840px, 95vw) !important;
  max-height: min(92vh, 760px);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  animation: confirmSheetIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .lesson-vocab-modal-sheet {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    padding: 1rem 0.9rem max(1rem, env(safe-area-inset-bottom)) !important;
    border-radius: 20px 20px 0 0 !important;
  }
}
.lesson-vocab-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.lesson-vocab-badge-icon {
  font-size: 1.6rem;
  width: 2.75rem;
  height: 2.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft, #fef3c7);
  border-radius: 12px;
  flex-shrink: 0;
}
.lesson-vocab-stats-strip {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  padding: 0.5rem 0.75rem;
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 0.75rem;
  font-size: 0.82rem;
}
.lesson-vocab-tab-bar {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.75rem;
}
.lesson-vocab-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.5rem 0.85rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.lesson-vocab-tab-btn:hover {
  color: var(--text);
}
.lesson-vocab-tab-btn.is-active {
  color: var(--brand, #0284c7);
  border-bottom-color: var(--brand, #0284c7);
}
.lesson-vocab-search-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}
.lesson-vocab-search-wrap {
  flex: 1;
  min-width: 200px;
}
.lesson-vocab-search-wrap input {
  width: 100%;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  font-size: 0.85rem;
  box-sizing: border-box;
}
.lesson-vocab-filter-chips {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}
.vocab-chip {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.vocab-chip:hover {
  border-color: var(--text-muted);
}
.vocab-chip.is-active {
  background: var(--brand, #0284c7);
  color: #fff;
  border-color: var(--brand, #0284c7);
}
.lesson-vocab-content-area {
  flex: 1;
  overflow-y: auto;
  max-height: calc(85vh - 220px);
  padding: 0.25rem 0.1rem 0.5rem;
}
.all-words-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 0.65rem;
}
.all-word-card {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  user-select: none;
}
.all-word-card:hover {
  border-color: var(--brand, #0284c7);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.all-word-card:active {
  transform: scale(0.985);
}
.all-word-card.is-speaking {
  border-color: var(--brand, #0284c7) !important;
  box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.25), 0 4px 14px rgba(2, 132, 199, 0.2);
  animation: cardSpeakPulse 0.6s ease-in-out infinite alternate;
}
.all-word-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}
.all-word-term {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.95rem;
  flex-wrap: wrap;
}
.all-word-lemma {
  font-size: 0.8rem;
  color: var(--text-muted);
}
.all-word-meaning {
  font-size: 0.82rem;
  color: var(--text);
  font-weight: 600;
  line-height: 1.35;
}
.all-word-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-top: auto;
  padding-top: 0.25rem;
  border-top: 1px dashed var(--border);
  font-size: 0.75rem;
}
.all-word-sentences {
  color: var(--text-muted);
}
.lesson-vocab-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}
.ped-vocab-link {
  background: none;
  border: 1px solid var(--accent, #f59e0b);
  color: var(--accent, #b45309);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: all 0.15s ease;
}
.ped-vocab-link:hover {
  background: var(--accent, #f59e0b);
  color: #fff;
}

.lesson-vocab-stat-card {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
}
.lesson-vocab-stat-num {
  font-weight: 800;
  font-size: 0.95rem;
  color: var(--text);
}
.lesson-vocab-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Journal Lesson Analysis Styles */
.journal-lesson-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-height: 520px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.journal-lesson-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg, rgba(255, 255, 255, 0.03));
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.journal-lesson-header {
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.journal-lesson-header:hover {
  background: rgba(255, 255, 255, 0.07);
}
.journal-lesson-title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.journal-lesson-stats-pills {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.78rem;
  flex-wrap: wrap;
}
.journal-lesson-body {
  padding: 0.85rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.journal-vocab-group {
  border-left: 3px solid var(--border);
  padding-left: 0.65rem;
}
.journal-vocab-group.group-learning { border-color: #f97316; }
.journal-vocab-group.group-shaky { border-color: #eab308; }
.journal-vocab-group.group-familiar { border-color: #22c55e; }
.journal-vocab-group-title {
  font-size: 0.84rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.journal-vocab-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.journal-vocab-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.65rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.86rem;
}
.journal-vocab-left {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.journal-vocab-word {
  font-weight: 700;
  color: var(--text);
}
.journal-vocab-lemma {
  font-size: 0.8rem;
  color: #38bdf8;
}
.journal-vocab-meaning {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.journal-vocab-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-shrink: 0;
}

/* ==========================================================================
   Streamlined Cinema Controls & Speed Stepper Widget
   ========================================================================== */
.cinema-speed-widget {
  position: relative;
  display: inline-flex;
  align-items: center;
  background: var(--bg-soft, #1e293b);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 4px;
}
.btn-speed-step {
  padding: 0.2rem 0.5rem !important;
  font-size: 0.9rem !important;
  line-height: 1 !important;
  border-radius: 999px !important;
  color: var(--text-muted) !important;
  border: none !important;
  cursor: pointer;
  background: transparent !important;
  transition: all 0.12s ease;
}
.btn-speed-step:hover {
  color: var(--text) !important;
  background: var(--bg-elev, #334155) !important;
}
.cinema-speed-pill {
  font-weight: 700 !important;
  font-size: 0.82rem !important;
  padding: 0.2rem 0.55rem !important;
  border: none !important;
  color: var(--accent, #38bdf8) !important;
  cursor: pointer;
  background: transparent !important;
}
.cinema-speed-pill:hover {
  text-decoration: underline;
}
.cinema-speed-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-elev, #1e293b);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.45);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 115px;
  z-index: 100;
  animation: fadeInFast 0.15s ease-out;
}
.speed-menu-opt {
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.65rem;
  font-size: 0.82rem;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: all 0.1s ease;
}
.speed-menu-opt:hover {
  background: var(--bg-soft, #334155);
}
.speed-menu-opt.active {
  background: var(--accent, #38bdf8);
  color: #fff;
  font-weight: 700;
}
.cinema-page-indicator {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   Playback Settings Modal
   ========================================================================== */
.playback-settings-sheet {
  max-width: 520px;
  width: 92%;
  max-height: 85vh;
  overflow-y: auto;
  border-radius: 14px;
}
.ps-section {
  margin-top: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}
.ps-section:last-of-type {
  border-bottom: none;
}
.ps-section-title {
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text);
  margin: 0 0 0.65rem 0;
}
.ps-option-row {
  margin-bottom: 0.75rem;
}
.ps-toggle-label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.88rem;
}
.ps-toggle-label input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: var(--accent, #38bdf8);
  width: 1.15rem;
  height: 1.15rem;
  flex-shrink: 0;
}
.ps-hint {
  font-size: 0.78rem;
  margin-top: 0.15rem;
  line-height: 1.35;
}

/* ==========================================================================
   Quizlet-like Flashcard UI & 3-Tier Familiarity Tagging
   ========================================================================== */
.fc-quizlet-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  margin-top: 0.65rem;
}
.btn-fc-nav {
  padding: 0.45rem 1.1rem !important;
  font-weight: 750 !important;
  font-size: 0.88rem !important;
  border-radius: 999px !important;
  border: 1px solid var(--border) !important;
  background: var(--bg-elev) !important;
  color: var(--text) !important;
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn-fc-nav:hover {
  border-color: var(--accent) !important;
  background: var(--bg-soft) !important;
  transform: translateY(-1px);
}
.fc-quizlet-counter {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.95rem;
  font-weight: 750;
  color: var(--text);
}
.btn-fc-flip-pill {
  border: 1px solid var(--border) !important;
  border-radius: 999px !important;
  padding: 0.22rem 0.65rem !important;
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  cursor: pointer;
  background: var(--bg-soft) !important;
  color: var(--accent) !important;
  transition: all 0.15s ease;
}
.btn-fc-flip-pill:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-color: var(--accent) !important;
}
.fc-tag-toolbar {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem;
  width: 100%;
  margin-top: 0.75rem;
}
.fc-tag-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.65rem 0.5rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  cursor: pointer;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}
.fc-tag-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.fc-tag-btn:active {
  transform: translateY(0);
}
.tag-btn-learning {
  border-color: rgba(249, 115, 22, 0.45);
  background: rgba(249, 115, 22, 0.08);
}
.tag-btn-learning:hover {
  border-color: #f97316;
  background: rgba(249, 115, 22, 0.2);
}
.tag-btn-shaky {
  border-color: rgba(234, 179, 8, 0.45);
  background: rgba(234, 179, 8, 0.08);
}
.tag-btn-shaky:hover {
  border-color: #eab308;
  background: rgba(234, 179, 8, 0.2);
}
.tag-btn-familiar {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.08);
}
.tag-btn-familiar:hover {
  border-color: #22c55e;
  background: rgba(34, 197, 94, 0.2);
}
.tag-icon {
  font-size: 1.25rem;
  line-height: 1;
}
.tag-text {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}
.tag-hotkey {
  font-size: 0.7rem;
  font-family: var(--mono, monospace);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 4px;
  background: var(--bg-soft);
}

/* ==========================================================================
   Multi-Language Profile Hub Grid & Cards
   ========================================================================== */
.pm-profiles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-top: 0.65rem;
}
.pm-profile-card {
  background: var(--bg-soft);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
}
.pm-profile-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.pm-profile-card.is-active {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, var(--bg-soft));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}
.pm-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pm-card-lang {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--text);
}
.pm-active-badge {
  font-size: 0.72rem;
  font-weight: 750;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.15rem 0.55rem;
  letter-spacing: 0.02em;
}
.pm-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}
.pm-card-name {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.pm-rename-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 5px;
  font-size: 0.8rem;
  border-radius: 4px;
}
.pm-rename-btn:hover {
  background: var(--bg-elev);
  color: var(--text);
}
.pm-rename-input {
  width: 100%;
  padding: 0.25rem 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--bg-elev);
  color: var(--text);
}
.pm-card-stats {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  background: var(--bg-elev);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
}
.pm-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pm-mastery-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  display: flex;
  margin-top: 0.25rem;
}
.pm-mastery-seg {
  height: 100%;
}
.pm-mastery-seg.familiar { background: #22c55e; }
.pm-mastery-seg.shaky { background: #eab308; }
.pm-mastery-seg.learning { background: #f97316; }
.pm-card-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: auto;
}
.pm-switch-btn {
  flex: 1;
  font-size: 0.82rem !important;
  font-weight: 700 !important;
  padding: 0.35rem 0.6rem !important;
}

/* Page Interstitial Quizzes (Matching Game, Substitution Drill, Type Switcher) */
.cinema-cm-type-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

.cm-type-pill {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: var(--bg-soft, rgba(255, 255, 255, 0.05));
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.cm-type-pill:hover {
  color: var(--text);
  border-color: var(--brand, #0284c7);
  background: rgba(2, 132, 199, 0.08);
}
.cm-type-pill.active {
  background: var(--brand, #0284c7) !important;
  border-color: var(--brand, #0284c7) !important;
  color: #ffffff !important;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* Matching Game Board */
.matching-board-container {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.matching-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-bottom: 0.25rem;
}

.matching-mode-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}
.matching-mode-btn.active {
  background: rgba(99, 102, 241, 0.18);
  border-color: #6366f1;
  color: #a5b4fc;
  font-weight: 700;
}

.matching-board {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.matching-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.matching-col-header {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  letter-spacing: 0.05em;
  padding-bottom: 0.2rem;
}

.matching-card {
  background: var(--bg-soft, #1e293b);
  border: 2px solid var(--border, #334155);
  border-radius: 10px;
  padding: 0.75rem 0.95rem;
  cursor: pointer;
  user-select: none;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.3s ease;
  text-align: center;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.94rem;
  color: var(--text);
}
.matching-card:hover {
  border-color: var(--brand, #0284c7);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.matching-card:active {
  transform: scale(0.98);
}
.matching-card.is-selected {
  border-color: var(--brand, #0284c7) !important;
  background: rgba(2, 132, 199, 0.18) !important;
  color: #38bdf8 !important;
  box-shadow: 0 0 16px rgba(2, 132, 199, 0.45);
  transform: scale(1.02);
}
.matching-card.is-mismatch {
  animation: cardShake 0.4s ease;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.2) !important;
  color: #f87171 !important;
}
.matching-card.is-matched {
  animation: cardDisappear 0.45s ease-out forwards;
  pointer-events: none;
}

.matching-audio-card {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.matching-progress-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.85rem;
  background: rgba(99, 102, 241, 0.1);
  border-radius: 8px;
  border: 1px dashed rgba(99, 102, 241, 0.3);
  font-size: 0.84rem;
  color: #a5b4fc;
}

@keyframes cardDisappear {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.9; background: rgba(34, 197, 94, 0.3); border-color: #22c55e; }
  100% { transform: scale(0.6); opacity: 0; visibility: hidden; }
}

@keyframes cardShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

/* Substitution Drill Styles (4 Choices) */
.sub-drill-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.sub-drill-stem-card {
  background: var(--bg-soft, rgba(255, 255, 255, 0.04));
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.85rem 1.1rem;
}
.sub-drill-stem-orig {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.45;
}
.sub-drill-stem-zh {
  font-size: 0.86rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}
.sub-drill-cue {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  color: #fbbf24;
  font-weight: 700;
  font-size: 0.82rem;
  margin-top: 0.5rem;
}

.sub-drill-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  margin-top: 0.25rem;
}

.sub-drill-opt-btn {
  display: flex;
  align-items: flex-start;
  text-align: left;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  gap: 0.65rem;
  cursor: pointer;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  color: var(--text);
  transition: all 0.15s ease;
}
.sub-drill-opt-btn:hover {
  border-color: var(--brand, #0284c7);
  transform: translateX(2px);
}
.sub-drill-opt-btn.is-correct {
  background: rgba(34, 197, 94, 0.18) !important;
  border-color: #22c55e !important;
  color: #4ade80 !important;
  font-weight: 700;
}
.sub-drill-opt-btn.is-wrong {
  background: rgba(239, 68, 68, 0.18) !important;
  border-color: #ef4444 !important;
  color: #f87171 !important;
}

.btn-cinema-ctrl.is-quiz-enabled {
  color: #818cf8 !important;
  border-color: rgba(99, 102, 241, 0.5) !important;
  background: rgba(99, 102, 241, 0.1) !important;
}

/* ==========================================================================
   Adaptive Re-calibration & Export Wizard Styles
   ========================================================================== */
.export-wizard-sheet {
  max-width: 660px;
  width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: var(--radius, 14px);
  padding: 1.5rem;
}

.export-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all 0.15s ease;
}

.export-profile-card:hover {
  border-color: var(--accent);
  background: var(--bg-hover, var(--bg-soft));
  transform: translateY(-1px);
}

.export-profile-card.is-selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.08);
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.export-profile-card-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
}

.export-profile-card-radio {
  font-size: 1.1rem;
  color: var(--text-muted);
}

.export-profile-card.is-selected .export-profile-card-radio {
  color: var(--accent);
}

.export-profile-card-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
}

.export-profile-card-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.cefr-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 0.4rem;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.15s ease;
}

.cefr-pick-btn:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}

.cefr-pick-btn.is-selected {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent);
  font-weight: 700;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25);
}

.export-recalib-preview-box {
  border: 1px solid var(--border);
  background: var(--bg-card);
  border-radius: 10px;
  padding: 1rem;
}

.recalib-metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.recalib-lu-tags-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.5rem;
}

.recalib-lu-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25rem 0.55rem;
  background: rgba(234, 88, 12, 0.12);
  border: 1px solid rgba(234, 88, 12, 0.35);
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #ea580c;
}

/* ========================================================
   Flashcard Driving Audio Podcast Studio (開車隨身聽模式)
   ======================================================== */
#fcPodcastModal {
  z-index: 145;
  backdrop-filter: blur(4px);
}
.fc-podcast-sheet {
  max-width: 680px !important;
  max-height: 94vh;
  overflow-y: auto;
}
.fc-driving-icon {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(37, 99, 235, 0.2));
  border-color: rgba(16, 185, 129, 0.4);
}
.fc-podcast-config-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.95rem;
}
.fc-config-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.fc-config-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fc-config-label {
  font-size: 0.88rem;
  color: var(--text);
}
.fc-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.fc-chips-row .fc-chip {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s ease;
}
.fc-chips-row .fc-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}
.fc-chips-row .fc-chip:hover:not(.active) {
  border-color: var(--accent);
}

/* Active Driver Card Visual in Player */
.fc-podcast-active-card {
  background: var(--surface);
  border: 2px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: var(--radius-md);
  padding: 1.15rem 1.25rem;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}
.fc-active-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}
.fc-active-index {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.fc-active-lemma {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  letter-spacing: -0.015em;
  margin-bottom: 0.35rem;
  word-break: break-word;
}
.fc-active-meaning {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.4;
  margin-bottom: 0.75rem;
}
.fc-active-example {
  background: var(--bg-soft);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-left: 3px solid var(--accent);
}
.fc-active-ex-de {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  margin-bottom: 0.25rem;
}
.fc-active-ex-zh {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Big Driver Control Buttons */
.fc-driver-ctrl-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin: 0.75rem 0 0.5rem;
}
.fc-driver-play-btn {
  width: 3.6rem !important;
  height: 3.6rem !important;
  border-radius: 50% !important;
  font-size: 1.45rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: linear-gradient(135deg, #10b981, #2563eb) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.4) !important;
  cursor: pointer;
}
.fc-driver-play-btn:hover {
  transform: scale(1.06);
}
.fc-driver-play-btn:active {
  transform: scale(0.96);
}

/* Playlist of Cards */
.fc-podcast-cards-list-wrap {
  margin-top: 1rem;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
}
.fc-cards-list-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}
.fc-podcast-cards-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  max-height: 180px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
.fc-podcast-card-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.45rem 0.65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
}
.fc-podcast-card-item:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 4%, var(--surface));
}
.fc-podcast-card-item.is-active-card {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  box-shadow: 0 0 0 1px var(--accent);
}
.fc-pcard-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}
.fc-pcard-item-lemma {
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-pcard-item-meaning {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-pcard-item-time {
  font-size: 0.74rem;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

/* ========================================================
   Landing Page: 95/5 Adaptive Reading Studio Course Catalog
   ======================================================== */

.landing-hero-card {
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 10%, var(--bg-elev)) 0%, var(--bg-elev) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.85rem 2rem;
  margin-bottom: 1.25rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.landing-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 9999px;
  padding: 0.2rem 0.7rem;
  margin-bottom: 0.75rem;
  letter-spacing: 0.02em;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.4);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.landing-hero-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
  margin: 0 0 0.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.landing-hero-title-sub {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent);
}

.landing-hero-desc {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 820px;
  margin: 0 0 1.15rem;
}

.landing-stats-row {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-top: 0.95rem;
  border-top: 1px solid var(--border);
}

.landing-stat-item {
  display: flex;
  flex-direction: column;
}

.landing-stat-item .stat-num {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.2;
}

.landing-stat-item .stat-lbl {
  font-size: 0.72rem;
  color: var(--text-subtle);
  font-weight: 600;
  margin-top: 0.15rem;
}

.landing-stat-divider {
  width: 1px;
  height: 1.75rem;
  background: var(--border);
}

/* Controls Card: Search & CEFR Level Filter */
.landing-controls-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem 1.4rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.landing-search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 0.9rem;
}

.landing-search-bar .search-icon {
  position: absolute;
  left: 0.95rem;
  font-size: 1.05rem;
  pointer-events: none;
  opacity: 0.65;
}

.landing-search-input {
  width: 100%;
  padding: 0.75rem 2.5rem 0.75rem 2.85rem;
  font-size: 0.92rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  transition: all 0.2s ease;
  box-sizing: border-box;
}

.landing-search-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--bg-elev);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.landing-search-clear {
  position: absolute;
  right: 0.75rem;
  background: transparent;
  border: none;
  font-size: 1rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: 50%;
  line-height: 1;
}

.landing-search-clear:hover {
  color: var(--text);
}

.landing-filter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.85rem;
}

.landing-filter-label {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}

.landing-level-chips {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.landing-level-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.landing-level-chip:hover {
  border-color: var(--accent);
  color: var(--text);
  transform: translateY(-1px);
}

.landing-level-chip.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.landing-level-chip .chip-count {
  font-size: 0.72rem;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.08);
  font-weight: 700;
}

.landing-level-chip.is-active .chip-count {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
}

.level-a1 .chip-dot { background: #10b981; }
.level-a2 .chip-dot { background: #06b6d4; }
.level-b1 .chip-dot { background: #3b82f6; }
.level-b2 .chip-dot { background: #8b5cf6; }
.level-c1 .chip-dot { background: #f59e0b; }
.level-c2 .chip-dot { background: #f43f5e; }

.landing-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.landing-results-count {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
}

.landing-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.landing-sort-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.landing-sort-select {
  padding: 0.3rem 0.6rem;
  font-size: 0.82rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

/* Landing Cards Grid */
.landing-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.35rem;
  margin-top: 0.5rem;
}

.lesson-card-item {
  display: flex;
  flex-direction: column;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  position: relative;
}

.lesson-card-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.12);
  border-color: var(--accent);
}

/* Media Thumbnail Container */
.lesson-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
}

.lesson-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.lesson-card-item:hover .lesson-card-img {
  transform: scale(1.04);
}

.lesson-card-media-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.25) 0%, rgba(15, 23, 42, 0.05) 50%, rgba(15, 23, 42, 0.75) 100%);
  pointer-events: none;
}

/* Badges on Thumbnail */
.lesson-card-badge-level {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 2;
  padding: 0.25rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 800;
  border-radius: 6px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(8px);
}

.badge-level-a1 { background: rgba(16, 185, 129, 0.92); color: #ffffff; box-shadow: 0 2px 6px rgba(16, 185, 129, 0.35); }
.badge-level-a2 { background: rgba(6, 182, 212, 0.92); color: #ffffff; box-shadow: 0 2px 6px rgba(6, 182, 212, 0.35); }
.badge-level-b1 { background: rgba(37, 99, 235, 0.92); color: #ffffff; box-shadow: 0 2px 6px rgba(37, 99, 235, 0.35); }
.badge-level-b2 { background: rgba(124, 58, 237, 0.92); color: #ffffff; box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35); }
.badge-level-c1 { background: rgba(217, 119, 6, 0.92); color: #ffffff; box-shadow: 0 2px 6px rgba(217, 119, 6, 0.35); }
.badge-level-c2 { background: rgba(225, 29, 72, 0.92); color: #ffffff; box-shadow: 0 2px 6px rgba(225, 29, 72, 0.35); }

.lesson-card-badge-format {
  position: absolute;
  top: 0.65rem;
  right: 0.65rem;
  z-index: 2;
  padding: 0.22rem 0.5rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.75);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lesson-card-duration {
  position: absolute;
  bottom: 0.55rem;
  right: 0.65rem;
  z-index: 2;
  font-size: 0.72rem;
  font-weight: 600;
  color: #f8fafc;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.85);
}

.lesson-card-play-hover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 3;
  pointer-events: none;
}

.lesson-card-item:hover .lesson-card-play-hover {
  opacity: 1;
}

.play-hover-circle {
  width: 3.2rem;
  height: 3.2rem;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.92);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  padding-left: 3px;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.5);
  transform: scale(0.92);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.lesson-card-item:hover .play-hover-circle {
  transform: scale(1.08);
}

/* Card Body */
.lesson-card-body {
  padding: 1.1rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: left;
}

.lesson-card-source-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-subtle);
  margin-bottom: 0.4rem;
}

.lesson-card-source {
  font-weight: 700;
  color: var(--accent);
}

.lesson-card-title-de {
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--text);
  line-height: 1.35;
  margin: 0 0 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-card-title-zh {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.35;
  margin: 0 0 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lesson-card-summary {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0 0 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Pedagogy / 95/5 Pills */
.lesson-card-krashen-meta {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  margin-bottom: 0.95rem;
  font-size: 0.72rem;
  font-weight: 600;
}

.krashen-pill-anchor {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
}

.krashen-pill-levelup {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(234, 88, 12, 0.12);
  color: #ea580c;
}

.krashen-pill-quizzes {
  padding: 0.2rem 0.45rem;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.12);
  color: #7c3aed;
}

/* Card Ladder Bar & Level Pills */
.lesson-card-ladder-bar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 0.6rem;
  padding: 0.4rem 0.6rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  flex-wrap: wrap;
}

.lesson-card-ladder-bar .ladder-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
}

.ladder-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  padding: 0.18rem 0.45rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  border: 1px solid var(--border);
  background: var(--bg-elev);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
}

.ladder-pill-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.ladder-pill-btn.is-active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.3);
}

.ladder-pill-btn.badge-lvl-a1.is-active { background: #059669; border-color: #059669; }
.ladder-pill-btn.badge-lvl-a2.is-active { background: #0284c7; border-color: #0284c7; }
.ladder-pill-btn.badge-lvl-b1.is-active { background: #d97706; border-color: #d97706; }
.ladder-pill-btn.badge-lvl-b2.is-active { background: #7c3aed; border-color: #7c3aed; }

/* Card Action Buttons */
.lesson-card-actions {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.landing-btn-cinema {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 700;
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
  border-radius: var(--radius-sm);
  color: #ffffff !important;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.landing-btn-cinema:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.lesson-card-sub-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0.35rem;
}

.lesson-card-sub-actions .btn {
  font-size: 0.76rem;
  padding: 0.3rem 0.35rem;
  justify-content: center;
  text-align: center;
}

/* Empty State */
.landing-empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-soft);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  margin: 1rem 0;
}

.landing-empty-state .empty-icon {
  font-size: 2.75rem;
  margin-bottom: 0.75rem;
}

.landing-empty-state h3 {
  margin: 0 0 0.45rem;
  font-size: 1.15rem;
  color: var(--text);
}

.landing-empty-state p {
  margin: 0 0 1.15rem;
  color: var(--text-muted);
}

@media (max-width: 640px) {
  .landing-cards-grid {
    grid-template-columns: 1fr;
  }
  .landing-hero-card {
    padding: 1.25rem 1.15rem;
  }
  .landing-hero-title {
    font-size: 1.45rem;
  }
  .landing-controls-card {
    padding: 1rem;
  }
  .landing-meta-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Listening Quiz (Blind Sentence & Cloze Audio Comprehension) */
.cinema-listening-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.listening-subtype-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  padding-bottom: 0.45rem;
  border-bottom: 1px dashed var(--border);
}

.listening-card {
  background: var(--bg-soft, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 12px;
  padding: 1.25rem 1.15rem;
  text-align: center;
  position: relative;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  transition: all 0.2s ease;
}

.listening-blind-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-muted);
  font-size: 1.05rem;
  font-weight: 600;
}

.listening-cloze-prompt {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
}

.listening-mask-blank {
  display: inline-block;
  background: rgba(2, 132, 199, 0.15);
  border: 2px dashed var(--brand, #0284c7);
  color: #38bdf8;
  padding: 0.15rem 0.75rem;
  border-radius: 8px;
  font-weight: 700;
  margin: 0 0.25rem;
  letter-spacing: 0.05em;
}

.listening-ctrl-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn-listening-play {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.6rem 1.35rem;
  font-size: 0.98rem;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: 0 3px 12px rgba(2, 132, 199, 0.35);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn-listening-play:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(2, 132, 199, 0.5);
}
.btn-listening-play:active {
  transform: scale(0.98);
}
.btn-listening-play.is-playing {
  animation: pulseListenPlay 1.2s infinite alternate;
}

@keyframes pulseListenPlay {
  from {
    box-shadow: 0 0 10px rgba(2, 132, 199, 0.4);
  }
  to {
    box-shadow: 0 0 22px rgba(2, 132, 199, 0.85);
  }
}

.listening-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.85rem;
}

.listening-opt-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 1rem;
  text-align: left;
  background: var(--bg-soft, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}
.listening-opt-btn:hover {
  border-color: var(--brand, #0284c7);
  background: rgba(2, 132, 199, 0.08);
  transform: translateY(-1px);
}
.listening-opt-btn:active {
  transform: scale(0.99);
}

.listening-opt-badge {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.listening-opt-btn.is-correct {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.18) !important;
  color: #86efac !important;
}
.listening-opt-btn.is-correct .listening-opt-badge {
  background: #22c55e !important;
  color: #ffffff !important;
  border-color: #22c55e !important;
}

.listening-opt-btn.is-incorrect {
  animation: cardShake 0.4s ease;
  border-color: #ef4444 !important;
  background: rgba(239, 68, 68, 0.18) !important;
  color: #fca5a5 !important;
}
.listening-opt-btn.is-incorrect .listening-opt-badge {
  background: #ef4444 !important;
  color: #ffffff !important;
  border-color: #ef4444 !important;
}

.listening-feedback-card {
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.35);
  border-radius: 10px;
  padding: 1rem 1.15rem;
  margin-top: 0.85rem;
  line-height: 1.6;
}

/* Reshuffled Word Blocks with Distractors & Missing Blanks */
.listening-assembly-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.4rem;
}

.listening-tray-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-muted);
}

.listening-tray-actions {
  display: flex;
  gap: 0.35rem;
}

.listening-section-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
}

.listening-assembly-tray {
  min-height: 58px;
  background: var(--bg, #0f172a);
  border: 2px dashed var(--border, #334155);
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  transition: all 0.2s ease;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.25);
}

.listening-assembly-tray.is-empty {
  justify-content: center;
}

.listening-tray-placeholder {
  color: var(--text-muted);
  font-size: 0.92rem;
  font-style: italic;
  user-select: none;
  opacity: 0.75;
}

.listening-assembly-tray.is-correct {
  border: 2px solid #22c55e !important;
  background: rgba(34, 197, 94, 0.12) !important;
  box-shadow: 0 0 16px rgba(34, 197, 94, 0.35) !important;
}

.listening-assembly-tray.is-shaking {
  animation: cardShake 0.45s ease;
  border-color: #ef4444 !important;
}

.listening-tray-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg-soft, #1e293b);
  border: 1.5px solid var(--brand, #0284c7);
  color: var(--text, #f8fafc);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  animation: chipPopIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.listening-tray-chip:hover {
  background: rgba(2, 132, 199, 0.2);
  border-color: #38bdf8;
  transform: translateY(-2px);
}

.listening-tray-chip:active {
  transform: scale(0.95);
}

.listening-tray-punct {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-muted);
  margin-left: 0.15rem;
  user-select: none;
}

.listening-bank-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.listening-word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  justify-content: center;
  padding: 0.85rem 0.65rem;
  background: var(--bg-soft, #1e293b);
  border: 1px solid var(--border, #334155);
  border-radius: 12px;
  min-height: 64px;
}

.listening-chip-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg, #0f172a);
  border: 1.5px solid var(--border, #475569);
  color: var(--text, #f8fafc);
  font-size: 1.05rem;
  font-weight: 700;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.listening-chip-btn:hover:not(.is-placed) {
  border-color: var(--brand, #0284c7);
  background: rgba(2, 132, 199, 0.16);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.listening-chip-btn:active:not(.is-placed) {
  transform: scale(0.95);
}

.listening-chip-btn.is-placed {
  opacity: 0.22;
  border-style: dashed;
  pointer-events: none;
  transform: scale(0.94);
  box-shadow: none;
  background: transparent;
}

/* Cloze Blanks Specific Styling */
.listening-cloze-scaffold {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 1.18rem;
  font-weight: 700;
  line-height: 1.8;
  color: var(--text);
  padding: 0.4rem 0.2rem;
}

.listening-cloze-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  min-height: 42px;
  border: 2px dashed var(--brand, #0284c7);
  background: rgba(2, 132, 199, 0.08);
  border-radius: 999px;
  padding: 0.2rem 0.75rem;
  margin: 0 0.25rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.listening-cloze-slot.is-filled {
  border-style: solid;
  border-color: var(--brand, #0284c7);
  background: rgba(2, 132, 199, 0.2);
}

.listening-cloze-slot:hover {
  background: rgba(2, 132, 199, 0.18);
}

.listening-action-row {
  display: flex;
  gap: 0.6rem;
  margin-top: 0.35rem;
}

.btn-listening-check {
  width: 100%;
  padding: 0.75rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 800;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  box-shadow: 0 3px 12px rgba(34, 197, 94, 0.25);
  transition: all 0.15s ease;
}

.btn-listening-check:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.listening-tray-chip.is-speaking-word {
  background: rgba(56, 189, 248, 0.3) !important;
  border-color: #38bdf8 !important;
  color: #ffffff !important;
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.8) !important;
  transform: translateY(-3px) scale(1.08) !important;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.listening-tray-chip.is-all-correct {
  background: rgba(34, 197, 94, 0.25) !important;
  border-color: #22c55e !important;
  color: #86efac !important;
}

.listening-tray-chip.is-chip-error {
  background: rgba(239, 68, 68, 0.22) !important;
  border-color: #ef4444 !important;
  color: #fca5a5 !important;
  animation: chipShake 0.4s ease;
}

/* Diff Comparison Card for Incorrect Order / Distractors */
.listening-diff-card {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.35);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-top: 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  animation: chipPopIn 0.25s ease;
}

.listening-diff-header {
  font-size: 0.94rem;
  font-weight: 700;
  color: #f87171;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.listening-diff-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.listening-diff-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
}

.listening-diff-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  align-items: center;
}

.diff-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.28rem 0.75rem;
  border-radius: 999px;
  border: 1.5px solid;
  user-select: none;
}

.diff-chip-correct {
  background: rgba(34, 197, 94, 0.15);
  border-color: #22c55e;
  color: #86efac;
}

.diff-chip-mismatch {
  background: rgba(239, 68, 68, 0.22);
  border-color: #ef4444;
  color: #fca5a5;
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.3);
}

.diff-chip-distractor {
  background: rgba(239, 68, 68, 0.3);
  border-color: #f43f5e;
  color: #fecdd3;
  text-decoration: line-through;
  box-shadow: 0 0 10px rgba(244, 63, 94, 0.4);
}

.diff-chip-match {
  background: rgba(2, 132, 199, 0.12);
  border-color: #0284c7;
  color: #7dd3fc;
}

.diff-chip-expected-target {
  background: rgba(234, 179, 8, 0.2);
  border-color: #eab308;
  color: #fde047;
  font-weight: 800;
  box-shadow: 0 0 10px rgba(234, 179, 8, 0.35);
}

.listening-diff-hint {
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.55;
  padding-top: 0.45rem;
  border-top: 1px dashed rgba(239, 68, 68, 0.25);
}

@keyframes chipShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-4px); }
  40%, 80% { transform: translateX(4px); }
}

@keyframes chipPopIn {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================================================
   Japanese Ruby Furigana & Romaji Support
   ======================================================== */
ruby {
  ruby-align: center;
  ruby-position: over;
  display: inline-flex;
  flex-direction: column-reverse;
  vertical-align: bottom;
  text-align: center;
  margin: 0 1px;
}
rt {
  font-size: 0.52em;
  font-weight: 600;
  color: #60a5fa;
  user-select: none;
  letter-spacing: 0;
  line-height: 1.1;
  text-align: center;
  display: block;
}
.token ruby rt {
  color: #3b82f6;
}
.cinema-token ruby rt {
  color: #93c5fd;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
}
.cinema-sub-romaji {
  font-size: 0.86rem;
  font-style: italic;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
  opacity: 0.9;
}
.cinema-sub-kana {
  font-size: 0.92rem;
  color: #94a3b8;
  letter-spacing: 0.03em;
  margin-top: 0.15rem;
}
.ja-badge-kana {
  display: inline-block;
  background: rgba(147, 197, 253, 0.15);
  border: 1px solid rgba(147, 197, 253, 0.4);
  color: #93c5fd;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  margin-right: 0.35rem;
}
.ja-badge-romaji {
  display: inline-block;
  background: rgba(168, 85, 247, 0.15);
  border: 1px solid rgba(168, 85, 247, 0.4);
  color: #c084fc;
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  font-style: italic;
}

/* ========================================================
   Creative Onboarding Level Bootstrap Wizard
   ======================================================== */
.onboarding-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(8px);
  padding: 1rem;
}
.onboarding-modal-card {
  background: var(--bg-surface, #0f172a);
  border: 1px solid var(--border, #334155);
  border-radius: 16px;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  padding: 1.5rem 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}
.onboarding-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.85rem;
}
.onboarding-step-pill {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-muted);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
}
.onboarding-step-pill.is-active {
  background: var(--brand, #0284c7);
  color: #ffffff;
  border-color: var(--brand, #0284c7);
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.35);
}
.onboarding-step-pill.is-done {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.35);
}
.onboarding-mixture-card {
  background: rgba(30, 41, 59, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem 1.15rem;
}
.onboarding-mix-bars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.6rem;
  margin-top: 0.65rem;
}
.onboarding-mix-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.65rem;
  text-align: center;
}
.onboarding-mix-label {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-muted);
}
.onboarding-mix-pct {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--brand, #38bdf8);
  margin: 0.2rem 0;
}
.onboarding-mix-bar-outer {
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
}
.onboarding-mix-bar-inner {
  height: 100%;
  background: var(--brand, #0284c7);
  border-radius: 999px;
  transition: width 0.3s ease;
}
.onboarding-vocab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.onboarding-level-bucket {
  background: var(--bg-soft, #1e293b);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.onboarding-bucket-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-muted);
  border-bottom: 1px dashed var(--border);
  padding-bottom: 0.35rem;
}
.onboarding-word-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}
.onboarding-word-card:hover {
  border-color: var(--brand, #0284c7);
  transform: translateY(-1px);
}
.onboarding-word-card.is-known {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.12) !important;
}
.onboarding-word-card.is-known .onboarding-word-check {
  color: #22c55e;
  font-weight: 800;
}
.onboarding-word-text {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text);
}
.onboarding-word-meaning {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-left: 0.35rem;
}
.onboarding-boundary-box {
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: 12px;
  padding: 1.15rem;
  margin-top: 0.5rem;
}
.onboarding-result-hero {
  text-align: center;
  padding: 1.5rem 1rem;
  background: linear-gradient(180deg, rgba(2, 132, 199, 0.15) 0%, rgba(15, 23, 42, 0) 100%);
  border-radius: 16px;
  border: 1px solid rgba(2, 132, 199, 0.35);
}
.onboarding-result-level-badge {
  display: inline-block;
  font-size: 2.4rem;
  font-weight: 900;
  color: #38bdf8;
  text-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
  margin: 0.4rem 0;
}

/* =====================================================================
   Sentence Drill & Pattern Transformation Modal Styles
   ===================================================================== */
.sentence-drill-sheet {
  width: min(800px, 95vw) !important;
  max-height: min(92vh, 840px);
  padding: 1.25rem 1.4rem;
  display: flex;
  flex-direction: column;
  animation: confirmSheetIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}
@media (max-width: 640px) {
  .sentence-drill-sheet {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94vh !important;
    padding: 1rem 0.9rem max(1rem, env(safe-area-inset-bottom)) !important;
    border-radius: 20px 20px 0 0 !important;
  }
}
.sentence-drill-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.85rem;
}
.drill-badge-icon {
  font-size: 1.5rem;
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(99, 102, 241, 0.12);
  border-radius: 12px;
  flex-shrink: 0;
}
.drill-progress-pill {
  display: inline-block;
  padding: 0.15rem 0.55rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--accent, #6366f1);
}
.drill-sentence-card {
  background: var(--bg-soft, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.1rem;
  margin-bottom: 1rem;
}
.drill-sentence-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
  flex-wrap: wrap;
}
.drill-idx-chip {
  font-size: 0.75rem;
  font-weight: 700;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 6px;
  color: var(--text-muted);
}
.drill-features-wrap {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.drill-feature-badge {
  font-size: 0.74rem;
  font-weight: 600;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-strong, #6366f1);
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.drill-de-text {
  font-size: 1.18rem;
  font-weight: 650;
  line-height: 1.45;
  color: var(--text);
}
.drill-zh-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.3rem;
  line-height: 1.4;
}
.drill-interactive-area {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 0.85rem;
  padding-right: 0.2rem;
}
.drill-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.1rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}
.drill-card-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.45rem;
}
.drill-card-title {
  font-size: 1.08rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text);
}
.drill-card-prompt {
  font-size: 0.93rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}
.drill-stem-display {
  font-size: 1.15rem;
  font-weight: 600;
  padding: 0.85rem 1.1rem;
  background: var(--bg-soft);
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  margin-bottom: 1rem;
  color: var(--text);
  line-height: 1.5;
}
.drill-input-field {
  width: 100%;
  box-sizing: border-box;
  padding: 0.75rem 0.95rem;
  font-size: 1.05rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  color: var(--text);
  outline: none;
  transition: all 0.15s ease;
}
.drill-input-field:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.18);
}
.drill-assembly-zone {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.85rem;
  border-radius: 8px;
  min-height: 52px;
  align-items: center;
  background: var(--bg-soft);
  border: 2px dashed var(--border);
  margin-bottom: 0.85rem;
  box-sizing: border-box;
}
.drill-assembly-zone.empty::before {
  content: "（點擊下方單字卡片，依語序填入此處）";
  color: var(--text-muted);
  font-size: 0.88rem;
  font-style: italic;
}
.drill-tiles-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.4rem 0;
}
.drill-tile {
  cursor: pointer;
  user-select: none;
  padding: 0.45rem 0.8rem;
  border-radius: 7px;
  font-size: 0.96rem;
  font-weight: 600;
  background: var(--card);
  border: 1.5px solid var(--border);
  color: var(--text);
  transition: all 0.15s ease;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.drill-tile:hover {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.06);
  transform: translateY(-1px);
}
.drill-tile.is-used {
  opacity: 0.35;
  pointer-events: none;
}
.drill-matching-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin-top: 0.5rem;
}
.drill-match-col {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.drill-match-card {
  cursor: pointer;
  user-select: none;
  padding: 0.65rem 0.85rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 0.94rem;
  font-weight: 600;
  transition: all 0.15s ease;
  text-align: center;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.drill-match-card:hover {
  border-color: #6366f1;
  background: var(--bg-soft);
}
.drill-match-card.is-selected {
  border-color: #6366f1 !important;
  background: rgba(99, 102, 241, 0.12) !important;
  color: #4f46e5 !important;
}
.drill-match-card.is-matched {
  border-color: #22c55e !important;
  background: rgba(34, 197, 94, 0.12) !important;
  color: #16a34a !important;
  cursor: default;
}
.drill-options-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.drill-option-card {
  cursor: pointer;
  user-select: none;
  padding: 0.75rem 0.95rem;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 0.96rem;
  font-weight: 550;
  transition: all 0.15s ease;
  color: var(--text);
}
.drill-option-card:hover {
  border-color: #6366f1;
  background: var(--bg-soft);
}
.drill-option-card.is-selected {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.12);
  color: #4f46e5;
  font-weight: 700;
}
.drill-feedback-card {
  border-radius: 8px;
  padding: 0.85rem 1.05rem;
  margin-top: 1rem;
  font-size: 0.92rem;
  line-height: 1.5;
}
.drill-feedback-card.is-correct {
  background: rgba(34, 197, 94, 0.12);
  border: 1.5px solid #22c55e;
  color: #15803d;
}
.drill-feedback-card.is-wrong {
  background: rgba(239, 68, 68, 0.12);
  border: 1.5px solid #ef4444;
  color: #b91c1c;
}
.drill-hint-box {
  background: rgba(234, 179, 8, 0.1);
  border: 1px solid rgba(234, 179, 8, 0.35);
  border-radius: 8px;
  padding: 0.7rem 0.9rem;
  margin-top: 0.75rem;
  font-size: 0.89rem;
  color: #a16207;
  line-height: 1.45;
}
.sentence-drill-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border);
  padding-top: 0.85rem;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.drill-stepper-dots {
  display: flex;
  gap: 0.35rem;
  align-items: center;
}
.drill-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.drill-dot.is-active {
  background: #6366f1;
  transform: scale(1.3);
}
.drill-dot.is-done {
  background: #22c55e;
}


