/* ════════════════════════════════════════════════
   player-ui.css — 自绘视频控制栏样式
   z-index 约束：
     - 触摸层 5、缺失提示 7、悬浮字幕 10、引导 20
     - 控制栏 25（本文件）
     - selection 全局菜单 2400+、dict-panel 2700（始终覆盖控制栏）
════════════════════════════════════════════════ */

.video-wrapper {
  --lp-controls-h: 0px;
}

.lp-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px;
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  box-sizing: border-box;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  pointer-events: none;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 200ms ease, transform 200ms ease;
}

.lp-controls.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.lp-ctrl-btn {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border-radius: 6px;
}

/* ⚠ 上面的 display:flex 会覆盖 [hidden] 的 UA 默认 display:none，
   不显式复位则 JS 里的 btn.hidden = true 完全无效（按钮照常显示）*/
.lp-ctrl-btn[hidden] {
  display: none;
}

.lp-ctrl-btn:active {
  background: rgba(255, 255, 255, 0.15);
}

.lp-icon {
  display: inline-block;
  font-style: normal;
  line-height: 1;
}

.lp-icon-play::before { content: '▶'; }
.lp-icon-pause::before { content: '⏸'; }

.lp-time {
  flex: 0 0 auto;
  color: #fff;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  user-select: none;
  -webkit-user-select: none;
}

.lp-progress {
  flex: 1 1 auto;
  height: 44px;                   /* 触摸热区 44px */
  display: flex;
  align-items: center;
  cursor: pointer;
  position: relative;
  touch-action: none;             /* 防止移动端原生手势抢占 */
  outline: none;
}

.lp-progress-track {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  pointer-events: none;
}

.lp-progress-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 4px;
  margin-top: -2px;
  background: var(--blue, #007aff);
  border-radius: 2px;
  width: 0%;
  pointer-events: none;
}

.lp-progress-thumb {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  margin-left: -7px;
  background: #fff;
  border-radius: 50%;
  left: 0%;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.4);
}

.lp-rate-label {
  font-size: 13px;
  color: #fff;
  font-weight: 600;
}

/* ────────────────────────────────────────────────
   悬浮字幕容器：随控制栏高度（--lp-controls-h）动态抬升底部偏移
   原 inline `bottom: 0` 已迁为本 class（HTML 中的两处 .video-wrapper 子 div）
──────────────────────────────────────────────── */
.lp-floating-subtitle-host {
  position: absolute;
  left: 0;
  width: 100%;
  text-align: center;
  pointer-events: none;
  z-index: 10;
  padding: 0 16px;
  box-sizing: border-box;
  bottom: var(--lp-controls-h, 0px);
  transition: bottom 200ms ease;
}
