/* ========================================
   PAGE: 视频播放器
   ======================================== */
.page-video-player {
  background: #000;
}

.video-nav-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4);
  padding-top: calc(var(--space-4) + env(safe-area-inset-top, 20px));
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, transparent 100%);
  z-index: 20;
}

.video-nav-left {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 18px;
  color: var(--color-text-primary);
}

/* 分支进度条 */
.branch-progress-bar {
  padding: 0 var(--space-4);
  padding-bottom: var(--space-2);
}

.progress-track {
  position: relative;
  height: 4px;
  background: var(--color-surface);
  border-radius: 2px;
  margin-bottom: var(--space-1);
}

.progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--color-alive) 0%, var(--color-fading) 100%);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-current {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background: var(--color-text-primary);
  border-radius: 50%;
  border: 2px solid var(--color-primary);
  transition: left 0.3s ease;
  z-index: 2;
}

.progress-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: var(--color-text-muted);
}

#remaining-label {
  color: var(--color-text-secondary);
}

/* 主视频区域 */
.video-main-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.video-player {
  width: 100%;
  height: 100%;
  position: relative;
}

.video-player img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.2s ease;
}

/* 播放控制覆盖层 */
.playback-overlay {
  position: absolute;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.video-player:hover .playback-overlay,
.video-player.show-controls .playback-overlay {
  opacity: 1;
  pointer-events: auto;
}

.playback-controls {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(10px);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
}

.playback-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: white;
  font-size: 16px;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s ease;
}

.playback-btn:hover {
  background: rgba(255,255,255,0.1);
}

.playback-btn.play-pause {
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  font-size: 18px;
}

.playback-btn.play-pause:hover {
  background: var(--color-accent-hover);
}

.playback-timer {
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  background: rgba(0,0,0,0.5);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--radius-sm);
}

/* 左右点击切换区域 */
.tap-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 25%;
  cursor: pointer;
  z-index: 5;
}

.tap-prev {
  left: 0;
}

.tap-next {
  right: 80px;
  width: 20%;
}

/* 右侧操作栏 */
.video-actions {
  position: absolute;
  right: var(--space-4);
  bottom: 160px;
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  z-index: 10;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
  cursor: pointer;
  color: var(--color-text-primary);
}

.action-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  overflow: hidden;
  position: relative;
}

.action-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.action-icon .status-dot-sm {
  position: absolute;
  bottom: 2px;
  right: 2px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.5);
}

.status-dot-sm.alive { background: var(--color-alive); }
.status-dot-sm.fading { background: var(--color-fading); animation: pulse-dot 2s infinite; }
.status-dot-sm.gone { background: var(--color-gone); }

.action-relay {
  background: var(--color-accent);
}

.action-branch {
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-text-muted);
}

.action-branch-dynamic {
  background: var(--color-fading);
  transition: background 0.3s ease;
}

.action-node-info {
  pointer-events: none;
}

.action-node-display {
  display: flex;
  align-items: baseline;
  justify-content: center;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
}

.node-current {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-text-primary);
}

.node-separator {
  font-size: 14px;
  color: var(--color-text-muted);
  margin: 0 2px;
}

.node-total {
  font-size: 12px;
  color: var(--color-text-muted);
}

.action-btn span {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
}

/* 底部节点缩略图滚动条 */
.nodes-scrubber {
  background: rgba(0,0,0,0.8);
  padding: var(--space-2) var(--space-3);
}

.scrubber-scroll {
  display: flex;
  gap: var(--space-1);
  overflow-x: auto;
  scroll-behavior: smooth;
}

.scrubber-scroll::-webkit-scrollbar {
  display: none;
}

.scrubber-node {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: 0.6;
  transition: all 0.2s ease;
}

.scrubber-node:hover {
  opacity: 0.9;
}

.scrubber-node.active {
  border-color: var(--color-accent);
  opacity: 1;
}

.scrubber-node img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 接近上限提示 */
.limit-warning {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(243, 156, 18, 0.9);
  color: #000;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  animation: pulse-warning 2s infinite;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
}
