/* 赛博灵堂 - 动画样式 */

/* 标题故障效果 */
@keyframes glitch {
  0%, 100% {
    transform: translate(0) skew(0deg);
  }
  5% {
    transform: translate(-3px, 2px) skew(2deg);
  }
  10% {
    transform: translate(3px, -2px) skew(-2deg);
  }
  15% {
    transform: translate(-2px, -3px) skew(1deg);
  }
  20% {
    transform: translate(2px, 3px) skew(-1deg);
  }
  25%, 95% {
    transform: translate(0) skew(0deg);
  }
}

@keyframes glitch-1 {
  0%, 100% {
    transform: translate(0);
    opacity: 0.8;
  }
  10% {
    transform: translate(3px, -3px);
    opacity: 0.6;
  }
  20% {
    transform: translate(-3px, 3px);
    opacity: 0.9;
  }
  30% {
    transform: translate(2px, 2px);
    opacity: 0.7;
  }
  40%, 90% {
    transform: translate(0);
    opacity: 0.8;
  }
}

@keyframes glitch-2 {
  0%, 100% {
    transform: translate(0);
    opacity: 0.8;
  }
  15% {
    transform: translate(-3px, 3px);
    opacity: 0.7;
  }
  25% {
    transform: translate(3px, -3px);
    opacity: 0.9;
  }
  35% {
    transform: translate(-2px, -2px);
    opacity: 0.6;
  }
  45%, 90% {
    transform: translate(0);
    opacity: 0.8;
  }
}

/* 霓虹闪烁 */
@keyframes neon-flicker {
  0%, 19%, 21%, 23%, 25%, 54%, 56%, 100% {
    text-shadow: 
      0 0 4px var(--primary-color),
      0 0 11px var(--primary-color),
      0 0 19px var(--primary-color),
      0 0 40px var(--primary-color),
      0 0 80px var(--primary-color);
    opacity: 1;
  }
  20%, 24%, 55% {
    text-shadow: none;
    opacity: 0.8;
  }
}

/* 文字闪烁 */
@keyframes flicker-text {
  0%, 100% {
    opacity: 1;
  }
  10% {
    opacity: 0.8;
  }
  20% {
    opacity: 1;
  }
  30% {
    opacity: 0.6;
  }
  40% {
    opacity: 1;
  }
  50% {
    opacity: 0.9;
  }
  60% {
    opacity: 1;
  }
  70% {
    opacity: 0.7;
  }
  80% {
    opacity: 1;
  }
  90% {
    opacity: 0.85;
  }
}

/* 文字抖动 */
@keyframes text-shake {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  10% {
    transform: translate(-1px, 1px) rotate(0.5deg);
  }
  20% {
    transform: translate(1px, -1px) rotate(-0.5deg);
  }
  30% {
    transform: translate(-2px, 0px) rotate(0.5deg);
  }
  40% {
    transform: translate(2px, 1px) rotate(-0.5deg);
  }
  50% {
    transform: translate(-1px, -1px) rotate(0deg);
  }
  60% {
    transform: translate(1px, 1px) rotate(0.5deg);
  }
  70% {
    transform: translate(0px, -2px) rotate(-0.5deg);
  }
  80% {
    transform: translate(-1px, 0px) rotate(0deg);
  }
  90% {
    transform: translate(1px, 1px) rotate(0.5deg);
  }
}

/* 文字呼吸效果 */
@keyframes text-breathe {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.02);
    opacity: 0.9;
  }
}

/* 文字波浪效果 */
@keyframes text-wave {
  0%, 100% {
    transform: translateY(0);
  }
  25% {
    transform: translateY(-3px);
  }
  75% {
    transform: translateY(3px);
  }
}

/* 文字旋转效果 */
@keyframes text-rotate {
  0%, 100% {
    transform: rotate(0deg);
  }
  25% {
    transform: rotate(1deg);
  }
  75% {
    transform: rotate(-1deg);
  }
}

/* 文字颜色循环 */
@keyframes text-color-cycle {
  0% {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
  }
  25% {
    color: #ff8800;
    text-shadow: 0 0 10px rgba(255, 136, 0, 0.8);
  }
  50% {
    color: #ffff00;
    text-shadow: 0 0 10px rgba(255, 255, 0, 0.8);
  }
  75% {
    color: #00ffff;
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.8);
  }
  100% {
    color: #ff0000;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.8);
  }
}

/* 文字弹跳 */
@keyframes text-bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0);
  }
  40% {
    transform: translateY(-8px);
  }
  60% {
    transform: translateY(-4px);
  }
}

/* 文字淡入 */
@keyframes text-fade-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 文字脉冲发光 */
@keyframes text-pulse-glow {
  0%, 100% {
    text-shadow: 
      0 0 5px var(--primary-glow),
      0 0 10px var(--primary-glow);
  }
  50% {
    text-shadow: 
      0 0 10px var(--primary-glow),
      0 0 20px var(--primary-glow),
      0 0 30px var(--primary-glow),
      0 0 40px var(--primary-glow);
  }
}

/* 文字扭曲效果 */
@keyframes text-distort {
  0%, 100% {
    transform: skew(0deg, 0deg);
  }
  20% {
    transform: skew(2deg, -1deg);
  }
  40% {
    transform: skew(-2deg, 1deg);
  }
  60% {
    transform: skew(1deg, -2deg);
  }
  80% {
    transform: skew(-1deg, 2deg);
  }
}

/* 火焰效果 */
@keyframes flicker {
  0% {
    transform: translateX(-50%) scaleY(1) scaleX(1);
    opacity: 1;
  }
  25% {
    transform: translateX(-50%) scaleY(1.1) scaleX(0.9);
    opacity: 0.9;
  }
  50% {
    transform: translateX(-50%) scaleY(0.9) scaleX(1.1);
    opacity: 1;
  }
  75% {
    transform: translateX(-50%) scaleY(1.05) scaleX(0.95);
    opacity: 0.95;
  }
  100% {
    transform: translateX(-50%) scaleY(1) scaleX(1);
    opacity: 1;
  }
}

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

/* 扬声器大幅摆动 */
@keyframes speaker-bounce {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-15px) rotate(-8deg);
  }
  50% {
    transform: translateY(5px) rotate(3deg);
  }
  75% {
    transform: translateY(-10px) rotate(5deg);
  }
}

/* 扬声器鼓膜脉动 */
@keyframes cone-pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(255, 0, 0, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 20px 5px rgba(255, 0, 0, 0.4);
  }
}

/* 扬声器震动条 */
@keyframes vibration-pulse {
  0%, 100% {
    transform: scaleY(1);
    opacity: 0.8;
  }
  50% {
    transform: scaleY(1.5);
    opacity: 1;
  }
}

/* 声波移动 */
@keyframes wave-move {
  0% {
    background-position: 0 0;
  }
  100% {
    background-position: 20px 0;
  }
}

/* 黑胶唱片旋转 */
@keyframes vinyl-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 弹幕滚动 */
@keyframes barrage-scroll {
  from {
    transform: translateX(100vw);
  }
  to {
    transform: translateX(-100%);
  }
}

/* 烟花爆炸 */
@keyframes firework-explode {
  0% {
    transform: translate(0, 0) scale(1);
    opacity: 1;
  }
  100% {
    transform: translate(var(--tx), var(--ty)) scale(0);
    opacity: 0;
  }
}

/* 淡入 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 背景文字浮动 */
@keyframes bg-text-float {
  0% {
    transform: translateX(-100%) rotate(-5deg) scale(1);
  }
  50% {
    transform: translateX(50vw) rotate(0deg) scale(1.1);
  }
  100% {
    transform: translateX(100vw) rotate(5deg) scale(1);
  }
}

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

/* 副标题光效 */
@keyframes subtitle-glow {
  from {
    text-shadow: 
      0 0 5px var(--primary-glow),
      0 0 10px var(--primary-glow);
  }
  to {
    text-shadow: 
      0 0 10px var(--primary-glow),
      0 0 20px var(--primary-glow),
      0 0 30px var(--primary-glow),
      0 0 40px var(--primary-glow);
  }
}

/* 花圈闪烁 */
@keyframes wreath-blink {
  0%, 100% {
    opacity: 1;
    color: #ff0000;
  }
  25% {
    opacity: 0.8;
    color: #ff8800;
  }
  50% {
    opacity: 1;
    color: #ffff00;
  }
  75% {
    opacity: 0.8;
    color: #00ff00;
  }
}

/* 烟雾上升 */
@keyframes smoke-rise {
  0% {
    opacity: 0.5;
    transform: translateY(0) scaleX(1);
  }
  100% {
    opacity: 0;
    transform: translateY(-20px) scaleX(2);
  }
}

/* 扫描线移动 */
@keyframes scanline-move {
  0% {
    transform: translateY(-100%);
  }
  100% {
    transform: translateY(100%);
  }
}

/* 地板灯闪烁 */
@keyframes floor-light-blink {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* 颜色循环 */
@keyframes color-cycle {
  0% { background-color: #ff0000; }
  16% { background-color: #ff8800; }
  33% { background-color: #ffff00; }
  50% { background-color: #00ff00; }
  66% { background-color: #0088ff; }
  83% { background-color: #8800ff; }
  100% { background-color: #ff0000; }
}

/* 粒子类型动画 */
@keyframes particle-money {
  0% {
    transform: translateY(-100px) rotate(0deg) scale(1);
    opacity: 0;
  }
  10% {
    opacity: 0.8;
  }
  50% {
    transform: translateY(50vh) rotate(360deg) scale(0.8);
    opacity: 0.6;
  }
  100% {
    transform: translateY(100vh) rotate(720deg) scale(0.5);
    opacity: 0;
  }
}

@keyframes particle-light {
  0% {
    transform: translateY(-50px) scale(0);
    opacity: 0;
  }
  50% {
    transform: translateY(50vh) scale(1);
    opacity: 0.8;
  }
  100% {
    transform: translateY(100vh) scale(0.5);
    opacity: 0;
  }
}

/* 闪烁边框 */
@keyframes border-blink {
  0%, 100% {
    border-color: var(--primary-color);
  }
  50% {
    border-color: transparent;
  }
}

/* 发光效果 */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 5px var(--primary-glow), 0 0 10px var(--primary-glow);
  }
  50% {
    box-shadow: 0 0 20px var(--primary-glow), 0 0 40px var(--primary-glow);
  }
}

/* 脉冲效果 */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 var(--primary-glow);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px 10px var(--primary-glow);
  }
}

/* 摇摆效果 */
@keyframes wobble {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(5deg); }
  75% { transform: rotate(-5deg); }
}

/* 淡入淡出 */
@keyframes fadeInOut {
  0%, 100% { opacity: 0; }
  50% { opacity: 1; }
}

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

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

/* 摇晃效果 */
@keyframes swing {
  0%, 100% {
    transform: rotate(0deg);
    transform-origin: top center;
  }
  25% { transform: rotate(15deg); }
  75% { transform: rotate(-15deg); }
}

/* 波纹效果 */
@keyframes ripple {
  0% {
    transform: scale(0);
    opacity: 1;
  }
  100% {
    transform: scale(4);
    opacity: 0;
  }
}

/* 光线效果 */
@keyframes ray-rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 雾气效果 */
@keyframes fog {
  0%, 100% {
    opacity: 0.3;
    transform: translateX(-10%);
  }
  50% {
    opacity: 0.6;
    transform: translateX(10%);
  }
}

/* 动画延迟类 */
.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }
.delay-700 { animation-delay: 0.7s; }
.delay-800 { animation-delay: 0.8s; }
.delay-900 { animation-delay: 0.9s; }
.delay-1000 { animation-delay: 1s; }

/* 动画持续时间类 */
.duration-fast { animation-duration: 0.5s; }
.duration-normal { animation-duration: 1s; }
.duration-slow { animation-duration: 2s; }
.duration-slower { animation-duration: 3s; }

/* 动画迭代次数类 */
.iterate-infinite { animation-iteration-count: infinite; }
.iterate-1 { animation-iteration-count: 1; }
.iterate-2 { animation-iteration-count: 2; }
.iterate-3 { animation-iteration-count: 3; }

/* 动画填充模式类 */
.fill-forwards { animation-fill-mode: forwards; }
.fill-backwards { animation-fill-mode: backwards; }
.fill-both { animation-fill-mode: both; }

/* 动画播放状态类 */
.paused { animation-play-state: paused; }
.running { animation-play-state: running; }

/* 舞池灯光动画 */
.dance-floor {
  position: relative;
  width: 100%;
  height: clamp(100px, 15vh, 180px);
  background: linear-gradient(180deg, rgba(0,0,0,0.8) 0%, rgba(20,0,0,0.9) 100%);
  border-top: 1px solid var(--primary-color);
  border-bottom: 1px solid var(--primary-color);
  overflow: hidden;
}

.floor-lights {
  display: flex;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
}

.floor-light-segment {
  flex: 1;
  height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--primary-color) 50%, transparent 100%);
  opacity: 0.15;
  animation: floor-light-blink 1s ease-in-out infinite;
}

.dancers {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  display: flex;
  justify-content: space-around;
  padding: 0 20px;
  z-index: 2;
}

.dancer {
  width: 20px;
  height: 30px;
  position: relative;
}

.dancer-body {
  width: 100%;
  height: 100%;
  background: var(--primary-color);
  clip-path: polygon(50% 0%, 100% 25%, 100% 100%, 0% 100%, 0% 25%);
  opacity: 0.7;
  box-shadow: 0 0 10px var(--primary-glow);
}

.spotlights {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.spotlight {
  position: absolute;
  top: -50%;
  width: 30%;
  height: 200%;
  background: linear-gradient(
    180deg,
    rgba(255, 0, 0, 0.15) 0%,
    transparent 100%
  );
  transform-origin: top center;
}

.spotlight:nth-child(1) { left: 10%; }
.spotlight:nth-child(2) { left: 40%; }
.spotlight:nth-child(3) { left: 70%; }

.lasers {
  position: absolute;
  top: 0;
  left: 50%;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.laser-beam {
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--primary-color) 0%,
    transparent 100%
  );
  transform-origin: top center;
  opacity: 0.6;
  box-shadow: 0 0 10px var(--primary-glow);
}

.laser-beam:nth-child(1) { left: 20%; }
.laser-beam:nth-child(2) { left: 50%; }
.laser-beam:nth-child(3) { left: 80%; }

/* 音乐播放器 */
.music-player {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 500;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  box-shadow: 0 0 15px var(--primary-glow);
  min-width: 280px;
}

.music-player.collapsed {
  min-width: auto;
}

.music-player.collapsed .player-content {
  display: none;
}

.player-toggle {
  padding: var(--spacing-sm);
  cursor: pointer;
  text-align: center;
  color: var(--primary-color);
  border-bottom: 1px solid var(--border-color);
}

.player-content {
  padding: var(--spacing-sm);
}

.song-info {
  text-align: center;
  margin-bottom: var(--spacing-sm);
}

.song-title {
  font-size: 0.9rem;
  color: var(--text-color);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.song-artist {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.player-controls {
  display: flex;
  justify-content: center;
  gap: var(--spacing-sm);
  margin-bottom: var(--spacing-sm);
}

.btn-control {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1rem;
  cursor: pointer;
  padding: var(--spacing-xs);
  transition: color var(--transition-fast);
}

.btn-control:hover {
  color: var(--primary-color);
}

.btn-play {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.btn-play:hover {
  background: #cc0000;
}

.progress-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  margin-bottom: var(--spacing-sm);
}

.time {
  font-size: 0.7rem;
  color: var(--text-secondary);
  min-width: 35px;
}

.progress-bar,
.volume-bar {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--bg-color);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

.progress-bar::-webkit-slider-thumb,
.volume-bar::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-color);
  cursor: pointer;
}

.volume-container {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
}

.btn-volume {
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
  font-size: 0.9rem;
}

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