/* Keep the learning tree and mobile player geometry intact; scope discovery tokens to this page. */
.video-detail-page[data-video-theme='light'] {
  --bg-app:#f7f9f8; --bg-panel:#fff; --bg-card:#fff; --bg-card-hover:#f2f7f4;
  --border-subtle:#e2eae4; --border-focus:#bfd8c9; --text-main:#17291f; --text-sub:#62766a; --text-muted:#718378;
  --accent:#16835d; --accent-hover:#116d4c; --accent-subtle:#eaf5ee; --accent-border:#a6d6bc;
  --on-accent:#fff; --active-word-bg:#dbf0e3; --active-word-text:#125638; --active-word-border:#94c9ab;
  --background:150 14% 97%; --foreground:143 28% 13%; --card:0 0% 100%; --card-foreground:143 28% 13%;
  --primary:159 71% 30%; --primary-foreground:0 0% 100%; --muted:145 25% 95%; --muted-foreground:143 10% 44%;
  --secondary:145 25% 95%; --secondary-foreground:143 28% 20%; --border:140 15% 90%; --input:140 15% 90%; --ring:159 71% 30%;
  --accent-hsl:145 35% 94%; --accent-foreground:159 71% 25%;
  --video-learning-border:#e2eae4;
}
.video-detail-page[data-video-theme] { font-family:Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif; background:var(--bg-app); }
.video-detail-page > .video-detail-workspace { height:100%; }
.video-detail-page .video-detail-title { display:flex; flex:none; align-items:center; min-width:0; min-height:49px; margin:0; padding:10px 20px; border-bottom:1px solid var(--border-subtle); background:var(--bg-panel); color:var(--text-main); font-size:16px; line-height:24px; font-weight:650; overflow-wrap:anywhere; }
.video-detail-mobile-settings { display:none; }
.video-detail-mobile-dictation { display:none; }
.video-detail-back { position:absolute; top:max(12px,env(safe-area-inset-top)); left:max(12px,env(safe-area-inset-left)); z-index:30; display:grid; place-items:center; width:44px; height:44px; border:1px solid rgb(255 255 255 / 24%); border-radius:50%; background:rgb(0 0 0 / 40%); color:#fff; backdrop-filter:blur(8px); transition:background .15s; }
.video-detail-back:hover { background:rgb(0 0 0 / 65%); }
.video-detail-back:focus-visible { outline:2px solid var(--accent); outline-offset:3px; }
.video-detail-tools { display:flex; flex:none; flex-wrap:wrap; align-items:center; justify-content:flex-end; gap:4px 8px; min-height:48px; padding:2px 10px; border-bottom:1px solid var(--border-subtle); background:var(--bg-panel); }
.video-detail-follow-toggle { display:inline-flex; align-items:center; gap:6px; min-height:40px; padding:0 4px; color:var(--text-sub); font-size:12px; white-space:nowrap; cursor:pointer; }
/* Match the video page's green learning palette. */
.video-detail-page .video-dictation-entry { --entry-accent:#16835d; display:flex; flex:0 0 auto; width:240px; max-width:100%; margin-left:auto; }
.video-detail-page[data-video-theme='dark'] .video-dictation-entry { --entry-accent:#6ee7b7; }
.video-detail-page .video-dictation-entry>a { display:grid; grid-template-columns:38px minmax(0,1fr)26px; align-items:center; gap:10px; width:100%; min-height:74px; padding:13px 15px; border:1px solid color-mix(in srgb,var(--entry-accent) 25%,var(--border-subtle)); border-radius:12px; background:linear-gradient(110deg,color-mix(in srgb,var(--entry-accent) 5%,var(--bg-panel)),var(--bg-panel)); color:var(--text-main); box-shadow:0 2px 5px rgb(0 0 0 / 2%); text-decoration:none; transition:border-color .18s,box-shadow .18s,transform .18s; }
.video-detail-page .video-dictation-entry-icon { display:grid; place-items:center; width:38px; height:38px; border-radius:11px; background:color-mix(in srgb,var(--entry-accent) 11%,var(--bg-panel)); color:var(--entry-accent); }
.video-detail-page .video-dictation-entry-copy { display:flex; flex-direction:column; gap:5px; min-width:0; }
.video-detail-page .video-dictation-entry-copy strong { font-size:14px; line-height:1.4; font-weight:650; letter-spacing:.1px; }
.video-detail-page .video-dictation-entry-caption { font-size:11px; line-height:1.5; color:var(--text-sub); }
.video-detail-page .video-dictation-entry-arrow { display:grid; place-items:center; width:26px; height:26px; border:1px solid color-mix(in srgb,var(--entry-accent) 20%,var(--bg-panel)); border-radius:50%; background:var(--bg-panel); color:var(--entry-accent); transition:background .18s,color .18s,transform .18s; }
.video-detail-page .video-dictation-entry>a:hover { border-color:color-mix(in srgb,var(--entry-accent) 55%,var(--border-subtle)); box-shadow:0 5px 14px rgb(0 0 0 / 5%); transform:translateY(-1px); }
.video-detail-page .video-dictation-entry>a:hover .video-dictation-entry-arrow { background:var(--entry-accent); color:var(--bg-panel); transform:translateX(2px); }
.video-detail-page .video-dictation-entry>a:focus-visible { outline:2px solid var(--entry-accent); outline-offset:3px; }
.video-detail-page .video-dictation-entry[data-completed] .video-dictation-entry-caption { color:var(--entry-accent); }
@media (max-width:1100px) and (min-width:768px) { .video-detail-page .video-dictation-entry { width:220px; } }
@media (max-width:767px) { .video-detail-page .video-dictation-entry { width:100%; } .video-detail-page .video-dictation-entry>a { min-height:70px; } }
@media (prefers-reduced-motion:reduce) { .video-detail-page .video-dictation-entry>a, .video-detail-page .video-dictation-entry-arrow { transition:none; } .video-detail-page .video-dictation-entry>a:hover, .video-detail-page .video-dictation-entry>a:hover .video-dictation-entry-arrow { transform:none; } }
.video-detail-tools .video-dictation-entry[data-compact] { width:auto; margin-left:0; }
.video-detail-tools .video-dictation-entry[data-compact]>a { display:flex; gap:7px; min-height:38px; padding:6px 10px; border-radius:8px; white-space:nowrap; }
.video-detail-tools .video-dictation-entry[data-compact] .video-dictation-entry-icon { width:22px; height:22px; background:transparent; }
.video-detail-tools .video-dictation-entry[data-compact] .video-dictation-entry-icon svg { width:17px; height:17px; }
.video-detail-tools .video-dictation-entry[data-compact] strong { color:var(--entry-accent); font-size:12px; }
.video-detail-tools .video-dictation-entry[data-compact] .video-dictation-entry-arrow { display:none; }
.video-detail-page .video-detail-tools > button,
.video-detail-page .video-detail-follow-toggle,
.video-detail-page .video-detail-tools .video-dictation-entry[data-compact]>a { display:inline-flex; align-items:center; justify-content:center; gap:6px; height:36px; min-height:36px; padding:0 10px; border:1px solid var(--border-subtle); border-radius:8px; background:var(--bg-panel); color:var(--text-sub); box-shadow:none; transition:background-color .15s,border-color .15s,color .15s; }
.video-detail-page .video-detail-tools > .theme-icon-button { width:36px; min-width:36px; padding:0; }
.video-detail-page .video-detail-tools > button:hover,
.video-detail-page .video-detail-follow-toggle:hover,
.video-detail-page .video-detail-tools .video-dictation-entry[data-compact]>a:hover { border-color:var(--accent-border); background:var(--accent-subtle); color:var(--accent); transform:none; }
.video-detail-page .video-detail-follow-toggle:focus-within { outline:2px solid var(--accent); outline-offset:2px; }
.video-detail-page .practice-mode-tabs { padding:0 12px; background:var(--bg-panel); border-color:var(--border-subtle); }
.video-detail-page .theme-mode-tab { font-size:13px; }
.video-detail-page .theme-mode-tab[data-active='true'] { color:var(--accent); background:var(--accent-subtle); border-radius:8px 8px 0 0; }
.video-detail-page .theme-mode-tab[data-active='true']::after { left:30%; right:30%; height:3px; }
.video-detail-page .subtitle-timeline-card,
.video-detail-page .practice-sentence-card,
.video-detail-page .shadowing-recording-card,
.video-detail-page .study-book-card { box-shadow:none; border-radius:12px; }
.video-detail-page[data-video-theme='light'] .subtitle-timeline-card.is-playing { background:#f0f8f3; box-shadow:inset 3px 0 0 var(--accent); border-color:#a6d6bc; }
.video-detail-page .subtitle-timeline-card { margin-bottom:8px; }
.video-detail-page .current-subtitle-panel { position:relative; padding:6px 20px; border-top:1px solid var(--border-subtle); background:var(--bg-panel); }
.current-subtitle-heading { display:flex; flex:none; align-items:center; justify-content:space-between; gap:8px; margin-bottom:2px; }
.current-subtitle-pages { display:flex; align-items:center; gap:3px; min-width:0; color:var(--text-sub); font-size:11px; white-space:nowrap; }
.current-subtitle-pages > button { display:inline-flex; align-items:center; justify-content:center; min-width:26px; height:26px; padding:0 4px; border-radius:5px; }
.current-subtitle-pages > button:hover:not(:disabled) { background:var(--accent-subtle); color:var(--accent); }
.current-subtitle-pages > button:disabled { opacity:.3; }
.current-subtitle-pages > button:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.video-detail-page .current-subtitle-pages .current-subtitle-resume { margin-left:4px; font-size:11px; color:var(--accent); }
.current-subtitle-reading { display:flex; flex:1 1 0%; flex-direction:column; justify-content:center; gap:6px; min-height:0; min-width:0; margin-bottom:24px; overflow:hidden; }
.current-subtitle-english-area { display:flex; flex:0 1 auto; align-items:center; justify-content:center; min-width:0; min-height:0; padding-block:2px; }
.video-detail-page .current-subtitle-panel .current-subtitle-english { width:100%; margin:0; color:var(--text-main); font-size:max(26px,calc(var(--user-reading-english,18px) * 1.55)); line-height:1.4; overflow-wrap:anywhere; text-align:center; }
.video-detail-page .current-subtitle-english .current-subtitle-word { display:inline-block; max-width:100%; padding:1px 1px; border:1px solid transparent; border-radius:6px; font:inherit; color:inherit; text-align:left; vertical-align:baseline; transition:background-color .15s,color .15s; }
.video-detail-page .current-subtitle-english .current-subtitle-word[data-word-state='current'] { padding-inline:3px; border-color:var(--active-word-border); background:var(--active-word-bg); color:var(--active-word-text); font-size:1.18em; font-weight:750; line-height:1.2; box-shadow:0 2px 0 color-mix(in srgb,var(--accent) 18%,transparent); }
.video-detail-page .current-subtitle-english .current-subtitle-word:hover { background:var(--accent-subtle); color:var(--accent); }
.video-detail-page .current-subtitle-english .current-subtitle-word:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.current-subtitle-translation { display:flex; flex:none; align-items:center; justify-content:center; gap:6px; width:100%; min-width:0; height:26px; padding:0; border:0; border-radius:4px; background:transparent; color:var(--text-sub); }
.current-subtitle-translation:hover { color:var(--accent); background:var(--accent-subtle); }
.current-subtitle-translation:focus-visible { outline:2px solid var(--accent); outline-offset:1px; }
.current-subtitle-translation > svg, .current-subtitle-translation-label { flex:none; }
.current-subtitle-translation-label { font-size:10px; color:var(--text-muted); }
.video-detail-page .current-subtitle-panel .current-subtitle-chinese { display:block; flex:0 1 auto; min-width:0; margin:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:inherit; font-size:max(17px,calc(var(--user-reading-chinese,14px) * 1.1)); line-height:24px; text-align:center; }
.current-subtitle-translation-popup { width:min(600px,calc(100vw - 32px)); max-height:min(50dvh,320px); overflow:auto; }
.current-subtitle-empty { margin:0; padding:16px 0; color:var(--text-muted); font-size:14px; line-height:1.8; text-align:center; }
.current-subtitle-reveal { width:100%; min-height:64px; padding:12px; border:1px dashed var(--border-focus); border-radius:10px; color:var(--text-sub); font-size:14px; }
.current-subtitle-reveal:hover { background:var(--accent-subtle); }
.current-subtitle-reveal:focus-visible { outline:2px solid var(--accent); outline-offset:2px; }
.video-detail-page [data-learning-control-bar] { border-color:var(--border-subtle); }
@media(min-width:768px) {
  .video-detail-page .video-detail-workspace { display:grid; grid-template-columns:58% minmax(0,1fr); grid-template-rows:auto minmax(0,1fr); grid-template-areas:'title tools' 'player learning'; width:100%; max-width:none; margin:0; padding:0; gap:0; }
  .video-detail-page .video-detail-title { grid-area:title; border-right:1px solid var(--border-subtle); }
  .video-detail-page .video-detail-tools { grid-area:tools; min-width:0; }
  .video-detail-page .video-detail-player { grid-area:player; display:flex; flex-direction:column; width:100%; min-width:0; height:100%; border:0; border-right:1px solid var(--border-subtle); border-radius:0; overflow:hidden; align-self:stretch; max-height:100%; background:var(--bg-panel); }
  .video-detail-page .video-detail-player > .video-detail-media:first-child { flex:1 1 0%; min-height:120px; }
  .video-detail-page .video-detail-media > div, .video-detail-page .video-detail-media > div > div { height:100%; min-height:0; }
  .video-detail-page .video-detail-media [data-detail-player][data-fullscreen='false'] { display:flex; flex-direction:column; height:100%; min-height:0; }
  .video-detail-page .video-detail-media [data-detail-player][data-fullscreen='false'] > [data-video-player-stage] { display:flex; flex:1 1 0%; align-items:center; justify-content:center; min-height:0; height:auto; overflow:hidden; container-type:size; background:var(--bg-panel); }
  .video-detail-page .video-detail-media [data-detail-player][data-fullscreen='false'] [data-video-player-stage] > [data-video-player-frame] { flex:none; width:100%; height:100%; min-height:0; aspect-ratio:auto !important; }
  .video-detail-page .video-detail-media [data-detail-player][data-fullscreen='false'] [data-video-player-frame] > video,
  .video-detail-page .video-detail-media [data-detail-player][data-fullscreen='false'] [data-video-layer-placeholder] > img { object-fit:cover; }
  .video-detail-page [data-detail-player-controls] { flex:none; }
  .video-detail-page .current-subtitle-panel { display:flex; flex:0 0 200px; flex-direction:column; height:200px; min-height:0; overflow:visible; }
  .video-detail-page .current-subtitle-panel > .subtitle-inline-definition { position:absolute; z-index:70; bottom:calc(100% + 8px); left:16px; right:16px; margin:0; max-height:min(40dvh,280px); overflow:auto; scrollbar-width:thin; }
  .video-detail-page .video-detail-learning-panel { grid-area:learning; width:auto; border:0; border-radius:0; overflow:hidden; background:var(--bg-panel); }
  .video-detail-page [data-video-player-frame] { border-radius:0; }
  .video-detail-page [data-learning-scroll-region] { padding:14px; }
}
@media(max-width:1100px) and (min-width:768px) {
  .video-detail-page .video-detail-workspace { grid-template-columns:52% minmax(0,1fr); }
}
@media(max-width:767px) {
  .video-detail-page .video-detail-tools { display:none; }
  .video-detail-page .video-detail-title { padding-inline:16px; }
  .video-detail-mobile-settings { display:block; padding:4px 0 10px; border-top:1px solid var(--border-subtle); }
  .video-detail-mobile-settings-heading { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:4px; color:var(--text-sub); font-size:12px; }
  .video-detail-page .video-detail-settings-row { display:flex; align-items:center; justify-content:space-between; gap:12px; min-height:54px; padding:6px 2px; font-size:14px; color:var(--text-main); cursor:pointer; }
  .video-detail-settings-row small { display:block; margin-top:2px; color:var(--text-muted); font-size:11px; line-height:16px; }
  .video-detail-mobile-dictation { display:block; flex:none; padding:10px 12px; border-bottom:1px solid var(--border-subtle); background:var(--bg-panel); }
  .video-detail-page .video-detail-mobile-dictation .video-dictation-entry>a { grid-template-columns:32px minmax(0,1fr)24px; min-height:54px; padding:8px 12px; gap:9px; }
  .video-detail-page .video-detail-mobile-dictation .video-dictation-entry-icon { width:32px; height:32px; border-radius:9px; }
  .video-detail-page .video-detail-mobile-dictation p { margin:7px 0 0; color:var(--text-sub); font-size:11px; line-height:17px; }
  .video-detail-page .video-detail-workspace { gap:0; padding:0; }
  .video-detail-page .video-detail-learning-panel { background:var(--bg-app); }
  .video-detail-page .practice-mode-tabs { padding:0 8px; }
  .video-detail-page [data-learning-scroll-region] { padding-top:12px; padding-inline:12px; }
  .video-detail-page .subtitle-timeline-card { margin-bottom:9px; }
  .video-detail-page [data-learning-control-bar], .video-detail-page [data-practice-action-bar] { box-shadow:0 -4px 18px rgb(23 75 57 / 5%); }
}
