/**
 * CloneModal 样式
 * 任务 3.13：音色克隆弹窗
 *
 * V21 Design System
 * CSS 前缀：xx-clonemodal-
 */

/* ── 容器 ───────────────────────────────────────────────── */

.xx-clonemodal-body {
  padding: 4px 0;
}

/* ── 步骤引导 ───────────────────────────────────────────── */

.xx-clonemodal-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  padding: 0 16px;
}

.xx-clonemodal-step {
  display: flex;
  align-items: center;
  gap: 8px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.xx-clonemodal-step--active {
  opacity: 1;
}

.xx-clonemodal-step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--xx-color-primary, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.xx-clonemodal-step:not(.xx-clonemodal-step--active)
  .xx-clonemodal-step-number {
  background: var(--xx-color-border, #e5e7eb);
  color: var(--xx-color-text-secondary, #6b7280);
}

.xx-clonemodal-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--xx-color-text, #111827);
  white-space: nowrap;
}

.xx-clonemodal-step-connector {
  width: 40px;
  height: 2px;
  background: var(--xx-color-border, #e5e7eb);
  margin: 0 8px;
  flex-shrink: 0;
}

/* ── 表单字段 ───────────────────────────────────────────── */

.xx-clonemodal-field {
  margin-bottom: 18px;
  position: relative;
}

.xx-clonemodal-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--xx-color-text, #111827);
  margin-bottom: 6px;
}

.xx-clonemodal-required {
  color: var(--xx-color-error, #ef4444);
  margin-left: 2px;
}

.xx-clonemodal-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--xx-color-border, #e5e7eb);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--xx-color-text, #111827);
  background: var(--xx-color-bg-secondary, #f9fafb);
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.xx-clonemodal-input:focus {
  border-color: var(--xx-color-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.xx-clonemodal-input::placeholder {
  color: var(--xx-color-text-placeholder, #9ca3af);
}

.xx-clonemodal-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--xx-color-border, #e5e7eb);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--xx-color-text, #111827);
  background: var(--xx-color-bg-secondary, #f9fafb);
  outline: none;
  resize: vertical;
  font-family: inherit;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
  box-sizing: border-box;
}

.xx-clonemodal-textarea:focus {
  border-color: var(--xx-color-primary, #6366f1);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.xx-clonemodal-textarea::placeholder {
  color: var(--xx-color-text-placeholder, #9ca3af);
}

.xx-clonemodal-char-count {
  position: absolute;
  right: 0;
  top: 0;
  font-size: 12px;
  color: var(--xx-color-text-secondary, #6b7280);
}

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

.xx-clonemodal-upload-zone {
  border: 2px dashed var(--xx-color-border, #e5e7eb);
  border-radius: var(--radius-sm);
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--xx-color-bg-secondary, #f9fafb);
}

.xx-clonemodal-upload-zone:hover {
  border-color: var(--xx-color-primary, #6366f1);
  background: rgba(99, 102, 241, 0.03);
}

.xx-clonemodal-upload-zone--active {
  border-color: var(--xx-color-primary, #6366f1);
  background: rgba(99, 102, 241, 0.06);
}

.xx-clonemodal-upload-zone--has-file {
  border-style: solid;
  border-color: var(--xx-color-primary, #6366f1);
  background: rgba(99, 102, 241, 0.04);
}

.xx-clonemodal-upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.xx-clonemodal-upload-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--xx-color-text, #111827);
  margin: 0 0 4px;
  word-break: break-all;
}

.xx-clonemodal-upload-hint {
  font-size: 12px;
  color: var(--xx-color-text-secondary, #6b7280);
  margin: 0;
}

/* ── 错误提示 ───────────────────────────────────────────── */

.xx-clonemodal-error {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--xx-color-error, #ef4444);
  font-size: 13px;
  margin-bottom: 16px;
}

.xx-clonemodal-error-icon {
  flex-shrink: 0;
  font-size: 14px;
}

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

.xx-clonemodal-tip {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-xs);
  background: rgba(99, 102, 241, 0.06);
  font-size: 12px;
  color: var(--xx-color-text-secondary, #6b7280);
  margin-bottom: 20px;
  line-height: 1.5;
}

.xx-clonemodal-tip-icon {
  flex-shrink: 0;
  font-size: 14px;
}

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

.xx-clonemodal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 4px;
}

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

.xx-clonemodal-uploading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  text-align: center;
}

.xx-clonemodal-uploading-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--xx-color-border, #e5e7eb);
  border-top-color: var(--xx-color-primary, #6366f1);
  border-radius: 50%;
  animation: xx-clonemodal-spin 0.8s linear infinite;
  margin-bottom: 20px;
}

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

.xx-clonemodal-uploading-text {
  font-size: 16px;
  font-weight: 500;
  color: var(--xx-color-text, #111827);
  margin: 0 0 8px;
}

.xx-clonemodal-uploading-sub {
  font-size: 13px;
  color: var(--xx-color-text-secondary, #6b7280);
  margin: 0;
}

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

.xx-clonemodal-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0;
}

.xx-clonemodal-divider-line {
  flex: 1;
  height: 1px;
  background: var(--xx-color-border, #e5e7eb);
}

.xx-clonemodal-divider-text {
  font-size: 13px;
  color: var(--xx-color-text-secondary, #6b7280);
  font-weight: 500;
}

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

.xx-clonemodal-record-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--xx-color-border, #e5e7eb);
  border-radius: var(--radius-xs);
  background: var(--xx-color-bg-secondary, #f9fafb);
}

.xx-clonemodal-record-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.xx-clonemodal-record-hint {
  margin: 0;
  font-size: 13px;
  color: var(--xx-color-text-secondary, #6b7280);
}

/* 录制波形动画 */
.xx-clonemodal-record-wave {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.xx-clonemodal-record-wave-bar {
  width: 3px;
  background: var(--xx-color-primary, #6366f1);
  border-radius: 999px;
  animation: xx-clonemodal-wave 0.8s ease-in-out infinite alternate;
}

.xx-clonemodal-record-wave-bar:nth-child(1) {
  height: 40%;
  animation-delay: 0s;
}
.xx-clonemodal-record-wave-bar:nth-child(2) {
  height: 70%;
  animation-delay: 0.15s;
}
.xx-clonemodal-record-wave-bar:nth-child(3) {
  height: 100%;
  animation-delay: 0.3s;
}
.xx-clonemodal-record-wave-bar:nth-child(4) {
  height: 60%;
  animation-delay: 0.45s;
}
.xx-clonemodal-record-wave-bar:nth-child(5) {
  height: 30%;
  animation-delay: 0.6s;
}

@keyframes xx-clonemodal-wave {
  from {
    transform: scaleY(0.4);
  }
  to {
    transform: scaleY(1);
  }
}

/* 录制按钮 */
.xx-clonemodal-record-btn {
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 50%;
  background: var(--xx-color-bg, #fff);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  font-size: 20px;
  cursor: pointer;
  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.xx-clonemodal-record-btn:hover {
  background: rgba(99, 102, 241, 0.06);
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.xx-clonemodal-record-btn--recording {
  background: var(--xx-color-error, #ef4444);
  color: #fff;
  animation: xx-clonemodal-pulse 1.2s ease-in-out infinite;
}

.xx-clonemodal-record-btn--recording:hover {
  background: #dc2626;
}

@keyframes xx-clonemodal-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* ── 进度阶段（上传中 / 克隆中 / 完成） ─────────────── */

.xx-clonemodal-progress-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  padding: 24px 0 16px;
}

/* 进度步骤指示器 */
.xx-clonemodal-steps-progress {
  display: flex;
  align-items: center;
  gap: 0;
  width: 100%;
  max-width: 360px;
}

.xx-clonemodal-step-progress {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 1;
}

.xx-clonemodal-step-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--xx-color-bg-tertiary, #f3f4f6);
  border: 2px solid var(--xx-color-border, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--xx-color-text-secondary, #6b7280);
  transition: all 0.3s ease;
}

.xx-clonemodal-step-progress--active .xx-clonemodal-step-icon {
  background: rgba(99, 102, 241, 0.08);
  border-color: var(--xx-color-primary, #6366f1);
  color: var(--xx-color-primary, #6366f1);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.12);
}

.xx-clonemodal-step-progress--done .xx-clonemodal-step-icon {
  background: rgba(34, 197, 94, 0.08);
  border-color: #22c55e;
  color: #22c55e;
}

.xx-clonemodal-step-progress--active .xx-clonemodal-step-label {
  color: var(--xx-color-primary, #6366f1);
  font-weight: 600;
}

.xx-clonemodal-step-progress--done .xx-clonemodal-step-label {
  color: #22c55e;
}

.xx-clonemodal-step-connector {
  flex: 0 0 40px;
  height: 2px;
  background: var(--xx-color-border, #e5e7eb);
  margin-bottom: 20px;
  transition: background 0.3s ease;
}

.xx-clonemodal-step-connector--done {
  background: #86efac;
}

/* 进度信息 */
.xx-clonemodal-progress-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.xx-clonemodal-progress-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--xx-color-primary, #6366f1);
  border-radius: 50%;
  animation: xx-clonemodal-spin 0.8s linear infinite;
}

.xx-clonemodal-progress-spinner--cloning {
  border-color: rgba(34, 197, 94, 0.15);
  border-top-color: #22c55e;
}

.xx-clonemodal-progress-text {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: var(--xx-color-text, #111827);
}

.xx-clonemodal-progress-sub {
  margin: 0;
  font-size: 13px;
  color: var(--xx-color-text-secondary, #6b7280);
}

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

.xx-clonemodal-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
}

.xx-clonemodal-success-icon {
  font-size: 48px;
  line-height: 1;
  animation: xx-clonemodal-bounce 0.6s ease-out;
}

@keyframes xx-clonemodal-bounce {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  60% {
    transform: scale(1.2);
    opacity: 1;
  }
  100% {
    transform: scale(1);
  }
}

.xx-clonemodal-success-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--xx-color-text, #111827);
}

.xx-clonemodal-success-desc {
  margin: 0;
  font-size: 13px;
  color: var(--xx-color-text-secondary, #6b7280);
  max-width: 280px;
  line-height: 1.6;
}

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

@media (max-width: 768px) {
  .xx-clonemodal-steps {
    padding: 0 8px;
  }

  .xx-clonemodal-step-connector {
    width: 24px;
    margin: 0 4px;
  }

  .xx-clonemodal-step-label {
    font-size: 12px;
  }

  .xx-clonemodal-step-number {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .xx-clonemodal-record-area {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .xx-clonemodal-record-btn {
    align-self: center;
  }

  .xx-clonemodal-steps-progress {
    max-width: 280px;
  }

  .xx-clonemodal-footer {
    flex-direction: column-reverse;
  }

  .xx-clonemodal-footer > * {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .xx-clonemodal-step-icon {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .xx-clonemodal-step-connector {
    flex: 0 0 16px;
    margin-bottom: 16px;
  }

  .xx-clonemodal-progress-spinner {
    width: 36px;
    height: 36px;
  }

  .xx-clonemodal-success-icon {
    font-size: 36px;
  }
}
