/* 主要样式: 布局、颜色、字体 */ 
/* 1. CSS变量定义 */
:root {
    --dark-blue: #1a1a2e;
    --dark-purple: #16213e;
    --star-white: #ffffff;
    --warm-gold: #ffd700;
    --sky-blue: #87CEEB;
    --font-pixel: 'Press Start 2P', cursive;
  }
  
  /* 2. 基础重置 */
  *,
  *::before,
  *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  /* 3. body 样式 */
  body {
    background: linear-gradient(to bottom, var(--dark-purple), var(--dark-blue));
    font-family: var(--font-pixel);
    color: var(--star-white);
    height: 100vh;
    overflow: hidden; /* 隐藏滚动条 */
  }
  
  /* 4. 页面容器 */
  .page-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  
  /* 5. 模态窗口基础 */
  .modal-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(26, 26, 46, 0.9); /* 半透明星云材质 */
    border: 2px solid var(--warm-gold);
    border-radius: 0; /* 像素风格无圆角 */
    padding: 2rem;
    max-width: 90vw;
    max-height: 90vh;
    overflow: auto;
    z-index: 1000;
    box-shadow: 0 0 0 4px var(--star-white), 0 0 0 6px var(--warm-gold);
  }
  
  /* 像素按钮基础 */
  .pixel-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-pixel);
    font-size: 0.75rem;
    color: var(--star-white);
    background: transparent;
    border: 2px solid var(--sky-blue);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
  }
  
  .pixel-button:hover {
    background: var(--sky-blue);
    color: var(--dark-blue);
  }

  /* =============================
   加载页面 - 专属样式
   ============================= */

/* 内容容器，负责整体布局和间距 */
#loading-page .loading-content {
  display: flex;
  flex-direction: column; /* 让内容垂直排列 */
  align-items: center;   /* 水平居中 */
  justify-content: center; /* 垂直居中 */
  text-align: center;
  gap: 2rem; /* 使用 gap 优雅地设置元素之间的间距 */
}

/* 主标题样式 */
#loading-page .main-title {
  font-size: 2.5rem; /* 调大一点更有气势 */
  color: var(--warm-gold); /* 使用我们的主题暖金色 */
  text-shadow: 2px 2px 0px var(--dark-blue); /* 添加一点像素阴影增加立体感 */
}

/* 副标题样式 */
#loading-page .subtitle {
  font-size: 1rem;
  color: var(--star-white);
  opacity: 0.8; /* 让它比主标题稍微暗一点 */
}

/* 像素风格按钮的样式 */
.pixel-button {
  background-color: transparent;
  border: 2px solid var(--sky-blue);
  color: var(--sky-blue);
  padding: 10px 20px;
  font-family: var(--font-pixel); /* 确保按钮也使用像素字体 */
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s ease; /* 添加一个简单的过渡效果 */
}

/* 按钮悬停效果 */
.pixel-button:hover:not(:disabled) {
  background-color: var(--sky-blue);
  color: var(--dark-blue);
}

/* 按钮禁用时的样式 */
.pixel-button:disabled {
  border-color: #555;
  color: #555;
  cursor: not-allowed;
}

/* 进度条容器的样式 */
.progress-bar-container {
  width: 250px; /* 给进度条一个固定的宽度 */
  height: 15px;
  border: 2px solid var(--star-white);
  background-color: var(--dark-blue);
}

/* 进度条本身的样式 */
.progress-bar {
  width: 0%; /* 初始宽度为0，由JS控制增长 */
  height: 100%;
  background-color: var(--sky-blue);
}

/* =============================
   星图页面 - 专属样式
   ============================= */

/* 星图容器，这是可拖拽的区域 */
.starmap-container {
  position: relative; /* 使用相对定位 */
  width: 100vw;       /* 占满整个屏幕宽度 */
  height: 100vh;      /* 占满整个屏幕高度 */
  cursor: default;       /* 鼠标变成“抓取”手势 */
  background-image: url('https://www.transparenttextures.com/patterns/stardust.png'); /* 添加一点星尘背景纹理增加层次感 */
}

.starmap-container:active {
  cursor: grabbing; /* 拖拽时变成“抓紧”手势 */
}

/* 星球的基础样式 */
.planet {
  position: absolute; /* 星球也使用绝对定位，方便JS控制位置 */
  width: 80px;
  height: 80px;
  border-radius: 50%; /* 将方形图片裁剪成圆形 */
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;

  /* 暖金色外发光效果 */
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.5);

  /* 应用我们在 animations.css 里定义的呼吸灯动画 */
  animation: breathing-light 3s infinite ease-in-out;
}

/* 星球名称标签的样式 */
.planet-label {
  position: absolute;
  bottom: -25px; /* 显示在星球正下方 */
  left: 50%;
  transform: translateX(-50%);
  color: var(--star-white);
  font-size: 0.9rem; /* 基础字体大小 */
  opacity: 0; /* 默认隐藏 */
  transition: opacity 0.3s ease;
  white-space: nowrap; /* 防止名称换行 */
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8); /* 添加阴影增强可读性 */
}

/* 星球中文部分样式 */
.planet-name-chinese {
  font-size: 1.8rem; /* 增大中文字体 */
  color: var(--warm-gold);
  font-weight: bold; /* 加粗中文 */
}

/* 星球英文部分样式 */
.planet-name-english {
  font-size: 1.1rem; /* 稍微增大英文字体 */
  color: var(--star-white);
  font-weight: normal;
}

/* 鼠标悬停在星球上时 */
.planet:hover {
  transform: scale(1.2); /* 变大 */
  box-shadow: 0 0 25px rgba(255, 215, 0, 0.8); /* 更强的暖金色光晕 */
  animation-play-state: paused; /* 暂停呼吸动画 */
}

.planet:hover .planet-label {
  opacity: 1; /* 显示星球名称 */
}

/* 已访问星球的样式 */
.planet.visited {
  animation: none; /* 停止动画 */
  box-shadow: 0 0 20px 8px rgba(255, 215, 0, 0.7); /* 变为持续发光 */
}

/* 核心星球特殊样式 */
#planet-core {
  width: 150px !important;
  height: 150px !important;
  filter: brightness(1.3);
  box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
  animation: core-pulse 2s infinite ease-in-out;
}

/* 星球固定位置样式 */
#planet-core {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-image: url('../assets/images/planet-core.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#planet-encounter {
  top: 20%;
  left: 75%;
  transform: translate(-50%, -50%);
  background-image: url('../assets/images/planet-encounter.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#planet-adventure {
  top: 30%;
  left: 15%;
  transform: translate(-50%, -50%);
  background-image: url('../assets/images/planet-adventure.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#planet-chaos {
  top: 70%;
  left: 25%;
  transform: translate(-50%, -50%);
  background-image: url('../assets/images/planet-chaos.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#planet-pact {
  top: 75%;
  left: 80%;
  transform: translate(-50%, -50%);
  background-image: url('../assets/images/planet-pact.png');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

#planet-core:hover {
  transform: scale(1.15);
  box-shadow: 0 0 40px rgba(255, 215, 0, 1);
  filter: brightness(1.5);
}

/* 核心星球脉冲动画 */
@keyframes core-pulse {
  0%, 100% {
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.8);
    filter: brightness(1.3);
  }
  50% {
    box-shadow: 0 0 45px rgba(255, 215, 0, 1);
    filter: brightness(1.6);
  }
}

/* =============================
   模态窗口 (Modal) - 重构后的通用样式
   ============================= */

/* 模态窗口容器 */
#modal-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* 默认不拦截事件 */
  z-index: 9998; /* 确保在其他元素之上 */
}

#modal-container > * {
  pointer-events: auto; /* 子元素恢复事件响应 */
}

/* 通用遮罩层 */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(5px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* 激活状态的遮罩层 */
.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* 通用模态窗口 - 修复居中问题 */
.modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: var(--dark-blue);
  border: 2px solid var(--warm-gold);
  border-radius: 8px;
  padding: 1.5rem;
  width: 90%;
  max-width: 600px;
  max-height: 70vh;
  overflow: hidden;
  color: var(--star-white);
  text-align: center;
  box-sizing: border-box;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

/* 激活状态的模态窗口 - 确保居中 */
.modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%);
}

/* 保持向后兼容的旧类名 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(10, 10, 20, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  overflow: hidden; /* 防止滚动 */
  padding: 0;
  box-sizing: border-box;
}

/* 修复旧的模态窗口样式 */
.modal-window {
  position: relative;
  background-color: var(--dark-blue);
  border: 2px solid var(--warm-gold);
  padding: 1.5rem;
  width: 100%;
  max-width: none;
  max-height: none;
  height: auto;
  overflow: hidden;
  color: var(--star-white);
  text-align: center;
  box-sizing: border-box;
  border-radius: 8px;
  margin: 0;
  transform: none;
  top: auto;
  left: auto;
}

/* 美化滚动条 */
.modal-window::-webkit-scrollbar {
  width: 8px;
}

.modal-window::-webkit-scrollbar-track {
  background: rgba(255, 215, 0, 0.1);
  border-radius: 4px;
}

.modal-window::-webkit-scrollbar-thumb {
  background: var(--warm-gold);
  border-radius: 4px;
}

.modal-window::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 215, 0, 0.8);
}

/* 响应式设计 - 移动设备优化 */
@media (max-width: 768px) {
  .modal-overlay {
    padding: 0; /* 移动设备上也不使用内边距 */
  }

  .modal-window, .modal {
    width: 95%;
    max-width: none;
    max-height: 90vh; /* 在移动设备上使用合适的高度 */
    padding: 1rem;
    margin: 1vh 1vw; /* 移动设备上使用较小的外边距 */
  }

  .modal-content h3 {
    font-size: 1.3rem;
  }

  .modal-content p {
    font-size: 1rem;
    padding: 0 0.2rem;
  }

  .modal-content .modal-image {
    max-height: 300px;
  }

  /* 移动设备上的照片画廊优化 */
  .photo-gallery {
    gap: 0.5rem;
    padding: 0.5rem 0;
    margin: 1rem 0;
  }

  .photo-gallery .gallery-item {
    width: 120px;
    height: 160px; /* 3:4 比例，120 * 4/3 = 160 */
  }
}

/* 关闭按钮 */
.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  color: var(--warm-gold);
  font-size: 2rem;
  cursor: pointer;
}

/* 弹窗内的内容 */
.modal-content {
  width: 100%;
  height: auto;
  overflow: visible;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem; /* 统一元素间距 */
}

.modal-content h3 {
  font-size: 1.4rem; /* 稍微减小标题 */
  margin: 0 0 1rem 0; /* 减小边距 */
  color: var(--warm-gold);
  word-wrap: break-word;
}

/* 模态窗口中的星球名称样式 */
.modal-content h3 .planet-name-chinese {
  font-size: 2rem; /* 中文部分使用更大字体 */
  color: var(--warm-gold);
  font-weight: bold;
}

.modal-content h3 .planet-name-english {
  font-size: 1.4rem; /* 英文部分保持原始大小 */
  color: var(--star-white);
  font-weight: normal;
}

.modal-content p {
  font-size: 1.3rem; /* 增大字体 */
  line-height: 1.8; /* 增大行高，让文字更易读 */
  opacity: 0.9;
  margin: 0 0 1rem 0; /* 减小边距 */
  text-align: left;
  padding: 0 0.5rem;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
}

.modal-content .modal-image {
  display: block;
  max-width: 100%;
  width: auto;
  height: auto;
  max-height: 250px; /* 进一步减小图片高度 */
  border: 2px solid var(--warm-gold);
  border-radius: 4px;
  object-fit: contain;
  margin: 0; /* 移除边距 */
}

.modal-content .modal-image-container {
  width: 100%;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0; /* 移除边距 */
  overflow: visible;
}

.modal-content video {
  width: 100%;
  height: auto;
  max-height: 300px; /* 限制视频高度 */
  border: none; /* 移除黄色边框 */
  border-radius: 4px;
  margin: 0; /* 移除边距 */
}

/* 契约星输入框样式 */
.pact-input-group {
  display: flex;
  gap: 10px;
}
.pact-input-group input {
  flex-grow: 1;
  background: transparent;
  border: 1px solid var(--star-white);
  color: var(--star-white);
  padding: 10px;
  font-family: var(--font-pixel);
}
.pact-input-group button {
  /* 复用我们的像素按钮样式 */
  background-color: transparent;
  border: 2px solid var(--warm-gold);
  color: var(--warm-gold);
  padding: 10px 20px;
  font-family: var(--font-pixel);
  cursor: pointer;
}

/* =============================
   模态窗口图片/视频样式修复
   ============================= */

/* 统一为弹窗内的图片和视频设置样式 */
/* -- 新的、更可靠的弹窗图片/视频样式 -- */
.modal-content .modal-image-container {
    width: 100%;
    height: auto; /* 改为自适应高度 */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    /* 移除容器边框 */
    overflow: visible; /* 确保内容不被裁剪 */
}

.modal-content video {
    width: 100%;
    height: 40vh;
    margin-bottom: 1.5rem;
    border: none; /* 移除黄色边框 */
    border-radius: 4px;
}

.modal-content .modal-image { /* 样式给图片本身 */
    display: block;
    max-width: 100%;
    width: auto;
    height: auto;
    max-height: 350px; /* 减小图片最大高度，确保模态窗口不会过大 */
    border: 2px solid var(--warm-gold); /* 只给图片本身加边框 */
    border-radius: 4px;
    object-fit: contain; /* 确保图片完整显示 */
}

/* 照片画廊样式 */
.photo-gallery {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    padding: 1rem 0;
    margin: 1.5rem 0;
    scroll-behavior: smooth;
}

.photo-gallery::-webkit-scrollbar {
    height: 8px;
}

.photo-gallery::-webkit-scrollbar-track {
    background: rgba(255, 215, 0, 0.1);
    border-radius: 4px;
}

.photo-gallery::-webkit-scrollbar-thumb {
    background: var(--warm-gold);
    border-radius: 4px;
}

.photo-gallery::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.8);
}

.photo-gallery .gallery-item {
    flex: 0 0 auto;
    width: 160px;
    height: 213px; /* 3:4 比例，160 * 4/3 = 213 */
    border: 2px solid var(--warm-gold);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-gallery .gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.6);
}

.photo-gallery .gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 保持 cover 以填满容器，适合竖版图片 */
    object-position: center; /* 确保图片居中显示 */
    transition: transform 0.3s ease;
}

.photo-gallery .gallery-item:hover img {
    transform: scale(1.1);
}

/* 图片预览模态窗口优化 */
.image-preview-modal .modal-content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.image-preview img {
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
}



/*
 * =========================================
 * 银河漩涡全屏显示 - 最终修复版
 * =========================================
*/
#galaxy-vortex-container {
    /* 核心定位与尺寸：强制覆盖其他规则 */
    position: fixed !important;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;

    /* 确保在最顶层，覆盖所有星球 */
    z-index: 999 !important;

    /* 视觉效果 */
    background-color: #000; /* 黑色背景，防止视频加载时闪烁 */
    cursor: pointer;

    /* 默认隐藏，通过JS控制显示 */
    display: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

/* 视频本身的样式 */
#galaxy-vortex-container video {
    width: 100%;
    height: 100%;
    object-fit: cover; /* 关键：填满容器，不变形 */
}

/* 当JS添加 .active 类时，使其显示 */
#galaxy-vortex-container.active {
    display: block; /* 先让它占据空间 */
    opacity: 1; /* 再平滑地显示出来 */
}

/* 邮筒容器样式 */
#postbox-container {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  cursor: pointer;
  z-index: 10;
}
#postbox-icon {
  width: 60px;
  height: 60px;
}

@keyframes spinning {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* 按钮淡入动画 */
@keyframes buttonFadeIn {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* 邮筒出现动画 */
@keyframes postboxAppear {
  from {
    opacity: 0;
    transform: translateX(-50%) scale(0.5);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) scale(1);
  }
}

/* 信纸飘出动画 */
@keyframes letterFloat {
  from {
    opacity: 0;
    transform: translateY(100vh) scale(0.3) rotate(-15deg);
  }
  50% {
    opacity: 0.7;
    transform: translateY(20vh) scale(0.7) rotate(-5deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1) rotate(0deg);
  }
}

/* =============================
   最终视觉微调
   ============================= */

/* --- 2. 加载页面字体调整 --- */
#loading-page .main-title {
  font-size: 3rem; /* 放大主标题 */
  color: #87CEEB; /* 修改为好看的天蓝色 */
  text-shadow: 2px 2px 0px var(--dark-blue);
}

#loading-page .subtitle {
  font-size: 1.7rem; /* 放大副标题 */
}


/* --- 3. 星战字幕样式 --- */
.star-wars-crawl {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: linear-gradient(to bottom, var(--dark-purple), var(--dark-blue));
}

.crawl-content {
  position: absolute;
  top: 100%;
  left: 50%;
  width: 80%;
  transform: translateX(-50%); /* 去掉3D效果 */
  font-size: 1.8rem;
  line-height: 2.2;
  text-align: center;
  color: var(--warm-gold);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.crawl-content .crawl-title {
  font-size: 2.2rem;
  margin-bottom: 2rem;
  color: var(--sky-blue);
  text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
}

.crawl-content p {
  margin-bottom: 1.5rem;
  opacity: 0.95;
}

#postbox-icon {
  width: 120px;  /* 放大邮筒图标 */
  height: 120px;
}

/* "我愿意"按钮样式 */
.willing-button {
  position: absolute;
  bottom: 10vh;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 40px;
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--warm-gold);
  background: linear-gradient(135deg, var(--dark-purple), var(--dark-blue));
  border: 2px solid var(--warm-gold);
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(106, 90, 205, 0.3);
  z-index: 10;
  font-family: inherit;
}

.willing-button:hover {
  background: linear-gradient(135deg, var(--dark-blue), var(--dark-purple));
  box-shadow: 0 6px 20px rgba(106, 90, 205, 0.5);
  transform: translateX(-50%) translateY(-2px);
}

.willing-button:active {
  transform: translateX(-50%) translateY(0px);
  box-shadow: 0 2px 10px rgba(106, 90, 205, 0.4);
}

/* --- 4. 未来信件样式优化 --- */
.letter-modal {
  background: linear-gradient(135deg,
    rgba(240, 235, 255, 0.98) 0%,
    rgba(235, 230, 255, 0.95) 50%,
    rgba(230, 225, 255, 0.98) 100%);
  border: 3px solid #6A5ACD;
  border-radius: 12px;
  box-shadow:
    0 0 30px rgba(106, 90, 205, 0.4),
    inset 0 0 30px rgba(138, 43, 226, 0.1),
    0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 800px;
  max-height: 85vh;
  padding: 2.5rem;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1001;
  /* 信纸纹理效果 */
  background-image:
    linear-gradient(90deg, rgba(106, 90, 205, 0.1) 1px, transparent 1px),
    linear-gradient(rgba(106, 90, 205, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
  /* 信纸边缘效果 */
  position: relative;
  overflow-y: auto;
}

/* 信纸滚动条样式 - 优雅紫色 */
.letter-modal::-webkit-scrollbar {
  width: 8px;
}

.letter-modal::-webkit-scrollbar-track {
  background: rgba(155, 136, 196, 0.1);
  border-radius: 4px;
}

.letter-modal::-webkit-scrollbar-thumb {
  background: #9b88c4;
  border-radius: 4px;
}

.letter-modal::-webkit-scrollbar-thumb:hover {
  background: rgba(155, 136, 196, 0.8);
}

.letter-modal .modal-content h3 {
  font-size: 2.2rem;
  color: #6A5ACD;
  text-align: center;
  margin-bottom: 2rem;
  text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
  border-bottom: 2px solid #6A5ACD;
  padding-bottom: 1rem;
  font-family: 'Times New Roman', serif;
  font-weight: bold;
}

.letter-modal .modal-content p {
  font-size: 1.1rem;
  text-align: left;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  color: #619DE4;
  text-shadow: none;
  text-indent: 2em; /* 首行缩进2字符 */
  font-family: 'Times New Roman', serif;
  /* 打字机效果的基础样式 */
  opacity: 0;
  animation: none; /* 默认不播放动画 */
}

/* 第一段特殊样式 - 左对齐，首行缩进2字符 */
.letter-modal .modal-content p[data-paragraph="0"] {
  text-align: left;
  text-indent: 2em; /* 第一段首行缩进2字符 */
}

/* 打字机动画效果 - 优化显示位置 */
@keyframes typewriter {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 光标闪烁动画 */
@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

.letter-modal .modal-content p.typing {
  opacity: 1;
  overflow: visible; /* 改为可见，避免文字位置问题 */
  white-space: normal; /* 允许正常换行 */
  border-right: 2px solid #6A5ACD;
  /* 移除动画，改用JS控制 */
}

.letter-modal .modal-content p.typed {
  opacity: 1;
  white-space: normal;
  border-right: none;
}

/* 特殊段落不缩进 */
.letter-modal .modal-content p[style*="text-align: right"] {
  text-indent: 0;
  text-align: right;
  font-style: italic;
  color: #696969;
}

/* 信件内容区域样式 */
.letter-content {
  margin-bottom: 2rem;
}

.letter-content p {
  margin-bottom: 1.5rem;
  line-height: 1.8;
  text-indent: 2em; /* 段落首行缩进 */
}

/* 信件署名区域样式 - 位于信纸右下角 */
.letter-signature {
  margin-top: 2rem; /* 增加上边距，避免与内容重合 */
  margin-bottom: 2rem;
  text-align: right;
  padding-right: 1rem; /* 右侧留白 */
}

.letter-signature p {
  text-indent: 0 !important;
  text-align: right !important;
  font-style: italic;
  color: #696969;
  margin-bottom: 0.5rem;
}

.letter-modal .modal-content p:last-of-type {
  margin-bottom: 0;
}

/* 信纸装饰边框 */
.letter-modal::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 15px;
  right: 15px;
  bottom: 15px;
  border: 1px solid rgba(106, 90, 205, 0.3);
  border-radius: 8px;
  pointer-events: none;
}

/* 信纸左侧装订线 */
.letter-modal::after {
  content: '';
  position: absolute;
  top: 0;
  left: 60px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom,
    transparent 0%,
    rgba(106, 90, 205, 0.3) 10%,
    rgba(106, 90, 205, 0.3) 90%,
    transparent 100%);
  pointer-events: none;
}

/* 视频模态窗口的特殊样式 */
#video-modal {
    /* 覆盖通用模态窗口的尺寸限制 */
    max-width: none !important;
    max-height: none !important;
    padding: 0 !important; /* 移除外层padding */
}

#video-modal .modal-content {
    padding: 0; /* 移除内边距，让视频填满 */
    background-color: #000; /* 黑色背景，更有沉浸感 */
    border-radius: 10px;
    overflow: hidden; /* 隐藏视频超出圆角的部分 */
    border: none !important; /* 强制移除边框 */
    box-shadow: none !important; /* 移除阴影效果 */
    /* 让容器适应视频的实际尺寸 */
    width: auto; /* 宽度自适应 */
    max-width: 90vw; /* 最大宽度不超过视口的90% */
    height: auto; /* 高度自适应 */
    max-height: 90vh; /* 最大高度不超过视口的90% */
    display: flex; /* 使用flex布局 */
    align-items: center; /* 垂直居中 */
    justify-content: center; /* 水平居中 */
}

#anniversary-video {
    max-width: 90vw; /* 最大宽度不超过视口的90% */
    max-height: 90vh; /* 最大高度不超过视口的90% */
    width: auto; /* 宽度自适应 */
    height: auto; /* 高度自适应 */
    display: block; /* 消除视频下方的微小空隙 */
    border: none !important; /* 强制移除所有边框 */
    border-radius: 10px; /* 与容器保持一致的圆角 */
    outline: none !important; /* 移除焦点轮廓 */
    box-shadow: none !important; /* 移除阴影 */
}

/* =============================
   流星动画 - 符合页面主题设计
   ============================= */

/* 流星容器 */
.shooting-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

/* 流星基础样式 */
.shooting-star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: var(--warm-gold);
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;

    /* 暖金色光晕，符合页面主题 */
    box-shadow:
        0 0 8px var(--warm-gold),
        0 0 16px rgba(255, 215, 0, 0.6),
        0 0 24px rgba(255, 215, 0, 0.3);

    /* 添加像素风格的锐化效果 */
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
}

/* 流星尾巴 */
.shooting-star::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 120px;
    height: 2px;
    background: linear-gradient(
        90deg,
        var(--warm-gold) 0%,
        rgba(255, 215, 0, 0.8) 20%,
        rgba(255, 215, 0, 0.4) 60%,
        transparent 100%
    );
    transform: translate(-50%, -50%);
    border-radius: 2px;
    box-shadow: 0 0 4px rgba(255, 215, 0, 0.5);
}

/* 流星动画 - 从不同方向划向左下角 */
@keyframes meteor-fall-1 {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-45deg);
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-100vw) translateY(100vh) rotate(-45deg);
    }
}

@keyframes meteor-fall-2 {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-30deg);
    }
    15% {
        opacity: 1;
    }
    85% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-80vw) translateY(120vh) rotate(-30deg);
    }
}

@keyframes meteor-fall-3 {
    0% {
        opacity: 0;
        transform: translateX(0) translateY(0) rotate(-60deg);
    }
    8% {
        opacity: 1;
    }
    92% {
        opacity: 1;
    }
    100% {
        opacity: 0;
        transform: translateX(-120vw) translateY(80vh) rotate(-60deg);
    }
}

/* 两颗平行流星的动画配置 - 10秒速度 */
.shooting-star:nth-child(1) {
    animation: meteor-fall-1 10s linear infinite;
    animation-delay: 0s;
}

.shooting-star:nth-child(2) {
    animation: meteor-fall-1 10s linear infinite;
    animation-delay: 3s; /* 延迟3秒出现 */
}

/* 小尺寸流星变体 */
.shooting-star.small {
    width: 2px;
    height: 2px;
    box-shadow:
        0 0 6px var(--warm-gold),
        0 0 12px rgba(255, 215, 0, 0.4);
}

.shooting-star.small::before {
    width: 80px;
    height: 1px;
}






