/* ============================================================
   三体 · THE THREE-BODY PROBLEM — 致敬页样式
   情绪板: dark-cinematic / kinetic / maximal-type
   色系: 深空黑 + 人类青 + 三体琥珀 + 末日红
   ============================================================ */

:root {
  --bg: #04060a;
  --surface: #0a1018;
  --text: #e8eef5;
  --muted: #8b98a8;
  --cyan: #4fd8ff;
  --cyan-dim: rgba(79, 216, 255, 0.35);
  --amber: #ffb35c;
  --red: #ff4d5e;
  --line: rgba(122, 162, 204, 0.14);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  --font-sans: "Noto Sans SC", "Microsoft YaHei", "PingFang SC", sans-serif;
  --font-mono: "Orbitron", "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scrollbar-color: rgba(79, 216, 255, 0.35) var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.7;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

::selection { background: rgba(79, 216, 255, 0.28); color: #fff; }

a { color: inherit; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 3px; }

::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(79,216,255,.4), rgba(255,179,92,.3));
  border-radius: 8px;
  border: 2px solid var(--bg);
}

/* ---------- 背景层 ---------- */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60rem 42rem at 84% 14%, rgba(79, 216, 255, 0.075), transparent 62%),
    radial-gradient(52rem 36rem at 10% 86%, rgba(255, 77, 94, 0.06), transparent 62%),
    radial-gradient(44rem 32rem at 55% 45%, rgba(123, 104, 238, 0.05), transparent 65%);
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(120% 95% at 50% 38%, transparent 58%, rgba(0, 0, 0, 0.5));
}

canvas#stars {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* ---------- 滚动进度条 ---------- */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 60;
  background: linear-gradient(90deg, var(--cyan), var(--amber), var(--red));
  box-shadow: 0 0 12px rgba(79, 216, 255, 0.55);
}

/* ---------- 导航 ---------- */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.05rem clamp(1.2rem, 4vw, 3rem);
  background: linear-gradient(180deg, rgba(4, 6, 10, 0.85), rgba(4, 6, 10, 0));
  transition: background 0.4s;
}

.site-nav.scrolled { background: rgba(4, 6, 10, 0.72); backdrop-filter: blur(8px); }

.brand { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; }

.brand-mark {
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: 1.15rem;
  color: var(--cyan);
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(79, 216, 255, 0.45);
  border-radius: 50%;
  box-shadow: 0 0 16px rgba(79, 216, 255, 0.35), inset 0 0 10px rgba(79, 216, 255, 0.12);
  animation: brandPulse 5s ease-in-out infinite;
}

@keyframes brandPulse {
  0%, 100% { box-shadow: 0 0 14px rgba(79,216,255,.3), inset 0 0 10px rgba(79,216,255,.1); }
  50% { box-shadow: 0 0 26px rgba(79,216,255,.55), inset 0 0 14px rgba(79,216,255,.22); }
}

.brand-name {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: 0.22em;
}

.brand-name em {
  font-family: var(--font-mono);
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.34em;
  color: var(--muted);
  margin-left: 0.5rem;
}

.nav-links { display: flex; gap: clamp(1.2rem, 3vw, 2.6rem); }

.nav-links a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  transition: color 0.3s;
  padding: 0.3rem 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.45s var(--ease);
}

.nav-links a:hover { color: var(--cyan); }
.nav-links a:hover::after { transform: scaleX(1); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 7rem 1.5rem 13rem;
}

.hero-inner { position: relative; z-index: 2; }

.hero-badge {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.44em;
  color: var(--muted);
  text-transform: uppercase;
  margin: 0 0 1.6rem;
}

.badge-line { width: 3.4rem; height: 1px; flex: none; }
.badge-line:first-child { background: linear-gradient(90deg, transparent, var(--cyan)); }
.badge-line:last-child { background: linear-gradient(90deg, var(--cyan), transparent); }

.hero-title {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(6rem, 23vw, 19rem);
  line-height: 0.98;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  background: linear-gradient(180deg, #ffffff 18%, #c6ddf5 55%, rgba(79, 216, 255, 0.5));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 42px rgba(79, 216, 255, 0.22));
  animation: titleBreath 7s ease-in-out infinite;
}

@keyframes titleBreath {
  0%, 100% { filter: drop-shadow(0 0 34px rgba(79,216,255,.18)); }
  50% { filter: drop-shadow(0 0 60px rgba(79,216,255,.34)); }
}

.hero-sub {
  margin: 1.4rem 0 2.6rem;
  color: var(--muted);
  font-size: clamp(0.78rem, 1.6vw, 0.95rem);
  letter-spacing: 0.42em;
  text-indent: 0.42em;
}

.typewriter {
  font-size: clamp(1rem, 2.2vw, 1.3rem);
  font-weight: 600;
  letter-spacing: 0.18em;
  color: var(--amber);
  min-height: 1.8em;
  text-shadow: 0 0 18px rgba(255, 179, 92, 0.35);
}

.tw-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 4px;
  vertical-align: -0.18em;
  background: var(--amber);
  animation: blink 1.05s steps(1) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.scroll-hint {
  position: absolute;
  bottom: 10.6rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted);
  text-decoration: none;
  letter-spacing: 0.34em;
  font-size: 0.72rem;
  transition: color 0.3s;
}

.scroll-hint:hover { color: var(--cyan); }

.scroll-arrow { animation: arrowDrop 2.2s ease-in-out infinite; }

@keyframes arrowDrop {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(8px); opacity: 1; }
}

/* ---------- 名言滚动条 ---------- */
.ticker {
  position: absolute;
  left: 0; right: 0;
  z-index: 2;
  overflow: hidden;
  padding: 0.85rem 0;
  border-block: 1px solid var(--line);
  background: rgba(4, 8, 14, 0.6);
  backdrop-filter: blur(5px);
}

.ticker-a { bottom: 3.3rem; }
.ticker-b { bottom: 0; background: rgba(4, 8, 14, 0.82); }

.ticker-track {
  display: flex;
  width: max-content;
  white-space: nowrap;
}

.ticker-a .ticker-track { animation: tickerX 90s linear infinite; }
.ticker-b .ticker-track { animation: tickerX 120s linear infinite reverse; }

@keyframes tickerX {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.tk-item {
  display: inline-flex;
  align-items: baseline;
  gap: 1.2rem;
  font-size: 0.86rem;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.tk-item .tk-q { color: var(--muted); }
.ticker-b .tk-item .tk-q { color: rgba(232, 238, 245, 0.82); }

.tk-item .tk-s {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.22em;
  color: var(--cyan-dim);
}

.tk-sep {
  width: 5px;
  height: 5px;
  flex: none;
  margin: 0 1.6rem;
  background: var(--amber);
  transform: rotate(45deg);
  opacity: 0.65;
}

/* ---------- 名场面章节 ---------- */
.scenes {
  position: relative;
  z-index: 1;
  max-width: 1480px;
  margin: 0 auto;
  padding: 1rem clamp(1.2rem, 4vw, 3rem) 4rem;
}

.scene {
  padding: clamp(4.5rem, 11vh, 9rem) 0;
  border-top: 1px solid var(--line);
}

.scene-inner {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  align-items: center;
  column-gap: clamp(2rem, 5vw, 4.5rem);
}

.scene-media { grid-column: 1 / 8; position: relative; margin: 0; filter: drop-shadow(0 34px 60px rgba(0, 0, 0, 0.55)); }

.scene:nth-child(even) .scene-media { grid-column: 6 / 13; }
.scene:nth-child(even) .scene-copy { grid-column: 1 / 6; grid-row: 1; }

.scene-copy { grid-column: 8 / 13; position: relative; }

/* 图片斜切 + 渐变描边 + 扫描线 */
.scene-media::before {
  content: "";
  position: absolute;
  inset: -1px;
  z-index: 0;
  background: linear-gradient(135deg, rgba(79, 216, 255, 0.55), rgba(255, 179, 92, 0.18) 45%, rgba(79, 216, 255, 0.12));
  clip-path: polygon(0 0, calc(100% - 3rem) 0, 100% 3rem, 100% 100%, 3rem 100%, 0 calc(100% - 3rem));
}

.scene-media img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: auto;
  clip-path: polygon(0 0, calc(100% - 3rem) 0, 100% 3rem, 100% 100%, 3rem 100%, 0 calc(100% - 3rem));
  filter: saturate(0.92) contrast(1.05);
  transition: transform 1.4s var(--ease);
}

.scene-media:hover img { transform: scale(1.025); }

.scene-media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 3px),
    linear-gradient(120deg, rgba(79, 216, 255, 0.1), transparent 45%);
  mix-blend-mode: overlay;
  clip-path: polygon(0 0, calc(100% - 3rem) 0, 100% 3rem, 100% 100%, 3rem 100%, 0 calc(100% - 3rem));
}

.scene-index {
  position: absolute;
  right: 2.4rem;
  bottom: -2.1rem;
  z-index: 3;
  font-family: var(--font-mono);
  font-weight: 900;
  font-size: clamp(4.5rem, 9vw, 8.5rem);
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1px rgba(79, 216, 255, 0.3);
  letter-spacing: 0.04em;
  user-select: none;
}

/* 章节文案 */
.scene-kicker {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--cyan);
}

.scene-kicker::before {
  content: "";
  width: 2.2rem;
  height: 1px;
  background: var(--cyan);
  flex: none;
}

.scene-kicker em {
  font-style: normal;
  color: var(--muted);
  letter-spacing: 0.24em;
}

.scene-title {
  margin: 1.2rem 0 1.5rem;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.22;
  background: linear-gradient(120deg, #ffffff 30%, #c6ddf5 62%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.scene-text {
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 1.3vw, 1.04rem);
  line-height: 2.05;
  max-width: 36em;
}

.scene-quote {
  margin: 2rem 0 0;
  padding: 0.4rem 0 0.4rem 1.5rem;
  border-left: 2px solid var(--amber);
}

.scene-quote p {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.95;
  color: var(--text);
}

.scene-quote p::before { content: "「"; color: var(--amber); }
.scene-quote p::after { content: "」"; color: var(--amber); }

.scene-quote cite {
  display: block;
  margin-top: 0.9rem;
  font-style: normal;
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.scene-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  list-style: none;
  margin: 1.8rem 0 0;
  padding: 0;
}

.scene-tags li {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.42rem 1rem;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--muted);
  background: rgba(79, 216, 255, 0.04);
}

/* ---------- 水滴装饰球 ---------- */
.orb {
  position: absolute;
  top: 7%;
  left: 5%;
  z-index: 3;
  width: clamp(60px, 8.5vw, 122px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 32% 28%,
    #ffffff 0%, #d8f4ff 10%, #8fd8ff 24%,
    #2c7bab 46%, #0a2a40 70%, #02070d 100%);
  box-shadow:
    0 0 42px rgba(79, 216, 255, 0.45),
    0 0 130px rgba(79, 216, 255, 0.16),
    inset 0 0 26px rgba(255, 255, 255, 0.22);
  animation: orbFloat 9s ease-in-out infinite;
}

.orb::before {
  content: "";
  position: absolute;
  inset: 8% 20% 22% 8%;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0) 58%);
  filter: blur(1px);
}

.orb::after {
  content: "";
  position: absolute;
  left: -14%;
  right: -14%;
  top: 44%;
  height: 12%;
  background: rgba(255, 255, 255, 0.14);
  transform: rotate(-14deg);
  filter: blur(4px);
}

@keyframes orbFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-16px); }
}

/* ---------- 二向箔装饰 ---------- */
.foil-cube {
  position: absolute;
  right: 5%;
  bottom: 6%;
  z-index: 3;
  width: clamp(42px, 5.5vw, 80px);
  height: clamp(42px, 5.5vw, 80px);
  background: linear-gradient(135deg, rgba(79, 216, 255, 0.5), rgba(255, 77, 94, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 0 34px rgba(79, 216, 255, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.4);
  animation: foilFlatten 8s ease-in-out infinite;
}

@keyframes foilFlatten {
  0%, 100% { transform: scaleY(1) rotate(0deg); border-radius: 0; }
  42%, 58% {
    transform: scaleY(0.05) rotate(90deg);
    border-radius: 50%;
    box-shadow: 0 0 60px rgba(79, 216, 255, 0.85), inset 0 0 20px rgba(255, 255, 255, 0.5);
  }
}

/* ---------- 入场动画 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(38px);
  transition:
    opacity 1.2s var(--ease),
    transform 1.2s var(--ease);
  will-change: opacity, transform;
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

.hero .hero-badge { transition-delay: 0.05s; }
.hero .hero-title { transition-delay: 0.18s; }
.hero .hero-sub { transition-delay: 0.32s; }
.hero .typewriter { transition-delay: 0.46s; }
.hero .scroll-hint { transition-delay: 0.62s; }

.scene .scene-media { transition-delay: 0.05s; }
.scene .scene-copy { transition-delay: 0.22s; }

/* ---------- 终章 ---------- */
.epilogue {
  position: relative;
  z-index: 1;
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 8rem 1.5rem 0;
  border-top: 1px solid var(--line);
}

.epilogue-kicker {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--amber);
}

.epilogue-title {
  margin: 1.7rem 0 1.6rem;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(2.4rem, 6vw, 5rem);
  line-height: 1.3;
  background: linear-gradient(120deg, #ffffff 30%, #c6ddf5 60%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 34px rgba(79, 216, 255, 0.18));
}

.epilogue-sub {
  margin: 0;
  color: var(--muted);
  letter-spacing: 0.12em;
  line-height: 2.1;
}

.back-top {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 3rem;
  padding: 0.95rem 2rem;
  border: 1px solid rgba(79, 216, 255, 0.4);
  border-radius: 999px;
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.82rem;
  letter-spacing: 0.28em;
  transition: all 0.45s var(--ease);
}

.back-top:hover {
  background: rgba(79, 216, 255, 0.1);
  box-shadow: 0 0 34px rgba(79, 216, 255, 0.25);
  transform: translateY(-2px);
}

.site-footer {
  width: 100%;
  margin-top: 7rem;
  padding: 2.2rem 1.5rem;
  border-top: 1px solid var(--line);
  color: rgba(139, 152, 168, 0.72);
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  line-height: 2.1;
}

.site-footer p { margin: 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 920px) {
  .scene-inner { grid-template-columns: 1fr; row-gap: 3.2rem; }
  .scene-media, .scene:nth-child(even) .scene-media { grid-column: 1; }
  .scene-copy, .scene:nth-child(even) .scene-copy { grid-column: 1; grid-row: auto; }
  .scene-index { right: 1rem; bottom: -1.6rem; }
  .scroll-hint { bottom: 8.6rem; }
  .nav-links { gap: 1.2rem; }
}

@media (max-width: 560px) {
  .nav-links { display: none; }
  .brand-name em { display: none; }
  .ticker { padding: 0.7rem 0; }
  .tk-item { font-size: 0.76rem; }
  .hero { padding-bottom: 11.5rem; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
}
