/* 🌌 动画效果样式表 */

/* 关键帧动画定义 */
@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.05); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 20px rgba(0, 245, 255, 0.3); }
  50% { box-shadow: 0 0 40px rgba(0, 245, 255, 0.6); }
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

@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 slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

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

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

@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-2px, 2px); }
  40% { transform: translate(-2px, -2px); }
  60% { transform: translate(2px, 2px); }
  80% { transform: translate(2px, -2px); }
  100% { transform: translate(0); }
}

@keyframes neonFlicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.8; }
  75% { opacity: 0.9; }
}

@keyframes starTwinkle {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes particleFloat {
  0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 故障艺术效果 */
.glitch-text {
  position: relative;
  font-family: var(--font-primary);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 2px;
}

.glitch-text::before,
.glitch-text::after {
  content: attr(data-text);
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.glitch-text::before {
  animation: glitch 2s infinite;
  color: var(--quantum-blue);
  z-index: -1;
}

.glitch-text::after {
  animation: glitch 3s infinite reverse;
  color: var(--neon-pink);
  z-index: -2;
}

.glitch-text:hover::before {
  animation-duration: 0.2s;
}

.glitch-text:hover::after {
  animation-duration: 0.3s;
}

/* 霓虹发光效果 */
.neon-glow {
  text-shadow: 
    0 0 5px currentColor,
    0 0 10px currentColor,
    0 0 15px currentColor,
    0 0 20px var(--quantum-blue),
    0 0 35px var(--quantum-blue),
    0 0 40px var(--quantum-blue);
  animation: neonFlicker 2s infinite alternate;
}

/* 粒子动画 */
.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: var(--quantum-blue);
  border-radius: 50%;
  animation: particleFloat 10s linear infinite;
}

.particle:nth-child(odd) {
  background: var(--neon-pink);
  animation-duration: 12s;
}

.particle:nth-child(3n) {
  background: var(--orbit-gold);
  animation-duration: 8s;
}

/* 星星闪烁 */
.star {
  position: absolute;
  width: 1px;
  height: 1px;
  background: white;
  border-radius: 50%;
  animation: starTwinkle 3s infinite;
}

.star::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  width: 3px;
  height: 3px;
  background: radial-gradient(circle, rgba(255,255,255,0.8) 0%, transparent 70%);
  border-radius: 50%;
}

/* 浮动动画 */
.float-animation {
  animation: float 3s ease-in-out infinite;
}

/* 脉冲动画 */
.pulse-animation {
  animation: pulse 2s ease-in-out infinite;
}

/* 发光动画 */
.glow-animation {
  animation: glow 2s ease-in-out infinite;
}

/* 心跳动画 */
.heartbeat-animation {
  animation: heartbeat 1.5s ease-in-out infinite;
}

/* 旋转动画 */
.rotate-animation {
  animation: rotate 10s linear infinite;
}

/* 淡入动画 */
.fade-in-up {
  animation: fadeInUp 0.8s ease-out;
}

.fade-in-down {
  animation: fadeInDown 0.8s ease-out;
}

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

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

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

/* 延迟动画 */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* 打字机效果 */
.typing-text {
  overflow: hidden;
  border-right: 2px solid var(--quantum-blue);
  white-space: nowrap;
  animation: typing 3s steps(40, end), blink 1s infinite;
}

/* 加载动画 */
.loading-spinner {
  display: inline-block;
  width: 40px;
  height: 40px;
  border: 3px solid rgba(0, 245, 255, 0.3);
  border-radius: 50%;
  border-top-color: var(--quantum-blue);
  animation: rotate 1s linear infinite;
}

.spinner-ring {
  display: inline-block;
  width: 64px;
  height: 64px;
  border: 8px solid rgba(0, 245, 255, 0.1);
  border-radius: 50%;
  border-top-color: var(--quantum-blue);
  animation: rotate 1s linear infinite;
}

/* 按钮粒子效果 */
.btn-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  pointer-events: none;
}

.btn-particles::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: radial-gradient(circle, var(--quantum-blue) 0%, transparent 70%);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: all 0.6s ease;
}

.portal-btn:hover .btn-particles::before {
  width: 300px;
  height: 300px;
  opacity: 0.1;
}

/* 响应式动画 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 性能优化 */
.will-change-transform {
  will-change: transform;
}

.will-change-opacity {
  will-change: opacity;
}

.gpu-accelerated {
  transform: translateZ(0);
  backface-visibility: hidden;
  perspective: 1000px;
}
