/* ===== Digital Human — Design System (ClipMind Style) ===== */
:root {
  --bg-deep: #030014;
  --bg-card: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --accent: #a78bfa;
  --accent-2: #22d3ee;
  --accent-3: #f472b6;
  --success: #34d399;
  --danger: #f87171;
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Outfit", "PingFang SC", "Microsoft YaHei", sans-serif;
  --glow: 0 0 60px rgba(167, 139, 250, 0.25);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-deep);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
}

#particles-js {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.page-wrap {
  position: relative;
  z-index: 1;
  min-height: 100vh;
}

.container {
  width: min(1120px, 92vw);
  margin: 0 auto;
}

/* ===== Nav ===== */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.15rem;
}

.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  box-shadow: var(--glow);
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 0.9rem;
  transition: all 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.nav-links a.nav-disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.nav-links a.nav-disabled:hover {
  color: var(--text-muted);
  background: transparent;
}

.nav-links a.nav-disabled.active {
  opacity: 0.38;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  border: none;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.25s, box-shadow 0.25s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: linear-gradient(135deg, #8b5cf6, #6366f1, #22d3ee);
  background-size: 200% 200%;
  color: #fff;
  box-shadow: 0 8px 32px rgba(139, 92, 246, 0.35);
  animation: gradient-shift 4s ease infinite;
}

@keyframes gradient-shift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 12px 40px rgba(139, 92, 246, 0.5);
}

.btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border: 1px solid rgba(248, 113, 113, 0.3);
}

.btn-danger:hover {
  background: rgba(248, 113, 113, 0.2);
}

.btn-sm { padding: 8px 18px; font-size: 0.85rem; }

/* ===== Glass Card ===== */
.glass {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 28px;
  position: relative;
  overflow: hidden;
}

.glass::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
}

/* ===== Hero ===== */
.hero {
  min-height: calc(100vh - 72px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 0 60px;
  text-align: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-radius: 999px;
  background: rgba(167, 139, 250, 0.12);
  border: 1px solid rgba(167, 139, 250, 0.25);
  color: var(--accent);
  font-size: 0.85rem;
  margin-bottom: 24px;
}

.hero-badge .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse-dot 2s ease infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero h1 {
  font-size: clamp(2.2rem, 6vw, 3.8rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 20px;
  letter-spacing: -0.02em;
}

.gradient-text {
  background: linear-gradient(135deg, #e9d5ff, #a78bfa, #22d3ee, #f472b6);
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradient-shift 6s ease infinite;
}

.hero p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 auto 36px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ===== Feature Grid ===== */
.features { padding: 40px 0 80px; }

.section-eyebrow {
  text-align: center;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-2);
  margin-bottom: 10px;
}

.section-title {
  text-align: center;
  font-size: 1.6rem;
  margin-bottom: 12px;
  font-weight: 700;
}

.section-subtitle {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.feature-card {
  padding: 28px;
  border-radius: var(--radius);
  background: var(--bg-card);
  border: 1px solid var(--border);
  transition: transform 0.4s, border-color 0.4s, box-shadow 0.4s;
}

.feature-card:hover {
  transform: translateY(-6px);
  border-color: rgba(167, 139, 250, 0.3);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
}

.feature-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  margin-bottom: 16px;
}

.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-muted); font-size: 0.9rem; }

/* ===== Upload Zone ===== */
.upload-zone {
  border: 2px dashed rgba(167, 139, 250, 0.35);
  border-radius: 20px;
  padding: 56px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: rgba(167, 139, 250, 0.06);
  transform: scale(1.01);
}

.upload-icon-wrap {
  width: 80px; height: 80px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(139,92,246,0.2), rgba(34,211,238,0.2));
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== Progress ===== */
.progress-track {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-fill::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: progress-shimmer 1.8s ease-in-out infinite;
}

@keyframes progress-shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ===== Status Dots ===== */
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.ok { background: var(--success); box-shadow: 0 0 10px rgba(52,211,153,0.5); }
.status-dot.err { background: var(--danger); box-shadow: 0 0 10px rgba(248,113,113,0.5); }

/* ===== Toast ===== */
.app-toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

.app-toast {
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.45);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.28s ease, transform 0.28s ease;
  pointer-events: auto;
}

.app-toast.is-visible { opacity: 1; transform: translateY(0); }

.app-toast-error {
  color: #fef2f2;
  background: rgba(127, 29, 29, 0.92);
  border-color: rgba(248, 113, 113, 0.45);
}

/* ===== Page Loader ===== */
.page-loader {
  position: fixed;
  inset: 0;
  background: var(--bg-deep);
  z-index: 9999;
  display: grid;
  place-items: center;
  transition: opacity 0.5s, visibility 0.5s;
}

.page-loader.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-orbit {
  width: 56px; height: 56px;
  border: 3px solid rgba(167, 139, 250, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(3, 0, 20, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open { opacity: 1; visibility: visible; }

.modal-dialog {
  width: min(480px, 100%);
  background: linear-gradient(160deg, rgba(30, 20, 60, 0.98), rgba(15, 10, 35, 0.98));
  border: 1px solid rgba(167, 139, 250, 0.25);
  border-radius: 20px;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  transform: scale(0.92) translateY(20px);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-dialog {
  transform: scale(1) translateY(0);
}

.modal-dialog h3 { margin-bottom: 8px; }
.modal-dialog p { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .nav { flex-direction: column; gap: 12px; }
  .feature-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(167,139,250,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(167,139,250,0.4); }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(3, 0, 20, 0.75);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal-dialog {
  background: #0f0a24;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px;
  max-width: 440px;
  width: 90%;
  animation: modal-in 0.35s ease;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-dialog h3 { font-size: 1.1rem; margin-bottom: 8px; }
.modal-dialog p { color: var(--text-muted); font-size: 0.88rem; margin-bottom: 20px; line-height: 1.5; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ===== Status Dot ===== */
.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  flex-shrink: 0;
}
.status-dot.ok {
  background: var(--success);
  box-shadow: 0 0 8px rgba(52, 211, 153, 0.5);
}
.status-dot.err {
  background: var(--danger);
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.5);
}

/* ===== Progress ===== */
.progress-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ===== App Toast (manage page) ===== */
.app-toast-root {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.app-toast {
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #ecfdf5;
  background: rgba(6, 78, 59, 0.92);
  border: 1px solid rgba(52, 211, 153, 0.4);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s, transform 0.3s;
}
.app-toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.app-toast-error {
  color: #fef2f2;
  background: rgba(127, 29, 29, 0.92);
  border-color: rgba(248, 113, 113, 0.4);
}

/* ===== Hero Actions ===== */
.hero-actions {
  display: flex;
  gap: 16px;
  margin-top: 4px;
}
