/* ===== 基础样式 ===== */
:root {
  --primary-color: #e74c3c;
  --secondary-color: #f39c12;
  --text-color: #333;
  --light-bg: #fff5f5;
  --card-bg: white;
  --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  --section-gap: 40px;
}

body {
  font-family: 'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-bg);
  margin: 0;
  padding: 0;
  background-image: url('../images/background.jpg');
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
}

/* ===== 通用容器 ===== */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 30px;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(3px);
  border-radius: 15px;
  box-shadow: var(--shadow);
}

/* ===== 信件和音乐页面布局 ===== */
.main-content {
  display: flex;
  gap: var(--section-gap);
  margin-top: 30px;
}

.copyright-notice {
    text-align: center;
    margin-top: 40px;
    padding: 15px;
    color: #777;
    font-size: 0.85em;
    opacity: 0.8;
}

.content-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

.thumbnail-wrapper img {
    max-width: 55%;
    height: auto;
}

.sidebar {
  width: 400px;
  display: flex;
  flex-direction: column;
  gap: var(--section-gap);
}

/* ===== 四个独立模块样式 ===== */
.module {
  background-color: var(--card-bg);
  border-radius: 12px;
  padding: 25px;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.module:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ===== 手写信模块 - 缩略图样式 ===== */
.handwritten-letter {
  text-align: center;
}

.thumbnail-wrapper {
  height: 500px; /* 与电子版信件高度一致 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
  position: relative;
}

.thumbnail-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.letter-thumbnail {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #eee;
  box-shadow: 0 3px 10px rgba(0,0,0,0.1);
  transition: all 0.3s ease;
}

.thumbnail-link:hover .letter-thumbnail {
  transform: scale(1.03);
  box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.view-full-text {
  display: block;
  margin-top: 15px;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.1em;
  transition: color 0.3s ease;
}

.thumbnail-link:hover .view-full-text {
  color: #c0392b;
}

/* ===== 音乐模块 ===== */
.music-gift {
  text-align: center;
}

.music-player {
  margin: 20px 0;
}

.audio-player {
  width: 100%;
  max-width: 400px;
  margin: 15px auto;
}

/* ===== 电子版信件模块 ===== */
.e-letter-container {
  height: 500px;
  overflow-y: auto;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

.e-letter-content {
  padding: 25px;
  line-height: 1.8;
}

.e-letter-content p {
  margin: 0 0 15px 0;
  text-align: justify;
}

/* ===== 歌词模块 ===== */
.lyrics-container {
  height: 500px;
  overflow-y: auto;
  background-color: #f9f9f9;
  border-radius: 8px;
  border: 1px solid #eee;
}

.lyrics-content {
  padding: 25px;
  line-height: 1.8;
}

.lyrics-content p {
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px dashed #eee;
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c0392b;
}

/* ===== 标题样式 ===== */
h1, h2, h3 {
  color: var(--primary-color);
  margin-top: 0;
}

h1 {
  font-size: 2.8em;
  text-align: center;
  margin-bottom: 30px;
}

h2 {
  font-size: 2em;
  margin-bottom: 20px;
}

h3 {
  font-size: 1.5em;
  margin-bottom: 15px;
}

/* ===== 按钮样式 ===== */
.btn {
  display: inline-block;
  padding: 12px 30px;
  background-color: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  text-align: center;
  margin-top: 20px;
}

.btn:hover {
  background-color: #c0392b;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
  .main-content {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
  }
  
  .thumbnail-wrapper,
  .e-letter-container,
  .lyrics-container {
    height: 400px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 20px;
  }
  
  h1 {
    font-size: 2.2em;
  }
  
  .module {
    padding: 20px;
  }
}

@media (max-width: 576px) {
  :root {
    --section-gap: 30px;
  }
  
  h1 {
    font-size: 1.8em;
  }
  
  .thumbnail-wrapper,
  .e-letter-container,
  .lyrics-container {
    height: 350px;
  }
}
