/* 全局设置 */
body {
  font-family: 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(-45deg, #0b3d0b, #145214, #f0b36e, #2a6f8f, #3a99d8);
  background-size: 400% 400%;
  animation: gradientFlow 20s ease infinite;
  color: #fff;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  transition: background 1s ease;
  padding-bottom: 40px; /* 让底部内容留出空间给固定的日期 */
  box-sizing: border-box;
  
}


/* 封面样式 */
.cover {
  display: flex;
  flex-direction: column; /* 文字垂直排列 */
  justify-content: center; /* 垂直居中 */
  align-items: center; /* 水平居中 */
  height: 100vh; /* 让容器高度撑满整个视口 */
  text-align: center; /* 文字内部居中 */
  padding: 20px; /* 适当留白 */
}


/* 打字机文字 */
.typing-text {
  font-size: 1.5rem;
  white-space: nowrap;
  overflow: hidden;
}


#typing-text,
#typing-text-hbd {
  font-size: 2rem;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
}

#typing-text-hbd {
  font-size: 7rem;
  color: #ffe066;
  opacity: 0;
  font-weight: bold;
  transition: opacity 0.5s ease;
}


#birthday-date {
  position: fixed;
  bottom: 20px;       /* 距离底部10px，可以根据需要调整 */
  left: 50%;          /* 水平位置先移到屏幕中央 */
  transform: translateX(-50%);  /* 再向左移动自身宽度的一半，实现真正居中 */
  font-size: 1.5rem;
  color: #fffacd;
  white-space: nowrap;
  pointer-events: none; /* 不影响点击操作，可选 */
  padding: 4px 8px;
  border-radius: 6px;
  user-select: none;   /* 防止选中 */
  font-weight: bold;
  font-style: italic;
}

@media screen and (max-width: 768px) {
  #typing-text{
    font-size: 1.5rem; /* 你希望在手机上显示的字号，可以根据需要调整 */
  }
  #typing-text-hbd {
    font-size: 3rem; /* 你希望在手机上显示的字号，可以根据需要调整 */
  }
  #birthday-date {
    font-size: 1rem;
  }
}

/* 打字光标动画 */
@keyframes blink {
  0%, 100% { border-color: transparent; }
  50% { border-color: #033d1b; }
}

/* 发光+放大动画 */
@keyframes glowAndZoom {
  0% {
    transform: scale(0.95);
    text-shadow: none;
    opacity: 0;
  }
  50% {
    transform: scale(1.05);
    text-shadow: 0 0 8px #ffd700, 0 0 16px #ffeb7b;
    opacity: 1;
  }
  100% {
    transform: scale(1);
    text-shadow: 0 0 6px #ffeb7b;
  }
}

.glowAndZoom {
  animation: glowAndZoom 1s ease;
}

@keyframes breathingGlow {
  0%, 100% {
    text-shadow: 0 0 4px #ffeb7b;
    opacity: 1;
  }
  50% {
    text-shadow: 0 0 14px #ffe066;
    opacity: 0.9;
  }
}

.glowLoop {
  animation: breathingGlow 3s ease-in-out infinite;
}


.enter-btn {
  margin-top: 30px;
  padding: 12px 40px;
  font-size: 1.1rem;
  color: white;
  background-color: #4caf50;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* 鼠标悬停：放大+发光 */
.enter-btn:hover {
  background-color: #388e3c;
  transform: scale(1.05);
  box-shadow: 0 0 12px 4px rgba(76, 175, 80, 0.6);
}

/* 点击时：缩小模拟按下感 */
.enter-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* 轻微内缩阴影 */
}





/* 移动端优化 */
@media (max-width: 600px) {
  .enter-btn {
    font-size: 1rem;
    padding: 8px 16px;
  }
}

/* 第二页 */
/* 整体页面容器 */
.page-container {
  display: flex;
  flex-direction: column; /* 垂直排列：标题、主区域、播放器 */
  height: 100vh;
  margin: 0 auto;       /* 水平居中 */
  box-sizing: border-box; /* 包含内边距和边框 */
}

/* 中间主区域，左右分栏 */
.page-main {
  display: flex;
  align-items: stretch; /* 让子元素高度一致 */
  gap: 20px;
  height: calc(100vh - 100px); /* 视口高度减去顶部标题和底部播放器等 */
  padding: 20px;
  box-sizing: border-box;
}

.page-title {
  text-align: center;       /* 文字居中 */
  font-size: 2.5rem;        /* 字体大小，可以根据需要调整 */
  font-weight: bold;        /* 加粗 */
  margin: 0px 0;           /* 上下间距，左右为0 */  
  margin-bottom: 0px; /* 控制 h1 与 .page-main 的间距 */
    color: #ffde59; /* 舞台灯光色 */
    text-shadow: 0 0 10px rgba(255, 222, 89, 0.7);
}
.page-title h1 {
  margin-top: 20px;
  margin-bottom: 0; /* 清除 h1 默认的底部 margin */
}

/* 右侧小作文 */
.words {
  flex: 1 1 50%;
  display: flex;
  flex-direction: column; /* 竖排 */
  align-items: flex-start;
  gap: 0px;
  max-height: 100vh;
  max-width: 90vw;
  overflow-y: auto;
  padding: 20px 30px;
  margin: 30px auto;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08); /* 轻柔背景 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  line-height: 1.8;
}

.words p {
  text-indent: 2em;           /* 每段首行缩进 */
  margin-bottom: 0em;         /* 段落间距 */
  font-size: 1.4rem;    /* 调整字体大小（可根据需要修改） */
  line-height: 2;
}

.words p:first-child {
  text-indent: 0;             /* 第一段顶格 */
  font-weight: bold;
  font-size: 1.6rem;    /* 调整字体大小（可根据需要修改） */
}

.words img {
  width: 80%;       /* 电脑上占容器80%宽 */
  max-width: 400px; /* 限制最大像素宽 */
  height: auto;
  display: block;
  margin: 0 auto;   /* 居中 */
  box-sizing: border-box;
  object-fit: contain; /* 图片完整显示，不裁剪，不拉伸 */
}

@media screen and (max-width: 768px) {
  .words img {
    width: 65%;    /* 手机端宽度撑满容器 */
    max-width: 400px;
  }
}

.words {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.words::-webkit-scrollbar {
  display: none; /* Chrome/Edge/Safari */
}

/* 照片部分 */
.memory-gallery {
  display: flex;
  flex-direction: column; /* 竖排 */
  align-items: center;
  gap: 20px;
  max-height: 100vh;
  max-width: 90vw;
  overflow-y: auto;
  padding: 30px;
  margin: 30px auto;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08); /* 轻柔背景 */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}
.memory-gallery {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}

.memory-gallery::-webkit-scrollbar {
  display: none; /* Chrome/Edge/Safari */
}

/* 手机端：使用上下布局 */
@media screen and (max-width: 768px) {
  .page-main {
    flex-direction: column;
    align-items: center;
  }

  .memory-gallery,
  .words {
    height: 40vh;
    width: 70vw;
    max-width: 100%;
    margin: 5px auto;
  }

  .page-title h1 {
    font-size: 2rem; /* 手机端字体变小 */
  }

  .words p {
    font-size: 1rem;         /* 手机上普通段落的字号更小 */
  }

  .words p:first-child {
    font-size: 1.2rem;       /* 手机上第一段的字号也相应缩小 */
  }
}

/* 小标题 */
.section-title {
  text-align: left;              /* 左对齐 */
  font-weight:normal;
  font-style: italic;
  /* font-weight: bold;            加粗 */
  /* text-decoration: underline;  */
  margin: 0px 0;               /* 上下边距 */
  font-size: 1.4rem;            /* 字体大小可调整 */
  align-self: flex-start;
  margin-top: 0px;       /* 与容器顶部距离 */
  margin-bottom: 0px;   /* 与下方内容的距离 */
  padding-left: 0px;     /* 距离容器左边的距离 */
}


.thumbnail {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center; /* ✅ 水平居中 img 和 date-label */
  justify-content: center; /* ✅ 可选：垂直居中 */
  text-align: center;
}


.thumbnail img {
  width: 100%;                /* 让图片宽度充满容器 */
  max-width: 480px;           /* 最大宽度限制在电脑上好看 */
  height: auto;               /* 保持宽高比例 */
  border-radius: 12px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
}
.thumbnail img:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.date-label {
  margin-top: 6px;
  font-size: 18px;
  color: #dcdcdc;
  font-style: italic;
  text-align: center;
  opacity: 0.85;
  margin-left: auto;
  margin-right: auto;
}


.memory-photo img {
  width: 100%;
  max-width: 300px;
  border-radius: 12px;
  object-fit: contain;
}

.memory-text {
  max-width: 400px;
  padding: 10px;
  color: #fff;
}

.modal {
  display: none;
  position: fixed;
  z-index: 999;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.6); /* 遮罩层 */
  backdrop-filter: blur(8px); /* 背景模糊 */
  justify-content: center;
  align-items: center;
}

.modal-content {
  position: relative;
  max-width: 90vw;    /* 最大宽度：视口的 90% */
  max-height: 90vh;   /* 最大高度：视口的 90% */
  background: rgba(255, 255, 255, 0.1);
  padding: 16px;
  border-radius: 12px;
  text-align: center;
  color: #fff;
  overflow: auto;     /* 防止内容溢出 */
  box-sizing: border-box;
  animation: fadeIn 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;

}

.modal-content img {
  max-width: 100%;
  max-height: 60vh; /* 限制图片在可视区域的最大高度 */
  height: auto;
  border-radius: 12px;
  margin-bottom: 0px;
  object-fit: contain;
}

.modal-text {
  max-height: 25vh;
  overflow-y: auto;
  padding: 8px;
  box-sizing: border-box;
  width: 100%;
}

.modal-text p {
  word-break: break-word;
  white-space: pre-wrap;
  margin: 0;
  font-size: 1.5rem;
  line-height: 1.5;
}

.modal-text h3 {
  margin-top: 5px;
  margin-bottom: 10px;
  font-size: 1.8rem;
}

        
/* 弹窗样式 */


.modal-media {
    width: 100%;
    height: 60vh;
    object-fit: contain;
    background: #000;
    display: block;
    border-radius: 12px;
}

.modal-info {
    padding: 20px;
}

.modal-title {
    font-size: 1.8rem;
    margin-bottom: 0px;
    margin-top:0px;
    color: #ffde59;
}

.modal-desc {
    font-size: 1.1rem;
    color: #e0e0e0;
    line-height: 1.6;
}
#modal-desc {
  text-align: left;         /* 左对齐 */
  text-indent: 2em;         /* 首行缩进两个中文字符 */
  white-space: pre-wrap;    /* 保留换行和空格 */
  word-break: break-word;   /* 避免单词撑破容器 */
  line-height: 1.6;         /* 更舒服的行间距 */
  font-size: 1.2rem;          /* 可根据需要调整字体大小 */
  color: #fff;              /* 或根据你的背景色调整颜色 */
}

/* 手机端样式（屏幕宽度 ≤ 768px） */
@media screen and (max-width: 768px) {
  #modal-title {
    font-size: 1.3rem;
  }

  #modal-desc {
    font-size: 1.1rem;
  }
}

.modal-close {
  position: absolute;
  top: 8px;
  right: 16px;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* 按钮隐藏与出现 */
.enter-btn {
  opacity: 0;
  transition: opacity 4s ease;
  pointer-events: none; /* 隐藏时禁止点击 */
}

.enter-btn.show {
  opacity: 1;
  pointer-events: auto; /* 显示后允许点击 */
}

/* === 音频播放器 === */
.audio-player {
  margin: 10px auto;  /* 水平居中 */
  padding: 20px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 15px;
  max-width: 80vw;
}

audio {
    width: 100%;
    outline: none;
}

/* 自定义播放器样式 */
audio::-webkit-media-controls-panel {
    background: transparent; /* 设置面板背景透明 */
    border-radius: 10px;
}

.audio-wrapper {
  max-width: 80vw;
  margin: 20px auto;
}

        
.video-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2;
    opacity: 0.8;
    transition: all 0.3s ease;
}

.video-indicator i {
    color: white;
    font-size: 24px;
    margin-left: 5px;
}

.video-indicator:hover {
box-shadow: 0 0 10px rgba(255, 255, 255, 0.6);
transform: translate(-50%, -50%) scale(1.2);
}

