/* 非IE浏览器PC端样式 */

/* 设计稿 1920x1041（@2x 3840x2083），1rem = 100vw/192，1920下 1rem=10px
   高度兜底：窗口越高内容越大，保证窄高屏内容不显小（内容总高约112rem）
   超过 1920px 宽的屏幕整体封顶为设计稿尺寸 */
html {
  font-size: min(max(calc(100vw / 192), calc(100vh / 112)), 10px);
}
body {
  background: #fff;
}

/* ==================== 开屏视频 ==================== */
.intro {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  /* margin: 0 auto;
  max-width: 1920px; */
  background: #000;
  transition: opacity 0.8s ease;
}
.intro video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.intro.hide {
  opacity: 0;
  pointer-events: none;
}

/* 移动端开屏提示：点击屏幕开始播放 */
.intro-tip {
  position: absolute;
  top: 35vh;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  display: none;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: rgba(242, 237, 228, 0.85);
  pointer-events: none;
  animation: introTipPulse 1.6s ease-in-out infinite;
}
@keyframes introTipPulse {
  50% {
    opacity: 0.35;
  }
}
.intro-tip.hide {
  animation: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
@media screen and (max-width: 1024px) {
  .intro-tip {
    display: block;
  }
}

/* ==================== 页面整体 ==================== */
.page {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 1920px;
  margin: 0 auto;
  background: #810f0f url("../images/bg.png") center top no-repeat;
  background-size: cover;
}

/* ==================== 顶部 ==================== */
.header {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  background: #810f0f;
}
.header img {
  width: 100%;
  object-fit: cover;
}

/* 主内容区：弹性撑满剩余高度，垂直居中，避免小屏PC端底部大范围留白 */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ==================== 信件卡片 ==================== */
.letter {
  position: relative;
  width: 94.2rem;
  height: 52.2rem;
  margin: 6rem auto 0;
}
.letter-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
/* 移动端信纸背景（竖版），PC端隐藏 */
.letter-bg-wap {
  display: none;
}
.letter-body {
  position: absolute;
  top: 5rem;
  left: 8.2rem;
  width: 52rem;
  height: 43rem;
  padding-right: 1.2rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
/* 仅正文区域可滚动 */
.letter-text {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(165, 113, 61, 0.55) transparent;
}
.letter-text::-webkit-scrollbar {
  width: 0.6rem;
}
.letter-text::-webkit-scrollbar-track {
  background: transparent;
}
.letter-text::-webkit-scrollbar-thumb {
  background: rgba(165, 113, 61, 0.55);
  border-radius: 999px;
}
.letter-title {
  flex: none;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-weight: 600;
  font-size: 2.7rem;
  line-height: 1.3;
  color: #3f1d0e;
}
.letter-title::after {
  content: "";
  display: block;
  width: 11.8rem;
  height: 0.2rem;
  margin-top: 1rem;
  background: #a5713d;
}
.letter-text > p {
  margin-top: 1.6rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.5rem;
  line-height: 2.2rem;
  color: #45210f;
}
.letter-text > p + p {
  margin-top: 2.2rem;
}
.letter-sign {
  flex: none;
  margin-top: 2.6rem;
}
.sign-line {
  display: block;
  width: 9.4rem;
  height: 0.2rem;
}
.letter-sign p {
  margin-top: 0.9rem;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  font-size: 1.2rem;
  color: #7d4510;
}

/* 进入校园网按钮 */
.enter-btn {
  position: absolute;
  top: 10.4rem;
  right: 6.4rem;
  z-index: 2;
  display: block;
  width: 24.1rem;
  height: 29.6rem;
}
.enter-shadow {
  position: absolute;
  bottom: 0.6rem;
  left: 0;
  width: 24.1rem;
  height: auto;
  transition:
    transform 0.35s ease,
    opacity 0.35s ease;
}
.enter-envelope {
  position: absolute;
  top: 0;
  left: 50%;
  width: 21.8rem;
  height: auto;
  transform: translateX(-50%);
  transition: transform 0.35s ease;
}
.enter-btn:hover .enter-envelope {
  transform: translateX(-50%) translateY(-1.2rem);
}
.enter-btn:hover .enter-shadow {
  transform: scale(0.92);
  opacity: 0.8;
}

/* ==================== BEST MOMENTS ==================== */
.moments {
  position: relative;
  width: 94.2rem;
  margin: 3.3rem auto 0;
}
.moments-bar {
  display: block;
  width: 80rem;
  height: auto;
  margin: 0 auto;
}

/* 轮播 */
.carousel {
  overflow: hidden;
  margin-top: 4.5rem;
}
.carousel-track {
  display: flex;
  gap: 1.2rem;
  transition: transform 0.6s ease;
  will-change: transform;
}
.slide {
  position: relative;
  flex: none;
  width: calc((100% - 3.6rem) / 4);
  aspect-ratio: 3 / 2;
  border-radius: 0.8rem;
  overflow: hidden;
}
.slide > a {
  display: block;
  width: 100%;
  height: 100%;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.slide-caption {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(49, 4, 9, 0.8);
  opacity: 0;
  /* 不拦截点击，悬停时点击仍命中下方链接 */
  pointer-events: none;
  transition: opacity 0.4s ease;
}
.slide-caption p {
  padding: 0 2rem;
  font-size: 1.25rem;
  line-height: 1.75;
  color: #f2ede4;
  text-align: center;
}
.slide:hover .slide-caption {
  opacity: 1;
}

/* 轮播控制条 */
.carousel-ctrl {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 3.6rem;
}
.ctrl-arrow {
  padding: 0.4rem;
  border: 0;
  background: none;
  font-family: Georgia, serif;
  font-size: 1.8rem;
  line-height: 1;
  color: #d8b483;
  cursor: pointer;
}
.ctrl-arrow:hover {
  color: #f0d9ae;
}
.progress {
  position: relative;
  width: 46rem;
  height: 0.8rem;
  border: 1px solid rgba(242, 227, 196, 0.55);
  border-radius: 999px;
  background: rgba(49, 4, 9, 0.9);
  overflow: hidden;
}
.progress-slider {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: #c99a63;
  transition:
    transform 0.6s ease,
    width 0.3s ease;
}

/* 底部装饰线 */
.bottom-line {
  display: block;
  width: 80rem;
  height: auto;
  margin: 0 auto;
}

/* ==================== 页脚 ==================== */
.footer {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80rem;
  margin: 1rem auto 0;
  padding: 0 0 2.4rem;
  font-size: 1.3rem;
  font-style: italic;
  color: #c99d67;
}
.footer a {
  color: #c99d67;
}
.footer a:hover {
  text-decoration: underline;
}

/* ==================== 响应式布局 ==================== */
@media screen and (max-width: 1024px) {
  html {
    font-size: calc(100vw / 95);
  }
  /* 顶部横幅原图过窄，移动端放大裁切两侧 */
  .header img {
    height: 10vw;
    object-fit: cover;
  }
  /* 移动端轮播：单张上下切换，文字常显在图片下方 */
  .carousel-track {
    flex-direction: column;
    gap: 0;
  }
  .slide {
    width: 100%;
    aspect-ratio: auto;
    overflow: visible;
    padding: 0 6%;
    margin-bottom: 1px;
  }
  .slide img {
    height: auto;
    aspect-ratio: 3 / 2;
    border-radius: 0.8rem;
  }
  .slide-caption {
    position: static;
    background: none;
    opacity: 1;
    padding: 1.4rem 0.5rem 0;
  }
  .slide-caption p {
    padding: 0;
    font-size: 2rem;
    line-height: 1.6;
    color: #f2e3c8;
  }
  /* 移动端轮播箭头加大 */
  .ctrl-arrow {
    padding: 1rem;
    font-size: 4rem;
  }
  .bottom-line {
    width: 100%;
    margin: 0 auto;
  }
  .letter {
    width: 92%;
    height: auto;
  }
  .letter-bg {
    display: none;
  }
  /* 信2在文档流中撑起卡片高度，完整显示不裁切 */
  .letter-bg-wap {
    display: block;
    position: static;
    width: 100%;
    height: auto;
  }
  .letter-body {
    position: absolute;
    top: 7%;
    left: 11%;
    width: 78%;
    height: 66%;
    padding: 0 1.5rem 0 0;
  }
  /* 移动端信件文字加大 */
  .letter-title {
    font-size: 3.9rem;
  }
  .letter-text > p {
    margin-top: 2rem;
    font-size: 2.3rem;
    line-height: 3.4rem;
  }
  .letter-text > p + p {
    margin-top: 2.6rem;
  }
  .letter-sign p {
    font-size: 1.5rem;
  }
  .letter-sign {
    margin-top: 2rem;
  }
  /* 信封按钮叠加在信2图片上层底部 */
  .enter-btn {
    top: auto;
    right: auto;
    bottom: 3%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
  }
  .moments {
    width: 92%;
  }
  .moments-bar {
    width: 100%;
  }
  .footer {
    font-size: 2rem;
  }
}

@media screen and (max-width: 480px) {
  html {
    font-size: calc(100vw / 60);
  }
  /* 小屏下信件字号略收、信封按钮缩小，保证文字与信封不重叠 */
  .letter-title {
    font-size: 3.5rem;
  }
  .letter-text > p {
    font-size: 2rem;
    line-height: 3rem;
  }
  .enter-btn {
    width: 17.6rem;
    height: 21.6rem;
  }
  .enter-shadow {
    width: 17.6rem;
    bottom: 0.4rem;
  }
  .enter-envelope {
    width: 15.9rem;
  }
  .footer {
    width: 92%;
    padding: 1rem 0 2.4rem;
  }
}
