/**
 * File: client/css/storyboard.css
 * 分镜生成页面样式 - Apple风格黑白主题
 * 作用: 定义分镜生成界面的样式
 * @modification 全部改为黑白灰配色，去除所有彩色
 * @date 2025-12-09
 */

/* ========== 顶部控制栏 ========== */
.aspect-ratio-selector {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  padding: 15px 20px;
  background: #f8f9fa;
  border-radius: 12px;
}

.aspect-ratio-selector label {
  font-weight: 600;
  font-size: 16px;
  color: #333333;
  margin-right: 10px;
}

.aspect-ratio-buttons {
  display: flex;
  gap: 10px;
}

/**
 * @description 比例按钮改为黑白
 * @date 2025-12-09
 */
.aspect-ratio-btn {
  padding: 10px 20px;
  border: 2px solid #dddddd;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.aspect-ratio-btn:hover {
  border-color: #000000;
  background: #f5f5f5;
}

.aspect-ratio-btn.active {
  border-color: #000000;
  background: #000000;
  color: #fff;
}

/* ========== 分镜生成按钮 ========== */
.storyboard-generate-section {
  display: flex;
  align-items: center;
}

/**
 * @description 生成按钮改为黑色
 * @date 2025-12-09
 */
#generateStoryboardBtn {
  padding: 15px 40px;
  background: #000000;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#generateStoryboardBtn:hover {
  background: #333333;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transform: translateY(-2px);
}

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

/* ========== 分镜网格布局 ========== */
.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-top: 30px;
}

@media (max-width: 1400px) {
  .storyboard-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

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

/* ========== 分镜卡片 ========== */
.storyboard-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: all 0.3s ease;
}

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

.storyboard-card.error {
  border: 2px solid #333333;
}

.storyboard-card.loading .storyboard-card-image {
  min-height: 150px;
}

/**
 * @description 卡片头部改为黑色
 * @date 2025-12-09
 */
.storyboard-card-header {
  background: #000000;
  padding: 12px 16px;
  color: #fff;
}

.storyboard-card-header h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

/* 图片区域 */
.storyboard-card-image {
  position: relative;
  width: 100%;
  background: #f5f5f5;
  overflow: hidden;
}

.storyboard-preview-img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.storyboard-preview-img:hover {
  transform: scale(1.05);
}

/* 自定义上传图片按钮样式 */
.storyboard-upload-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;
}

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

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

/* 上传中加载状态 */
.storyboard-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 40px 20px;
  background: rgba(255, 255, 255, 0.95);
}

/**
 * @description 加载spinner改为黑色
 * @date 2025-12-09
 */
.storyboard-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f0f0f0;
  border-top-color: #000000;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.storyboard-loading p {
  margin-top: 12px;
  color: #666666;
  font-size: 14px;
}

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

/* 错误提示 */
.storyboard-card-error {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 40px 20px;
  background: #f5f5f5;
}

.storyboard-card-error i {
  font-size: 48px;
  margin-bottom: 12px;
}

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

/* 卡片内容区域 */
.storyboard-card-content {
  padding: 16px;
}

.storyboard-scene {
  margin-bottom: 12px;
  font-size: 14px;
  color: #666666;
  line-height: 1.6;
}

.storyboard-scene strong {
  color: #333333;
  font-weight: 600;
}

/* 提示词编辑区 */
.storyboard-prompt {
  margin-bottom: 12px;
}

.storyboard-prompt label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #333333;
}

.prompt-textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  transition: border-color 0.3s ease;
  min-height: 120px;
  line-height: 1.5;
}

/**
 * @description 文本框聚焦改为黑色边框
 * @date 2025-12-09
 */
.prompt-textarea:focus {
  outline: none;
  border-color: #000000;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/**
 * @description 重新生成按钮改为黑色
 * @date 2025-12-09
 */
.storyboard-regenerate-btn {
  width: 100%;
  padding: 10px;
  background: #000000;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.storyboard-regenerate-btn:hover {
  background: #333333;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

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

/* ========== 参考图编辑开关 ========== */
/**
 * @description 参考图编辑开关样式
 * @date 2025-12-10
 */
.reference-edit-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.3s;
  border-radius: 24px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked + .toggle-slider {
  background-color: #000000;
}

.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(20px);
}

.toggle-label {
  font-size: 13px;
  color: #666666;
}

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

/* ========== 响应式布局 ========== */
@media (max-width: 768px) {
  .storyboard-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .aspect-ratio-selector {
    flex-direction: column;
    align-items: flex-start;
  }

  .aspect-ratio-buttons {
    width: 100%;
  }

  .aspect-ratio-btn {
    flex: 1;
  }

  #generateStoryboardBtn {
    width: 100%;
  }
}
