/* 初始加载页面专用样式 - 使用更具体的作用域 */
#init-layout .aurora-bg-root {
  --white: #fff;
  --black: #000;
  --transparent: transparent;
  --blue-500: #3b82f6;
  --indigo-300: #a5b4fc;
  --blue-300: #60a5fa;
  --violet-200: #ddd6fe;
  --blue-400: #60a5fa;

  /* 固定定位*/
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1; 

  /* 不阻挡点击事件 */
  pointer-events: none;
  background-color: #fafafa;

  /* 过渡效果 */
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

#init-layout .aurora-overlay {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

#init-layout .aurora-gradient {
  position: absolute;
  top: -10px;
  right: -10px;
  bottom: -10px;
  left: -10px;

  /* 视觉效果 */
  pointer-events: none;
  opacity: 0.5;
  will-change: transform;
  filter: blur(10px) invert(1);
  /* 亮色模式：反转滤镜 */

  /* 渐变定义 */
  --white-gradient: repeating-linear-gradient(100deg, var(--white) 0%, var(--white) 7%, var(--transparent) 10%, var(--transparent) 12%, var(--white) 16%);

  --aurora: repeating-linear-gradient(100deg, var(--blue-500) 10%, var(--indigo-300) 15%, var(--blue-300) 20%, var(--violet-200) 25%, var(--blue-400) 30%);

  /* 背景图片和尺寸 */
  background-image: var(--white-gradient), var(--aurora);
  background-size: 300%, 200%;
  background-position:
    50% 50%,
    50% 50%;

  /* 遮罩效果 */
  mask-image: radial-gradient(ellipse at 100% 0%, black 10%, var(--transparent) 70%);
  -webkit-mask-image: radial-gradient(ellipse at 100% 0%, black 10%, var(--transparent) 70%);

  /* 动画 */
  animation: animate-aurora 60s linear infinite;
}

/* 伪元素增强效果 */
#init-layout .aurora-gradient::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background-image: var(--white-gradient), var(--aurora);
  background-size: 200%, 100%;
  background-attachment: fixed;
  mix-blend-mode: difference;
  animation: animate-aurora 60s linear infinite;
}

/* 动画关键帧 */
@keyframes animate-aurora {
  0% {
    background-position:
      50% 50%,
      50% 50%;
  }

  100% {
    background-position:
      350% 50%,
      350% 50%;
  }
}

/* 响应式优化 */
@media (max-width: 600px) {
  #init-layout .aurora-gradient {
    animation-duration: 40s; /* 移动端动画稍快一些 */
  }
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
  #init-layout .aurora-gradient,
  #init-layout .aurora-gradient::after {
    animation: none;
  }

  #init-layout .aurora-bg-root {
    transition: none;
  }
}

#init-layout .loader-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

#init-layout .loader {
  display: flex;
  height: 90px;
  transform: rotate(180deg);
}

#init-layout .loader span {
  width: 36px;
  margin: 0 2px;
  border-radius: 4px;
  animation: loading 2s infinite;
}

@keyframes loading {
  0%,
  100% {
    height: 10px;
    background: #ffd166;
  }

  25% {
    height: 90px;
    background: #06d6a0;
  }

  50% {
    height: 40px;
    background: #118ab2;
  }

  75% {
    height: 90px;
    background: #ef476f;
  }
}

#init-layout .loader span:nth-child(1) {
  animation-delay: 0.2s;
}

#init-layout .loader span:nth-child(2) {
  animation-delay: 0.4s;
}

#init-layout .loader span:nth-child(3) {
  animation-delay: 0.6s;
}

#init-layout .loader span:nth-child(4) {
  animation-delay: 0.8s;
}

#init-layout .loader span:nth-child(5) {
  animation-delay: 1s;
}
