/* 现代化加载动画 */

/* 主加载器 */
.modern-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease-out;
}

.modern-loader.fade-out {
  opacity: 0;
  pointer-events: none;
}

/* 脉冲圆环 */
.pulse-ring {
  position: relative;
  width: 80px;
  height: 80px;
}

.pulse-ring::before,
.pulse-ring::after {
  content: '';
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  animation: pulse-ring 2s cubic-bezier(0.455, 0.03, 0.515, 0.955) infinite;
}

.pulse-ring::before {
  width: 100%;
  height: 100%;
  animation-delay: 0s;
}

.pulse-ring::after {
  width: 60px;
  height: 60px;
  top: 10px;
  left: 10px;
  animation-delay: 0.5s;
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.8);
    opacity: 1;
  }
  100% {
    transform: scale(1.2);
    opacity: 0;
  }
}

/* 中心图标 */
.loader-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  animation: rotate 2s linear infinite;
}

.loader-icon i {
  color: #667eea;
  font-size: 20px;
}

@keyframes rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* 加载文字 */
.loader-text {
  position: absolute;
  bottom: 30%;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 18px;
  font-weight: 300;
  letter-spacing: 2px;
  animation: fade-in-out 2s ease-in-out infinite;
}

@keyframes fade-in-out {
  0%, 100% {
    opacity: 0.3;
  }
  50% {
    opacity: 1;
  }
}

/* 进度条 */
.loader-progress {
  position: absolute;
  bottom: 20%;
  left: 50%;
  transform: translateX(-50%);
  width: 200px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.loader-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #fff, #f0f0f0);
  border-radius: 2px;
  width: 0%;
  animation: progress-fill 3s ease-in-out;
}

@keyframes progress-fill {
  0% {
    width: 0%;
  }
  100% {
    width: 100%;
  }
}

/* 粒子背景 */
.loader-particles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.loader-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 50%;
  animation: float-up 3s linear infinite;
}

@keyframes float-up {
  0% {
    transform: translateY(100vh) rotate(0deg);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) rotate(360deg);
    opacity: 0;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .pulse-ring {
    width: 60px;
    height: 60px;
  }
  
  .pulse-ring::after {
    width: 40px;
    height: 40px;
    top: 10px;
    left: 10px;
  }
  
  .loader-icon {
    width: 30px;
    height: 30px;
  }
  
  .loader-icon i {
    font-size: 16px;
  }
  
  .loader-text {
    font-size: 16px;
  }
  
  .loader-progress {
    width: 150px;
  }
}

/* 暗色主题 */
@media (prefers-color-scheme: dark) {
  .modern-loader {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  }
  
  .loader-icon {
    background: rgba(255, 255, 255, 0.1);
  }
  
  .loader-icon i {
    color: #4facfe;
  }
} 