/**
 * CloneVoiceModal — V21 Design System
 *
 * 音色克隆弹窗样式
 * 三步骤状态：input → uploading → success
 */

/* ── 弹窗内容区 ─────────────────────────────────────────── */

.cvm-body {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── 表单区 ─────────────────────────────────────────────── */

.cvm-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cvm-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #475467);
}

.cvm-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--line, #e4e7ec);
  border-radius: var(--radius-sm);
  background: var(--bg-surface, #fff);
  color: var(--text-primary, #101828);
  font-size: 14px;
  line-height: 1.5;
  transition:
    border-color 0.2s,
    box-shadow 0.2s;
  outline: none;
}

.cvm-input:focus {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 3px
    color-mix(in srgb, var(--primary-color) 12%, transparent);
}

.cvm-input::placeholder {
  color: var(--muted, #98a2b3);
}

/* ── 上传区域 ───────────────────────────────────────────── */

.cvm-upload-zone {
  border: 2px dashed var(--line, #e4e7ec);
  border-radius: var(--radius-md);
  padding: 28px 20px;
  text-align: center;
  background: var(--bg-subtle, #f8fafc);
  cursor: pointer;
  transition:
    border-color 0.2s,
    background 0.2s;
}

.cvm-upload-zone:hover {
  border-color: var(--primary, #6366f1);
  background: color-mix(in srgb, var(--primary-color) 4%, transparent);
}

.cvm-upload-zone.cvm-upload-zone--active {
  border-color: var(--primary, #6366f1);
  background: color-mix(in srgb, var(--primary-color) 6%, transparent);
}

.cvm-upload-icon {
  font-size: 36px;
  margin-bottom: 8px;
  line-height: 1;
}

.cvm-upload-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #101828);
  margin: 0 0 4px;
}

.cvm-upload-hint {
  font-size: 13px;
  color: var(--muted, #98a2b3);
  margin: 0;
}

/* ── 或分隔线 ───────────────────────────────────────────── */

.cvm-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 4px 0;
}

.cvm-divider-line {
  flex: 1;
  height: 1px;
  background: var(--line, #e4e7ec);
}

.cvm-divider-text {
  font-size: 13px;
  color: var(--muted, #98a2b3);
  flex-shrink: 0;
}

/* ── 录制区域 ───────────────────────────────────────────── */

.cvm-record-area {
  border: 1px solid var(--line, #e4e7ec);
  border-radius: var(--radius-md);
  padding: 24px;
  text-align: center;
}

.cvm-record-hint {
  font-size: 13px;
  color: var(--muted, #98a2b3);
  margin: 0 0 14px;
}

.cvm-record-btn {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  padding: 0;
  background: linear-gradient(
    135deg,
    var(--error-color, #ef4444),
    var(--error-dark, #dc2626)
  );
  color: var(--text-inverse);
  box-shadow: 0 4px 14px
    color-mix(in srgb, var(--error-color, #ef4444) 35%, transparent);
  transition:
    transform 0.15s,
    box-shadow 0.15s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cvm-record-btn:hover {
  transform: scale(1.06);
  box-shadow: 0 6px 20px
    color-mix(in srgb, var(--error-color, #ef4444) 45%, transparent);
}

.cvm-record-btn:active {
  transform: scale(0.96);
}

.cvm-record-btn--recording {
  animation: cvm-pulse 1.2s ease-in-out infinite;
}

@keyframes cvm-pulse {
  0%,
  100% {
    box-shadow: 0 4px 14px
      color-mix(in srgb, var(--error-color, #ef4444) 35%, transparent);
  }
  50% {
    box-shadow: 0 4px 28px
      color-mix(in srgb, var(--error-color, #ef4444) 60%, transparent);
  }
}

/* ── 提示条 ─────────────────────────────────────────────── */

.cvm-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: var(--warning-soft, #fef3c7);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--warning-color, #92400e);
  line-height: 1.5;
}

.cvm-tip-icon {
  flex-shrink: 0;
  font-size: 14px;
  line-height: 1.5;
}

/* ── 底部按钮 ───────────────────────────────────────────── */

.cvm-footer {
  display: flex;
  gap: 12px;
  margin-top: 4px;
}

.cvm-footer .xx-btn {
  flex: 1;
}

/* ── 上传中状态 ─────────────────────────────────────────── */

.cvm-uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 16px;
}

.cvm-uploading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--line, #e4e7ec);
  border-top-color: var(--primary, #6366f1);
  border-radius: 50%;
  animation: cvm-spin 0.8s linear infinite;
}

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

.cvm-uploading-text {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-primary, #101828);
  margin: 0;
}

.cvm-uploading-sub {
  font-size: 13px;
  color: var(--muted, #98a2b3);
  margin: 0;
}

/* ── 成功状态 ───────────────────────────────────────────── */

.cvm-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  gap: 12px;
}

.cvm-success-icon {
  font-size: 56px;
  line-height: 1;
}

.cvm-success-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #101828);
  margin: 0;
}

.cvm-success-desc {
  font-size: 14px;
  color: var(--muted, #98a2b3);
  margin: 0;
}

/* ── 响应式 ─────────────────────────────────────────────── */

@media (max-width: 768px) {
  .cvm-overlay {
    padding: var(--space-md);
  }

  .cvm-modal {
    width: 100%;
    max-width: 100%;
    padding: var(--space-lg);
  }
}

@media (max-width: 576px) {
  .cvm-upload-zone {
    padding: 20px 14px;
  }

  .cvm-record-btn {
    width: 64px;
    height: 64px;
    font-size: 26px;
  }

  .cvm-footer {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .cvm-record-btn {
    width: 60px;
    height: 60px;
  }

  .cvm-tip {
    font-size: 12px;
    padding: var(--space-sm);
  }
}
