@font-face {
  font-family: "TsangerYuYangT";
  src: url("https://repo.acovia.net/resources/fonts/TsangerYuYangT.ttf");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #100c08;
  --surface: #181410;
  --surface-2: #201c18;
  --text: #ffefdf;
  --muted: #cfbfaf;
  --faint: #af9f8f;
  --accent: #8f4f00;
  --accent-hover: #af5f00;
  --accent-soft: #ff8f000f;
  --on-accent: #ffffff;
  --selection-bg: #ff8f004f;
  --line: #4f3f2f;
  --line-strong: #6f5f4f;
  --serif: "TsangerYuYangT", "仓耳渔阳体", "Noto Serif SC", "Songti SC", serif;
  --sans: "TsangerYuYangT", "仓耳渔阳体", "Noto Sans SC", "PingFang SC", system-ui, sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(ellipse 60% 45% at 50% -12%, var(--accent-soft), transparent 70%),
    var(--bg);
  font-family: var(--sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--selection-bg); }

a { color: inherit; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 20;
  padding: 8px 14px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--on-accent);
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1040px;
  margin: 0 auto;
  padding: 22px 28px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.brand img { width: 34px; height: 34px; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-nav a {
  color: var(--muted);
  font-size: 0.82rem;
  text-decoration: none;
  transition: color 0.2s ease;
}
.site-nav a:hover { color: var(--text); }

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 28px;
}

.hero {
  max-width: 760px;
  padding: clamp(72px, 13vh, 140px) 0 clamp(64px, 9vh, 96px);
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
}

.hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(3.6rem, 10vw, 7rem);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: 0.01em;
  animation: rise 0.7s ease both;
}

.lead {
  max-width: 620px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  line-height: 1.9;
  animation: rise 0.7s 0.08s ease both;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
  animation: rise 0.7s 0.16s ease both;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  color: var(--text);
  background: transparent;
  font-family: var(--sans);
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.button:hover { border-color: var(--accent); transform: translateY(-1px); }

.button-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 700;
}
.button-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.button-copy code {
  font-family: var(--mono);
  font-size: 0.84rem;
  letter-spacing: 0.02em;
}
.button-copy span {
  color: var(--faint);
  font-size: 0.7rem;
  padding-left: 10px;
  border-left: 1px solid var(--line-strong);
}

.meta {
  margin: 22px 0 0;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  animation: rise 0.7s 0.24s ease both;
}

.links {
  animation: rise 0.7s 0.3s ease both;
}

.fri-links {
  padding: 42px 0px;
  max-width: 960px;
  animation: rise 0.7s 0.42s ease both;
}

.link-row {
  display: grid;
  grid-template-columns: 52px 1fr 24px;
  align-items: center;
  gap: 14px;
  padding: 20px 4px;
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  text-decoration: none;
  transition: 0.3s;
}
.link-row + .link-row { border-top: 0; }

.link-row:hover {
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%);
}

.num {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.08em;
}

.link-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.link-text strong {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}
.link-text small { color: var(--muted); font-size: 0.76rem; }

.arrow {
  color: var(--faint);
  font-size: 0.95rem;
  transition: color 0.2s ease, transform 0.2s ease;
}
.link-row:hover .arrow { color: var(--accent); transform: translateX(3px); }

/* ---------- 载入 ---------- */
.loader { display: none; }

html.js .loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--bg);
  transition: opacity 0.45s ease;
}

html.js #page {
  opacity: 0;
  transition: opacity 0.45s ease;
}

html.js.is-ready #page { opacity: 1; }

html.js.is-ready .loader {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.45s ease, visibility 0s linear 0.45s;
}

.loader img { width: 34px; height: 34px; }

.loader span {
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.loader-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  animation: loader-pulse 1.2s ease-in-out infinite;
}

@keyframes loader-pulse {
  50% { opacity: 0.25; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-dot { animation: none; }
}

/* ---------- 胶片 ---------- */
.reel {
  --frame-gap: 12px;
  --frame-w: clamp(240px, calc((min(100vw, 960px) - 24px) / 3), 312px);
  --reel-count: 5; /* 每行图片数，决定错位节奏与行程长度 */
  --reel-travel: calc(var(--reel-count) * (var(--frame-w) + var(--frame-gap)));
  margin-top: 84px;
  animation: rise 0.7s 0.36s ease both;
}

.reel-label {
  margin: 0 0 16px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 400;
  letter-spacing: 0.2em;
}

.reel-window {
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

/* 一行内的画面叠在同一个网格单元里，各自决定自己的位置，不共用一条轨道 */
.reel-row {
  --reel-duration: 54s;
  position: relative;
  display: grid;
  grid-template-columns: 100%;
  container-type: inline-size; /* 供 reel-flow 里的 100cqw 取行宽 */
  padding: 22px 0;
  background: var(--surface-2);
}

.reel-row + .reel-row { margin-top: 10px; }

.reel-row::before,
.reel-row::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 10px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='10'%3E%3Crect width='12' height='10' rx='2.5' fill='%23808080'/%3E%3C/svg%3E");
  background-repeat: repeat-x;
  background-size: 28px 10px;
  pointer-events: none;
}
.reel-row::before { top: 5px; }
.reel-row::after { bottom: 5px; }

/* 每张图独立走完 --reel-count 个身位；行程两端都在窗口外，循环点因此看不见 */
.reel-frame {
  --i: 0;
  grid-area: 1 / 1;
  width: var(--frame-w);
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 2px;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
  animation: reel-flow var(--reel-duration) linear infinite;
  /* 第一张走在最前，后面的依次排到它右边 */
  animation-delay: calc((var(--reel-count) - 1 - var(--i)) / var(--reel-count) * var(--reel-duration) * -1);
}

.reel-frame:nth-child(2) { --i: 1; }
.reel-frame:nth-child(3) { --i: 2; }
.reel-frame:nth-child(4) { --i: 3; }
.reel-frame:nth-child(5) { --i: 4; }

.reel-row--reverse { --reel-duration: 66s; }
.reel-row--reverse .reel-frame {
  animation-direction: reverse;
  /* 反向播放时相位改用正序，首张才能仍在最左 */
  animation-delay: calc(var(--i) / var(--reel-count) * var(--reel-duration) * -1);
}

.reel-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 从窗口右侧外走到左侧外，一次循环刚好走完 --reel-count 个身位 */
@keyframes reel-flow {
  from { transform: translateX(100cqw); }
  to { transform: translateX(calc(100cqw - var(--reel-travel))); }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  max-width: 1040px;
  margin: 96px auto 0;
  padding: 22px 28px 40px;
  border-top: 1px solid var(--line);
  color: var(--faint);
  font-family: var(--mono);
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 30;
  transform: translate(-50%, 14px);
  padding: 9px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--text);
  background: var(--surface);
  font-size: 0.76rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

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

@media (max-width: 640px) {
  .site-header { padding: 16px 20px; }
  .site-nav { gap: 16px; }
  main { padding: 0 20px; }
  .hero { padding-top: 64px; }
  .actions { flex-direction: column; align-items: stretch; }
  .button { width: 100%; }
  .link-row { grid-template-columns: 36px 1fr 18px; gap: 10px; }
  .site-footer { margin-top: 72px; padding: 20px 20px 32px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reel-row {
    display: flex;
    gap: var(--frame-gap);
    overflow-x: auto;
  }
  .reel-frame {
    flex: none;
    animation: none;
  }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}

@media print {
  .site-header, .toast, .skip-link { display: none !important; }
  body { background: #fffdfb; color: #181818; }
  .hero h1 { color: #080808; }
  .lead, .meta, .link-text small, .num { color: #484848; }
}
