/* 年份导航 */
.years { display: flex; gap: 6px; scroll-target-group: auto; }
.years a {
  display: inline-flex; align-items: baseline; gap: 6px; min-height: 36px; padding: 6px 14px;
  border-radius: 999px; text-decoration: none; font: 600 .95rem/1.4 var(--f-display);
  border: 1px solid var(--line); background: var(--surface); transition: background-color .2s, color .2s, border-color .2s;
}
.years a span { font: 400 .78rem var(--f-mono); color: var(--muted); }
.years a:hover { border-color: var(--accent); }
.years a:is(:target-current, .target-current) { background: var(--ink); border-color: var(--ink); color: var(--on-ink); }
.years a:is(:target-current, .target-current) span { color: var(--on-ink-muted); }

/* 年份区块：左侧大号年份吸顶，右侧时间线 */
.year { padding-block: clamp(40px, 7vh, 72px); scroll-margin-top: calc(var(--header-h) + 64px); }
.year:focus { outline: none; }
.year + .year { border-top: 1px solid var(--line); }
.year[hidden] { display: none; }
.year-grid { display: grid; grid-template-columns: minmax(10rem, 16rem) minmax(0, 1fr); gap: 24px 48px; align-items: start; }
.year-num {
  position: sticky; top: calc(var(--header-h) + 88px);
  margin: 0; font: 800 clamp(3rem, 7vw, 5.5rem)/.9 var(--f-display); letter-spacing: -0.05em;
}
.yn { background: var(--holo) 0 100% / 100% 6px no-repeat; padding: 0 2px 10px; }
.year-num small { display: block; margin-top: 12px; font: 400 .95rem var(--f-body); letter-spacing: 0; color: var(--muted); }

.year-body { position: relative; padding-left: 30px; }
.year-body::before, .year-body::after {
  content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px;
}
.year-body::before { background: var(--line); }
.year-body::after { background: linear-gradient(var(--mint), var(--sky), var(--lilac), var(--pink)); transform-origin: top; }
.month + .month { margin-top: 28px; }
.month[hidden] { display: none; }
.month h3 { margin: 0 0 4px; font: 600 .95rem/1.5 var(--f-body); color: var(--muted); }
.year .row { position: relative; }
.year .row::before, .year .row::after {
  content: ""; position: absolute; left: -29px; top: 22px; width: 12px; height: 12px; border-radius: 50%;
}
.year .row::before { background: var(--surface); border: 2px solid var(--line); }
.year .row::after { background: var(--accent); opacity: 0; scale: .4; }
.row:has(.row-title:hover)::after, .row:has(.row-title:focus-visible)::after { opacity: 1; scale: 1; }

/* 滚动时：时间线跟着读到的位置填色，经过的节点亮起 */
@keyframes fill { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes light { to { opacity: 1; scale: 1; } }
@supports ((animation-timeline: view()) and (animation-range: entry)) {
  [data-motion="on"] {
    .year-body { view-timeline: --yb block; }
    .year-body::after { animation: fill linear both; animation-timeline: --yb; animation-range: entry 30% exit 40%; }
    .year .row::after { animation: light linear both; animation-timeline: view(); animation-range: entry 100% cover 55%; }
  }
}
@supports not ((animation-timeline: view()) and (animation-range: entry)) {
  .year-body::after { display: none; }
}
[data-motion="off"] .year-body::after { display: none; }

@media (max-width: 760px) {
  .year-grid { grid-template-columns: 1fr; }
  .year-num { position: static; font-size: 3rem; }
  .year-num small { display: inline; margin-left: 10px; }
}
