/* ============================================
   动画与过渡效果
   ============================================ */

/* === 淡入 === */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(16px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* === 缩放 === */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* === 脉动 === */
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 var(--accent-muted);
  }
  50% {
    box-shadow: 0 0 0 8px transparent;
  }
}

/* === 数字滚动 === */
@keyframes countUp {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === 打字机光标 === */
@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* === 进度条填充 === */
@keyframes fillBar {
  from { width: 0; }
}

/* === 动画工具类 === */
.animate-fadeIn { animation: fadeIn var(--transition-base) ease; }
.animate-fadeInUp { animation: fadeInUp var(--transition-slow) ease; }
.animate-fadeInDown { animation: fadeInDown var(--transition-slow) ease; }
.animate-fadeInLeft { animation: fadeInLeft var(--transition-slow) ease; }
.animate-fadeInRight { animation: fadeInRight var(--transition-slow) ease; }
.animate-scaleIn { animation: scaleIn var(--transition-base) ease; }
.animate-pulse { animation: pulse 2s infinite; }

/* === 交错动画 === */
.stagger-item {
  opacity: 0;
  animation: fadeInUp var(--transition-slow) ease forwards;
}

.stagger-item:nth-child(1) { animation-delay: 0ms; }
.stagger-item:nth-child(2) { animation-delay: 80ms; }
.stagger-item:nth-child(3) { animation-delay: 160ms; }
.stagger-item:nth-child(4) { animation-delay: 240ms; }
.stagger-item:nth-child(5) { animation-delay: 320ms; }
.stagger-item:nth-child(6) { animation-delay: 400ms; }

/* === 过渡工具类 === */
.transition-fast { transition: var(--transition-fast); }
.transition-base { transition: var(--transition-base); }
.transition-slow { transition: var(--transition-slow); }

/* === 悬浮效果 === */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* === 减少动画偏好 === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
