/* 视频容器全屏固定 */
.hero-section {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  transition: transform 1s cubic-bezier(0.25, 1, 0.3, 1), opacity 0.8s ease;
  will-change: transform, opacity;
}

/* 视频样式 */
#hero-video {
  position: absolute;
  top: 50%;
  left: 50%;
  min-width: 100%;
  min-height: 100%;
  width: auto;
  height: auto;
  transform: translate(-50%, -50%);
  object-fit: cover;
  z-index: -1;
  background: black;
}

/* 遮罩层 */
.hero-overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

/* 标题 */
#site-title {
  font-size: 3rem;
  color: #fff;
  margin-bottom: 1rem;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.8);
  margin-top: -100px;
}

/* 副标题 */
#site-subtitle {
  font-size: 1.5rem;
  color: #eee;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.25rem;
}

/* 光标闪烁动画 */
.typed-cursor {
  font-weight: 900;
  animation: blink 1s infinite;
  user-select: none;
}

@keyframes blink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}

/* 下滑按钮 */
.scroll-down {
  position: absolute;
  bottom: 5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 2rem;
  color: white;
  cursor: pointer;
  animation: bounce 2s infinite;
  z-index: 10;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

.scroll-down {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: white;
}

.scroll-text {
  font-size: 1rem;
  color: #f0f0f0;
  opacity: 0.85;
  margin-bottom: 6px;
  user-select: none;
}

/* 响应式 */
@media screen and (max-width: 768px) {
  #site-title {
    font-size: 2rem;
  }
  #site-subtitle {
    font-size: 1rem;
  }
  .scroll-down {
    bottom: 6rem;
    font-size: 1.8rem;
  }
}

/* ===== 视频底部柔和渐隐过渡 ===== */
.hero-fade-mask {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px; /* 控制淡出长度 */
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0) 0%, var(--fade-color, #f3f8ff) 100%);
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 2;
}

/* 触发滚动时渐显 */
.hero-fade-mask.show {
  opacity: 1;
}

/* 夜间模式适配 */
body.night-mode {
  --fade-color: #1c2238;
}

/* ===== PPT 推入式过渡动画 ===== */
.hero-section.slide-out {
  transform: translateY(-100%);
  opacity: 0.9;
}

.main-content,
main {
  transition: transform 1s cubic-bezier(0.25, 1, 0.3, 1);
  will-change: transform;
}

.main-content.slide-in,
main.slide-in {
  transform: translateY(-100vh);
}


/* ===== Hero 推入 + 擦除动画 ===== */

/* hero整体动画设置 */
.hero-section {
  transition:
    transform 1.2s cubic-bezier(0.25, 1, 0.3, 1),
    opacity 1.2s ease;
  will-change: transform, opacity;
  z-index: 5;
}

/* 主体区同步动画 */
.main-content,
main {
  position: relative;
  z-index: 1;
  opacity: 0;
  transform: translateY(60px);
  transition:
    opacity 1s ease,
    transform 1s cubic-bezier(0.25, 1, 0.3, 1);
  will-change: opacity, transform;
}

/* hero 推动淡出 */
.hero-section.slide-out {
  transform: translateY(-60px);
  opacity: 0;
}

/* main 擦入淡入 */
.main-content.slide-in,
main.slide-in {
  opacity: 1;
  transform: translateY(0);
}

/* ===== 渐隐衔接遮罩 ===== */
.hero-fade-mask {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    var(--fade-color, #f3f8ff) 100%
  );
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 2;
}

.hero-fade-mask.show {
  opacity: 1;
}

body.night-mode {
  --fade-color: #1c2238;
}
