/* ===== 历年回顾时间轴 ===== */

/* body 在 style.css 里是 height:100% 的定高 flex 容器：矮屏下 #timeline 会被
   flex-shrink 压到 min-height，结尾贴纸溢出到盒子外、跑到 footer 下面。
   回顾页改为自动高度 + 三段禁止收缩，版权永远在最底 */
body { overflow-x: hidden; height: auto; min-height: 100dvh; }
#rvHeader, #timeline, #rvFooter { flex-shrink: 0; }

/* 页头 */
#rvHeader {
  position: relative; z-index: 1;
  text-align: center;
  padding: 34px 16px 6px;
}
#rvHome { display: inline-block; text-decoration: none; }
#rvHome svg { width: clamp(150px, 20vw, 230px); height: auto; display: block; margin: 0 auto; }
#rvHome text {
  font-family: var(--font-fun); font-weight: 700;
  fill: var(--orange); stroke: var(--outline); stroke-width: 7px;
  stroke-linejoin: round; paint-order: stroke fill;
}
#rvHome:hover svg { animation: boing .7s cubic-bezier(.28,.84,.42,1); }
.rv-title {
  font-family: var(--font-fun); font-weight: 700;
  font-size: clamp(30px, 5vw, 52px);
  color: var(--ink); margin-top: 2px;
  transform: rotate(-1.2deg);
}
.rv-sub {
  font-size: clamp(13px, 1.7vw, 17px);
  color: var(--ink-soft); margin-top: 8px;
}

/* 时间轴容器 */
#timeline {
  position: relative; z-index: 1;
  max-width: 1020px; margin: 0 auto;
  padding: 46px 20px 30px;
  display: flex; flex-direction: column;
  min-height: calc(100vh - 120px);
}
#tlLine {
  position: absolute; top: 46px; bottom: 30px;
  left: 50%; width: 60px; height: calc(100% - 76px);
  transform: translateX(-50%);
  overflow: visible;
}
#tlPath {
  stroke: var(--outline); stroke-width: 4;
  stroke-linecap: round; stroke-dasharray: 6 10;
  opacity: .8; transition: stroke 2s ease;
}
body.phase-night #tlPath { stroke: #93a3dc; }
#tlProgress {
  stroke: var(--orange); stroke-width: 5;
  stroke-linecap: round;
}

/* 随滚动下移的爪印 */
#paw {
  position: absolute; left: 50%; top: 46px;
  width: 34px; height: 34px;
  transform: translate(-50%, -50%) rotate(-12deg);
  z-index: 2; pointer-events: none;
  filter: drop-shadow(2px 3px 0 rgba(26,26,26,.25));
}

/* 年份条目：桌面左右交错 */
.entry {
  position: relative;
  display: grid; grid-template-columns: 1fr 96px 1fr;
  align-items: center;
  margin-bottom: 64px;
  opacity: 0; transform: translateY(36px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.9,.3,1.1);
}
.entry.in { opacity: 1; transform: translateY(0); }

.year-badge {
  grid-column: 2; justify-self: center;
  font-family: var(--font-fun); font-weight: 700;
  font-size: clamp(22px, 3vw, 34px);
  color: var(--outline);
  background: var(--orange);
  border: 3px solid var(--outline);
  border-radius: 225px 16px 255px 16px / 16px 255px 16px 225px;
  padding: 6px 18px;
  box-shadow: 3px 4px 0 rgba(26,26,26,.3);
  transform: rotate(-3deg) scale(.6);
  transition: transform .6s cubic-bezier(.3,1.6,.5,1);
  z-index: 2;
}
.entry.in .year-badge { transform: rotate(-3deg) scale(1); }
.entry:nth-child(even) .year-badge { transform: rotate(2.5deg) scale(.6); }
.entry.in:nth-child(even) .year-badge { transform: rotate(2.5deg) scale(1); }

/* 卡片 */
.card {
  display: block; text-decoration: none;
  background: var(--btn-bg);
  border: 3px solid var(--outline);
  border-radius: 20px 255px 20px 225px / 225px 20px 255px 20px;
  box-shadow: 4px 5px 0 rgba(26,26,26,.28);
  padding: 14px 14px 16px;
  transform: rotate(-1.1deg);
  transition: transform .22s cubic-bezier(.3,1.5,.5,1), box-shadow .22s ease, background 2s ease, border-color 2s ease;
}
.entry:nth-child(even) .card { transform: rotate(1.1deg); }
.card:hover, .card:focus-visible {
  transform: rotate(0deg) translateY(-5px) scale(1.02);
  box-shadow: 6px 9px 0 rgba(26,26,26,.28);
  outline: none;
}
.card:active { transform: scale(.98); box-shadow: 2px 3px 0 rgba(26,26,26,.28); }
.entry:nth-child(odd) .card { grid-column: 1; grid-row: 1; }
.entry:nth-child(even) .card { grid-column: 3; grid-row: 1; }

/* 16:9 缩略图 */
.thumb {
  display: block;
  position: relative; aspect-ratio: 16 / 9;
  border: 3px solid var(--outline);
  border-radius: 14px 60px 14px 60px / 60px 14px 60px 14px;
  overflow: hidden; background: #000;
}
.thumb img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .6s cubic-bezier(.2,.8,.3,1);
}
.card:hover .thumb img { transform: scale(1.06) rotate(.6deg); }
.play {
  position: absolute; left: 50%; top: 50%;
  width: 58px; height: 58px; transform: translate(-50%, -50%);
  background: rgba(255,248,236,.92);
  border: 3px solid var(--outline); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 2px 3px 0 rgba(26,26,26,.35);
  animation: playPulse 2.2s ease-in-out infinite;
}
.play svg { width: 24px; height: 24px; margin-left: 4px; }
.card:hover .play { animation: none; transform: translate(-50%, -50%) scale(1.12) rotate(-6deg); }
@keyframes playPulse { 0%,100% { transform: translate(-50%,-50%) scale(1); } 50% { transform: translate(-50%,-50%) scale(1.08); } }

.card-title {
  display: block;
  font-family: var(--font-fun); font-weight: 700;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.55; color: var(--ink);
  margin: 12px 4px 8px;
}
/* 视频日期戳：手写体 + 虚线下划线，像随手记在卡片角落 */
.card-date {
  display: inline-block; margin: 0 4px;
  font-family: var(--font-fun); font-weight: 700;
  font-size: 14px; letter-spacing: .08em;
  color: var(--ink-soft);
  border-bottom: 2px dashed var(--ink-soft);
  padding-bottom: 2px; transform: rotate(-1deg);
}

/* 非链接卡片（总结中 / 文字 / 图片条目）：不做悬停抬起 */
.card-static, .card-static:hover, .card-static:active { cursor: default; }
.card-static:hover { box-shadow: 4px 5px 0 rgba(26,26,26,.28); transform: rotate(-1.1deg); }
.entry:nth-child(even) .card-static:hover { transform: rotate(1.1deg); }
/* 进行中的一年：虚线边框，像还没写完的纸 */
.card-pending { border-style: dashed; }
.card-pending .card-title { margin-bottom: 4px; }
/* 纯文字条目 */
.card-note .card-title { font-size: clamp(15px, 1.8vw, 19px); }

/* 结尾贴纸：沉到时间轴底部 */
#tlEnd { text-align: center; padding: 10px 0 26px; margin-top: auto; padding-top: 60px; }
.end-sticker {
  display: inline-block;
  font-family: var(--font-fun); font-weight: 700;
  font-size: clamp(14px, 1.8vw, 18px);
  color: var(--ink); background: var(--btn-bg);
  border: 3px solid var(--outline);
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px;
  box-shadow: 3px 4px 0 rgba(26,26,26,.28);
  padding: 8px 20px; transform: rotate(-1.4deg);
}

/* 页脚（非绝对定位，跟在时间轴后） */
#rvFooter {
  position: relative; z-index: 1;
  text-align: center; font-size: 10px; line-height: 1.6;
  color: var(--ink-soft); padding: 0 12px 26px;
}

/* 夜晚描边提亮 */
body.phase-night .card, body.phase-night .thumb,
body.phase-night .year-badge, body.phase-night .end-sticker { border-color: #93a3dc; }
body.phase-night .play { border-color: #93a3dc; }

/* ---- 移动端：时间轴靠左，卡片单列 ---- */
@media (max-width: 700px) {
  #tlLine { left: 26px; transform: none; width: 40px; }
  #paw { left: 26px; width: 28px; height: 28px; }
  .entry { grid-template-columns: 52px 1fr; margin-bottom: 44px; }
  .year-badge { grid-column: 1; grid-row: 1; align-self: start; margin-top: -6px; font-size: 20px; padding: 4px 10px; }
  .entry:nth-child(odd) .card, .entry:nth-child(even) .card { grid-column: 2; grid-row: 1; }
  #timeline { padding: 36px 14px 20px; }
  #tlLine { top: 36px; height: calc(100% - 66px); }
  .play { width: 46px; height: 46px; }
  .play svg { width: 19px; height: 19px; }
}