/* ═══════════════════════════════════════════
   neurun Utilities — 动效 + 工具类
   ═══════════════════════════════════════════ */

/* ── Easing tokens ── */
:root {
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
}

/* ── Tab 切换过渡 ── */
.tab-panel {
  opacity: 1;
  transition: opacity .2s var(--ease-out);
}
.tab-panel[hidden] {
  display: none;
}
.tab-panel.fade-in {
  animation: fade-in .25s var(--ease-out);
}
.tab-panel.fade-out {
  animation: fade-out .15s var(--ease-out);
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fade-out {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(4px); }
}

/* ── 数据揭示序列 (stagger) ── */
.reveal {
  opacity: 0;
  transform: translateY(8px);
  animation: reveal .35s var(--ease-out) forwards;
}
.reveal:nth-child(1) { animation-delay: 0ms; }
.reveal:nth-child(2) { animation-delay: 80ms; }
.reveal:nth-child(3) { animation-delay: 160ms; }
.reveal:nth-child(4) { animation-delay: 240ms; }
.reveal:nth-child(5) { animation-delay: 320ms; }
.reveal:nth-child(6) { animation-delay: 400ms; }
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}

/* ── 脉冲指示器 (草稿生成等) ── */
.pulse-indicator {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.4s var(--ease-in-out) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.4); }
}

/* ── 进度条平滑过渡 ── */
.progress-bar {
  height: 4px;
  border-radius: 2px;
  background: var(--bg-subtle);
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width .3s var(--ease-out);
}

/* ── 尊重用户偏好 ── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
