/* ==========================================================================
   1. 全局变量定义与基础重置
   ========================================================================== */
:root {
  --bg-color: #f5f5f7;
  --card-bg: #ffffff;
  --text-main: #1d1d1f;
  --text-sub: #86868b;
  --accent-color: #0066cc;
  --border-color: rgba(0, 0, 0, 0.08);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", STSong, Georgia, serif;
}

* { 
  box-sizing: border-box; 
  margin: 0; 
  padding: 0; 
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
}

/* 版心容器 */
.apple-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ==========================================================================
   2. 顶部导航栏 (Header)
   ========================================================================== */
.apple-header {
  background: rgba(245, 245, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
}

.header-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-title-group {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.header-title {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-main);
}

.header-tag {
  font-size: 11px;
  color: var(--text-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.header-timer {
  font-size: 12px;
  color: var(--text-sub);
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 12px;
  font-variant-numeric: tabular-nums;
}

.header-timer strong {
  color: var(--text-main);
  font-weight: 600;
}

/* ==========================================================================
   3. Hero Banner 区域与内嵌拉长版播放器
   ========================================================================== */
.hero-section {
  padding: 40px 0 20px;
}

.hero-subtitle {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 4px;
}

/* Hero 标题与播放器并排容器 */
.hero-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.hero-main-title {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0;
}

/* Hero 右侧横向拉长、降低高度的播放器胶囊 */
.hero-player-box {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 240px; /* 拉长播放器尺寸 */
  height: 32px; /* 降低高度 */
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px; /* 扁平胶囊圆角 */
  padding: 0 14px 0 8px;
  user-select: none;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
}

.hero-player-box:hover {
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* 播放/暂停 独立圆形控制按钮 */
.player-btn {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--text-main);
  color: #ffffff;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.2s ease, background-color 0.2s ease;
  padding: 0;
}

.player-btn:hover {
  transform: scale(1.08);
  background: #000000;
}

/* 微调 Play 图标避免视觉偏心 */
.player-btn #icon-play {
  margin-left: 1px;
}

/* 歌曲名称与状态文字平铺 */
.hero-player-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  cursor: pointer;
  overflow: hidden;
}

.hero-player-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-player-status {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--text-sub);
  white-space: nowrap;
  margin-left: 8px;
}

.hero-banner {
  width: 100%;
  height: 360px;
  border-radius: 18px;
  overflow: hidden;
  position: relative;
  background: #000;
  border: none;
}

.hero-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.85;
  transition: transform 0.6s ease;
  border: none;
}

.hero-banner:hover img { 
  transform: scale(1.02); 
}

.hero-banner-caption {
  position: absolute;
  bottom: 14px;
  right: 20px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 10px;
  letter-spacing: 0.12em;
  font-weight: 400;
  background: transparent;
  padding: 0;
  border-radius: 0;
  border: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   4. 关于本站 (Intro)
   ========================================================================== */
.intro-block {
  margin-top: 36px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.intro-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
  text-transform: uppercase;
}

.intro-text {
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.8;
  text-align: justify;
}

/* ==========================================================================
   5. 通用板块标题栏
   ========================================================================== */
.section-head {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 20px;
  margin: 40px 0 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.section-head-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.section-title {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-main);
  margin: 0;
  order: 1;
}

.section-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--text-sub);
  text-transform: uppercase;
  margin-bottom: 0;
  order: 2;
}

.section-head-sub {
  font-size: 12px;
  color: var(--text-sub);
  letter-spacing: 0.02em;
}

/* ==========================================================================
   6. 双列文章卡片网格
   ========================================================================== */
.four-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.grid-card {
  background: var(--card-bg);
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  filter: grayscale(100%);
  opacity: 0.88;
  transition: filter 0.4s ease, transform 0.3s ease, border-color 0.3s ease, opacity 0.3s ease, box-shadow 0.3s ease;
}

.grid-card:hover {
  filter: grayscale(0%);
  opacity: 1;
  transform: translateY(-3px);
  border-color: rgba(0, 0, 0, 0.2);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.card-thumb {
  width: 100%;
  height: 135px;
  overflow: hidden;
  background: #eee;
  border-bottom: none;
}

.card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
  transition: transform 0.5s ease;
}

.grid-card:hover .card-thumb img {
  transform: scale(1.04);
}

.card-content {
  padding: 22px 24px 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.card-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
}

.card-excerpt {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-action {
  margin-top: 18px;
  font-size: 12px;
  color: var(--accent-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   7. 言语存留 (SMS Archives) 模块
   ========================================================================== */
.sms-standalone-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px 32px 32px;
  margin-top: 52px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.sms-grid-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.sms-item-box {
  background: #f8f8fa;
  border-radius: 12px;
  padding: 18px 20px;
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: auto;
}

.sms-item-text {
  font-family: var(--font-serif);
  font-size: 13.5px;
  color: var(--text-main);
  line-height: 1.7;
  word-break: break-word;
}

.sms-item-time {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-sub);
  margin-top: 12px;
}

/* ==========================================================================
   8. 时光演进（版本历史）模块
   ========================================================================== */
.timeline-unified-card {
  margin-top: 52px;
  background: #2a2a2e;
  border-radius: 18px;
  padding: 32px;
  color: #f5f5f7;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.timeline-unified-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 16px;
}

.timeline-unified-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  color: #ffffff;
}

.timeline-unified-sub {
  font-size: 12px;
  color: #9e9ea3;
  letter-spacing: 0.05em;
}

.history-row-container {
  overflow-x: auto;
  padding: 8px 4px 12px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.history-row {
  display: flex;
  gap: 16px;
  min-width: max-content;
}

.history-card-item {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 240px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  flex-shrink: 0;
}

.history-card-item:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.3);
}

.history-ver {
  font-size: 12px;
  font-weight: 700;
  color: #2997ff;
}

.history-date {
  font-size: 11px;
  color: #9e9ea3;
  margin-bottom: 10px;
}

.history-desc {
  font-size: 12px;
  color: #e3e3e7;
  line-height: 1.5;
}

/* ==========================================================================
   9. 底部联系方式卡片
   ========================================================================== */
.contact-card {
  margin-top: 52px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 18px;
  padding: 28px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.02);
}

.contact-info-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}

.contact-info-desc {
  font-size: 12px;
  color: var(--text-sub);
}

.contact-links {
  display: flex;
  gap: 12px;
  align-items: center;
}

.contact-link-item {
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 400;
  cursor: default;
  user-select: text;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.contact-link-item:hover {
  color: var(--text-main);
  background: rgba(0, 0, 0, 0.035);
  transform: translateY(-1px);
}

/* ==========================================================================
   10. 通用 Modal 模态弹窗与文章样式
   ========================================================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
  padding: 16px;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-wrapper {
  background: #ffffff;
  width: min(92vw, 720px);
  max-height: calc(85vh - env(safe-area-inset-bottom, 0px));
  border-radius: 20px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.18);
  display: flex;
  flex-direction: column;
  transform: scale(0.96);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .modal-wrapper {
  transform: scale(1);
}

.modal-header {
  padding: 18px 32px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fbfbfd;
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: 0.02em;
}

.modal-close {
  background: rgba(0, 0, 0, 0.05);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sub);
}

.modal-close:hover { 
  background: rgba(0, 0, 0, 0.1); 
  color: var(--text-main); 
}

.modal-body {
  padding: 32px 40px calc(48px + env(safe-area-inset-bottom, 0px));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1;
}

.modal-img-frame {
  width: 100%;
  height: 186px;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
  border: none;
  background: #000;
}

.modal-img-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: none;
}

.modal-center-title {
  text-align: center;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.01em;
  margin: 0 0 28px 0;
  padding-bottom: 16px;
  position: relative;
}

.modal-center-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 1px;
  background: var(--text-main);
  opacity: 0.25;
}

.modal-content-text {
  font-family: var(--font-serif);
  color: #222225;
}

.modal-content-text p {
  font-size: 15px;
  line-height: 2.0;
  margin-bottom: 22px;
  text-align: justify;
  word-break: break-word;
  letter-spacing: 0.01em;
}

.modal-content-text p:last-child { 
  margin-bottom: 0; 
}

.modal-content-text p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  line-height: inherit;
  padding: 0;
  font-weight: normal;
  color: inherit;
}

.modal-content-text blockquote {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.8;
  color: #1d1d1f;
  border-left: 2px solid #1d1d1f;
  margin: 28px 0;
  padding-left: 18px;
  font-style: normal;
}

/* ==========================================================================
   11. 时光演进专属 Modal 模式
   ========================================================================== */
.modal-body.history-mode {
  padding: 24px 32px calc(40px + env(safe-area-inset-bottom, 0px));
}

.modal-body.history-mode .modal-img-frame {
  height: 320px;
  margin-bottom: 0;
  border-radius: 12px;
}

.modal-body.history-mode #modalImgBox {
  height: auto;
  max-height: 60vh;
  background-color: #f5f5f7;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px 0;
  overflow: hidden;
  text-align: center;
}

.modal-body.history-mode #modalImg {
  height: auto;
  max-height: 60vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  display: block;
  margin: 0 auto;
}

.history-modal-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--text-main);
  line-height: 1.6;
  text-align: left;
  margin-top: 16px;
}

.history-modal-text p:first-of-type::first-letter {
  font-size: inherit;
  float: none;
  line-height: inherit;
  padding: 0;
  font-weight: normal;
  color: inherit;
}

/* ==========================================================================
   12. 全局页脚 Footer
   ========================================================================== */
.apple-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  margin-top: 32px;
  font-size: 11px;
  color: var(--text-sub);
  display: flex;
  justify-content: space-between;
}

/* ==========================================================================
   13. 移动端响应式适配 (Mobile Media Query)
   ========================================================================== */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
  }

  .header-title-group {
    width: 100%;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .header-timer {
    font-size: 11px;
    padding: 4px 12px;
    align-self: center;
    margin-top: 2px;
  }

  .hero-section {
    text-align: center;
  }

  /* 移动端标题与播放器垂直居中对齐 */
  .hero-title-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .hero-banner {
    height: auto !important;
    aspect-ratio: auto !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 12px;
  }

  .hero-banner img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    opacity: 1;
  }

  .hero-banner-caption {
    display: none !important;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 12px 16px;
  }

  .section-head-left {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }

  .four-grid, 
  .sms-grid-preview { 
    grid-template-columns: 1fr; 
  }

  .timeline-unified-header { 
    flex-direction: column; 
    align-items: flex-start; 
    gap: 6px; 
  }

  .contact-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
  }

  .contact-links {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
  }

  .contact-link-item {
    padding: 0;
  }

  .modal-header { padding: 14px 20px; }
  .modal-body { 
    padding: 24px 20px calc(48px + env(safe-area-inset-bottom, 0px)); 
  }
  .modal-img-frame { height: 130px; margin-bottom: 20px; border-radius: 8px; }
  .modal-center-title { font-size: 1.3rem; margin-bottom: 22px; padding-bottom: 12px; }
  .modal-content-text p { font-size: 14.5px; line-height: 1.85; margin-bottom: 18px; }

  .modal-body.history-mode { 
    padding: 16px 20px calc(36px + env(safe-area-inset-bottom, 0px)); 
  }
  .modal-body.history-mode .modal-img-frame { height: 200px; }

  .apple-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    line-height: 1.6;
  }
}