/* player.css - 2026-08-30 - Magnet Video Player v2 控制条样式 */

/* ============ 控制条 ============ */
.pc-control-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0.35) 70%, transparent);
  padding: 30px 14px 10px;
  color: #fff;
  font-size: 13px;
  user-select: none;
  transition: opacity 0.25s ease;
}
.pc-hide { opacity: 0; pointer-events: none; }

/* ============ 进度条 ============ */
.pc-progress {
  position: relative;
  width: 100%;
  height: 16px;
  cursor: pointer;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
}
.pc-progress-buffered {
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  height: 3px;
  width: 0;
  background: rgba(255,255,255,0.32);
  border-radius: 2px;
  transition: width 0.5s ease;
  pointer-events: none;
}
.pc-progress-inner {
  position: relative;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.12);
  border-radius: 2px;
}
.pc-progress-play {
  position: absolute;
  left: 0; top: 0;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  border-radius: 2px;
  pointer-events: none;
  transition: width 0.1s linear;
}
.pc-progress-thumb {
  position: absolute;
  top: 50%;
  left: 0;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px rgba(59,130,246,0.6);
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}
.pc-progress:hover .pc-progress-thumb { opacity: 1; }
.pc-progress:hover .pc-progress-inner,
.pc-progress:hover .pc-progress-buffered { height: 5px; top: 50%; }
.pc-progress-hit {
  position: absolute;
  inset: 0;
}

/* ============ 控制按钮 ============ */
.pc-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.pc-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.pc-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 17px;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.pc-btn:hover { background: rgba(255,255,255,0.12); color: #60a5fa; }
.pc-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.pc-time {
  font-size: 12px;
  color: rgba(255,255,255,0.85);
  margin-left: 6px;
  font-variant-numeric: tabular-nums;
  font-family: 'SF Mono', Menlo, monospace;
}
.pc-btn-rate, .pc-btn-quality, .pc-btn-episodes {
  font-size: 13px;
  min-width: 36px;
}

/* ============ 中央播放按钮 ============ */
.pc-center-play {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 18;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px; /* visually center the triangle */
}
.pc-center-play:hover { transform: translate(-50%, -50%) scale(1.08); background: rgba(59,130,246,0.85); }

/* ============ 弹出菜单 ============ */
.pc-menu {
  position: absolute;
  z-index: 25;
  background: rgba(20, 25, 40, 0.96);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 110px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.pc-menu-item {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.85);
  text-align: left;
  padding: 8px 14px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
}
.pc-menu-item:hover { background: rgba(59,130,246,0.3); color: #fff; }

/* ============ Toast 提示 ============ */
.pc-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 30;
  background: rgba(0,0,0,0.7);
  color: #fff;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.pc-toast-show { opacity: 1; }

/* ============ Mini 浮窗 ============ */
.pc-mini-player {
  position: fixed;
  z-index: 9999;
  width: 320px;
  height: 180px;
  background: #000;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  overflow: hidden;
  cursor: move;
  resize: both;
}
.pc-mini-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.pc-mini-close {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.pc-mini-player:hover .pc-mini-close { opacity: 1; }
.pc-mini-close:hover { background: rgba(239,68,68,0.8); }

/* ============ 鼠标 cursor 自动隐藏 ============ */
.pc-cursor-active { cursor: default; }
.pc-cursor-active.pc-cursor-hidden,
.pc-hide + video { cursor: none; }

/* ============ 移动端适配 ============ */
@media (max-width: 640px) {
  .pc-control-bar { padding: 16px 8px 6px; font-size: 12px; }
  .pc-btn { padding: 6px; font-size: 16px; }
  .pc-btn-episodes, .pc-btn-screenshot, .pc-btn-mini { display: none; }
  .pc-time { font-size: 11px; }
}

/* ============ 全屏时调优 ============ */
:fullscreen .pc-control-bar,
:-webkit-full-screen .pc-control-bar {
  font-size: 16px;
}
:fullscreen .pc-progress,
:-webkit-full-screen .pc-progress { height: 22px; }
:fullscreen .pc-progress-inner,
:fullscreen .pc-progress-buffered,
:-webkit-full-screen .pc-progress-inner,
:-webkit-full-screen .pc-progress-buffered { height: 6px; }
:fullscreen .pc-progress-thumb,
:-webkit-full-screen .pc-progress-thumb { width: 16px; height: 16px; }