/* ===== 搜剧AI 播放器：自定义控制栏 / 缓冲 / 状态 / 错误重试 ===== */
.player-box {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  overflow: hidden;
  border-radius: 10px;
  user-select: none;
}
.player-box.is-fullscreen {
  border-radius: 0;
  aspect-ratio: auto;
  height: 100%;
}
.player-box video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

/* 第三方播放器嵌入（如巨量播放器 jlplayer 播放页） */
.player-box.is-embed {
  background: #000;
}
.player-embed {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
  background: #000;
}
.player-box.is-fullscreen .player-embed {
  height: 100%;
}

/* 中央缓冲 / 加载态 */
.player-center-state {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  pointer-events: none;
  color: #fff;
  z-index: 6;
}
.player-spinner {
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-top-color: #3dd6a0;
  border-radius: 50%;
  animation: ps-spin 0.9s linear infinite;
}
.player-state-text { font-size: 13px; opacity: 0.9; text-shadow: 0 1px 3px rgba(0,0,0,.6); }
@keyframes ps-spin { to { transform: rotate(360deg); } }

/* 错误重试 */
.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.72);
  z-index: 9;
}
.player-error[hidden] { display: none; }
.pe-card {
  text-align: center;
  color: #fff;
  padding: 24px 28px;
  background: rgba(20, 22, 28, 0.9);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  max-width: 80%;
}
.pe-icon { font-size: 34px; margin-bottom: 8px; }
.pe-msg { font-size: 14px; margin: 0 0 16px; opacity: .92; }
.pe-retry {
  border: none;
  background: #3dd6a0;
  color: #06281c;
  font-weight: 700;
  padding: 9px 22px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
}
.pe-retry:hover { background: #54e3b4; }

/* 顶部状态条 */
.player-topbar {
  position: absolute;
  top: 10px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  z-index: 5;
  pointer-events: none;
  font-size: 12px;
}
.pt-status, .pt-quality {
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}
.pt-quality { background: rgba(61, 214, 160, 0.85); color: #06281c; font-weight: 600; }

/* 中央大播放按钮 */
.player-bigplay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 74px;
  height: 74px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  z-index: 7;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .2s, transform .2s;
}
.player-bigplay:hover { background: rgba(61, 214, 160, 0.85); color: #06281c; transform: translate(-50%, -50%) scale(1.06); }

/* 弹幕层 */
.danmaku-layer {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 4;
}

/* 自定义控制栏 */
.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 8;
  padding: 28px 12px 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.78), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity .3s;
}
.player-controls.is-show { opacity: 1; }

.pc-progress {
  position: relative;
  height: 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  margin-bottom: 4px;
}
.pc-rail {
  position: relative;
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
  transition: height .15s;
}
.pc-progress:hover .pc-rail { height: 6px; }
.pc-buffered {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 4px;
}
.pc-played {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: #3dd6a0;
  border-radius: 4px;
}
.pc-thumb {
  position: absolute;
  top: 50%;
  left: 0%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  transform: translateY(-50%) scale(0);
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 4px rgba(0,0,0,.5);
  transition: transform .15s;
}
.pc-progress:hover .pc-thumb { transform: translateY(-50%) scale(1); }

/* 进度条悬停预览气泡 */
.pc-preview {
  position: absolute;
  bottom: 22px;
  transform: translateX(-50%);
  padding: 2px 8px;
  background: rgba(0,0,0,.8);
  color: #fff;
  font-size: 12px;
  border-radius: 4px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 5;
}
.pc-btn.on { color: #3dd6a0; background: rgba(61,214,160,.16); }

/* jlm3u8 解析页失败兜底：切换巨量播放器线路 */
.player-fallback {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 6;
}
.pf-btn {
  display: inline-block;
  padding: 7px 14px;
  background: rgba(61,214,160,.92);
  color: #06281d;
  font-size: 13px;
  font-weight: 600;
  border-radius: 999px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0,0,0,.35);
}
.pf-btn:hover { background: #3dd6a0; }
.pf-hint { color: rgba(255,255,255,.82); font-size: 12px; text-shadow: 0 1px 3px rgba(0,0,0,.6); }

.pc-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
}
.pc-btn {
  border: none;
  background: transparent;
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
}
.pc-btn:hover { background: rgba(255,255,255,.15); }
.pc-btn.on { color: #3dd6a0; }
.pc-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  opacity: .9;
}
.pc-sep { opacity: .5; margin: 0 3px; }
.pc-vol {
  display: flex;
  align-items: center;
  gap: 4px;
}
.pc-vol-range {
  width: 72px;
  accent-color: #3dd6a0;
  cursor: pointer;
}
.pc-spacer { flex: 1 1 auto; }
.pc-select {
  background: rgba(255,255,255,.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 6px;
  font-size: 12px;
  padding: 4px 6px;
  cursor: pointer;
}
.pc-select option { color: #111; }

/* 配额提示 */
.player-quota-tip {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 5;
  font-size: 12px;
  color: #fff;
  background: rgba(0,0,0,.45);
  padding: 3px 9px;
  border-radius: 999px;
  display: none;
}
.player-box:hover .player-quota-tip { display: block; }

/* ===== 播放器增强：菜单 / 直播 / 跳过 / 手势 / 播放列表 ===== */

/* 文本型按钮（画质 / 倍速） */
.pc-btn.pc-text {
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .12);
  white-space: nowrap;
}
.pc-btn.pc-text:hover { background: rgba(255, 255, 255, .22); }

/* 通用弹层菜单（清晰度 / 倍速 / 音轨 / 字幕） */
.pv-menu {
  position: absolute;
  right: 12px;
  bottom: 56px;
  min-width: 132px;
  max-height: 46%;
  overflow: auto;
  padding: 6px;
  background: rgba(12, 16, 20, .96);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .5);
  z-index: 20;
}
.pv-menu-item {
  display: block;
  width: 100%;
  padding: 7px 10px;
  border: none;
  background: transparent;
  color: #e6f1f3;
  font-size: 13px;
  text-align: left;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
}
.pv-menu-item:hover { background: rgba(103, 232, 249, .14); }
.pv-menu-item.on { color: #3dd6a0; font-weight: 700; }

/* 网络状态 */
.pt-network {
  background: rgba(0, 0, 0, .5);
  color: #fff;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
}
.pt-network.is-good { color: #3dd6a0; }
.pt-network.is-mid { color: #ffd166; }
.pt-network.is-bad { color: #ff8a8a; }

/* 直播模式 */
.player-live-tag {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 7;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e5484d;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.player-live-latest {
  position: absolute;
  right: 12px;
  bottom: 74px;
  z-index: 12;
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(61, 214, 160, .92);
  color: #06281d;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
/* 直播：进度条不可拖动 */
.pc-progress.is-disabled { opacity: .45; cursor: not-allowed; }

/* 跳过片头 / 片尾 / 插播广告 */
.player-skip {
  position: absolute;
  right: 16px;
  bottom: 74px;
  z-index: 12;
  padding: 8px 18px;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  font-size: 13px;
  cursor: pointer;
}
.player-skip .ps-text { font-weight: 600; }
.player-skip:hover { background: rgba(61, 214, 160, .9); color: #06281d; border-color: transparent; }

/* 撤销跳过 */
.player-undo {
  position: absolute;
  right: 16px;
  bottom: 74px;
  z-index: 13;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: rgba(12, 16, 20, .9);
  color: #cfeff5;
  font-size: 12px;
  cursor: pointer;
}
.player-undo:hover { background: rgba(61, 214, 160, .9); color: #06281d; }

/* 手势提示（进度 / 音量 / 亮度） */
.player-gesture {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 14;
  padding: 10px 16px;
  border-radius: 10px;
  background: rgba(0, 0, 0, .72);
  color: #fff;
  font-size: 13px;
  pointer-events: none;
}

/* 播放列表（队列 / 自动连播） */
.player-playlist {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 62%);
  z-index: 15;
  display: flex;
  flex-direction: column;
  background: rgba(10, 14, 18, .96);
  border-left: 1px solid rgba(255, 255, 255, .1);
}
.player-playlist[hidden] { display: none; }
.pl-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 13px;
}
.pl-head span { font-size: 11px; color: #7c9099; }
.pl-list { flex: 1 1 auto; overflow: auto; padding: 8px; }
.pl-item {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  color: #cfe0e5;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pl-item:hover { background: rgba(255, 255, 255, .08); }
.pl-item.on { color: #3dd6a0; background: rgba(61, 214, 160, .14); font-weight: 700; }

/* 轻量提示（全局 Toast 不可用时的降级） */
.player-toast {
  position: absolute;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 16;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(12, 16, 20, .94);
  color: #e6f1f3;
  font-size: 13px;
  pointer-events: none;
}

/* ===== 响应式：桌面 / 平板 / 手机 ===== */
@media (max-width: 1024px) {
  /* 平板：菜单略微上移，避免与控件重叠 */
  .pv-menu { bottom: 52px; }
}
@media (max-width: 640px) {
  /* 手机：精简控制栏，优先保留播放 / 进度 / 全屏；音量条折叠 */
  .player-controls { padding: 20px 8px 6px; }
  .pc-btn { font-size: 15px; padding: 3px 4px; }
  .pc-time { display: none; }
  .pc-vol-range { width: 48px; }
  .pc-vol { display: none; }
  .player-bigplay { width: 58px; height: 58px; font-size: 24px; }
  .pv-menu { right: 8px; bottom: 48px; min-width: 116px; }
  .player-playlist { width: 74%; }
  .player-skip, .player-undo, .player-live-latest { bottom: 62px; right: 10px; padding: 6px 14px; font-size: 12px; }
  .player-topbar { font-size: 11px; }
}
