/* ==========================================================================
   SoundRadar 宣传站 - animations.css
   高级动画和视觉特效
   ========================================================================== */

/* ============ 页面加载动画 ============ */
@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ============ 按钮点击波纹效果 ============ */
.btn-ripple {
  position: relative;
  overflow: hidden;
}
.btn-ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .4);
  transform: translate(-50%, -50%);
  transition: width .6s, height .6s;
}
.btn-ripple:active::before {
  width: 300px;
  height: 300px;
}

/* ============ 渐变流动动画 ============ */
@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.gradient-animate {
  background-size: 200% 200%;
  animation: gradientFlow 6s ease infinite;
}

/* ============ 悬浮上下漂浮 ============ */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.float-animate {
  animation: floatY 3s ease-in-out infinite;
}

/* ============ 光晕扩散 ============ */
@keyframes glowPulse {
  0%, 100% {
    box-shadow: 0 0 20px rgba(79, 70, 229, .3),
                0 0 40px rgba(79, 70, 229, .15);
  }
  50% {
    box-shadow: 0 0 40px rgba(79, 70, 229, .5),
                0 0 80px rgba(79, 70, 229, .25),
                0 0 120px rgba(79, 70, 229, .15);
  }
}

.glow-animate {
  animation: glowPulse 2s ease-in-out infinite;
}

/* ============ 旋转闪烁 ============ */
@keyframes spinGlow {
  0% {
    transform: rotate(0deg);
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
  100% {
    transform: rotate(360deg);
    filter: brightness(1);
  }
}

.spin-glow {
  animation: spinGlow 10s linear infinite;
}

/* ============ 打字机效果 ============ */
@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  50% { border-color: transparent; }
}

.typewriter {
  overflow: hidden;
  border-right: 2px solid var(--primary);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink .75s step-end infinite;
}

/* ============ 闪烁脉冲（用于标签） ============ */
@keyframes blinkPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: .7;
    transform: scale(.95);
  }
}

.blink-pulse {
  animation: blinkPulse 2s ease-in-out infinite;
}

/* ============ 卡片翻转效果 ============ */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform .6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* ============ 震动效果 ============ */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
  20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.shake {
  animation: shake .5s ease-in-out;
}

/* ============ 弹跳效果 ============ */
@keyframes bounce {
  0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
  40% { transform: translateY(-15px); }
  60% { transform: translateY(-8px); }
}

.bounce {
  animation: bounce 1s ease-in-out;
}

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

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

.fade-in {
  animation: fadeIn .6s ease-in;
}

.fade-out {
  animation: fadeOut .6s ease-out;
}

/* ============ 从左滑入 ============ */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-left {
  animation: slideInLeft .6s ease-out;
}

/* ============ 从右滑入 ============ */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight .6s ease-out;
}

/* ============ 缩放进入 ============ */
@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.zoom-in {
  animation: zoomIn .5s ease-out;
}

/* ============ 旋转进入 ============ */
@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-180deg) scale(0.5);
  }
  to {
    opacity: 1;
    transform: rotate(0) scale(1);
  }
}

.rotate-in {
  animation: rotateIn .6s ease-out;
}

/* ============ 粒子效果背景 ============ */
@keyframes particleFloat {
  0% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: .5;
  }
  90% {
    opacity: .5;
  }
  100% {
    transform: translateY(-100vh) translateX(50px);
    opacity: 0;
  }
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--primary);
  border-radius: 50%;
  animation: particleFloat 15s linear infinite;
}

/* ============ 光束扫描 ============ */
@keyframes beamScan {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.beam-scan {
  position: relative;
  overflow: hidden;
}

.beam-scan::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg,
    transparent,
    rgba(255, 255, 255, .3),
    transparent);
  animation: beamScan 3s ease-in-out infinite;
}

/* ============ 渐变边框动画 ============ */
@keyframes borderRotate {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.animated-border {
  position: relative;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
}

.animated-border::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: var(--grad-brand);
  border-radius: var(--radius-lg);
  z-index: -1;
  background-size: 200% 200%;
  animation: borderRotate 3s ease infinite;
}

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

.count-up {
  animation: countUp .8s ease-out;
}

/* ============ 呼吸效果 ============ */
@keyframes breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.03);
    opacity: .95;
  }
}

.breathe {
  animation: breathe 3s ease-in-out infinite;
}
