/* ========================================
   开场动画 - 山景图片放大+文字+缩回
   ======================================== */

/* 开场覆盖层 */
.intro-overlay {
  position: fixed;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  inset: 0;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.8s ease, visibility 0.8s ease;
  overflow: hidden;
  background: #000;
  margin: 0 !important;
  padding: 0 !important;
}

/* 开场动画播放时隐藏移动端顶栏 */
body.intro-active .mobile-header {
  display: none !important;
}

/* 加载状态时显示loading动画 */
.intro-overlay.loading::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top: 3px solid #ffffff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  0% { transform: translate(-50%, -50%) rotate(0deg); }
  100% { transform: translate(-50%, -50%) rotate(360deg); }
}

.intro-overlay.loading .intro-text,
.intro-overlay.loading .intro-background {
  opacity: 0 !important;
  visibility: hidden !important;
}

/* 动画完成后隐藏 */
.intro-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: -1;
}

/* 本地山景背景图片 */
.intro-background {
  position: absolute;
  inset: 0;
  background-image: url('default.webp');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  animation: kenBurns 4.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
  z-index: 1;
  transform: scale(1);
  transform-origin: center center;
  opacity: 0;
}

/* 添加深色遮罩让文字清晰，带动态渐变 */
.intro-background::before {
  content: '';
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(ellipse at 30% 50%, rgba(59, 130, 246, 0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 70% 50%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
    linear-gradient(135deg, rgba(14, 32, 70, 0.35), rgba(8, 57, 141, 0.3));
  animation: gradientShift 3s ease-in-out;
  z-index: 2;
}

@keyframes gradientShift {
  0% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

/* 文字容器 */
.intro-text {
  position: relative;
  z-index: 10;
  text-align: center;
  color: white;
  pointer-events: none;
}

.intro-text h1 {
  font-size: clamp(1.2rem, 3vw, 2.5rem);
  font-weight: 300;
  margin: 0 0 0.8rem 0;
  letter-spacing: 0.15em;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.3),
               0 1px 3px rgba(0, 0, 0, 0.2);
  opacity: 0;
  animation: fadeInScale 1s ease-out 0.5s forwards,
             shimmer 3s ease-in-out 1.5s infinite;
}

.intro-text p {
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  font-weight: 700;
  margin: 0;
  letter-spacing: 0.1em;
  background: linear-gradient(90deg, 
    #ffffff 0%, 
    #a8daff 25%, 
    #ffffff 50%, 
    #a8daff 75%, 
    #ffffff 100%);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: none;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.4))
          drop-shadow(0 1px 6px rgba(0, 0, 0, 0.3))
          drop-shadow(0 0 20px rgba(168, 218, 255, 0.2));
  opacity: 0;
  animation: fadeInUp 1s ease-out 1.2s forwards,
             gradientSlide 4s linear 2s infinite;
}

/* Ken Burns效果 - 淡入+轻微放大，顶级网站常用 */
@keyframes kenBurns {
  0% {
    transform: scale(1);
    opacity: 0;
    filter: blur(0px);
  }
  20% {
    opacity: 1;
  }
  100% {
    transform: scale(1.05);
    opacity: 1;
    filter: blur(0px);
  }
}

/* 文字淡入+缩放动画 */
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8) translateY(30px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* 文字向上淡入动画 */
@keyframes fadeInUp {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 光斑粒子动画 */
@keyframes float {
  0%, 100% {
    transform: translateY(0) translateX(0);
    opacity: 0;
  }
  10% {
    opacity: 1;
  }
  90% {
    opacity: 1;
  }
  100% {
    transform: translateY(-100px) translateX(50px);
    opacity: 0;
  }
}

/* 渐变色滑动动画 */
@keyframes gradientSlide {
  0% {
    background-position: 0% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* 微光闪烁动画 */
@keyframes shimmer {
  0%, 100% {
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.7),
                 0 1px 5px rgba(0, 0, 0, 0.4);
  }
  50% {
    text-shadow: 0 2px 15px rgba(0, 0, 0, 0.7),
                 0 1px 5px rgba(0, 0, 0, 0.4),
                 0 0 20px rgba(255, 255, 255, 0.4);
  }
}

/* 防止页面滚动 */
body.intro-active {
  overflow: hidden;
}
