/**
 * File: client/css/components/character-cards.css
 * 角色卡片样式
 * 作用: 定义角色图片生成和展示的卡片样式（9:16比例）
 */

/* 角色生成网格容器 */
.character-generation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* 单个角色卡片 */
.character-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.character-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 角色图片容器 (9:16比例) */
/**
 * @description 修改背景为黑白色调
 * @date 2025-12-11
 */
.character-card-image {
  position: relative;
  width: 100%;
  padding-top: 177.78%; /* 16/9 = 1.7778 */
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  overflow: hidden;
}

.character-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/**
 * @description 自定义上传图片按钮样式
 * @date 2025-11-28
 * 新增功能：允许用户上传自定义角色图片
 * 样式：四方形黑色透明底，白色+号，左上角
 */
.upload-image-btn {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.5);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 22px;
  font-weight: 300;
  line-height: 1;
  transition: background 0.2s ease;
  z-index: 10;
}

.upload-image-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.upload-image-btn:active {
  background: rgba(0, 0, 0, 0.8);
}

/**
 * @description 角色名称标签已移除
 * @date 2025-11-02
 * 修改内容: 去掉右上角的角色名称标签
 */

/* 加载状态 */
.character-card-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  z-index: 20;
}

/**
 * @description 修改spinner颜色为黑色
 * @date 2025-12-11
 */
.character-card-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f0f0f0;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.character-card-loading p {
  margin-top: 16px;
  color: #666;
  font-size: 14px;
}

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

/**
 * @description 提示词编辑区域
 * @date 2025-11-02
 * 修改内容: 替换角色信息区域为提示词编辑区域
 */
.character-card-prompt {
  padding: 16px;
  background: #fafafa;
  border-top: 1px solid #e5e5e5;
}

.character-card-prompt label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

/**
 * @description 角色名字标签样式
 * @date 2025-12-01
 * 新增内容: 在提示词上方显示角色名字
 */
/**
 * @description 修改角色名称下边框为黑色
 * @date 2025-12-11
 */
.character-name-label {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #1a1a1a;
  word-break: break-all;
}

.character-card-prompt .prompt-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.5;
  color: #1a1a1a;
  background: #ffffff;
  resize: vertical;
  min-height: 80px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  transition: border-color 0.2s ease;
}

/**
 * @description 修改输入框focus状态为黑色
 * @date 2025-12-11
 */
.character-card-prompt .prompt-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/**
 * @description 配音选择区域
 * @date 2025-11-03
 * 新增内容: 添加配音选择下拉菜单样式
 * @date 2025-11-03 修改: 添加试听按钮和情感选择样式
 * @date 2025-11-03 修改: 调整上边距为0,因为上方的重新生成按钮已有下边距
 */
.voice-select-wrapper {
  margin-top: 0;
}

.voice-select-wrapper label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

/* 音色选择行 - 包含下拉菜单和试听按钮 */
.voice-select-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.voice-select {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 13px;
  color: #1a1a1a;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/**
 * @description 修改音色选择器hover/focus状态为黑色
 * @date 2025-12-11
 */
.voice-select:hover {
  border-color: #1a1a1a;
}

.voice-select:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.voice-select option {
  padding: 8px;
  font-size: 13px;
}

/**
 * @description 修改试听按钮为黑白色调
 * @date 2025-12-11
 */
/* 试听按钮 */
.preview-voice-btn {
  min-width: 44px;
  padding: 10px 12px;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-voice-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: #333333;
}

.preview-voice-btn:active:not(:disabled) {
  transform: translateY(0);
}

.preview-voice-btn:disabled {
  background: #d1d1d6;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

/* 情感选择容器 */
.emotion-select-container {
  margin-top: 0;
}

.emotion-select-wrapper {
  margin-top: 12px;
}

.emotion-select-wrapper label {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
}

.emotion-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  font-size: 13px;
  color: #1a1a1a;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/**
 * @description 修改情感选择器hover/focus状态为黑色
 * @date 2025-12-11
 */
.emotion-select:hover {
  border-color: #1a1a1a;
}

.emotion-select:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.emotion-select option {
  padding: 8px;
  font-size: 13px;
}

/**
 * @description 重新生成按钮样式 - 修改为黑白色调
 * @date 2025-11-03 修改: 调整margin,适配新的按钮位置(在提示词下方,配音选择上方)
 * @date 2025-12-11 修改: 配色改为黑白色调
 */
.character-card-prompt .regenerate-btn {
  width: 100%;
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 10px 16px;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.character-card-prompt .regenerate-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: #333333;
}

.character-card-prompt .regenerate-btn:active {
  transform: translateY(0);
}

.character-card-prompt .regenerate-btn:disabled {
  background: #a0a0a0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/**
 * @description 修改错误状态为黑白色调
 * @date 2025-12-11
 */
/* 错误状态 */
.character-card-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.05);
  z-index: 15;
}

.character-card-error i {
  font-size: 48px;
  color: #1a1a1a;
  margin-bottom: 12px;
}

.character-card-error p {
  color: #333333;
  font-size: 14px;
  text-align: center;
  padding: 0 20px;
}

/* 占位符文本 */
.placeholder-text {
  text-align: center;
  color: #999;
  font-size: 16px;
  padding: 60px 20px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .character-generation-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    padding: 16px;
  }

  .character-card-prompt .prompt-input {
    font-size: 12px;
    min-height: 70px;
  }

  /**
   * @description 配音选择在移动端的样式调整
   * @date 2025-11-03
   * @date 2025-11-03 修改: 添加试听按钮和情感选择的响应式样式
   */
  .voice-select {
    font-size: 12px;
    padding: 8px 10px;
  }

  .voice-select option {
    font-size: 12px;
  }

  .preview-voice-btn {
    min-width: 40px;
    font-size: 16px;
    padding: 8px 10px;
  }

  .emotion-select {
    font-size: 12px;
    padding: 8px 10px;
  }

  .emotion-select option {
    font-size: 12px;
  }

  .character-card-prompt .regenerate-btn {
    font-size: 13px;
    padding: 8px 14px;
  }
}

/* ========== DubbingX情绪选择样式 ========== */
/**
 * @description Premium全情绪音色的三级选择器样式
 * @date 2025-11-03
 * @date 2025-11-03 修改: 添加.emotion-row样式,改为3行布局,移除图标
 */
/**
 * @description 修改Premium情绪选择器背景为黑白色调
 * @date 2025-12-11
 */
.emotion-premium-wrapper {
  margin-top: 12px;
  padding: 12px;
  background: #fafafa;
  border-radius: 8px;
  border: 1px solid #e5e5e5;
}

.emotion-premium-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 10px;
}

/**
 * @description 情绪选择行样式 - 每行包含标签和下拉框
 * @date 2025-11-03
 */
.emotion-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.emotion-row:last-of-type {
  margin-bottom: 0;
}

.emotion-row-label {
  font-size: 13px;
  color: #374151;
  font-weight: 500;
  min-width: 50px;
  flex-shrink: 0;
}

.emotion-row select {
  flex: 1;
  padding: 8px 12px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/**
 * @description 修改情感行选择器hover/focus状态为黑色
 * @date 2025-12-11
 */
.emotion-row select:hover:not(:disabled) {
  border-color: #1a1a1a;
}

.emotion-row select:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

.emotion-row select:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
  opacity: 0.6;
}

.emotion-cascade {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-bottom: 10px;
}

.emotion-cascade-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.emotion-cascade-item label {
  font-size: 11px;
  color: #6b7280;
  font-weight: 500;
}

.emotion-cascade-item select {
  padding: 6px 8px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: white;
}

/**
 * @description 修改级联箭头颜色为黑色
 * @date 2025-12-11
 */
.cascade-arrow {
  font-size: 16px;
  color: #1a1a1a;
  margin-bottom: 8px;
  font-weight: bold;
}

/**
 * @description 修改情感预览样式为黑白色调
 * @date 2025-12-11
 */
.emotion-preview {
  margin-top: 8px;
  padding: 8px;
  background: #f5f5f5;
  border: 1px solid #1a1a1a;
  border-radius: 4px;
  font-size: 12px;
  color: #1a1a1a;
  font-weight: 500;
  text-align: center;
}

/**
 * @description 试听按钮样式
 * @date 2025-11-03
 */
/**
 * @description 试听按钮样式 - 修改为黑白色调
 * @date 2025-11-03
 * @date 2025-12-11 修改: 配色改为黑白色调
 */
.voice-preview-btn {
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.voice-preview-btn:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  background: #333333;
}

.voice-preview-btn:active:not(:disabled) {
  transform: translateY(0);
}

.voice-preview-btn:disabled {
  background: #a0a0a0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  opacity: 0.6;
}

.emotion-loading, .emotion-error, .emotion-info {
  padding: 8px;
  text-align: center;
  font-size: 12px;
  border-radius: 4px;
  margin-top: 8px;
}

.emotion-loading {
  background: #f3f4f6;
  color: #6b7280;
}

/**
 * @description 修改错误提示样式为黑白色调
 * @date 2025-12-11
 */
.emotion-error {
  background: #f5f5f5;
  color: #333333;
}

.emotion-info {
  background: #f3f4f6;
  color: #9ca3af;
}

/**
 * @description 修改加载提示样式为黑白色调
 * @date 2025-12-11
 */
.voice-loading-hint {
  padding: 12px;
  background: #f5f5f5;
  border: 1px solid #d1d1d6;
  border-radius: 4px;
  color: #333333;
  font-size: 13px;
  text-align: center;
  margin-top: 8px;
}

/**
 * @description 旁白配音选择区域样式
 * @date 2025-11-03
 */
.narrator-voice-section {
  background: #f9fafb;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px;
  margin: 20px;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
}

.narrator-section-title {
  font-size: 18px;
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 16px 0;
  padding-bottom: 12px;
  border-bottom: 2px solid #e5e7eb;
}

.narrator-voice-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (max-width: 480px) {
  .character-generation-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .emotion-cascade {
    flex-direction: column;
    align-items: stretch;
  }

  .cascade-arrow {
    transform: rotate(90deg);
    align-self: center;
  }

  .narrator-voice-section {
    margin: 15px;
    padding: 15px;
  }
}

/* ==================== 场景生成样式 (16:9) ==================== */
/**
 * @description 场景生成区域样式
 * @date 2025-12-24
 * 功能：显示根据场景设计生成的场景图片（16:9横向画面）
 */

/* 场景生成区域容器 */
.scene-generation-section {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 1px solid #e5e5e5;
}

/* 场景生成头部 */
.scene-generation-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 0 20px;
}

.scene-generation-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

/* 场景生成网格容器 */
.scene-generation-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 24px;
  padding: 20px;
  max-width: 1400px;
  margin: 0 auto;
}

/* 单个场景卡片 */
.scene-card {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.scene-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* 场景图片容器 (16:9比例) */
.scene-card-image {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 9/16 = 0.5625 */
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  overflow: hidden;
}

.scene-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.scene-card-image img:hover {
  transform: scale(1.02);
}

/* 场景名称标签 */
.scene-name-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.7);
  color: #ffffff;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  z-index: 5;
}

/* 场景加载状态 */
.scene-card-loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.95);
  z-index: 10;
}

.scene-card-loading .spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f0f0f0;
  border-top-color: #1a1a1a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.scene-card-loading p {
  margin-top: 16px;
  color: #666;
  font-size: 14px;
}

/* 场景错误状态 */
.scene-card-error {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fef2f2;
  color: #dc2626;
}

.scene-card-error i {
  font-size: 32px;
  margin-bottom: 8px;
}

.scene-card-error p {
  font-size: 14px;
  text-align: center;
  padding: 0 20px;
}

/* 场景信息区域 */
.scene-card-info {
  padding: 16px;
  background: #fafafa;
  border-top: 1px solid #e5e5e5;
}

.scene-card-info h4 {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 12px 0;
}

.scene-card-info p {
  font-size: 13px;
  color: #666;
  margin: 0;
  line-height: 1.5;
}

/* 场景提示词容器 */
.scene-prompt-container {
  margin-top: 12px;
}

.scene-prompt-container label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 600;
  color: #666;
}

/**
 * @description 场景提示词输入框
 * @modification 添加可编辑样式提示
 * @date 2025-01-04
 */
.scene-prompt-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #e5e5e5;
  border-radius: 6px;
  font-size: 12px;
  font-family: inherit;
  resize: vertical;
  background: #fff;
  color: #333;
  min-height: 60px;
  cursor: text;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.scene-prompt-input:hover {
  border-color: #ccc;
}

.scene-prompt-input:focus {
  outline: none;
  border-color: #1a1a1a;
  box-shadow: 0 0 0 2px rgba(26, 26, 26, 0.1);
}

/* 场景重新生成按钮 */
.scene-regenerate-btn {
  margin-top: 12px;
  width: 100%;
  padding: 10px 16px;
  background: #1a1a1a;
  color: #ffffff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.scene-regenerate-btn:hover {
  background: #333;
}

.scene-regenerate-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* 场景生成响应式设计 */
@media (max-width: 768px) {
  .scene-generation-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 16px;
  }

  .scene-generation-header {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .scene-generation-grid {
    gap: 12px;
    padding: 12px;
  }
}

/* ==================== 标签芯片样式 ==================== */
/**
 * @description 角色和场景的标签芯片样式
 * @date 2025-01-19
 * 功能：黑底白字的标签芯片，显示在图片右上角
 */

/* 角色标签芯片 - 黑底白字 */
.character-tag-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #1a1a1a;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 场景标签芯片 - 黑底白字 */
.scene-tag-chip {
  position: absolute;
  top: 12px;
  right: 12px;
  background: #1a1a1a;
  color: #ffffff;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  letter-spacing: 0.5px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .character-tag-chip,
  .scene-tag-chip {
    font-size: 11px;
    padding: 4px 10px;
    max-width: 120px;
  }
}
