/**
 * File: client/css/voice-design.css
 * 音色设计组件样式
 * 作用: 音色设计面板的样式定义，卡片式布局
 * @date 2026-02-28
 */

/* 音色设计面板描述 */
.voice-design-description {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid #3b82f6;
  padding: 12px 16px;
  margin-bottom: 24px;
  border-radius: 4px;
}

.voice-design-description p {
  margin: 0;
  color: #64748b;
  font-size: 14px;
  line-height: 1.6;
}

/* 音色设计网格容器 */
.voice-design-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

/* 音色卡片 */
.voice-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 20px;
  transition: all 0.3s ease;
  position: relative;
  /**
   * @description 使用flex布局，让按钮固定在底部
   * @date 2026-02-28
   */
  display: flex;
  flex-direction: column;
  height: 100%;
}

.voice-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* 卡片头部 */
.voice-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

.voice-card-header .character-name {
  font-size: 16px;
  font-weight: 600;
  color: #1e293b;
  margin: 0;
}

.character-gender {
  font-size: 13px;
  color: #64748b;
  background: #f1f5f9;
  padding: 4px 12px;
  border-radius: 12px;
}

/* 卡片主体 */
.voice-card-body {
  margin-bottom: 12px;
  /**
   * @description 占据剩余空间，推动按钮到底部
   * @date 2026-02-28
   */
  flex: 1;
  display: flex;
  flex-direction: column;
}

.character-info {
  margin: 8px 0;
  font-size: 13px;
  color: #475569;
  line-height: 1.6;
}

.character-info strong {
  color: #1e293b;
}

/* 音色结果区域 */
.voice-result {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
}

.voice-label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: #1e293b;
}

.voice-desc-input {
  width: 100%;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.5;
  color: #475569;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  resize: vertical;
  font-family: inherit;
  transition: border-color 0.2s;
}

.voice-desc-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.voice-hint {
  margin: 6px 0 0 0;
  font-size: 11px;
  color: #94a3b8;
  font-style: italic;
}

/* 卡片底部操作按钮 */
.voice-card-footer {
  display: flex;
  gap: 8px;
  padding-top: 12px;
  /**
   * @description 防止按钮区域被压缩，保持固定在底部
   * @date 2026-02-28
   */
  flex-shrink: 0;
  margin-top: auto;
}

.voice-card-footer .btn {
  flex: 1;
  justify-content: center;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 按钮样式 */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: 6px;
}

.btn-success {
  background: #10b981;
  color: white;
  border: 1px solid #10b981;
}

.btn-success:hover {
  background: #059669;
  border-color: #059669;
}

/**
 * @description 黑色按钮样式（用于试听音色按钮）
 * @date 2026-02-28
 */
.btn-dark {
  background: #1e293b;
  color: white;
  border: 1px solid #1e293b;
}

.btn-dark:hover {
  background: #0f172a;
  border-color: #0f172a;
}

/**
 * @description 上传按钮样式（白底黑字）
 * @date 2026-03-24
 */
.btn-upload {
  background: white;
  color: #1e293b;
  border: 1px solid #cbd5e1;
  font-weight: 500;
}

.btn-upload:hover {
  background: #f8fafc;
  border-color: #1e293b;
  color: #0f172a;
}

.btn-outline {
  background: white;
  color: #64748b;
  border: 1px solid #cbd5e1;
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* Loading状态 */
.voice-loading {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10;
}

.spinner-small {
  width: 20px;
  height: 20px;
  border: 2px solid #e2e8f0;
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

.voice-loading span {
  font-size: 13px;
  color: #64748b;
}

/* 占位文本 */
.voice-design-grid .placeholder-text {
  grid-column: 1 / -1;
  text-align: center;
  color: #94a3b8;
  font-size: 14px;
  padding: 40px 20px;
}

/* 按钮禁用状态 */
button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .voice-design-grid {
    grid-template-columns: 1fr;
  }

  .voice-card-footer {
    flex-direction: column;
  }

  .voice-card-footer .btn {
    width: 100%;
  }
}
