[data-mobile-video-header],
[data-mobile-video-navigation],
[data-mobile-learning-controls],
.subtitle-mobile-favorite-icon { display: none; }
.detail-player-settings-heading { position: sticky; top: -9px; z-index: 10; display: flex; align-items: center; gap: 4px; background: var(--bg-panel); }

.video-repeat-overlay { position: fixed; inset: 0; z-index: 1000; background: rgb(23 19 16 / 40%); }
.video-repeat-dialog {
  --repeat-accent: #d97706;
  --repeat-bg: #fff;
  --repeat-muted-bg: #f5f5f4;
  --repeat-text: #2a2018;
  --repeat-muted: #6c6c6c;
  position: fixed;
  z-index: 1001;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(354px, calc(100vw - 28px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px 18px 16px;
  border: 1px solid #e8e6e4;
  border-radius: 18px;
  background: var(--repeat-bg);
  color: var(--repeat-text);
  box-shadow: 0 16px 60px rgb(0 0 0 / 18%);
}
.video-repeat-dialog[data-theme='dark'] { --repeat-bg: #221e1b; --repeat-muted-bg: #332d28; --repeat-text: #f8f5f2; --repeat-muted: #c4bdb5; border-color: #645544; }
.video-repeat-title { margin: 0 0 18px; font-size: 15px; font-weight: 650; }
.video-repeat-close { position: absolute; top: 7px; right: 6px; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; color: var(--repeat-muted); }
.video-repeat-dialog fieldset { margin: 0 0 15px; min-width: 0; }
.video-repeat-dialog legend { margin-bottom: 7px; color: var(--repeat-muted); font-size: 12px; }
.video-repeat-options { display: flex; gap: 5px; }
.video-repeat-options button { flex: 1; min-width: 0; min-height: 36px; padding: 5px 0; border-radius: 10px; background: var(--repeat-muted-bg); color: var(--repeat-text); font-size: 12px; line-height: 1.3; }
.video-repeat-modes { padding: 4px; border-radius: 12px; background: var(--repeat-muted-bg); }
.video-repeat-modes button { min-height: 34px; }
.video-repeat-options button[aria-pressed='true'] { background: var(--repeat-accent); color: #fff; font-weight: 650; box-shadow: 0 2px 4px rgb(217 119 6 / 12%); }
.video-repeat-options button:disabled { opacity: .4; }
.video-repeat-dialog [id='video-repeat-description'] { margin: 0; color: var(--repeat-muted); font-size: 11px; line-height: 1.5; }
.video-repeat-dialog button:focus-visible { outline: 2px solid var(--repeat-accent); outline-offset: 2px; }

@media (max-width: 767px) {
  .video-detail-page[data-video-detail-page] {
    --video-learning-bottom-controls-height: calc(76px + env(safe-area-inset-bottom));
    height: 100vh;
    height: 100dvh;
  }
  .video-detail-page .video-detail-title,
  .video-detail-page .video-detail-back,
  .video-detail-page .video-detail-desktop-navigation,
  .video-detail-page [data-learning-control-bar] { display: none; }

  .video-detail-page [data-mobile-video-header] {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 54px;
    padding: 0 8px;
    gap: 6px;
    background: var(--bg-panel);
    border-bottom: 1px solid var(--border-subtle);
  }
  [data-mobile-video-header] h1 {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
  }
  [data-mobile-video-header] button {
    display: grid;
    place-items: center;
    width: 40px;
    height: 44px;
    flex-shrink: 0;
    color: var(--text-sub);
    border-radius: 12px;
  }
  [data-mobile-video-header] button[aria-pressed='true'] { color: var(--accent); background: var(--accent-subtle); }
  [data-mobile-video-header] svg { width: 20px; height: 20px; }

  .video-detail-page .detail-player[data-fullscreen='false'] .detail-player-controls {
    position: absolute;
    inset: auto 0 0;
    z-index: 35;
    border: 0;
    color: white;
    background: linear-gradient(transparent, rgb(0 0 0 / 48%));
    padding: 8px 8px 0;
  }
  .video-detail-page .detail-player[data-fullscreen='false'][data-playing='true'] .detail-player-controls { display: none; }
  .video-detail-page .detail-player[data-fullscreen='false'] .detail-player-seek-row { min-height: 36px; grid-template-columns: auto minmax(0, 1fr); gap: 8px; }
  .video-detail-page .detail-player[data-fullscreen='false'] .detail-player-time { color: white; font-size: 10px; }
  .video-detail-page .detail-player[data-fullscreen='false'] .detail-player-settings-anchor { position: absolute; inset: auto 0 32px; display: flex; justify-content: center; pointer-events: none; }
  .video-detail-page .detail-player[data-fullscreen='false'] button[aria-label='设置'] { pointer-events: auto; color: white; width: 88px; min-height: 44px; gap: 6px; padding: 0 12px; border: 1px solid rgb(255 255 255 / 25%); background: rgb(0 0 0 / 55%); border-radius: 22px; }
  .video-detail-page .detail-player[data-fullscreen='false'] button[aria-label='设置']:hover { background: rgb(0 0 0 / 55%); }
  .video-detail-page .detail-player[data-fullscreen='false'] button[aria-label='设置'] > span { display: inline; font-size: 12px; }
  .video-detail-page .detail-player[data-fullscreen='false'] [data-manual-play] { width: 48px; height: 48px; transform: translateY(-16px); }
  .video-detail-page .detail-player .detail-player-settings[data-fullscreen='false'] {
    pointer-events: auto;
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: min(360px, calc(100vw - 32px));
    max-height: min(520px, calc(100dvh - 2 * var(--video-learning-bottom-controls-height) - 16px));
    color: var(--text-main);
  }

  .video-detail-page [data-learning-mode-tabs] { padding: 0; background: var(--bg-panel); }
  .video-detail-page [data-learning-controls] { height: var(--video-learning-bottom-controls-height); flex: none; }
  .video-detail-page [data-mobile-video-navigation] {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    padding: 7px 11px;
    border-bottom: 1px solid var(--border-subtle);
  }
  [data-mobile-video-navigation] > * {
    display: flex;
    min-height: 35px;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: var(--text-sub);
    font-size: 14px;
    font-weight: 500;
  }
  [data-mobile-video-navigation] [aria-pressed='true'] { background: var(--accent); color: var(--on-accent); font-weight: 650; }

  .video-detail-page .subtitle-reading-list {
    padding: 15px 11px 16px;
    background: var(--bg-app);
    scroll-padding: 12px 0 16px;
  }
  .video-detail-page .subtitle-timeline-card {
    margin-bottom: 11px;
    padding: 6px 16px 15px;
    border: 1px solid var(--border-subtle);
    border-radius: 18px;
    background: var(--bg-panel);
    box-shadow: 0 2px 6px rgb(43 34 27 / 3%);
  }
  .video-detail-page[data-video-theme] .subtitle-timeline-card[data-active='true'] {
    background: linear-gradient(135deg, var(--bg-panel), var(--accent-subtle));
    border-color: color-mix(in srgb, var(--accent) 28%, var(--border-subtle));
    box-shadow: 0 3px 10px rgb(217 119 6 / 5%);
  }
  .video-detail-page .subtitle-card-heading { min-height: 38px; margin-bottom: 4px; gap: 4px; }
  .video-detail-page .subtitle-card-time {
    min-height: 28px;
    padding: 0 8px;
    border-radius: 9px;
    background: var(--bg-app);
    font-size: 11px;
    color: var(--text-sub);
  }
  .video-detail-page .theme-playing-label { min-height: 32px; gap: 5px; font-size: 11px; font-weight: 650; }
  .video-detail-page .theme-playing-label svg { width: 14px; height: 14px; }
  .video-detail-page [data-subtitle-card-visibility],
  .video-detail-page [data-subtitle-card-loop],
  .video-detail-page .subtitle-desktop-favorite-label { display: none; }
  .video-detail-page [data-subtitle-card-favorite] { width: 36px; height: 38px; margin-right: -10px; }
  .video-detail-page [data-subtitle-card-favorite][aria-pressed='true'] { color: var(--accent); }
  .video-detail-page .subtitle-mobile-favorite-icon { display: block; width: 16px; height: 16px; }
  .video-detail-page .subtitle-reading-english.user-text-english { font-size: max(16px, var(--user-reading-english, 16px)); font-weight: 650; line-height: 1.65; }
  .video-detail-page .subtitle-reading-chinese.user-text-chinese { margin-top: 10px; font-size: max(13px, var(--user-reading-chinese, 13px)); line-height: 1.65; opacity: .8; }
  .video-detail-page .subtitle-reading-english button.user-text-english { font-size: inherit; font-weight: inherit; line-height: inherit; border: 1px solid transparent; border-radius: 5px; padding: 0 2px; }
  .video-detail-page .subtitle-reading-english button.theme-active-word { color: var(--active-word-text); background: var(--active-word-bg); box-shadow: 0 1px 0 var(--active-word-border); border-color: var(--active-word-border); font-weight: 800; }

  .video-detail-page [data-mobile-learning-controls] {
    position: fixed;
    inset: auto 0 0;
    z-index: 60;
    display: grid;
    grid-template-columns: 1fr 1fr 1.15fr 1fr 1fr;
    align-items: center;
    height: calc(76px + env(safe-area-inset-bottom));
    padding: 4px 10px calc(4px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-panel);
    box-shadow: 0 -4px 18px rgb(43 34 27 / 3%);
  }
  [data-mobile-learning-controls] > button {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    min-height: 52px;
    gap: 4px;
    border-radius: 12px;
    color: var(--text-sub);
    font-size: 10px;
    line-height: 1.25;
    touch-action: manipulation;
  }
  [data-mobile-learning-controls] > button[aria-pressed='true'] { color: var(--accent); }
  [data-mobile-learning-controls] > button:disabled { opacity: .4; }
  [data-mobile-learning-controls] svg { width: 21px; height: 21px; }
  [data-mobile-learning-controls] .mobile-control-symbol { font-size: 18px; line-height: 23px; font-weight: 650; }
  .video-detail-page [data-mobile-learning-controls] .mobile-primary-play {
    width: 58px;
    height: 58px;
    min-height: 58px;
    justify-self: center;
    border-radius: 50%;
    color: var(--on-accent);
    background: var(--accent);
    box-shadow: 0 4px 10px rgb(217 119 6 / 22%);
  }
  [data-mobile-learning-controls] .mobile-primary-play svg { width: 25px; height: 25px; }
  .video-detail-page[data-video-theme] [data-subtitle-follow-recovery] { bottom: 12px; }
  [data-mobile-video-header] button:focus-visible,
  [data-mobile-video-navigation] > *:focus-visible,
  [data-mobile-learning-controls] button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
}

@media (max-width: 767px) and (max-height: 520px) {
  .video-detail-page .detail-player[data-fullscreen='false'] [data-manual-play] { transform: translate(-76px, -10px); }
}

