/* ==========================================================================
   点击式时间轴 · Timeline deck
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.deck-section {
  position: relative;
  padding: 104px 0 122px;
  overflow: hidden;
  background:
    radial-gradient(1000px 760px at 50% -8%, rgba(179, 38, 30, .11), transparent 66%),
    linear-gradient(180deg, transparent, rgba(255, 255, 255, .012));
}

.deck {
  position: relative;
  margin-top: 4px;
}

.deck__frame {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(900px 520px at 76% 18%, rgba(179, 38, 30, .15), transparent 62%),
    linear-gradient(155deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .012));
  box-shadow: 0 40px 90px rgba(0, 0, 0, .45);
  isolation: isolate;
}

.deck__frame::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(rgba(201, 163, 92, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 163, 92, .05) 1px, transparent 1px);
  background-size: 64px 64px;
  -webkit-mask-image: radial-gradient(ellipse at 58% 42%, #000 0%, transparent 76%);
  mask-image: radial-gradient(ellipse at 58% 42%, #000 0%, transparent 76%);
}

.deck__frame::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 190px;
  height: 190px;
  z-index: 0;
  pointer-events: none;
  background: linear-gradient(135deg, transparent 50%, rgba(201, 163, 92, .07) 50%);
}

.deck__topbar,
.deck__viewport,
.deck__bottom {
  position: relative;
  z-index: 3;
}

/* ---------- Topbar ---------- */
.deck__topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 30px 16px;
  border-bottom: 1px solid var(--line-soft);
}

.deck__chapter {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .18em;
  color: var(--gold);
}
.deck__chapter-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 12px rgba(223, 74, 51, .8);
}

.deck__topmeta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.deck__counter {
  display: flex;
  align-items: baseline;
  gap: 4px;
  font-family: var(--serif);
  font-size: .7rem;
  letter-spacing: .12em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.deck__counter b {
  display: inline-block;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--cream);
}
.deck__counter b.is-bump {
  animation: counter-bump .45s var(--ease);
}
@keyframes counter-bump {
  0% { opacity: .25; transform: translateY(7px); }
  100% { opacity: 1; transform: none; }
}
.deck__counter span { color: var(--muted); }

.deck__fullscreen {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .64rem;
  letter-spacing: .1em;
  cursor: pointer;
  transition: color .3s, border-color .3s, background .3s;
}
.deck__fullscreen svg {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
}
.deck__fullscreen:hover {
  color: var(--gold);
  border-color: rgba(201, 163, 92, .42);
  background: rgba(201, 163, 92, .06);
}

/* ---------- Viewport / slides ---------- */
.deck__viewport {
  height: 480px;
  overflow: hidden;
  outline: none;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}
.deck__viewport:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: -4px;
}

.slide {
  --enter: 46px;
  --exit: -46px;
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(210px, .72fr) minmax(0, 1.55fr);
  gap: 46px;
  align-items: center;
  padding: 26px 46px 12px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(var(--enter)) scale(.985);
  transition:
    opacity .45s var(--ease),
    transform .55s var(--ease),
    visibility 0s linear .55s;
}
.deck__viewport[data-dir="next"] .slide { --enter: 46px; --exit: -46px; }
.deck__viewport[data-dir="prev"] .slide { --enter: -46px; --exit: 46px; }

.slide.is-active {
  z-index: 3;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition:
    opacity .45s var(--ease),
    transform .55s var(--ease),
    visibility 0s;
}
.slide.is-prev {
  z-index: 2;
  visibility: visible;
  opacity: 0;
  transform: translateX(var(--exit)) scale(.985);
  pointer-events: none;
}

.slide::before {
  content: "";
  position: absolute;
  left: -150px;
  top: 50%;
  width: 440px;
  height: 440px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(179, 38, 30, .17), transparent 67%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

/* ---------- Left side ---------- */
.slide__side {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  align-self: stretch;
  gap: 2px;
  padding-right: 36px;
  border-right: 1px solid var(--line-soft);
}

.slide__year {
  font-family: var(--serif);
  font-size: clamp(4.8rem, 7.4vw, 7.4rem);
  font-weight: 600;
  line-height: .92;
  letter-spacing: -.02em;
  color: var(--cream);
  text-shadow: 0 10px 50px rgba(0, 0, 0, .35);
}
.slide__date {
  margin-top: 8px;
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: .2em;
  color: var(--gold);
}
.slide__rule {
  display: block;
  width: 46px;
  height: 1px;
  margin: 16px 0 12px;
  background: var(--gold);
  opacity: .55;
}
.slide__index {
  font-size: .66rem;
  letter-spacing: .3em;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- Right side ---------- */
.slide__body {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 670px;
  padding: 4px 0;
}

.slide__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.deck-tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #a29583;
  font-size: .62rem;
  letter-spacing: .12em;
  line-height: 1.7;
}
.deck-tag--red {
  border-color: rgba(223, 74, 51, .4);
  color: #e29687;
  background: rgba(179, 38, 30, .1);
}
.slide__place {
  font-size: .68rem;
  letter-spacing: .14em;
  color: var(--muted);
}

.slide h3 {
  margin: 0 0 12px;
  font-family: var(--serif);
  font-size: clamp(1.8rem, 2.65vw, 2.55rem);
  font-weight: 600;
  line-height: 1.32;
  letter-spacing: .02em;
  color: var(--cream);
}
.slide__lead {
  max-width: 640px;
  margin-bottom: 12px;
  font-size: .95rem;
  line-height: 1.9;
  color: #c4b7a6;
  text-wrap: pretty;
}
.slide__detail {
  max-width: 640px;
  padding-top: 12px;
  border-top: 1px dashed rgba(201, 163, 92, .2);
  font-size: .82rem;
  line-height: 1.9;
  color: var(--muted);
  text-wrap: pretty;
}
.slide blockquote {
  max-width: 640px;
  margin-top: 14px;
  padding: 10px 16px;
  border-left: 2px solid var(--red);
  background: rgba(179, 38, 30, .075);
  font-family: var(--serif);
  font-size: .84rem;
  line-height: 1.85;
  color: #d8c8b3;
}
.slide blockquote cite {
  display: block;
  margin-top: 4px;
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .06em;
  color: var(--muted);
  text-align: right;
}

.slide__ghost {
  position: absolute;
  right: -10px;
  bottom: -52px;
  z-index: 0;
  font-family: var(--serif);
  font-size: 17rem;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(201, 163, 92, .09);
  pointer-events: none;
}

/* ---------- Content animation ---------- */
.slide.is-active .slide__side > *,
.slide.is-active .slide__body > * {
  animation: deck-rise .62s var(--ease) both;
}
.slide.is-active .slide__side > *:nth-child(1) { animation-delay: .04s; }
.slide.is-active .slide__side > *:nth-child(2) { animation-delay: .1s; }
.slide.is-active .slide__side > *:nth-child(3) { animation-delay: .16s; }
.slide.is-active .slide__side > *:nth-child(4) { animation-delay: .2s; }
.slide.is-active .slide__body > *:nth-child(1) { animation-delay: .08s; }
.slide.is-active .slide__body > *:nth-child(2) { animation-delay: .14s; }
.slide.is-active .slide__body > *:nth-child(3) { animation-delay: .2s; }
.slide.is-active .slide__body > *:nth-child(4) { animation-delay: .26s; }
.slide.is-active .slide__body > *:nth-child(5) { animation-delay: .32s; }

@keyframes deck-rise {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.slide.is-active .slide__year {
  animation: deck-year .85s var(--ease) both;
}
@keyframes deck-year {
  0% { opacity: 0; transform: translateY(22px) scale(.96); filter: blur(4px); }
  100% { opacity: 1; transform: none; filter: none; }
}

.slide.is-active .slide__ghost {
  animation: deck-ghost .9s var(--ease) both;
}
@keyframes deck-ghost {
  from { opacity: 0; transform: translateY(14px) scale(.96); }
  to { opacity: 1; transform: none; }
}

/* ---------- Hint ---------- */
.deck__hint {
  position: absolute;
  right: 28px;
  bottom: 14px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .62rem;
  letter-spacing: .1em;
  color: var(--muted);
  pointer-events: none;
  transition: opacity .35s, visibility .35s;
}
.deck__hint-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red-bright);
  box-shadow: 0 0 10px rgba(223, 74, 51, .8);
  animation: hint-pulse 1.8s ease-in-out infinite;
}
@keyframes hint-pulse {
  0%, 100% { transform: scale(.8); opacity: .55; }
  50% { transform: scale(1.35); opacity: 1; }
}
.deck.is-touched .deck__hint {
  opacity: 0;
  visibility: hidden;
}

/* ---------- Bottom controls ---------- */
.deck__bottom {
  padding: 0 30px 22px;
}

.deck__progress {
  height: 2px;
  margin-bottom: 16px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(201, 163, 92, .14);
}
.deck__progress span {
  display: block;
  width: 100%;
  height: 100%;
  transform: scaleX(.0625);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--red-bright), var(--gold) 68%, var(--gold-light));
  box-shadow: 0 0 12px rgba(223, 74, 51, .55);
  transition: transform .55s var(--ease);
}

.deck__controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.deck__arrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: .68rem;
  letter-spacing: .08em;
  cursor: pointer;
  transition: color .3s, border-color .3s, background .3s, opacity .3s;
}
.deck__arrow:hover:not(:disabled) {
  color: var(--cream);
  border-color: rgba(201, 163, 92, .42);
  background: rgba(201, 163, 92, .06);
}
.deck__arrow:disabled {
  opacity: .25;
  cursor: not-allowed;
}
.deck__arrow--next {
  color: var(--gold);
  border-color: rgba(201, 163, 92, .3);
}

.deck__dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.deck__dots::-webkit-scrollbar { display: none; }
.deck__dot {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 17px;
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.deck__dot span {
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(201, 163, 92, .3);
  transition: width .35s var(--ease), height .35s var(--ease),
              background .35s, border-radius .35s, box-shadow .35s;
}
.deck__dot:hover span {
  background: var(--gold);
  transform: scale(1.35);
}
.deck__dot.is-active span {
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--red-bright);
  box-shadow: 0 0 9px rgba(223, 74, 51, .65);
}
.deck__dot:focus-visible {
  outline: 1px solid var(--gold);
  outline-offset: 1px;
  border-radius: 6px;
}

.deck__noscript {
  margin-top: 16px;
  color: var(--muted);
  font-size: .8rem;
}

/* ---------- Fullscreen ---------- */
.deck__frame:fullscreen {
  width: 100vw;
  height: 100vh;
  border: 0;
  border-radius: 0;
  background:
    radial-gradient(1100px 680px at 74% 18%, rgba(179, 38, 30, .17), transparent 62%),
    #0f0c0b;
}
.deck__frame:fullscreen::backdrop {
  background: #0b0908;
}
.deck__frame:fullscreen .deck__viewport:focus-visible {
  outline-color: rgba(201, 163, 92, .45);
}
.deck__frame:fullscreen .deck__topbar {
  padding: 26px 48px 18px;
}
.deck__frame:fullscreen .deck__viewport {
  height: auto;
  flex: 1;
  min-height: 0;
}
.deck__frame:fullscreen .slide {
  grid-template-columns: minmax(280px, .8fr) minmax(0, 1.65fr);
  gap: 7vw;
  padding: 3vh 7vw 2vh;
}
.deck__frame:fullscreen .slide__year {
  font-size: clamp(7rem, 14vw, 13rem);
}
.deck__frame:fullscreen .slide h3 {
  font-size: clamp(2.3rem, 3.8vw, 3.8rem);
}
.deck__frame:fullscreen .slide__lead {
  font-size: clamp(1rem, 1.3vw, 1.2rem);
}
.deck__frame:fullscreen .slide__detail {
  font-size: clamp(.85rem, 1vw, .98rem);
}
.deck__frame:fullscreen .slide blockquote {
  font-size: clamp(.88rem, 1vw, 1rem);
}
.deck__frame:fullscreen .slide__ghost {
  font-size: clamp(20rem, 30vw, 32rem);
  right: 1vw;
  bottom: -7vh;
}
.deck__frame:fullscreen .slide__side {
  padding-right: 4vw;
}
.deck__frame:fullscreen .deck__bottom {
  padding: 0 48px 28px;
}
.deck__frame:fullscreen .deck__hint {
  right: 48px;
  bottom: 22px;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1024px) {
  .deck__viewport { height: 460px; }
  .slide {
    grid-template-columns: minmax(190px, .68fr) minmax(0, 1.5fr);
    gap: 30px;
    padding: 24px 30px 10px;
  }
  .slide__side { padding-right: 26px; }
  .slide__year { font-size: clamp(4.2rem, 7.6vw, 5.8rem); }
  .slide h3 { font-size: clamp(1.75rem, 2.8vw, 2.2rem); }
  .deck__topbar { padding: 20px 24px 14px; }
  .deck__bottom { padding: 0 24px 20px; }
}

@media (max-width: 860px) {
  .deck-section { padding: 84px 0 96px; }
  .deck__frame { border-radius: 14px; }
  .deck__viewport { height: 600px; }
  .slide {
    grid-template-columns: 1fr;
    gap: 16px;
    align-content: center;
    padding: 24px 26px 10px;
  }
  .slide__side {
    flex-direction: row;
    align-items: baseline;
    justify-content: flex-start;
    gap: 12px;
    align-self: auto;
    padding: 0 0 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .slide__year { font-size: 3.7rem; }
  .slide__date { margin-top: 0; font-size: .9rem; }
  .slide__rule { display: none; }
  .slide__index { margin-left: auto; }
  .slide__body {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
  .slide__ghost { font-size: 12rem; right: -18px; bottom: -30px; }
  .deck__hint { display: none; }
  .deck__counter b { font-size: 1.4rem; }
  .deck__frame:fullscreen .slide {
    grid-template-columns: 1fr;
    gap: 18px;
    padding: 3vh 5vw 2vh;
  }
  .deck__frame:fullscreen .slide__year { font-size: 4.2rem; }
  .deck__frame:fullscreen .slide h3 { font-size: clamp(1.7rem, 4.4vw, 2.4rem); }
}

@media (max-width: 620px) {
  .deck-section { padding: 68px 0 80px; }
  .deck__viewport { height: 600px; }
  .deck__topbar { padding: 16px 18px 12px; }
  .deck__chapter { font-size: .6rem; letter-spacing: .12em; }
  .deck__topmeta { gap: 12px; }
  .deck__fullscreen { padding: 6px; width: 30px; height: 30px; justify-content: center; }
  .deck__fullscreen span { display: none; }
  .deck__counter b { font-size: 1.2rem; }
  .deck__counter span { font-size: .62rem; }
  .slide { padding: 20px 18px 8px; gap: 14px; }
  .slide__year { font-size: 3rem; }
  .slide__date { font-size: .8rem; }
  .slide__body { max-height: none; }
  .slide h3 { font-size: clamp(1.45rem, 6.2vw, 1.8rem); margin-bottom: 10px; }
  .slide__lead { font-size: .83rem; line-height: 1.85; margin-bottom: 10px; }
  .slide__detail { font-size: .74rem; line-height: 1.8; padding-top: 10px; }
  .slide blockquote { margin-top: 10px; padding: 8px 12px; font-size: .76rem; }
  .slide__meta { margin-bottom: 12px; }
  .slide__ghost { font-size: 9rem; right: -14px; bottom: -18px; }
  .deck__bottom { padding: 0 18px 16px; }
  .deck__progress { margin-bottom: 12px; }
  .deck__controls { gap: 10px; }
  .deck__arrow { padding: 8px 11px; font-size: .62rem; }
  .deck__arrow span { display: none; }
  .deck__dot { width: 14px; }
  .deck__dot.is-active span { width: 15px; }
  .deck__frame:fullscreen .deck__topbar { padding: 18px 20px 12px; }
  .deck__frame:fullscreen .slide { padding: 3vh 5vw 2vh; gap: 18px; }
  .deck__frame:fullscreen .slide__year { font-size: 3.6rem; }
  .deck__frame:fullscreen .slide h3 { font-size: clamp(1.5rem, 6vw, 2rem); }
  .deck__frame:fullscreen .slide__lead { font-size: .9rem; }
  .deck__frame:fullscreen .slide__detail { font-size: .78rem; }
  .deck__frame:fullscreen .deck__bottom { padding: 0 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .slide,
  .slide.is-active,
  .slide.is-prev {
    transition: none;
  }
  .slide.is-active .slide__side > *,
  .slide.is-active .slide__body > *,
  .slide.is-active .slide__year,
  .slide.is-active .slide__ghost,
  .deck__hint-dot {
    animation: none !important;
  }
  .deck__progress span { transition: none; }
}
