/* ============================================================
   R11 animations.css — 动画集中管理
   所有@keyframes + 动画工具类
   ============================================================ */

/* ---- 入场动画 ---- */

@keyframes text-zoom-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes text-fade-up {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes btn-scale-in {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ---- 倒计时翻页 ---- */
@keyframes flip-top {
  0% { transform: rotateX(0deg); }
  100% { transform: rotateX(90deg); }
}

@keyframes flip-bottom {
  0% { transform: rotateX(-90deg); }
  100% { transform: rotateX(0deg); }
}

/* ---- 脉冲 ---- */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

@keyframes pulse-border {
  0%, 100% { border-color: var(--festival-primary); }
  50% { border-color: var(--festival-accent); }
}

@keyframes pulse-bar {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes pulse-shadow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(196,30,58,0.3); }
  50% { box-shadow: 0 0 0 12px rgba(196,30,58,0); }
}

/* ---- 下滑提示 ---- */
@keyframes bounce-down {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(8px); }
}

/* ---- 粒子飘落 ---- */
@keyframes fall {
  0% {
    transform: translateY(-10vh) rotate(0deg);
    opacity: 0;
  }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% {
    transform: translateY(110vh) rotate(720deg);
    opacity: 0;
  }
}

@keyframes sway {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(20px); }
  75% { transform: translateX(-20px); }
}

/* ---- 烟花 ---- */
@keyframes firework-burst {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(1); opacity: 0; }
}

/* ---- 优惠券飞入 ---- */
@keyframes coupon-fly-in {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  50% {
    transform: translate(calc(var(--fly-x) * 0.5), calc(var(--fly-y) * 0.5)) scale(0.8);
    opacity: 0.8;
  }
  100% {
    transform: translate(var(--fly-x), var(--fly-y)) scale(0.3);
    opacity: 0;
  }
}

/* ---- 红包雨 ---- */
@keyframes red-envelope-fall {
  0% {
    transform: translateY(-20px) rotate(0deg) scale(1);
    opacity: 1;
  }
  80% { opacity: 1; }
  100% {
    transform: translateY(100vh) rotate(360deg) scale(0.5);
    opacity: 0;
  }
}

/* ---- 弹窗入场 ---- */
@keyframes modal-in {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

@keyframes modal-out {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.9); opacity: 0; }
}

/* ---- Toast ---- */
@keyframes toast-in {
  from { transform: translateX(-50%) translateY(-20px); opacity: 0; }
  to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

@keyframes toast-out {
  from { transform: translateX(-50%) translateY(0); opacity: 1; }
  to { transform: translateX(-50%) translateY(-20px); opacity: 0; }
}

/* ---- 加载动画（商品懒加载占位） ---- */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}

.shimmer-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200px 100%;
  animation: shimmer 1.5s infinite;
}

/* ---- 动画工具类 ---- */
.text-zoom-in { animation: text-zoom-in 0.4s ease-out both; }
.text-fade-up { animation: text-fade-up 0.4s 0.2s ease-out both; }
.btn-scale-in { animation: btn-scale-in 0.4s 0.6s ease-out both; }
.fade-in { animation: fade-in 0.3s ease-out both; }
.slide-up { animation: slide-up 0.4s ease-out both; }
.pulse { animation: pulse 2s infinite; }
.pulse-shadow { animation: pulse-shadow 1.5s infinite; }
.countdown-flip-top { animation: flip-top 0.25s ease-in both; }
.countdown-flip-bottom { animation: flip-bottom 0.25s ease-out 0.25s both; }
.modal-in { animation: modal-in 0.3s ease-out both; }
.modal-out { animation: modal-out 0.3s ease-in both; }
.toast-in { animation: toast-in 0.3s ease-out both; }
.toast-out { animation: toast-out 0.3s ease-in both; }
