.coach-dock {
  position: absolute;
  left: 10px;
  right: 10px;
  z-index: 12;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px 8px;
  border-radius: 16px;
  background: rgba(8, 12, 20, 0.82);
  color: #f8fafc;
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  pointer-events: auto;
}

.player > .coach-dock { bottom: 48px; }
.video-wrapper > .coach-dock { bottom: 8px; }

/* Mobile chrome under sticky player:
   1 row: 1x + 英文/双语（带教入口隐藏；上一句/下一句在 Hold 上方） */
body.video-reader-mobile-focus .coach-dock,
body.video-reader-mobile-focus .video-player-area > .coach-dock,
.coach-dock[data-host="mobile"] {
  position: relative !important;
  left: auto !important;
  right: auto !important;
  top: auto !important;
  bottom: auto !important;
  inset: auto !important;
  z-index: 1 !important;
  display: flex !important;
  flex: 0 0 auto !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 4px !important;
  width: 100% !important;
  max-width: none !important;
  max-height: none !important;
  height: auto !important;
  margin: 4px 0 0 !important;
  overflow: visible !important;
  padding: 2px 10px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  color: #0f172a !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  pointer-events: auto !important;
  transform: none !important;
}

body.video-reader-mobile-focus .video-wrapper > .coach-dock {
  display: none !important;
}

body.video-reader-mobile-focus .coach-dock .coach-rows,
body.video-reader-mobile-focus .coach-dock .coach-panel,
.coach-dock[data-host="mobile"] .coach-rows,
.coach-dock[data-host="mobile"] .coach-panel {
  display: none !important;
}

body.video-reader-mobile-focus .coach-dock .coach-chrome,
.coach-dock[data-host="mobile"] .coach-chrome {
  position: relative;
  display: flex !important;
  flex: 0 0 auto;
  /* 单行：左侧倍数 · 右侧英文/双语 */
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-width: 0;
  overflow: visible !important;
  z-index: 6;
  box-sizing: border-box;
}

body.video-reader-mobile-focus .coach-dock .coach-chrome > .mobile-speed-controls,
.coach-dock[data-host="mobile"] .coach-chrome > .mobile-speed-controls {
  flex: 0 0 auto;
  order: 0;
  margin-right: auto;
}

/* 带教已下线：coach-bar / 带教按钮永不显示（勿再用 display:flex 顶掉 hidden） */
body.video-reader-mobile-focus .coach-dock .coach-bar,
body.video-reader-mobile-focus .coach-dock .coach-toggle,
.coach-dock[data-host="mobile"] .coach-bar,
.coach-dock[data-host="mobile"] .coach-toggle,
body.video-reader-mobile-focus .coach-dock .coach-bar[hidden],
.coach-dock[data-host="mobile"] .coach-bar[hidden] {
  display: none !important;
  width: 0 !important;
  min-width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  visibility: hidden !important;
}

/* Speed dropdown replaces the old 带教 pill: tap trigger → pick rate. */
body.video-reader-mobile-focus .coach-dock .coach-speed-dropdown,
.coach-dock[data-host="mobile"] .coach-speed-dropdown,
body.video-reader-mobile-focus .coach-dock .mobile-speed-controls.coach-speed-dropdown,
body.video-reader-mobile-focus .mobile-view-toggle > .mobile-speed-controls {
  position: relative;
  display: flex !important;
  flex: 0 0 auto;
  align-items: stretch;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body.video-reader-mobile-focus .coach-dock .mobile-speed-trigger,
.coach-dock[data-host="mobile"] .mobile-speed-trigger,
body.video-reader-mobile-focus .mobile-view-toggle .mobile-speed-trigger {
  flex: 0 0 auto;
  min-width: 36px;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 999px;
  color: #0f766e;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

body.video-reader-mobile-focus .coach-dock .mobile-speed-trigger[aria-expanded="true"],
.coach-dock[data-host="mobile"] .mobile-speed-trigger[aria-expanded="true"],
body.video-reader-mobile-focus .mobile-view-toggle .mobile-speed-trigger[aria-expanded="true"] {
  color: #0f766e;
  background: rgba(15, 118, 110, 0.1);
}

body.video-reader-mobile-focus .coach-dock .mobile-speed-menu,
.coach-dock[data-host="mobile"] .mobile-speed-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 40;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4px;
  min-width: 112px;
  padding: 6px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

body.video-reader-mobile-focus .coach-dock .mobile-speed-menu[hidden],
.coach-dock[data-host="mobile"] .mobile-speed-menu[hidden] {
  display: none !important;
}

body.video-reader-mobile-focus .coach-dock .mobile-speed-menu .mobile-speed-btn,
.coach-dock[data-host="mobile"] .mobile-speed-menu .mobile-speed-btn {
  min-width: 0;
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #0f172a;
  background: #f8fafc;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
  white-space: nowrap;
}

body.video-reader-mobile-focus .coach-dock .mobile-speed-menu .mobile-speed-btn.active,
.coach-dock[data-host="mobile"] .mobile-speed-menu .mobile-speed-btn.active {
  color: #ffffff;
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
}

body.video-reader-mobile-focus.mobile-speed-menu-open .coach-dock,
body.video-reader-mobile-focus.mobile-speed-menu-open .video-player-area > .coach-dock {
  z-index: 60 !important;
  overflow: visible !important;
}

body.video-reader-mobile-focus .coach-dock .coach-status,
.coach-dock[data-host="mobile"] .coach-status {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  padding: 0 !important;
  margin: -1px !important;
}

/* 带教功能已取消：隐藏入口与带教面板 */
body.video-reader-mobile-focus .coach-dock .coach-bar,
body.video-reader-mobile-focus .coach-dock .coach-toggle,
body.video-reader-mobile-focus .coach-dock .coach-panel,
body.video-reader-mobile-focus .coach-dock .coach-actions,
body.video-reader-mobile-focus .coach-dock .coach-rows,
.coach-dock[data-host="mobile"] .coach-bar,
.coach-dock[data-host="mobile"] .coach-toggle,
.coach-dock[data-host="mobile"] .coach-panel,
.coach-dock[data-host="mobile"] .coach-actions,
.coach-dock[data-host="mobile"] .coach-rows {
  display: none !important;
}

/* 顶栏里若仍残留上一句/下一句，强制隐藏（句子导航已挪到 Hold 上方） */
body.video-reader-mobile-focus .mobile-view-toggle > [data-mode="prev"],
body.video-reader-mobile-focus .mobile-view-toggle > [data-mode="next"],
.coach-dock[data-host="mobile"] .mobile-view-toggle > [data-mode="prev"],
.coach-dock[data-host="mobile"] .mobile-view-toggle > [data-mode="next"] {
  display: none !important;
}

body.video-reader-mobile-focus .coach-dock .coach-actions,
.coach-dock[data-host="mobile"] .coach-actions {
  display: none !important;
}

body.video-reader-mobile-focus .coach-dock[data-open="true"] .coach-actions:not([hidden]),
.coach-dock[data-host="mobile"][data-open="true"] .coach-actions:not([hidden]) {
  display: grid !important;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  min-width: 0;
  order: -1;
  overflow: visible !important;
  padding: 0;
}

body.video-reader-mobile-focus .coach-dock .coach-chrome .mobile-view-toggle,
.coach-dock[data-host="mobile"] .coach-chrome .mobile-view-toggle,
body.video-reader-mobile-focus .coach-dock > .mobile-view-toggle,
body.video-reader-mobile-focus .mobile-transcript-view > .mobile-view-toggle {
  display: flex !important;
  flex: 0 0 auto;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
  overflow: visible;
}

body.video-reader-mobile-focus .mobile-view-toggle > .mobile-speed-controls,
.coach-dock[data-host="mobile"] .mobile-view-toggle > .mobile-speed-controls {
  display: none !important;
}

body.video-reader-mobile-focus .mobile-view-toggle > .mobile-view-btn,
.coach-dock[data-host="mobile"] .mobile-view-toggle > .mobile-view-btn {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  max-width: none;
  min-height: 36px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

@media (max-width: 360px) {
  body.video-reader-mobile-focus .mobile-view-toggle > .mobile-view-btn,
  .coach-dock[data-host="mobile"] .mobile-view-toggle > .mobile-view-btn {
    padding: 0 8px;
    font-size: 12px;
  }
}

body.video-reader-mobile-focus .coach-action,
.coach-dock[data-host="mobile"] .coach-action {
  flex: none !important;
  width: 100%;
  min-width: 0;
  min-height: 36px;
  padding: 6px 4px;
  border-color: #e2e8f0;
  border-radius: 999px;
  background: #f8fafc;
  color: #0f172a;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.video-reader-mobile-focus .coach-action.is-on,
.coach-dock[data-host="mobile"] .coach-action.is-on {
  border-color: transparent;
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: #ffffff;
}

body.video-reader-mobile-focus .study-pop,
body.video-reader-mobile-focus .study-modal {
  left: 10px !important;
  right: 10px !important;
  top: auto !important;
  bottom: calc(12px + env(safe-area-inset-bottom)) !important;
  width: auto !important;
  max-height: min(38vh, 320px);
  transform: none !important;
  overflow: auto;
}

body.video-reader-mobile-focus .study-backdrop {
  background: transparent;
}

.coach-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* Desktop caption: no permanent 带教 tip bar / status — tools appear only after clicking a line. */
.coach-dock[data-host="desktop"] .coach-bar,
.caption-bar .coach-dock .coach-bar,
.coach-dock[data-host="desktop"] .coach-chrome,
.caption-bar .coach-dock .coach-chrome,
.coach-dock[data-host="desktop"] .coach-actions,
.caption-bar .coach-dock .coach-actions {
  display: none !important;
}

/* Desktop lyric window: taller stage + larger current line. */
.coach-dock[data-host="desktop"] .coach-rows,
.caption-bar .coach-dock[data-host="desktop"] .coach-rows {
  gap: 10px;
  min-height: 132px;
  align-content: center;
}

.coach-dock[data-host="desktop"] .coach-row.is-depth-1,
.caption-bar .coach-dock[data-host="desktop"] .coach-row.is-depth-1 {
  font-size: clamp(15px, 1.5vw, 18px);
  line-height: 1.4;
}

.coach-dock[data-host="desktop"] .coach-row.is-depth-0,
.coach-dock[data-host="desktop"] .coach-row.is-current.is-depth-0,
.caption-bar .coach-dock[data-host="desktop"] .coach-row.is-depth-0,
.caption-bar .coach-dock[data-host="desktop"] .coach-row.is-current.is-depth-0 {
  font-size: clamp(22px, 2.6vw, 32px);
  font-weight: 800;
  line-height: 1.45;
}

.coach-toggle,
.coach-action,
.coach-panel button,
.coach-word {
  font: inherit;
  cursor: pointer;
}

.coach-toggle {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 5px 12px;
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.coach-dock[data-open="true"] .coach-toggle {
  background: #f0fdfa;
  color: #0f766e;
}

.coach-status {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(248, 250, 252, 0.78);
  font-size: 12px;
}

.coach-rows[hidden],
.coach-actions[hidden],
.coach-panel[hidden] {
  display: none !important;
}

.coach-rows {
  display: grid;
  grid-template-rows: repeat(7, minmax(0, auto));
  gap: 4px;
  overflow: visible;
  justify-items: center;
  align-items: center;
}

.coach-dock[data-roll="forward"] .coach-rows,
.coach-dock[data-roll="back"] .coach-rows {
  animation: coach-roll 280ms ease;
}

@keyframes coach-roll {
  from { transform: translateY(28%); opacity: 0.55; }
  to { transform: translateY(0); opacity: 1; }
}

.coach-row {
  margin: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: rgba(248, 250, 252, 0.62);
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
}

.coach-dock[data-open="true"] .coach-row:hover {
  color: rgba(248, 250, 252, 0.88);
}

.coach-row.is-current {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  white-space: normal;
  line-height: 1.45;
}

/* Fisheye: edges small → center large (both above and below). */
.coach-row.is-depth-3 {
  font-size: 11px;
  line-height: 1.25;
  opacity: 0.42;
  max-width: 68%;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.coach-row.is-depth-2 {
  font-size: 12.5px;
  line-height: 1.3;
  opacity: 0.58;
  max-width: 80%;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.coach-row.is-depth-1 {
  font-size: 14px;
  line-height: 1.35;
  opacity: 0.78;
  max-width: 90%;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.coach-row.is-depth-0,
.coach-row.is-current.is-depth-0 {
  font-size: clamp(17px, 1.7vw, 22px);
  font-weight: 800;
  line-height: 1.5;
  opacity: 1;
  max-width: 100%;
  white-space: normal;
}

.coach-row.is-tools-open {
  color: #ecfdf5;
}

.coach-row.is-marked { text-decoration: underline; text-decoration-color: #2dd4bf; text-underline-offset: 3px; }

.coach-word {
  border: 0;
  padding: 0 1px;
  background: transparent;
  color: inherit;
  border-radius: 4px;
}

.coach-word.is-marked { box-shadow: inset 0 -2px 0 #2dd4bf; }
.coach-word.is-selected { background: rgba(45, 212, 191, 0.28); }

.coach-actions {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.coach-action {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.coach-action.is-on,
.coach-action:hover { background: rgba(45, 212, 191, 0.22); color: #ecfdf5; }

.coach-panel {
  max-height: 34%;
  overflow: auto;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.55;
}

/* Desktop caption: word card under the focused line */
.coach-dock[data-host="desktop"] .coach-panel,
.caption-bar .coach-dock .coach-panel {
  max-height: none;
  margin: 6px 0 0;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  font-size: 14px;
}

.coach-panel[hidden] { display: none; }
.coach-panel p { margin: 0 0 6px; white-space: pre-wrap; }
.coach-panel textarea {
  width: 100%;
  min-height: 68px;
  box-sizing: border-box;
  border: 0;
  border-radius: 8px;
  padding: 8px;
  resize: vertical;
  font: inherit;
}
.coach-panel button,
.coach-panel a {
  display: inline-flex;
  margin-top: 6px;
  margin-right: 8px;
  border-radius: 999px;
  padding: 4px 10px;
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}
.coach-panel button { border: 0; }

.coach-phon { color: #5eead4; }

.transcript .seg.is-tools-open {
  box-shadow: inset 0 0 0 1px rgba(13, 148, 136, 0.28);
}

.seg-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
}

.seg-tool,
.study-tabs button,
.study-add,
.study-x {
  font: inherit;
  cursor: pointer;
}

.seg-tool {
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 650;
  padding: 0 2px;
}

.seg-tool:hover { color: #0f766e; }

.transcript .seg.is-lined .text {
  text-decoration: underline;
  text-decoration-color: #0f766e;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

#coach-study:empty { display: none; }

#coach-study {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.study-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.28);
  pointer-events: auto;
  cursor: pointer;
}

.study-pop,
.study-modal {
  pointer-events: auto;
  box-sizing: border-box;
  background: #fff;
  color: #0f172a;
  border: 1px solid #e7e9ef;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

.study-pop {
  position: fixed;
  overflow: auto;
  border-radius: 18px;
  padding: 14px 14px 12px;
}

.seg-note,
#caption-note {
  display: block;
  width: 100%;
  margin: 0.55rem 0 0;
  padding: 0.45rem 0.7rem;
  border: 0;
  border-radius: 12px;
  background: #f0fdfa;
  color: #0f766e;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 650;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
}

.seg-note::before,
#caption-note::before {
  content: '笔记  ';
  font-weight: 800;
}

#caption-note {
  grid-column: 1 / -1;
  margin: 8px 0 0;
}

.study-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(440px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  padding: 16px 16px 18px;
}

.study-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.study-head strong {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 16px;
  font-weight: 750;
}

.study-head .study-save { margin-top: 0; flex: 0 0 auto; }

.study-x {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #64748b;
  font-size: 20px;
  line-height: 1;
}

.study-sentence {
  margin: 0 0 8px;
  color: #0f766e;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.5;
}

.study-save {
  display: inline-flex;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.study-note textarea {
  width: 100%;
  min-height: 96px;
  box-sizing: border-box;
  border: 1px solid #e7e9ef;
  border-radius: 14px;
  padding: 10px 12px;
  resize: vertical;
  font: inherit;
  color: #0f172a;
  background: #f8fafc;
}

.study-hint,
.study-label {
  margin: 8px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

.study-copy {
  margin: 4px 0 0;
  color: #0f172a;
  font-size: 15px;
  line-height: 1.65;
}

.study-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 12px;
  padding: 4px;
  border-radius: 999px;
  background: #f8fafc;
}

.study-tabs button {
  border: 0;
  border-radius: 999px;
  padding: 8px 6px;
  background: transparent;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.study-tabs button.is-on {
  background: linear-gradient(135deg, #0d9488, #2dd4bf);
  color: #fff;
}

.study-body { overflow: auto; min-height: 0; }

.study-block,
.study-word {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid #e7e9ef;
  border-radius: 16px;
  background: #f0fdfa;
}

.study-badge {
  display: inline-flex;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #ccfbf1;
  color: #0f766e;
  font-size: 12px;
  font-weight: 750;
}

.study-trunk {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  line-height: 1.45;
}

.study-parts,
.study-points {
  margin: 0;
  padding-left: 1.1rem;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.6;
}

.study-word { background: #fff; }
.study-word-name { margin: 0; font-size: 18px; font-weight: 750; }

.study-add {
  margin-top: 8px;
  border: 1px solid #99f6e4;
  border-radius: 999px;
  padding: 6px 12px;
  background: #f0fdfa;
  color: #0f766e;
  font-size: 13px;
  font-weight: 750;
}

.study-add:disabled { opacity: 0.7; cursor: default; }
