/* 阶段导航：大量年份内容默认只呈现当前阶段，完整时间轴可随时展开。 */
.timeline-controls {
  width: min(1060px, 90vw);
  margin: 0 auto 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.timeline-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}
.timeline-tabs::-webkit-scrollbar { display: none; }

.timeline-tab, .show-all {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: 13px 'Noto Serif SC', serif;
  cursor: pointer;
  transition: .2s ease;
}
.timeline-tab { padding: 8px 17px; border-radius: 999px; }
.timeline-tab:hover, .timeline-tab.is-active { color: var(--paper); border-color: var(--ink); background: var(--ink); }
.show-all { padding: 8px 0; border-width: 0 0 1px; color: var(--ink); white-space: nowrap; }
.show-all span { color: var(--accent); margin-left: 4px; }

.timeline:not(.showing-all) .memory { display: none; }
.timeline:not(.showing-all) .memory.is-current { display: grid; width: 50%; margin-left: 0; padding-right: 62px; padding-left: 0; }
.timeline:not(.showing-all) .memory.is-current:after { left: auto; right: -5px; }
.timeline:not(.showing-all):before { left: 50%; bottom: 0; }

@media (max-width: 720px) {
  .timeline-controls { width: calc(100% - 48px); margin-bottom: 27px; display: block; }
  .timeline-tabs { width: calc(100vw - 48px); margin-right: -24px; padding-right: 24px; }
  .timeline-tab { padding: 7px 14px; }
  .show-all { margin-top: 13px; font-size: 12px; }
  .timeline:not(.showing-all) .memory.is-current { width: auto; margin-left: 0; padding: 0 0 0 31px; }
  .timeline:not(.showing-all) .memory.is-current:after { left: 0; right: auto; }
  .timeline:not(.showing-all):before { left: 5px; }

  .site-header { padding: 0 18px; }
  .brand { max-width: calc(100% - 58px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .site-header nav { padding: 14px 24px 22px; box-shadow: 0 12px 20px #24333114; }
  .hero { min-height: auto; padding: 104px 20px 62px; }
  .hero-copy .intro br { display: none; }
  .intro { margin: 20px 0 27px; }
  .hero-art { height: clamp(250px, 74vw, 330px); margin: 40px 6vw 0; }
  .year-card { max-width: 180px; padding: 11px 15px; }
  .scribble { display: none; }
  .chapter-intro { padding: 68px 20px 42px; }
  .chapter-intro > p:last-child { font-size: 15px; }
  .memory-photo { height: clamp(205px, 61vw, 255px); }
  .memory h3 { font-size: 25px; }
  .moments { padding: 66px 20px; }
  .photo-grid { grid-template-columns: 1fr; gap: 14px; }
  .photo-grid .tall, .photo-grid figure { grid-row: auto; min-height: 255px; }
  .photo-grid .tall { min-height: 330px; }
  .letter { padding: 66px 20px; }
  .letter-inner { padding: 42px 20px; }
  footer { padding: 24px 20px; text-align: center; }
  footer .beian { display: block; margin-top: 4px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: 46px; }
  .hero-art { margin-left: 3vw; margin-right: 3vw; }
  .photo-grid { gap: 10px; }
  figcaption { padding: 32px 10px 10px; font-size: 12px; }
  .hero h1 { word-break: keep-all; }
  .year-card { left: -12px; }
  .letter blockquote { font-size: 21px; }
}

.beian { color: inherit; text-decoration: none; white-space: nowrap; }
.beian:hover, .beian:focus-visible { color: #fff; text-decoration: underline; }
