/* ================================================
   动画定义文件
   ================================================ */

/* ================================================
   淡入淡出动画
   ================================================ */

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ================================================
   缩放动画
   ================================================ */

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes scaleUp {
  from {
    transform: scale(1);
  }
  to {
    transform: scale(1.05);
  }
}

/* ================================================
   旋转动画
   ================================================ */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* ================================================
   弹跳动画
   ================================================ */

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-10px);
  }
  60% {
    transform: translateY(-5px);
  }
}

/* ================================================
   加载动画
   ================================================ */

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

@keyframes pulse-scale {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 20px rgba(255, 107, 107, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(255, 107, 107, 0.6);
  }
}

@keyframes skeleton {
  0% {
    background-position: -200px 0;
  }
  100% {
    background-position: calc(200px + 100%) 0;
  }
}

/* ================================================
   光泽动画
   ================================================ */

@keyframes shine {
  from {
    left: -100%;
  }
  to {
    left: 200%;
  }
}

@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px currentColor, 0 0 10px currentColor;
  }
  50% {
    box-shadow: 0 0 20px currentColor, 0 0 30px currentColor;
  }
}

/* ================================================
   滑动动画
   ================================================ */

@keyframes slideInLeft {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

@keyframes slideInUp {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* ================================================
   波纹动画
   ================================================ */

@keyframes ripple {
  from {
    transform: scale(0);
    opacity: 1;
  }
  to {
    transform: scale(4);
    opacity: 0;
  }
}

/* ================================================
   浮动动画
   ================================================ */

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* ================================================
   工具类
   ================================================ */

/* 淡入 */
.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.animate-fade-in-down {
  animation: fadeInDown 0.6s ease-out;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease-out;
}

/* 缩放 */
.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

/* 旋转 */
.animate-spin {
  animation: spin 1s linear infinite;
}

/* 弹跳 */
.animate-bounce {
  animation: bounce 1s ease-in-out infinite;
}

/* 浮动 */
.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* 脉冲 */
.animate-pulse {
  animation: pulse 2s ease-in-out infinite;
}

/* ================================================
   滚动动画类（配合 Intersection Observer 使用）
   ================================================ */

/* 初始状态：隐藏 */
.scroll-animate {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

/* 激活状态：显示 */
.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 从左侧进入 */
.scroll-animate-left {
  opacity: 0;
  transform: translateX(-30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-left.visible {
  opacity: 1;
  transform: translateX(0);
}

/* 从右侧进入 */
.scroll-animate-right {
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-right.visible {
  opacity: 1;
  transform: translateX(0);
}

/* 缩放进入 */
.scroll-animate-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.scroll-animate-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* ================================================
   延迟类（用于交错动画）
   ================================================ */

.delay-100 { animation-delay: 100ms; }
.delay-200 { animation-delay: 200ms; }
.delay-300 { animation-delay: 300ms; }
.delay-400 { animation-delay: 400ms; }
.delay-500 { animation-delay: 500ms; }
.delay-600 { animation-delay: 600ms; }
.delay-700 { animation-delay: 700ms; }
.delay-800 { animation-delay: 800ms; }

/* ================================================
   缓动函数
   ================================================ */

.ease-out-back {
  transition-timing-function: cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ease-in-out-quart {
  transition-timing-function: cubic-bezier(0.77, 0, 0.175, 1);
}

.ease-elastic {
  transition-timing-function: cubic-bezier(0.68, -0.55, 0.265, 1.55);
}
