/* ═══════════════════════════════════════════════════════════
   Easy Prompt Web — Design System
   Inspired by: v0.dev · ChatGPT · Linear · Vercel · shadcn/ui
   Raycast · Stripe · Arc · Framer · Dify · Cal.com · Resend
   Supabase · Cursor · Notion · Perplexity · Mintlify · Jasper
   Copy.ai · Writesonic · Railway
   ═══════════════════════════════════════════════════════════ */

/* ─── 1. Design Tokens ─── */
:root {
  /* Surface */
  --bg-base: #09090b;
  --bg-subtle: #0f0f14;
  --bg-muted: #18181b;
  --bg-elevated: #1c1c22;
  --bg-overlay: rgba(0, 0, 0, 0.6);

  /* Border */
  --border: rgba(255, 255, 255, 0.06);
  --border-hover: rgba(255, 255, 255, 0.12);
  --border-active: rgba(139, 92, 246, 0.4);

  /* Text */
  --text-primary: #fafafa;
  --text-secondary: #a1a1aa;
  --text-muted: #71717a;
  --text-faint: #52525b;

  /* Accent */
  --accent: #8b5cf6;
  --accent-hover: #7c3aed;
  --accent-subtle: rgba(139, 92, 246, 0.12);
  --accent-glow: rgba(139, 92, 246, 0.2);
  --gradient-start: #8b5cf6;
  --gradient-end: #6366f1;

  /* Semantic */
  --success: #22c55e;
  --success-subtle: rgba(34, 197, 94, 0.12);
  --error: #ef4444;
  --error-subtle: rgba(239, 68, 68, 0.12);
  --warning: #f59e0b;
  --warning-subtle: rgba(245, 158, 11, 0.12);

  /* Typography */
  --font-sans:
    "MiSans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono:
    "JetBrains Mono", "SF Mono", "Fira Code", "Cascadia Code", monospace;

  /* Spacing */
  --header-height: 56px;
  --max-width: 720px;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.08);

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
}

/* Light theme */
[data-theme="light"] {
  --bg-base: #fafafa;
  --bg-subtle: #f5f5f5;
  --bg-muted: rgba(0, 0, 0, 0.015);
  --bg-elevated: #fff;
  --bg-overlay: rgba(0, 0, 0, 0.35);
  --border: rgba(0, 0, 0, 0.06);
  --border-hover: rgba(0, 0, 0, 0.12);
  --border-active: rgba(139, 92, 246, 0.5);
  --text-primary: #09090b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --text-faint: #a1a1aa;
  --accent-subtle: rgba(139, 92, 246, 0.06);
  --accent-glow: rgba(139, 92, 246, 0.12);
  --success-subtle: rgba(34, 197, 94, 0.08);
  --error-subtle: rgba(239, 68, 68, 0.08);
  --warning-subtle: rgba(245, 158, 11, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.03);
  --shadow-glow: 0 0 40px rgba(139, 92, 246, 0.06);
  --gradient-start: #a78bfa;
  --gradient-end: #818cf8;
}

/* ─── 2. Reset & Base ─── */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-base);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Theme transition — activated via .theme-transitioning class */
html.theme-transitioning,
html.theme-transitioning *,
html.theme-transitioning *::before,
html.theme-transitioning *::after {
  transition:
    background-color 0.5s ease,
    border-color 0.5s ease,
    color 0.3s ease,
    box-shadow 0.5s ease,
    fill 0.3s ease,
    stroke 0.3s ease !important;
}

/* Scroll-triggered reveal */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity 0.6s var(--ease-out),
    transform 0.6s var(--ease-out),
    filter 0.6s var(--ease-out);
  filter: blur(3px);
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0);
  filter: blur(0);
}

::selection {
  background: rgba(139, 92, 246, 0.3);
  color: var(--text-primary);
  text-shadow: 0 0 8px rgba(139, 92, 246, 0.4);
}

[data-theme="light"] ::selection {
  background: rgba(139, 92, 246, 0.2);
  color: var(--text-primary);
}

input,
textarea,
button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

a {
  color: var(--accent);
  text-decoration: none;
}

/* ─── 3. Ambient Background ─── */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.15;
  will-change: transform;
}

/* 右上角主光晕 — 紫蓝锥形旋转渐变 */
.ambient-orb--1 {
  width: 600px;
  height: 600px;
  background: conic-gradient(
    from 180deg at 50% 50%,
    var(--gradient-start),
    #6366f1,
    #818cf8,
    var(--gradient-end),
    var(--gradient-start)
  );
  top: -240px;
  right: -150px;
  opacity: 0.22;
  filter: blur(80px);
  animation: orbDrift1 12s ease-in-out infinite;
}

/* 左下角光晕 — 青粉锥形渐变 */
.ambient-orb--2 {
  width: 520px;
  height: 520px;
  background: conic-gradient(
    from 0deg at 50% 50%,
    #06b6d4,
    var(--gradient-end),
    #ec4899,
    #06b6d4
  );
  bottom: -200px;
  left: -130px;
  opacity: 0.18;
  filter: blur(80px);
  animation: orbDrift2 16s ease-in-out infinite;
}

/* 中心微光 — 品红脉冲 */
.ambient-orb--3 {
  width: 300px;
  height: 300px;
  background: conic-gradient(
    from 90deg at 50% 50%,
    #ec4899,
    #a855f7,
    #6366f1,
    #ec4899
  );
  top: 35%;
  left: calc(50% - 150px);
  opacity: 0.1;
  filter: blur(80px);
  animation: orbDrift3 10s ease-in-out infinite;
}

/* 网格覆盖层 — 科技感 */
.ambient-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.06) 1px, transparent 1px);
  background-size: 60px 60px;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    black 20%,
    transparent 70%
  );
  -webkit-mask-image: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    black 20%,
    transparent 70%
  );
  animation: gridPulse 6s ease-in-out infinite alternate;
}

@keyframes gridPulse {
  from {
    opacity: 0.5;
  }
  to {
    opacity: 1;
  }
}

/* 顶部光线扫描效果 */
.ambient-bg::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.6),
    rgba(99, 102, 241, 0.4),
    transparent
  );
  box-shadow: 0 0 20px 2px rgba(139, 92, 246, 0.3);
  animation: ambientScanline 8s ease-in-out infinite;
}

@keyframes ambientScanline {
  0% {
    left: -60%;
  }
  50% {
    left: 100%;
  }
  100% {
    left: -60%;
  }
}

/* 亮色主题——光球使用高饱和色调，透明度显著提高 */
[data-theme="light"] .ambient-orb {
  filter: blur(80px);
}

[data-theme="light"] .ambient-orb--1 {
  background: conic-gradient(
    from 180deg at 50% 50%,
    #8b5cf6,
    #3b82f6,
    #6366f1,
    #a78bfa,
    #8b5cf6
  );
  opacity: 0.35;
}

[data-theme="light"] .ambient-orb--2 {
  background: conic-gradient(
    from 0deg at 50% 50%,
    #06b6d4,
    #8b5cf6,
    #ec4899,
    #06b6d4
  );
  opacity: 0.3;
}

[data-theme="light"] .ambient-orb--3 {
  background: conic-gradient(
    from 90deg at 50% 50%,
    #a78bfa,
    #818cf8,
    #60a5fa,
    #a78bfa
  );
  opacity: 0.32;
  animation: orbDrift3Light 10s ease-in-out infinite;
}

[data-theme="light"] .ambient-bg::before {
  background-image:
    linear-gradient(rgba(139, 92, 246, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(139, 92, 246, 0.04) 1px, transparent 1px);
}

[data-theme="light"] .ambient-bg::after {
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.3),
    rgba(99, 102, 241, 0.2),
    transparent
  );
  box-shadow: 0 0 15px 1px rgba(139, 92, 246, 0.15);
}

/* ─── 4. Header ─── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background: color-mix(in srgb, var(--bg-base) 72%, transparent);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
}

.header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.header__logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: -0.01em;
  transition: opacity var(--duration-fast);
}

.header__logo:hover {
  opacity: 0.8;
}

.header__logo-icon {
  color: var(--accent);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.header__nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast);
  text-decoration: none;
}

.header__nav-btn:hover {
  background: var(--border);
  color: var(--text-primary);
}

.header__nav-label {
  display: none;
}

@media (min-width: 640px) {
  .header__nav-label {
    display: inline;
  }
}

/* Theme toggle icon state */
[data-theme="dark"] .icon-moon {
  display: none;
}
[data-theme="dark"] .icon-sun {
  display: block;
}
[data-theme="light"] .icon-sun {
  display: none;
}
[data-theme="light"] .icon-moon {
  display: block;
}

/* ─── 5. Main ─── */
.main {
  position: relative;
  z-index: 1;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px 80px;
  min-height: calc(100vh - var(--header-height) - 60px);
}

/* ─── 6. Hero ─── */
.hero {
  text-align: center;
  padding: 60px 0 40px;
}

.hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin-bottom: 24px;
  border: 1px solid rgba(139, 92, 246, 0.15);
}

.hero__title {
  font-size: clamp(32px, 6vw, 48px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.hero__title-gradient {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end),
    #ec4899,
    var(--gradient-start),
    var(--gradient-end)
  );
  background-size: 300% 300%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientFlow 6s ease-in-out infinite;
}

@keyframes gradientFlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.hero__subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ─── 7. Input Section ─── */
.input-section {
  margin-bottom: 16px;
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out),
    filter var(--duration-slow) var(--ease-out);
}

.input-section.is-generating {
  opacity: 0.6;
  transform: scale(0.98) translateY(-4px);
  filter: blur(1px);
  pointer-events: none;
}

.input-box {
  position: relative;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(48px) saturate(200%) brightness(1.05);
  -webkit-backdrop-filter: blur(48px) saturate(200%) brightness(1.05);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -1px 0 rgba(0, 0, 0, 0.15),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.08),
    0 8px 32px rgba(0, 0, 0, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.1),
    var(--shadow-glow);
  transition:
    border-color var(--duration-normal) var(--ease-out),
    box-shadow var(--duration-slow) var(--ease-out),
    background var(--duration-normal) var(--ease-out);
  overflow: hidden;
}

[data-theme="light"] .input-box {
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(48px) saturate(200%) brightness(1.1);
  -webkit-backdrop-filter: blur(48px) saturate(200%) brightness(1.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 -1px 0 rgba(0, 0, 0, 0.04),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.25),
    0 8px 32px rgba(0, 0, 0, 0.07),
    0 2px 8px rgba(0, 0, 0, 0.04),
    var(--shadow-glow);
}

.input-box::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    transparent 40%,
    rgba(139, 92, 246, 0) 40%,
    rgba(139, 92, 246, 0) 100%
  );
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--duration-slow) var(--ease-out);
  z-index: 1;
}

.input-box:focus-within::before {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end),
    #ec4899,
    var(--gradient-end),
    var(--gradient-start)
  );
  background-size: 300% 300%;
  animation: borderGlow 4s ease-in-out infinite;
  opacity: 1;
}

@keyframes borderGlow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.input-box:focus-within {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(56px) saturate(220%) brightness(1.08);
  -webkit-backdrop-filter: blur(56px) saturate(220%) brightness(1.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.25),
    inset 0 -1px 0 rgba(0, 0, 0, 0.18),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.1),
    0 12px 40px rgba(0, 0, 0, 0.22),
    0 0 0 3px var(--accent-glow),
    0 0 60px -10px rgba(139, 92, 246, 0.18),
    var(--shadow-glow);
}

[data-theme="light"] .input-box:focus-within {
  background: rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(56px) saturate(220%) brightness(1.12);
  -webkit-backdrop-filter: blur(56px) saturate(220%) brightness(1.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.6),
    inset 0 -1px 0 rgba(0, 0, 0, 0.05),
    inset 0 0 0 0.5px rgba(255, 255, 255, 0.3),
    0 12px 40px rgba(0, 0, 0, 0.1),
    0 0 0 3px var(--accent-glow),
    0 0 60px -10px rgba(139, 92, 246, 0.18),
    var(--shadow-glow);
}

.input-box__textarea {
  display: block;
  width: 100%;
  min-height: 160px;
  max-height: 400px;
  padding: 20px 20px 0;
  border: none;
  outline: none;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  transition: color var(--duration-normal) var(--ease-out);
}

.input-box__textarea::placeholder {
  transition: all var(--duration-normal) var(--ease-out);
}

.input-box__textarea:focus::placeholder {
  opacity: 0.4;
}

.input-box.has-content {
  border-color: var(--border-hover);
  background: color-mix(in srgb, var(--bg-elevated) 97%, var(--accent) 3%);
}

.input-box__textarea {
  line-height: 1.7;
  resize: vertical;
  font-family: var(--font-sans);
}

.input-box__textarea::placeholder {
  color: var(--text-faint);
}

.input-box__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  gap: 12px;
}

.input-box__meta {
  display: flex;
  align-items: center;
  gap: 10px;
}

.input-box__counter {
  font-size: 12px;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.input-box__counter.is-warning {
  color: var(--warning);
}

.input-box__counter.is-danger {
  color: var(--error);
}

.input-box__actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ─── 8. Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: none;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color var(--duration-fast),
    box-shadow var(--duration-fast),
    transform var(--duration-fast),
    opacity var(--duration-fast);
  white-space: nowrap;
  user-select: none;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn--primary {
  background: linear-gradient(
    135deg,
    var(--gradient-start),
    var(--gradient-end)
  );
  color: #fff;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.btn--primary::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 25%,
    rgba(255, 255, 255, 0.15) 50%,
    transparent 75%
  );
  background-size: 250% 100%;
  background-position: 200% 0;
  transition: background-position 0.6s var(--ease-out);
  z-index: 0;
}

.btn--primary:not(:disabled):hover::before {
  background-position: -50% 0;
}

.btn--primary:not(:disabled):hover {
  transform: translateY(-1px);
  box-shadow:
    0 4px 16px rgba(139, 92, 246, 0.35),
    0 0 40px -8px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.btn--primary:not(:disabled):active {
  transform: translateY(0) scale(0.97);
  box-shadow:
    0 1px 4px rgba(139, 92, 246, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn--generating {
  animation: generatingPulse 1.5s ease-in-out infinite;
}

@keyframes generatingPulse {
  0%,
  100% {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 0 20px -4px rgba(239, 68, 68, 0.3);
  }
  50% {
    box-shadow:
      0 1px 2px rgba(0, 0, 0, 0.2),
      0 0 40px -4px rgba(239, 68, 68, 0.5);
  }
}

.btn--ghost {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-secondary);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .btn--ghost {
  background: rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.6);
}

.btn--ghost:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.1),
    0 4px 12px rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .btn--ghost:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 4px 12px rgba(0, 0, 0, 0.05);
}

.btn--ghost.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-subtle);
}

.btn--icon {
  background: rgba(255, 255, 255, 0.01);
  color: var(--text-muted);
  border: 1px solid transparent;
  padding: 6px;
  min-width: auto;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

[data-theme="light"] .btn--icon {
  background: rgba(255, 255, 255, 0.3);
}

.btn--icon:not(:disabled):hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05);
}

[data-theme="light"] .btn--icon:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(0, 0, 0, 0.05);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.btn--sm {
  padding: 5px 10px;
  font-size: 12px;
}

.btn--generating {
  position: relative;
  overflow: hidden;
}

.btn--generating::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.15),
    transparent
  );
  animation: btnShimmer 1.5s infinite;
}

@keyframes btnShimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

/* ─── 9. Scene Tags ─── */
.scene-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 4px 16px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  mask-image: linear-gradient(
    to right,
    black calc(100% - 48px),
    transparent 100%
  );
  -webkit-mask-image: linear-gradient(
    to right,
    black calc(100% - 48px),
    transparent 100%
  );
}

/* 右侧占位空间，让最后一个标签滑动后不被淡出遮挡 */
.scene-tags::after {
  content: "";
  flex-shrink: 0;
  width: 48px;
}

.scene-tags::-webkit-scrollbar {
  display: none;
}

.scene-tags__label {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  font-weight: 500;
}

.scene-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast),
    border-color var(--duration-fast),
    transform var(--duration-fast) var(--ease-spring),
    box-shadow var(--duration-fast);
  user-select: none;
}

[data-theme="light"] .scene-tag {
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: rgba(255, 255, 255, 0.5);
}

.scene-tag:hover {
  background: rgba(139, 92, 246, 0.1);
  border-color: rgba(139, 92, 246, 0.3);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow:
    0 4px 12px rgba(139, 92, 246, 0.15),
    inset 0 1px 1px rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .scene-tag:hover {
  background: rgba(139, 92, 246, 0.08);
  border-color: rgba(139, 92, 246, 0.2);
  box-shadow:
    0 4px 12px rgba(139, 92, 246, 0.1),
    inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.scene-tag:active {
  transform: translateY(0) scale(0.95);
}

.scene-tag.is-active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  animation: tagSelect 0.35s var(--ease-spring);
  box-shadow:
    0 0 0 2px rgba(139, 92, 246, 0.15),
    0 2px 8px rgba(139, 92, 246, 0.12);
}

@keyframes tagSelect {
  0% {
    transform: scale(1);
  }
  40% {
    transform: scale(0.9);
  }
  70% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* ─── 10. Progress ─── */
.progress {
  padding: 24px 0;
  display: flex;
  justify-content: center;
}

#progress {
  transition:
    opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-spring);
}

#progress.is-entering {
  animation: progressEnter 0.4s var(--ease-spring) forwards;
}

@keyframes progressEnter {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.progress__inner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.progress__inner::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 30%,
    #ec4899 50%,
    var(--gradient-end) 70%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: progressPulse 2s ease-in-out infinite;
}

.progress__inner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.03),
    transparent
  );
  background-size: 200% 100%;
  animation: progressGlow 3s ease-in-out infinite;
}

@keyframes progressPulse {
  0% {
    background-position: 200% 0;
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
  100% {
    background-position: -200% 0;
    opacity: 0.7;
  }
}

@keyframes progressGlow {
  0%,
  100% {
    background-position: 200% 0;
  }
  50% {
    background-position: -200% 0;
  }
}

.progress__spinner {
  animation: spin 1.2s linear infinite;
  color: var(--accent);
}

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

.progress__text {
  font-size: 13.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ─── 11. Output Section ─── */
.output-section {
  animation: slideUp 0.5s var(--ease-out);
}

.output-section.is-entering {
  animation: outputEnter 0.6s var(--ease-spring) forwards;
}

@keyframes outputEnter {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.97);
    filter: blur(6px);
  }
  60% {
    opacity: 1;
    filter: blur(0);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.output-card {
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.15),
    inset 0 -1px 1px rgba(0, 0, 0, 0.2),
    0 8px 32px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  transition: background var(--duration-normal) var(--ease-out);
}

[data-theme="light"] .output-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.85);
  box-shadow:
    inset 0 1px 1px rgba(255, 255, 255, 0.9),
    0 8px 32px rgba(0, 0, 0, 0.05);
}

.output-card__header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.output-card__label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.output-card__badges {
  display: flex;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
}

.output-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--accent-subtle);
  color: var(--accent);
  white-space: nowrap;
}

.output-badge.is-composite {
  background: var(--warning-subtle);
  color: var(--warning);
}

.output-card__body {
  padding: 20px;
  max-height: 600px;
  overflow-y: auto;
}

.output-card__content {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-primary);
  white-space: pre-wrap;
  word-wrap: break-word;
  tab-size: 2;
}

/* ─── 12. Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px) scale(0.9);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  background: var(--error-subtle);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--error);
  font-size: 13px;
  font-weight: 500;
  z-index: 1000;
  opacity: 0;
  transition:
    opacity var(--duration-slow) var(--ease-spring),
    transform var(--duration-slow) var(--ease-spring);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  backdrop-filter: blur(12px);
}

.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0) scale(1);
}

.toast.is-dismissing {
  opacity: 0;
  transform: translateX(-50%) translateY(10px) scale(0.95);
}

.toast.is-success {
  background: var(--success-subtle);
  border-color: rgba(34, 197, 94, 0.2);
  color: var(--success);
}

.toast svg {
  flex-shrink: 0;
  animation: toastIconPop 0.4s var(--ease-spring) 0.1s both;
}

@keyframes toastIconPop {
  from {
    transform: scale(0) rotate(-45deg);
    opacity: 0;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

.toast::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  width: 100%;
  background: currentColor;
  opacity: 0.3;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  animation: toastProgress 5s linear forwards;
  transform-origin: left;
}

@keyframes toastProgress {
  from {
    transform: scaleX(1);
  }
  to {
    transform: scaleX(0);
  }
}

/* ─── 13. Footer ─── */
.footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 16px 20px;
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.footer__main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.footer__dot {
  color: var(--border-hover);
}

.footer__ecosystem {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.footer__eco-label {
  color: var(--text-faint);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.footer__eco-divider {
  width: 1px;
  height: 12px;
  background: var(--border-hover);
}

.footer__eco-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  opacity: 0.8;
  transition: opacity var(--duration-fast);
}

.footer__eco-link:hover {
  opacity: 1;
}

/* ─── 13.5 Header Hub Link ─── */
.header__nav-divider {
  width: 1px;
  height: 20px;
  background: var(--border-hover);
  margin: 0 4px;
}

.header__hub-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.12),
    rgba(99, 102, 241, 0.12)
  );
  color: var(--accent);
  text-decoration: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid rgba(139, 92, 246, 0.18);
  transition: all var(--duration-normal) var(--ease-out);
  position: relative;
  overflow: hidden;
}

.header__hub-link::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.08),
    rgba(99, 102, 241, 0.15)
  );
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.header__hub-link:hover {
  border-color: rgba(139, 92, 246, 0.35);
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.12);
  transform: translateY(-1px);
}

.header__hub-link:hover::before {
  opacity: 1;
}

.header__hub-link-icon {
  position: relative;
  z-index: 1;
  animation: hubIconPulse 3s ease-in-out infinite;
}

@keyframes hubIconPulse {
  0%,
  100% {
    opacity: 0.8;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.1);
  }
}

.header__hub-link-text {
  position: relative;
  z-index: 1;
}

.header__hub-link-arrow {
  position: relative;
  z-index: 1;
  opacity: 0.4;
  transition: opacity var(--duration-fast);
}

.header__hub-link:hover .header__hub-link-arrow {
  opacity: 0.8;
}

/* ─── 13.6 Hub Bubble Tooltip ─── */
.header__hub-link-wrapper {
  position: relative;
}

.hub-bubble {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
  cursor: pointer;
  animation:
    hubBubbleIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    hubBubblePulse 3s ease-in-out 0.5s infinite;
}

.hub-bubble[hidden] {
  display: none;
}

.hub-bubble__arrow {
  position: absolute;
  top: -5px;
  right: 18px;
  width: 10px;
  height: 10px;
  background: #8b5cf6;
  transform: rotate(45deg);
  border-radius: 2px;
}

.hub-bubble__icon {
  animation: hubIconPulse 3s ease-in-out infinite;
}

.hub-bubble--hiding {
  animation: hubBubbleOut 0.25s ease-in forwards;
}

@keyframes hubBubbleIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes hubBubblePulse {
  0%,
  100% {
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.35);
  }
  50% {
    box-shadow: 0 8px 28px rgba(139, 92, 246, 0.5);
  }
}

@keyframes hubBubbleOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(-6px) scale(0.95);
  }
}

/* ─── 13.7 Hero CTA Link ─── */

/* ─── 13.8 Cross-Product Guide Bar ─── */
.guide-bar {
  position: relative;
  z-index: 90;
  border-bottom: 1px solid rgba(139, 92, 246, 0.12);
  background: linear-gradient(
    90deg,
    rgba(139, 92, 246, 0.08),
    rgba(99, 102, 241, 0.06),
    rgba(139, 92, 246, 0.08)
  );
  opacity: 0;
  transform: translateY(-100%);
  transition: none;
}

.guide-bar--enter {
  animation: guideBarSlideIn 0.4s var(--ease-out) forwards;
}

@keyframes guideBarSlideIn {
  from {
    opacity: 0;
    transform: translateY(-100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.guide-bar.guide-bar--hiding {
  animation: guideBarSlideOut 0.3s var(--ease-out) forwards;
}

@keyframes guideBarSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-100%);
  }
}

.guide-bar__inner {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px;
}

.guide-bar__content {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.guide-bar__icon {
  color: var(--accent);
  opacity: 0.7;
  flex-shrink: 0;
  animation: hubIconPulse 3s ease-in-out infinite;
}

.guide-bar__text {
  font-size: 12.5px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.guide-bar__link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--duration-fast);
}

.guide-bar__link:hover {
  color: var(--accent-hover, #a78bfa);
}

.guide-bar__link svg {
  transition: transform var(--duration-fast);
}

.guide-bar__link:hover svg {
  transform: translateX(3px);
}

.guide-bar__close {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--duration-fast);
}

.guide-bar__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

@media (max-width: 639px) {
  .guide-bar__text {
    display: none;
  }
  .guide-bar__inner {
    padding: 7px 16px;
  }
}
.hero__cta-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  text-decoration: none;
  background: var(--accent-subtle);
  border: 1px solid rgba(139, 92, 246, 0.15);
  transition: all var(--duration-normal) var(--ease-out);
  letter-spacing: 0.01em;
}

.hero__cta-link:hover {
  background: rgba(139, 92, 246, 0.18);
  border-color: rgba(139, 92, 246, 0.3);
  box-shadow: 0 0 24px rgba(139, 92, 246, 0.1);
  transform: translateY(-1px);
}

.hero__cta-link svg:last-child {
  transition: transform var(--duration-fast);
}

.hero__cta-link:hover svg:last-child {
  transform: translateX(3px);
}

@media (max-width: 639px) {
  .header__hub-link-text {
    display: none;
  }
  .header__hub-link {
    padding: 6px 8px;
    gap: 4px;
  }
  .header__hub-link-arrow {
    display: none;
  }
  .hero__cta-link {
    font-size: 12px;
    padding: 7px 14px;
    gap: 6px;
  }
}

/* ─── 14. Overlay ─── */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 200;
  opacity: 0;
  transition:
    opacity 0.4s var(--ease-out),
    backdrop-filter 0.5s var(--ease-out);
  cursor: pointer;
  backdrop-filter: blur(0px) saturate(100%);
}

.overlay.is-visible {
  opacity: 1;
  backdrop-filter: blur(12px) saturate(140%);
}

/* Overlay关闭时快速退出 */
.overlay.is-dismissing {
  opacity: 0;
  backdrop-filter: blur(0px) saturate(100%);
  transition:
    opacity 0.25s var(--ease-out),
    backdrop-filter 0.25s var(--ease-out);
}

/* ─── 15. Settings Panel (Slide-over) ─── */
.panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 380px;
  max-width: 100vw;
  height: 100vh;
  background: var(--bg-subtle);
  border-left: 1px solid var(--border);
  z-index: 300;
  transform: perspective(1200px) translateX(105%) rotateY(-15deg);
  transform-origin: right center;
  transition:
    transform 0.5s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.4s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.3);
  opacity: 0;
}

.panel.is-visible {
  transform: perspective(1200px) translateX(0) rotateY(0deg);
  opacity: 1;
  box-shadow:
    -16px 0 64px rgba(0, 0, 0, 0.4),
    -4px 0 24px rgba(139, 92, 246, 0.08);
}

/* Panel内容交错入场 */
.panel.is-visible .panel__header {
  animation: panelContentReveal 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.1s both;
}
.panel.is-visible .panel__body {
  animation: panelContentReveal 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.18s both;
}
.panel.is-visible .panel__actions,
.panel.is-visible .panel__hint {
  animation: panelContentReveal 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.26s both;
}

@keyframes panelContentReveal {
  from {
    opacity: 0;
    transform: translateX(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
    filter: blur(0);
  }
}

/* Panel关闭时的离场动画 */
.panel.is-dismissing {
  transform: perspective(1200px) translateX(110%) rotateY(-8deg);
  opacity: 0;
  transition:
    transform 0.35s cubic-bezier(0.52, 0, 0.74, 0),
    opacity 0.3s var(--ease-out);
}

.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

.panel__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast);
}

.panel__close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.panel__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  contain: content;
}

.panel__hint {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--accent-subtle);
  border: 1px solid rgba(139, 92, 246, 0.1);
  font-size: 12.5px;
  color: var(--accent);
  line-height: 1.5;
}

.panel__hint svg {
  flex-shrink: 0;
  margin-top: 1px;
}

.panel__actions {
  display: flex;
  gap: 10px;
  padding-top: 4px;
}

.panel__actions .btn {
  flex: 1;
  justify-content: center;
}

.panel__test-result {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.panel__test-result.is-ok {
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid rgba(34, 197, 94, 0.15);
}

.panel__test-result.is-error {
  background: var(--error-subtle);
  color: var(--error);
  border: 1px solid rgba(239, 68, 68, 0.15);
}

/* ─── 15b. History Panel ─── */
.panel--wide {
  width: 520px;
}

.panel__header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--border);
}

/* empty state */
.history-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.history-empty svg {
  opacity: 0.35;
}

.history-empty__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.history-empty__desc {
  font-size: 13px;
  color: var(--text-faint);
  line-height: 1.5;
}

/* history card */
.history-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg-muted);
  overflow: hidden;
  transition: border-color var(--duration-fast);
}

.history-card:hover {
  border-color: var(--border-active);
}

.history-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  cursor: pointer;
  gap: 12px;
}

.history-card__meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.history-card__top-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.history-card__time {
  font-size: 12px;
  color: var(--text-faint);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.history-card__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 100px;
  white-space: nowrap;
}

.history-card__badge--smart {
  background: var(--accent-subtle);
  color: var(--accent);
}

.history-card__badge--scene {
  background: var(--success-subtle);
  color: var(--success);
}

.history-card__preview {
  font-size: 13px;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.4;
}

.history-card__chevron {
  flex-shrink: 0;
  color: var(--text-faint);
  transition: transform var(--duration-fast);
}

.history-card.is-expanded .history-card__chevron {
  transform: rotate(180deg);
}

/* expanded body */
.history-card__body {
  display: none;
  border-top: 1px solid var(--border);
  padding: 16px;
}

.history-card.is-expanded .history-card__body {
  display: block;
}

.history-diff {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.history-diff__section {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.history-diff__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.history-diff__label--before {
  background: var(--error-subtle);
  color: var(--error);
}

.history-diff__label--after {
  background: var(--success-subtle);
  color: var(--success);
}

.history-diff__copy {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0.7;
  transition: opacity var(--duration-fast);
}

.history-diff__copy:hover {
  opacity: 1;
}

.history-diff__text {
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 200px;
  overflow-y: auto;
}

.history-card__delete {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-faint);
  cursor: pointer;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast);
  flex-shrink: 0;
}

.history-card__delete:hover {
  background: var(--error-subtle);
  color: var(--error);
}

/* ─── 16. Forms ─── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.form-input {
  width: 100%;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-primary);
  font-size: 13.5px;
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  transition:
    border-color var(--duration-fast),
    box-shadow var(--duration-fast),
    background var(--duration-fast);
}

[data-theme="light"] .form-input {
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: rgba(0, 0, 0, 0.03);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
}

.form-input:focus {
  border-color: var(--accent);
  background: rgba(0, 0, 0, 0.3);
  box-shadow:
    inset 0 1px 3px rgba(0, 0, 0, 0.15),
    0 0 0 3px var(--accent-glow);
}

[data-theme="light"] .form-input:focus {
  background: rgba(255, 255, 255, 1);
  box-shadow:
    inset 0 1px 2px rgba(0, 0, 0, 0.02),
    0 0 0 3px var(--accent-glow);
}

.form-input::placeholder {
  color: var(--text-faint);
}

.form-input-group {
  position: relative;
  display: flex;
}

.form-input-group .form-input {
  padding-right: 40px;
}

.form-input-addon {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--duration-fast);
}

.form-input-addon:hover {
  color: var(--text-primary);
}

.form-hint {
  font-size: 12px;
  color: var(--text-faint);
}

/* ─── 17. Scene Browser Modal ─── */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) perspective(1000px) scale(0.85) rotateX(8deg);
  width: 640px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 64px);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  z-index: 300;
  opacity: 0;
  transition:
    opacity 0.4s var(--ease-out),
    transform 0.55s cubic-bezier(0.32, 0.72, 0, 1),
    filter 0.4s var(--ease-out),
    box-shadow 0.5s var(--ease-out);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  filter: blur(8px);
}

.modal.is-visible {
  opacity: 1;
  transform: translate(-50%, -50%) perspective(1000px) scale(1) rotateX(0deg);
  filter: blur(0);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(139, 92, 246, 0.1),
    0 0 60px rgba(139, 92, 246, 0.06);
}

/* Modal内容交错入场 */
.modal.is-visible .modal__header {
  animation: modalItemReveal 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.08s both;
}
.modal.is-visible .modal__search {
  animation: modalItemReveal 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.14s both;
}
.modal.is-visible .modal__categories {
  animation: modalItemReveal 0.4s cubic-bezier(0.32, 0.72, 0, 1) 0.2s both;
}
.modal.is-visible .modal__grid {
  animation: modalItemReveal 0.5s cubic-bezier(0.32, 0.72, 0, 1) 0.26s both;
}

@keyframes modalItemReveal {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.97);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* Modal关闭时的离场动画 */
.modal.is-dismissing {
  transform: translate(-50%, -50%) perspective(1000px) scale(0.92)
    rotateX(-4deg);
  opacity: 0;
  filter: blur(6px);
  transition:
    opacity 0.25s var(--ease-out),
    transform 0.3s cubic-bezier(0.52, 0, 0.74, 0),
    filter 0.25s var(--ease-out);
}

.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.modal__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
}

.modal__count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--border);
}

.modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition:
    color var(--duration-fast),
    background-color var(--duration-fast);
}

.modal__close:hover {
  background: var(--border);
  color: var(--text-primary);
}

.modal__search {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.modal__search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  padding: 3px 6px;
}

.modal__search-input::placeholder {
  color: var(--text-faint);
}

/* Persona tabs */
.modal__personas {
  display: flex;
  gap: 6px;
  padding: 8px 20px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal__personas::-webkit-scrollbar {
  height: 0;
}

.persona-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    color var(--duration-fast),
    border-color var(--duration-fast),
    background-color var(--duration-fast);
}

.persona-tab:hover {
  border-color: var(--border-active);
  color: var(--text-primary);
}

.persona-tab.is-active {
  background: var(--accent-subtle);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}

.persona-tab svg {
  flex-shrink: 0;
}

.modal__body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px;
  contain: content;
}

/* Scene category */
.scene-category {
  margin-bottom: 20px;
}

.scene-category__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding-bottom: 10px;
}

.scene-category__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.scene-card {
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition:
    border-color var(--duration-fast),
    background-color var(--duration-fast),
    transform var(--duration-fast),
    box-shadow var(--duration-fast);
}

.scene-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.12) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  transition: opacity var(--duration-fast);
  z-index: 0;
}

.scene-card:hover::after {
  opacity: 1;
}

.scene-card:hover {
  border-color: var(--border-active);
  background: var(--accent-subtle);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.scene-card__name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}

.scene-card__desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.scene-card__name-en {
  font-size: 11px;
  color: var(--text-faint);
  margin-top: 2px;
}

/* ─── 18. Scene Picker Dropdown ─── */
.dropdown {
  position: absolute;
  z-index: 150;
  width: 260px;
  max-height: 320px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(-4px);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}

.dropdown.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.dropdown__search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text-muted);
}

.dropdown__search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  color: var(--text-primary);
  padding: 3px 6px;
}

.dropdown__search-input::placeholder {
  color: var(--text-faint);
}

.dropdown__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.dropdown__item {
  display: flex;
  flex-direction: column;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.dropdown__item:hover,
.dropdown__item.is-focused {
  background: var(--accent-subtle);
}

.dropdown__item-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.dropdown__item-desc {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 1px;
}

/* ─── 18b. Model Combobox ─── */
.combo {
  position: relative;
}

.combo__input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.combo__input-wrap .combo__input {
  padding-right: 36px;
}

.combo__toggle {
  position: absolute;
  right: 1px;
  top: 1px;
  bottom: 1px;
  width: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  transition:
    color var(--duration-fast),
    background var(--duration-fast);
}

.combo__toggle:hover {
  color: var(--text-primary);
  background: var(--border);
}

.combo__toggle svg {
  transition: transform var(--duration-fast) var(--ease-out);
}

.combo.is-open .combo__toggle svg {
  transform: rotate(180deg);
}

.combo__dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-4px) scale(0.98);
  transition:
    opacity var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
  pointer-events: none;
  z-index: 400;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* 动态向上展开的样式 */
.combo.is-dropup .combo__dropdown {
  top: auto;
  bottom: calc(100% + 4px);
  transform: translateY(4px) scale(0.98);
}

.combo.is-open .combo__dropdown {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.combo__list {
  flex: 1;
  overflow-y: auto;
  padding: 4px;
}

.combo__group {
  padding: 6px 10px 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  user-select: none;
}

.combo__separator {
  height: 1px;
  border: none;
  background: var(--border);
  margin: 4px 10px;
}

.combo__option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--duration-fast);
}

.combo__option:hover,
.combo__option.is-focused {
  background: var(--accent-subtle);
}

.combo__option.is-selected {
  background: color-mix(in srgb, var(--accent) 12%, transparent);
}

.combo__option-id {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.combo__option-desc {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.combo__empty {
  padding: 16px 10px;
  text-align: center;
  font-size: 12px;
  color: var(--text-faint);
}

/* ─── 19. Responsive ─── */
@media (max-width: 768px) {
  .hero {
    padding: 40px 0 28px;
  }

  .hero__title {
    font-size: 28px;
  }

  .hero__subtitle {
    font-size: 14px;
  }

  .input-box__textarea {
    min-height: 130px;
    font-size: 14px;
  }

  .input-box__actions {
    flex-direction: column;
    width: 100%;
  }

  .input-box__actions .btn {
    width: 100%;
    justify-content: center;
  }

  .input-box__toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .scene-category__grid {
    grid-template-columns: 1fr;
  }

  .panel {
    width: 100vw;
  }

  .modal {
    max-width: calc(100vw - 16px);
    max-height: calc(100vh - 32px);
  }
}

@media (max-width: 480px) {
  .hero__badge {
    font-size: 11px;
    padding: 5px 12px;
  }

  .main {
    padding: 0 12px 60px;
  }
}

/* ─── 20. Scrollbar ─── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-faint);
}

/* ─── 21. Utility ─── */
[hidden] {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ─── 22. Smooth reveal for output text ─── */
@keyframes fadeInLine {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── 23. Focus visible ─── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Search inputs inside containers — subtle rounded focus ring */
.modal__search-input:focus,
.modal__search-input:focus-visible,
.dropdown__search-input:focus,
.dropdown__search-input:focus-visible {
  outline: 1.5px solid rgba(139, 92, 246, 0.8);
  outline-offset: 1px;
  border-radius: var(--radius-sm);
}

[data-theme="light"] .modal__search-input:focus,
[data-theme="light"] .modal__search-input:focus-visible,
[data-theme="light"] .dropdown__search-input:focus,
[data-theme="light"] .dropdown__search-input:focus-visible {
  outline-color: rgba(139, 92, 246, 0.8);
}

button:focus:not(:focus-visible),
input:focus:not(:focus-visible),
textarea:focus:not(:focus-visible) {
  outline: none;
}

/* ─── 24. Print ─── */
@media print {
  .header,
  .footer,
  .ambient-bg,
  .scene-tags,
  .input-box__toolbar {
    display: none;
  }
  .output-card {
    border: 1px solid #ccc;
    box-shadow: none;
  }
  body {
    background: #fff;
    color: #000;
  }
}

/* ═══════════════════════════════════════════════════════════
   §26. Enhanced Animation System
   Inspired by: Linear · Vercel · Stripe · Notion · Raycast
   shadcn/ui · Framer · Arc · Tailwind UI · Superlist
   Things 3 · Cal.com · Resend · Lemon Squeezy · Dub.co
   ═══════════════════════════════════════════════════════════ */

/* 26.1 Theme transition smoothing */
body,
.header,
.input-box,
.output-card,
.panel,
.modal,
.scene-tag,
.history-card,
.footer {
  transition:
    background-color var(--duration-normal) var(--ease-out),
    color var(--duration-normal) var(--ease-out),
    border-color var(--duration-normal) var(--ease-out);
}

/* 26.2 Ambient orb drift — 位移 + 旋转 + 缩放融合动画 */
@keyframes orbDrift1 {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(80px, -60px) rotate(90deg) scale(1.12);
  }
  50% {
    transform: translate(-40px, 40px) rotate(180deg) scale(0.92);
  }
  75% {
    transform: translate(50px, 20px) rotate(270deg) scale(1.06);
  }
  100% {
    transform: translate(0, 0) rotate(360deg) scale(1);
  }
}

@keyframes orbDrift2 {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
  }
  25% {
    transform: translate(-70px, 50px) rotate(-90deg) scale(0.94);
  }
  50% {
    transform: translate(50px, -40px) rotate(-180deg) scale(1.1);
  }
  75% {
    transform: translate(-30px, -20px) rotate(-270deg) scale(0.96);
  }
  100% {
    transform: translate(0, 0) rotate(-360deg) scale(1);
  }
}

@keyframes orbDrift3 {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.1;
  }
  33% {
    transform: translate(40px, -30px) rotate(120deg) scale(1.2);
    opacity: 0.16;
  }
  66% {
    transform: translate(-25px, 20px) rotate(240deg) scale(0.85);
    opacity: 0.06;
  }
  100% {
    transform: translate(0, 0) rotate(360deg) scale(1);
    opacity: 0.1;
  }
}

@keyframes orbDrift3Light {
  0% {
    transform: translate(0, 0) rotate(0deg) scale(1);
    opacity: 0.32;
  }
  33% {
    transform: translate(40px, -30px) rotate(120deg) scale(1.2);
    opacity: 0.38;
  }
  66% {
    transform: translate(-25px, 20px) rotate(240deg) scale(0.85);
    opacity: 0.22;
  }
  100% {
    transform: translate(0, 0) rotate(360deg) scale(1);
    opacity: 0.32;
  }
}

/* orb drift animations now applied inline on .ambient-orb--1/2/3 */

/* 26.3 Hero section entrance stagger */
@keyframes heroFadeUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero__badge {
  animation: heroFadeUp 0.6s var(--ease-out) 0.1s both;
}

.hero__title {
  animation: heroFadeUp 0.6s var(--ease-out) 0.2s both;
}

.hero__subtitle {
  animation: heroFadeUp 0.6s var(--ease-out) 0.3s both;
}

/* 26.4 Input box typing glow */
.input-box__textarea:focus {
  box-shadow: 0 0 0 3px var(--accent-glow);
}

/* 26.5 Button press micro-interactions */
.btn:not(:disabled):active {
  transform: scale(0.97);
}

.header__actions .icon-btn:active {
  transform: scale(0.9);
}

/* 26.6 Scene tag hover lift & stagger entrance */
@keyframes tagEnter {
  from {
    opacity: 0;
    transform: translateY(6px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.scene-tag {
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    background-color var(--duration-fast),
    border-color var(--duration-fast),
    color var(--duration-fast);
}

.scene-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.scene-tag:active {
  transform: translateY(0) scale(0.97);
}

.scene-tags .scene-tag:nth-child(2) {
  animation: tagEnter 0.35s var(--ease-out) 0.03s both;
}
.scene-tags .scene-tag:nth-child(3) {
  animation: tagEnter 0.35s var(--ease-out) 0.06s both;
}
.scene-tags .scene-tag:nth-child(4) {
  animation: tagEnter 0.35s var(--ease-out) 0.09s both;
}
.scene-tags .scene-tag:nth-child(5) {
  animation: tagEnter 0.35s var(--ease-out) 0.12s both;
}
.scene-tags .scene-tag:nth-child(6) {
  animation: tagEnter 0.35s var(--ease-out) 0.15s both;
}
.scene-tags .scene-tag:nth-child(7) {
  animation: tagEnter 0.35s var(--ease-out) 0.18s both;
}
.scene-tags .scene-tag:nth-child(8) {
  animation: tagEnter 0.35s var(--ease-out) 0.21s both;
}
.scene-tags .scene-tag:nth-child(9) {
  animation: tagEnter 0.35s var(--ease-out) 0.24s both;
}
.scene-tags .scene-tag:nth-child(10) {
  animation: tagEnter 0.35s var(--ease-out) 0.27s both;
}

/* 26.7 Scene tag hover glow */
.scene-tag:hover {
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.08);
}

.scene-tag.is-active {
  box-shadow:
    0 0 0 1px var(--accent),
    0 2px 8px rgba(139, 92, 246, 0.15);
}

/* 26.8 History card hover lift */
.history-card {
  transition:
    transform var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast);
}

.history-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-hover);
}

/* 26.9 Copy success pulse */
@keyframes copyPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.15);
  }
  100% {
    transform: scale(1);
  }
}

.btn-copy.is-copied,
#btn-copy.is-copied {
  animation: copyPulse 0.35s var(--ease-spring);
}

#btn-copy .icon-check {
  animation: copyCheckDraw 0.4s var(--ease-spring) forwards;
}

@keyframes copyCheckDraw {
  from {
    transform: scale(0) rotate(-90deg);
    opacity: 0;
  }
  50% {
    transform: scale(1.2) rotate(0deg);
    opacity: 1;
  }
  to {
    transform: scale(1) rotate(0deg);
    opacity: 1;
  }
}

#btn-copy.is-copied {
  background: var(--success-subtle) !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
  color: var(--success) !important;
}

/* 26.10-11 — Legacy panel/modal overrides removed, now in §14/§15/§17 */

/* 26.12 Progress shimmer */
@keyframes progressShimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

.progress__inner {
  position: relative;
}

.progress.is-visible .progress__inner::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--accent) 50%,
    transparent 100%
  );
  background-size: 200% 100%;
  animation: progressShimmer 1.5s linear infinite;
  border-radius: 1px;
}

/* 26.13 Output badges stagger */
@keyframes badgeEnter {
  from {
    opacity: 0;
    transform: scale(0.85);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.output-badge {
  animation: badgeEnter 0.3s var(--ease-spring) both;
}

.output-badge:nth-child(2) {
  animation-delay: 0.05s;
}
.output-badge:nth-child(3) {
  animation-delay: 0.1s;
}
.output-badge:nth-child(4) {
  animation-delay: 0.15s;
}
.output-badge:nth-child(5) {
  animation-delay: 0.2s;
}

/* 26.14 Toast enhanced entrance */
@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0) scale(1);
  }
}

.toast.is-visible {
  animation: toastSlideIn 0.3s var(--ease-spring);
}

/* 26.15 Dropdown item slide highlight */
.scene-picker__item {
  transition:
    background-color var(--duration-fast),
    transform var(--duration-fast) var(--ease-out);
}

.scene-picker__item:hover {
  transform: translateX(2px);
}

.scene-picker__item:active {
  transform: translateX(2px) scale(0.99);
}

/* 26.16 Footer gentle entrance */
@keyframes footerFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.footer {
  animation: footerFadeIn 0.5s var(--ease-out) 0.5s both;
}

/* ─── 28. Cursor Light Effect ─── */
.cursor-light {
  position: fixed;
  width: 400px;
  height: 400px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.06) 0%,
    rgba(99, 102, 241, 0.03) 35%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
  transform: translate(-50%, -50%);
  transition: opacity 0.3s ease;
  will-change: left, top;
}

[data-theme="light"] .cursor-light {
  background: radial-gradient(
    circle,
    rgba(139, 92, 246, 0.06) 0%,
    rgba(99, 102, 241, 0.03) 35%,
    transparent 70%
  );
}

/* ─── 29. Button Ripple Effect ─── */
.btn-ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0);
  animation: rippleExpand 0.6s ease-out forwards;
  pointer-events: none;
  z-index: 0;
}

@keyframes rippleExpand {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ─── 30. Output Line Reveal ─── */
.output-line {
  opacity: 0;
  transform: translateY(6px);
  animation: lineReveal 0.4s var(--ease-out) forwards;
}

@keyframes lineReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ─── 31. Scene Card Spotlight (JS-driven) ─── */
.scene-card {
  --spotlight-x: 50%;
  --spotlight-y: 50%;
}

.scene-card::after {
  left: var(--spotlight-x);
  top: var(--spotlight-y);
}

/* ─── 32. Enhanced Ghost Button Hover ─── */
.btn--ghost {
  position: relative;
  overflow: hidden;
}

.btn--ghost::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    transparent 30%,
    rgba(139, 92, 246, 0.04) 50%,
    transparent 70%
  );
  background-size: 250% 100%;
  background-position: 200% 0;
  transition: background-position 0.5s var(--ease-out);
  z-index: 0;
}

.btn--ghost:not(:disabled):hover::before {
  background-position: -50% 0;
}

/* ─── 33. Input Section entrance ─── */
@keyframes inputSectionEnter {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

.input-section {
  animation: inputSectionEnter 0.6s var(--ease-out) 0.35s both;
}

/* ─── 34. Output card enhanced ─── */
.output-card {
  position: relative;
}

.output-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(
    135deg,
    rgba(139, 92, 246, 0.2),
    rgba(99, 102, 241, 0.1),
    rgba(236, 72, 153, 0.1),
    rgba(139, 92, 246, 0.2)
  );
  background-size: 300% 300%;
  animation: borderGlow 6s ease-in-out infinite;
  -webkit-mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  mask:
    linear-gradient(#fff 0 0) content-box,
    linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  z-index: 1;
}

/* ─── 35. Hero badge shimmer ─── */
.hero__badge {
  position: relative;
  overflow: hidden;
}

.hero__badge::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 60%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(139, 92, 246, 0.15),
    transparent
  );
  animation: badgeShimmer 4s ease-in-out 1s infinite;
}

@keyframes badgeShimmer {
  0% {
    left: -60%;
  }
  40% {
    left: 120%;
  }
  100% {
    left: 120%;
  }
}

/* ─── 36. 3D Card Tilt ─── */
.tilt-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --tilt-scale: 1;
  --tilt-glow-x: 50%;
  --tilt-glow-y: 50%;
  transform: perspective(800px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y))
    scale(var(--tilt-scale));
  transition: transform 0.15s ease-out;
  will-change: transform;
}

/* 鼠标离开后平滑复位 */
.tilt-card.tilt-resetting {
  transition: transform 0.6s cubic-bezier(0.32, 0.72, 0, 1);
}

/* 3D 光泽反射层 */
.tilt-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    ellipse 50% 50% at var(--tilt-glow-x) var(--tilt-glow-y),
    rgba(255, 255, 255, 0.08) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease-out;
  z-index: 10;
}

.tilt-card:hover::before {
  opacity: 1;
}

/* 输入框 3D tilt 特殊样式 */
.input-box.tilt-card {
  position: relative;
}

/* 输出卡片 3D tilt */
.output-card.tilt-card {
  position: relative;
}

/* 场景卡片增强 3D 效果 */
.scene-card.tilt-card::before {
  background: radial-gradient(
    ellipse 40% 40% at var(--tilt-glow-x) var(--tilt-glow-y),
    rgba(139, 92, 246, 0.12) 0%,
    transparent 70%
  );
}

/* ─── 27. Reduced Motion ─── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .ambient-bg,
  .cursor-light {
    display: none;
  }

  .tilt-card {
    transform: none !important;
  }
}
