/**
 * File: client/css/video-generator.css
 * 视频生成组件样式 - Apple风格黑白主题
 * 作用: 视频生成页面的布局和样式
 * @modification 全部改为黑白灰配色，去除所有彩色
 * @date 2025-12-09
 */

/* ============================================
   视频生成页面顶部标题栏
   ============================================ */
.video-gen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
}

.video-gen-header .panel-title {
  margin: 0;
}

/* ============================================
   视频生成状态提示
   ============================================ */
.video-generation-status {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.video-generation-status p {
  margin: 0;
  color: #555555;
  font-size: 14px;
}

/* ============================================
   视频列表容器
   ============================================ */
.video-clips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .video-clips {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .video-clips {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   视频卡片
   ============================================ */
.video-clip-item {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.video-clip-item:hover {
  border-color: #000000;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/* ============================================
   视频卡片头部
   ============================================ */
.video-clip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #f8fafc;
  border-bottom: 1px solid #e5e7eb;
}

.video-clip-number {
  font-weight: 600;
  color: #1e293b;
  font-size: 14px;
}

.video-clip-duration {
  display: none;
}

/**
 * @description 状态标签改为黑白灰
 * @date 2025-12-09
 */
.video-clip-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}

.video-clip-status.status-pending {
  background: #f0f0f0;
  color: #888888;
}

.video-clip-status.status-generating {
  background: #e0e0e0;
  color: #333333;
  animation: pulse 2s infinite;
}

.video-clip-status.status-completed {
  background: #333333;
  color: #ffffff;
}

.video-clip-status.status-failed {
  background: #000000;
  color: #ffffff;
}

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

/* ============================================
   视频预览区域
   ============================================ */
.video-clip-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/**
 * @description 9:16 竖屏比例样式
 * @date 2025-12-10
 */
.video-clip-preview.aspect-9-16 {
  aspect-ratio: 9 / 16;
}

/**
 * @description 9:16 竖屏时，视频列表改为5列布局
 * @date 2025-12-10
 */
.video-clips.aspect-9-16 {
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

.video-clips.aspect-9-16 .video-clip-item {
  max-width: none;
}

@media (max-width: 1400px) {
  .video-clips.aspect-9-16 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .video-clips.aspect-9-16 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .video-clips.aspect-9-16 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 500px) {
  .video-clips.aspect-9-16 {
    grid-template-columns: 1fr;
  }
}

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

.video-player {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

/* ============================================
   视频信息区域
   ============================================ */
.video-clip-info {
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
}

.video-clip-scene {
  margin: 0;
  font-size: 13px;
  color: #64748b;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================
   视频提示词编辑区域
   ============================================ */
.video-clip-prompt {
  padding: 10px 16px;
  border-top: 1px solid #e5e7eb;
}

.video-prompt-label {
  display: block;
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 6px;
  font-weight: 500;
}

.video-prompt-input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.5;
  color: #374151;
  background: #f9fafb;
  resize: vertical;
  min-height: 60px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/**
 * @description 输入框聚焦改为黑色边框
 * @date 2025-12-09
 */
.video-prompt-input:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
  background: #fff;
}

.video-prompt-input::placeholder {
  color: #9ca3af;
}

/* ============================================
   视频操作按钮
   ============================================ */
.video-clip-actions {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.video-single-gen-btn {
  font-size: 12px;
  padding: 6px 12px;
}

.video-single-gen-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/**
 * @description 上传图片按钮样式
 * @date 2025-12-13
 */
.video-upload-img-btn {
  font-size: 12px;
  padding: 6px 12px;
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #64748b;
}

.video-upload-img-btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
  color: #475569;
}

.video-upload-img-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ============================================
   视频进度条
   ============================================ */
.video-clip-progress {
  padding: 8px 16px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #f1f5f9;
}

.video-progress-bar {
  flex: 1;
  height: 6px;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}

/**
 * @description 进度条改为黑色
 * @date 2025-12-09
 */
.video-progress-fill {
  height: 100%;
  background: #000000;
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

.video-progress-text {
  font-size: 12px;
  color: #333333;
  min-width: 35px;
  text-align: right;
}

/* ============================================
   空状态占位
   ============================================ */
.video-clips .placeholder-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #64748b;
  font-size: 14px;
}

/* ============================================
   按钮样式
   ============================================ */
/**
 * @description 危险按钮改为黑色
 * @date 2025-12-09
 */
.btn-danger {
  background: #000000;
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-danger:hover {
  background: #333333;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-danger:active {
  transform: translateY(0);
}

.btn-danger:disabled {
  background: #999999;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ============================================
   响应式布局调整
   ============================================ */
@media (max-width: 640px) {
  .video-gen-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .video-clip-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .video-clip-actions {
    flex-wrap: wrap;
  }
}

/* ============================================
   对口型区域样式
   ============================================ */
.lipsync-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #e5e7eb;
}

.lipsync-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.lipsync-header .btn-danger:disabled {
  background: #999999;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
  transform: none;
}

.lipsync-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.lipsync-status {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.lipsync-status p {
  margin: 0;
  color: #555555;
  font-size: 14px;
}

/* ============================================
   对口型卡片列表
   ============================================ */
.lipsync-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

/**
 * @description 9:16 竖屏时，口型匹配列表改为5列布局
 * @date 2025-12-10
 */
.lipsync-cards.aspect-9-16 {
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}

@media (max-width: 1400px) {
  .lipsync-cards.aspect-9-16 {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 1100px) {
  .lipsync-cards.aspect-9-16 {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 800px) {
  .lipsync-cards.aspect-9-16 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 1200px) {
  .lipsync-cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .lipsync-cards {
    grid-template-columns: 1fr;
  }
}

.lipsync-cards .placeholder-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}

/* ============================================
   对口型卡片
   ============================================ */
.lipsync-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.lipsync-card:hover {
  border-color: #666666;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/**
 * @description 对口型卡片头部改为灰色
 * @date 2025-12-09
 */
.lipsync-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #666666;
  color: white;
}

.lipsync-card-number {
  font-weight: 600;
  font-size: 14px;
}

.lipsync-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
}

.lipsync-card-status.status-pending {
  background: rgba(255, 255, 255, 0.2);
}

.lipsync-card-status.status-processing {
  background: #cccccc;
  color: #333333;
  animation: pulse 2s infinite;
}

.lipsync-card-status.status-completed {
  background: #333333;
}

.lipsync-card-status.status-failed {
  background: #000000;
}

.lipsync-card-status.status-fallback {
  background: #888888;
}

/* 对口型卡片预览区域 */
.lipsync-card-preview {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/**
 * @description 9:16 竖屏比例样式
 * @date 2025-12-10
 */
.lipsync-card-preview.aspect-9-16 {
  aspect-ratio: 9 / 16;
}

.lipsync-card-preview video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.lipsync-card-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 对口型进度覆盖层 */
.lipsync-progress-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: white;
}

/**
 * @description spinner改为灰色
 * @date 2025-12-09
 */
.lipsync-progress-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.2);
  border-top-color: #cccccc;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.lipsync-progress-text {
  margin-top: 12px;
  font-size: 13px;
  color: #cccccc;
}

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

/* 对口型卡片对白区域 */
.lipsync-card-dialogue {
  padding: 12px 16px;
  border-top: 1px solid #e5e7eb;
  background: #f8fafc;
}

.lipsync-dialogue-label {
  font-size: 11px;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.lipsync-dialogue-text {
  margin: 0;
  font-size: 13px;
  color: #1e293b;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 对口型卡片操作按钮 */
.lipsync-card-actions {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

/**
 * @description 预览按钮改为灰色
 * @date 2025-12-09
 */
.lipsync-preview-btn {
  font-size: 12px;
  padding: 6px 14px;
  background: #666666;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.lipsync-preview-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.lipsync-preview-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.lipsync-single-btn {
  font-size: 12px;
  padding: 6px 12px;
}

/* 降级标记 */
.lipsync-fallback-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  padding: 2px 8px;
  background: #f0f0f0;
  color: #888888;
  border-radius: 4px;
  margin-left: 8px;
}

/* 响应式调整 */
@media (max-width: 640px) {
  .lipsync-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .lipsync-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .lipsync-card-actions {
    flex-wrap: wrap;
  }
}

/* ============================================
   视频音效生成区域样式
   ============================================ */
.video-audio-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid #e5e7eb;
}

.video-audio-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.video-audio-header .section-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.video-audio-status {
  background: #f5f5f5;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 20px;
}

.video-audio-status p {
  margin: 0;
  color: #555555;
  font-size: 14px;
}

/* ============================================
   视频音效卡片列表
   ============================================ */
.video-audio-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 20px;
}

@media (max-width: 1200px) {
  .video-audio-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .video-audio-list {
    grid-template-columns: 1fr;
  }
}

.video-audio-list .placeholder-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px 20px;
  color: #64748b;
  font-size: 14px;
}

/* ============================================
   视频音效卡片
   ============================================ */
.video-audio-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.video-audio-card:hover {
  border-color: #888888;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

/**
 * @description 视频音效卡片头部改为深灰色
 * @date 2025-12-09
 */
.video-audio-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: #888888;
  color: white;
}

.video-audio-card-number {
  font-weight: 600;
  font-size: 14px;
}

.video-audio-card-status {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.2);
}

.video-audio-card-status.status-pending {
  background: rgba(255, 255, 255, 0.2);
}

.video-audio-card-status.status-generating {
  background: #cccccc;
  color: #333333;
  animation: pulse 2s infinite;
}

.video-audio-card-status.status-completed {
  background: #333333;
}

.video-audio-card-status.status-failed {
  background: #000000;
}

.video-audio-card-status.status-fallback {
  background: #666666;
}

/* 视频音效卡片音频区域 */
.video-audio-card-audio {
  padding: 16px;
  background: #f8fafc;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.video-audio-card-audio audio {
  width: 100%;
  height: 40px;
}

.video-audio-card-audio .audio-label {
  font-size: 11px;
  color: #94a3b8;
  margin-bottom: 8px;
  display: block;
}

/* 空音频提示 */
.video-audio-empty-audio {
  font-size: 13px;
  color: #9ca3af;
  text-align: center;
  padding: 16px 8px;
  background: #f1f5f9;
  border-radius: 6px;
}

/* 生成中动画 */
.video-audio-generating {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  color: #666666;
  font-size: 13px;
}

.generating-spinner {
  width: 20px;
  height: 20px;
  border: 2px solid #e0e0e0;
  border-top-color: #666666;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 视频音效卡片操作按钮 */
.video-audio-card-actions {
  padding: 12px 16px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  border-top: 1px solid #e5e7eb;
}

/**
 * @description 下载按钮改为深灰色
 * @date 2025-12-09
 */
.video-audio-download-btn {
  font-size: 12px;
  padding: 6px 14px;
  background: #888888;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.video-audio-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.video-audio-download-btn:disabled {
  background: #cccccc;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.video-audio-single-btn {
  font-size: 12px;
  padding: 6px 12px;
}

/**
 * @description 警告按钮改为深灰色
 * @date 2025-12-09
 */
.btn-warning {
  background: #888888;
  color: white;
  border: none;
  padding: 10px 24px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.btn-warning:hover {
  background: #777777;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.btn-warning:active {
  transform: translateY(0);
}

.btn-warning:disabled {
  background: #cccccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* 响应式调整 */
@media (max-width: 640px) {
  .video-audio-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }

  .video-audio-card-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .video-audio-card-actions {
    flex-wrap: wrap;
  }
}
