/**
 * VideoGeneration 样式
 * ====================
 */

.video-generation {
  width: 100%;
}

/* ============================================
   分镜卡片 – 步骤 3 视频生成列表样式
   ============================================ */

.scene-card-compact {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  padding: var(--spacing-md);
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
  box-shadow: 0 1px 3px rgb(0 0 0 / 4%);
}

.scene-card-compact:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgb(54 178 106 / 8%);
  transform: translateY(-1px);
}

.scene-card-compact.active {
  border-color: var(--primary);
  box-shadow:
    0 0 0 2px var(--primary-light),
    0 4px 12px rgb(54 178 106 / 10%);
  background: linear-gradient(135deg, rgb(54 178 106 / 4%) 0%, rgb(24 160 138 / 2%) 100%);
}

.scene-card-header {
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding-bottom: var(--spacing-xs);
}

.scene-id-text {
  font-size: var(--font-sm);
  font-weight: 700;
  color: var(--text-primary);
}

.scene-type-badge {
  font-size: var(--font-xs);
  font-weight: 600;
  padding: var(--spacing-2xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  letter-spacing: 0.3px;
}

/* 分镜标签 - 使用原画面/配音的渐变+边框样式 */
.scene-type-badge.regular {
  background: linear-gradient(135deg, rgb(54 178 106 / 12%) 0%, rgb(24 160 138 / 8%) 100%);
  color: var(--primary);
  border: 1px solid rgb(54 178 106 / 20%);
}

/* 空镜标签 - 使用渐变+边框样式 */
.scene-type-badge.empty {
  background: linear-gradient(135deg, rgb(148 163 184 / 10%) 0%, rgb(100 116 139 / 6%) 100%);
  color: rgb(100 116 139);
  border: 1px solid rgb(148 163 184 / 20%);
}

.scene-duration-badge {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  margin-left: auto;
}

.scene-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
  flex-shrink: 0;
  transition: all 0.3s ease;
}

.scene-status-dot.completed {
  background: var(--success);
  box-shadow: 0 0 0 3px rgb(34 197 94 / 20%);
}

.scene-card-body {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xs);
}

/* 画面和配音文字样式统一 - 不省略，全部展示 */
.scene-card-desc,
.scene-card-voiceover {
  margin: 0;
  font-size: var(--font-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

/* 画面描述专用样式 */
.scene-card-desc {
  color: var(--text-primary);
  font-weight: 500;
}

/* 配音文字样式 */
.scene-card-voiceover {
  color: var(--text-secondary);
}

/* 标签样式统一 */
.scene-field-label-pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--font-xs);
  font-weight: 700;
  padding: var(--spacing-2xs) var(--spacing-sm);
  border-radius: var(--radius-sm);
  margin-right: var(--spacing-sm);
  vertical-align: middle;
  letter-spacing: 0.5px;
}

/* 画面标签 - 使用原分镜的纯色背景样式 */
.scene-card-desc .scene-field-label-pill {
  background: rgb(54 178 106 / 10%);
  color: var(--primary);
}

/* 配音标签 - 使用纯色背景样式 */
.scene-card-voiceover .scene-field-label-pill {
  background: rgb(54 178 106 / 10%);
  color: var(--primary);
}

/* ============================================
   选择形象弹窗 - 竖版缩略图卡片
   ============================================ */

.material-card-avatar-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-xs);
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  transition: all 0.2s ease;
}

.material-card-avatar-item:hover {
  background: var(--bg-hover);
  border-color: var(--border-color);
}

.material-card-avatar-item.selected {
  background: var(--primary-light);
  border: 2px solid var(--primary);
}

/* 缩略图容器 - 3:4 比例 */
.avatar-item-thumbnail {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-input);
  border: 1px solid var(--border-light);
}

.avatar-item-thumbnail video,
.avatar-item-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 占位符 */
.avatar-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-hover);
}

/* 选中标记 */
.avatar-item-check {
  position: absolute;
  top: var(--spacing-xs);
  right: var(--spacing-xs);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 名称 */
.avatar-item-name {
  font-size: var(--font-xs);
  color: var(--text-primary);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

/* 时间 */
.avatar-item-time {
  font-size: var(--font-xs);
  color: var(--text-tertiary);
  text-align: center;
}

/* ============================================
   分页组件
   ============================================ */

.pagination {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-xs);
  background: var(--bg-input);
  border-radius: var(--radius-lg);
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--bg-card);
  color: var(--text-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pagination-btn.active {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-sm);
}

.pagination-btn.nav {
  width: auto;
  padding: 0 var(--spacing-sm);
  font-size: var(--font-xs);
}

/* ============================================
   镜头导航按钮 - 与字幕压制页面统一
   ============================================ */

/* ============================================
   右侧预览区 - 与字幕压制页面统一
   ============================================ */

.video-gen-right {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: 0;
  overflow-y: auto;
  align-items: center;
  border-left: 1px solid var(--border-light);
  padding-left: var(--spacing-lg);
  min-height: 0;
}

/* 视频预览区域 */
.video-preview-area {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  width: 100%;
  align-items: center;
}

.video-preview-header {
  font-size: var(--font-sm);
  font-weight: 600;
  color: var(--text-primary);
  padding-left: var(--spacing-sm);
  align-self: flex-start;
}

/* 视频预览外层容器 - 用于定位箭头 */
.video-preview-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 视频预览容器 - 9:16 竖屏 */
.video-preview-container {
  position: relative;
  width: auto;
  height: 600px;
  aspect-ratio: 9 / 16;
  margin: 0 auto;
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 8px 32px rgb(0 0 0 / 30%);
  border: 1px solid var(--border-light);
}

/* 左右导航箭头 - 在视频两侧外部 */
.nav-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 10;
}

.nav-arrow:hover:not(:disabled) {
  background: var(--primary);
  transform: translateY(-50%) scale(1.1);
}

.nav-arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

.nav-arrow-left {
  left: -48px;
}

.nav-arrow-right {
  right: -48px;
}

.preview-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  gap: var(--spacing-sm);
}

.video-placeholder svg {
  opacity: 0.6;
}

.video-placeholder .placeholder-sub {
  font-size: var(--font-xs);
  color: rgba(255, 255, 255, 0.4);
}

/* ============================================
   加载动画
   ============================================ */

@keyframes avatar-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ============================================
   BGM 选择弹窗
   ============================================ */

.modal-bgm-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.modal-bgm-tabs::-webkit-scrollbar {
  display: none;
}

.modal-bgm-tab {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: var(--font-xs);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.modal-bgm-tab:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.modal-bgm-tab.active {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.modal-bgm-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.modal-bgm-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid transparent;
  background: var(--bg-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-bgm-row:hover {
  background: var(--bg-hover);
}

.modal-bgm-row.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.modal-bgm-preview-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-primary);
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.modal-bgm-preview-btn:hover {
  background: var(--primary);
  color: #fff;
}

.modal-bgm-preview-btn.playing {
  background: var(--primary);
  color: #fff;
  animation: bgm-pulse 1.5s ease-in-out infinite;
}

@keyframes bgm-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.modal-bgm-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.modal-bgm-row-title {
  font-size: var(--font-sm);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-bgm-row-meta {
  font-size: 11px;
  color: var(--text-tertiary);
  line-height: 1.3;
}

.modal-bgm-check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.modal-bgm-empty {
  text-align: center;
  padding: 32px;
  color: var(--text-tertiary);
  font-size: var(--font-sm);
}

.modal-bgm-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
}

.modal-bgm-upload-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  border: 1px dashed var(--border-color);
  background: transparent;
  color: var(--text-tertiary);
  font-size: var(--font-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-bgm-upload-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

.modal-bgm-local-hint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--primary-light);
  border: 1px solid var(--primary);
  font-size: var(--font-xs);
  color: var(--text-primary);
}

.modal-bgm-local-clear {
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.modal-bgm-local-clear:hover {
  color: var(--danger);
  background: var(--bg-hover);
}

/* 滑块输入样式 */
.slider-input {
  appearance: none;
  width: 100%;
  height: 6px;
  background: transparent;
  border-radius: var(--radius-sm);
  outline: none;
  cursor: pointer;
  border: none;
  padding: 0;
}

.slider-input::-webkit-slider-runnable-track {
  width: 100%;
  height: 6px;
  background: linear-gradient(
    to right,
    var(--primary) 0%,
    var(--primary) var(--slider-percent, 50%),
    var(--bg-input) var(--slider-percent, 50%),
    var(--bg-input) 100%
  );
  border-radius: var(--radius-sm);
}

.slider-input::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  background: var(--bg-card);
  border: 2px solid var(--primary);
  border-radius: var(--radius-full);
  cursor: pointer;
  box-shadow: 0 1px 4px rgb(0 0 0 / 15%);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.slider-input::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgb(54 178 106 / 30%);
}

.slider-input:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 4px var(--primary-light);
}
