/* ksvideo 特有样式 */

/* --- 分类标签栏 --- */
.tags-bar {
  position: fixed;
  top: 52px;
  left: 0;
  right: 0;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: var(--blur);
  padding: 10px 16px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  white-space: nowrap;
  z-index: 90;
  scrollbar-width: none;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.tags-bar::-webkit-scrollbar { display: none; }

.tag {
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 13px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition);
}

.tag:hover {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
}

.tag.active {
  background: var(--accent-dim);
  color: var(--accent);
  font-weight: 600;
  border-color: rgba(0, 212, 255, 0.3);
}

/* --- 分类提示 --- */
.current-cat-hint {
  position: fixed;
  top: 104px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-dim);
  backdrop-filter: var(--blur);
  color: var(--accent);
  padding: 6px 18px;
  border-radius: var(--radius-full);
  font-size: 12px;
  z-index: 90;
  display: none;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.tags-hint {
  position: fixed;
  top: 92px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  z-index: 90;
  pointer-events: none;
}

/* --- 视频播放区 --- */
.player-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
}

.player-bg-left, .player-bg-right {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc((100vw - 400px) / 2);
  background: linear-gradient(135deg, #0a0a2e, #1a0a2e);
  z-index: 0;
}

.player-bg-left { left: 0; }
.player-bg-right { right: 0; }

#player-container {
  position: relative;
  width: 400px;
  height: calc(100vh - 130px);
  max-height: 780px;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  z-index: 1;
  transition: transform 0.25s ease, opacity 0.25s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

#player-container.slide-up {
  transform: translateY(-30px);
  opacity: 0;
}

#player-container.slide-down {
  transform: translateY(30px);
  opacity: 0;
}

/* 视频元素 */
#main-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* 缩略图覆盖 */
#video-thumb {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  z-index: 2;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top: 3px solid var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 视频信息覆盖层 */
.video-overlay {
  position: absolute;
  bottom: 50px;
  left: 0;
  right: 0;
  padding: 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  pointer-events: none;
}

.video-overlay button,
.video-overlay span {
  pointer-events: auto;
}

/* --- 自定义控制条 --- */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50px;
  background: linear-gradient(transparent, rgba(0,0,0,0.9));
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 10px;
  z-index: 10;
  opacity: 0;
  transition: opacity var(--transition);
}

#player-container:hover .custom-controls,
.custom-controls.active {
  opacity: 1;
}

.ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  padding: 6px;
  flex-shrink: 0;
  transition: color var(--transition), transform var(--transition);
  opacity: 0.9;
}

.ctrl-btn:hover {
  color: var(--accent);
  transform: scale(1.1);
  opacity: 1;
}

.ctrl-time {
  color: var(--text-secondary);
  font-size: 11px;
  flex-shrink: 0;
  min-width: 75px;
  font-variant-numeric: tabular-nums;
}

.ctrl-progress {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
  transition: height 0.15s;
}

.ctrl-progress:hover { height: 6px; }

.ctrl-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #00bfe6);
  border-radius: 2px;
  width: 0%;
  position: relative;
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.3);
}

.ctrl-progress-handle {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-radius: 50%;
  position: absolute;
  top: 50%;
  left: 0%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.15s, transform 0.15s;
  box-shadow: 0 0 6px rgba(0, 212, 255, 0.5);
}

.ctrl-progress:hover .ctrl-progress-handle {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.1);
}

.ctrl-volume-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.ctrl-volume-slider {
  width: 64px;
  height: 4px;
  background: rgba(255,255,255,0.15);
  border-radius: 2px;
  cursor: pointer;
  position: relative;
}

.ctrl-volume-bar {
  height: 100%;
  background: #fff;
  border-radius: 2px;
  width: 100%;
  transition: width 0.1s;
}

.video-info { flex: 1; }

#video-category {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  border: 1px solid rgba(0, 212, 255, 0.2);
}

.video-actions {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
}

.video-actions button {
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-actions button:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
  transform: scale(1.1);
}

.video-actions .btn-fav.active {
  color: #ff6b6b;
  border-color: rgba(255, 107, 107, 0.3);
}

.bounce { animation: bounce 0.4s ease; }

@keyframes bounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.3); }
  50% { transform: scale(0.9); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- 底部切换按钮 --- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  background: rgba(10, 10, 26, 0.85);
  backdrop-filter: var(--blur);
  z-index: 100;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.btn-nav {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  padding: 8px 28px;
  border-radius: var(--radius-full);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-nav:hover {
  background: rgba(255,255,255,0.12);
  border-color: rgba(255,255,255,0.15);
  transform: translateY(-1px);
}

.switch-hint {
  color: var(--text-muted);
  font-size: 11px;
  position: fixed;
  bottom: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  pointer-events: none;
}

/* --- 首次交互覆盖层 --- */
.start-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  cursor: pointer;
  transition: opacity 0.3s;
}

.start-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.start-overlay .icon { font-size: 64px; margin-bottom: 16px; }
.start-overlay p { color: var(--text-secondary); font-size: 16px; }

/* --- 响应式 --- */
@media (max-width: 500px) {
  #player-container {
    width: 100vw;
    height: 100vh;
    max-height: none;
    border-radius: 0;
  }

  .player-bg-left, .player-bg-right { display: none; }
  .switch-hint { display: none; }
  .bottom-nav { height: 48px; }
  .btn-nav { padding: 6px 18px; font-size: 12px; }
  .tags-bar { top: 52px; }
}
