/* 简洁的加载动画 - 镜像对称设计，添加半透明背景降亮 */
#spinner-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* 使用半透明黑色背景降低页面亮度，突出进度条 */
  background: rgba(0, 0, 0, 0);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  /* 进入动画：只控制透明度，不缩放 */
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 显示状态 - 背景淡入 */
#spinner-container.show {
  opacity: 1;
  background: rgba(0, 0, 0, 0.7);
}

/* 退出动画 - 背景淡出 */
#spinner-container.hide {
  opacity: 0;
  background: rgba(0, 0, 0, 0);
}

.spinner {
  position: relative;
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
  /* 进度条入场动画：从小到大，透明到可见 */
  opacity: 0;
  transform: scale(0.3);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* 进度条显示状态 */
.spinner.show {
  opacity: 1;
  transform: scale(1);
}

/* 进度条退出动画：从大到小，可见到透明（与入场完全对称） */
.spinner.hide {
  opacity: 0;
  transform: scale(0.3);
}

.spinner::before {
  content: '';
  position: absolute;
  border: 4px solid transparent;
  /* 增强颜色对比度，使在透明背景下更突出 */
  border-top: 4px solid #0d6efd;
  border-right: 4px solid #20c997;
  border-radius: 50%;
  width: 100%;
  height: 100%;
  animation: spin 1.2s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  /* 添加轻微阴影增强可见性 */
  box-shadow: 0 0 10px rgba(13, 110, 253, 0.3);
}

.spinner::after {
  content: '';
  position: absolute;
  border: 4px solid transparent;
  /* 增强颜色对比度 */
  border-bottom: 4px solid #e83e8c;
  border-left: 4px solid #fd7e14;
  border-radius: 50%;
  width: 70%;
  height: 70%;
  top: 15%;
  left: 15%;
  animation: spinReverse 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) infinite;
  /* 添加轻微阴影增强可见性 */
  box-shadow: 0 0 8px rgba(232, 62, 140, 0.3);
}

/* 加载文字 */
.loading-text {
  color: #ffffff;
  font-size: 18px;
  font-weight: 500;
  text-align: center;
  animation: pulse 2s ease-in-out infinite;
  /* 文字入场动画：从小到大，透明到可见 */
  opacity: 0;
  transform: scale(0.3);
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* 添加文字阴影增强可读性 */
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5), 0 0 8px rgba(13, 110, 253, 0.3);
}

/* 文字显示状态 */
.loading-text.show {
  opacity: 1;
  transform: scale(1);
}

/* 文字退出动画：从大到小，可见到透明（与入场完全对称） */
.loading-text.hide {
  opacity: 0;
  transform: scale(0.3);
}

.loading-dots {
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: #007bff;
  margin: 0 2px;
  animation: loadingDots 1.4s infinite ease-in-out both;
}

.loading-dots:nth-child(1) { animation-delay: -0.32s; }
.loading-dots:nth-child(2) { animation-delay: -0.16s; }

@keyframes spin {
  0% {
    transform: rotate(0deg) scale(1);
    border-top-color: #0d6efd;
    border-right-color: #20c997;
  }
  25% {
    transform: rotate(90deg) scale(1.1);
    border-top-color: #20c997;
    border-right-color: #fd7e14;
  }
  50% {
    transform: rotate(180deg) scale(1);
    border-top-color: #fd7e14;
    border-right-color: #e83e8c;
  }
  75% {
    transform: rotate(270deg) scale(1.1);
    border-top-color: #e83e8c;
    border-right-color: #6f42c1;
  }
  100% {
    transform: rotate(360deg) scale(1);
    border-top-color: #0d6efd;
    border-right-color: #20c997;
  }
}

@keyframes spinReverse {
  0% {
    transform: rotate(360deg) scale(0.8);
    border-bottom-color: #e83e8c;
    border-left-color: #fd7e14;
  }
  50% {
    transform: rotate(180deg) scale(1.2);
    border-bottom-color: #20c997;
    border-left-color: #0d6efd;
  }
  100% {
    transform: rotate(0deg) scale(0.8);
    border-bottom-color: #e83e8c;
    border-left-color: #fd7e14;
  }
}

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

@keyframes loadingDots {
  0%, 80%, 100% {
    transform: scale(0);
    opacity: 0;
  }
  40% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 粒子背景效果 */
.particle-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: -1;
}

.particle {
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  animation: float 6s ease-in-out infinite;
}

.particle:nth-child(1) {
  width: 6px;
  height: 6px;
  left: 10%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  width: 4px;
  height: 4px;
  left: 20%;
  animation-delay: -2s;
}

.particle:nth-child(3) {
  width: 8px;
  height: 8px;
  left: 30%;
  animation-delay: -1s;
}

.particle:nth-child(4) {
  width: 5px;
  height: 5px;
  left: 40%;
  animation-delay: -3s;
}

.particle:nth-child(5) {
  width: 7px;
  height: 7px;
  left: 50%;
  animation-delay: -0.5s;
}

.particle:nth-child(6) {
  width: 4px;
  height: 4px;
  left: 60%;
  animation-delay: -2.5s;
}

.particle:nth-child(7) {
  width: 6px;
  height: 6px;
  left: 70%;
  animation-delay: -1.5s;
}

.particle:nth-child(8) {
  width: 5px;
  height: 5px;
  left: 80%;
  animation-delay: -3.5s;
}

.particle:nth-child(9) {
  width: 8px;
  height: 8px;
  left: 90%;
  animation-delay: -4s;
}

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