/* ====================================
   components.css: 复杂定制组件 (upload, voice-trainer, alert variants)
   ==================================== */

/* ===== Voice upload area ===== */
.voice-trainer {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-brand-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-top: var(--s-3);
}
.voice-trainer > summary {
  padding: var(--s-3) var(--s-4);
  cursor: pointer;
  list-style: none;
  display: flex; align-items: center;
  font-weight: 600; font-size: 13px;
  user-select: none;
}
.voice-trainer > summary::-webkit-details-marker { display: none; }
.voice-trainer > summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--color-text-secondary);
  transition: transform .2s;
}
.voice-trainer[open] > summary { background: var(--color-brand-100); }
.voice-trainer[open] > summary::after { transform: rotate(180deg); }
.voice-trainer__body {
  padding: var(--s-4);
  border-top: 1px solid var(--color-brand-200);
  background: var(--color-bg-card);
  display: flex; flex-direction: column;
  gap: var(--s-3);
}
.voice-trainer__step {
  display: flex; gap: var(--s-3); align-items: flex-start;
}
.voice-trainer__num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--color-brand-500);
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  flex-shrink: 0;
}

/* ===== Final step CTA bar ===== */
.cta-final {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: var(--s-3);
  border-top: 1px solid rgba(255,255,255,.2);
  flex-wrap: wrap;
  gap: var(--s-3);
}

/* ===== Status pill (for model-status / loading) ===== */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 600;
}
.status-pill__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.status-pill--ok .status-pill__dot { background: var(--color-success); }
.status-pill--loading .status-pill__dot { background: var(--color-warning); animation: pulse 1.4s infinite; }
.status-pill--off .status-pill__dot { background: var(--color-neutral-300); }
.status-pill--off { opacity: 0.6; }
.status-pill--loading { color: var(--color-warning); border-color: var(--color-warning); }

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.85); }
}

/* ===== Spinner (loading state) ===== */
.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid var(--color-brand-100);
  border-top-color: var(--color-brand-500);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Toast (瞬时消息) — v5.0.74: 底部改顶部居中 + 放大醒目，贴近操作区上方 */
.toast {
  position: fixed;
  top: 18px; left: 50%;
  transform: translateX(-50%);
  background: var(--color-neutral-900);
  color: white;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  z-index: 1000;
  animation: toastIn .3s ease;
  box-shadow: var(--shadow-lg);
  max-width: calc(100vw - 32px);
  text-align: center;
  white-space: pre-line;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -8px); } }
.toast--success { background: var(--color-success); }
.toast--warning { background: var(--color-warning); color: var(--color-text); }
.toast--danger { background: var(--color-danger); }
