:root {
  --bg: #f5efe3;
  --card: rgba(255, 253, 247, 0.82);
  --line: rgba(58, 50, 41, 0.14);
  --text: #27231e;
  --muted: #6e6559;
  --red: #b23a33;
  --gold: #9a6b1f;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(1100px 550px at 85% -5%, rgba(178, 58, 51, 0.07), transparent 60%),
    radial-gradient(900px 500px at 8% 12%, rgba(154, 107, 31, 0.1), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.75;
  overflow-x: hidden;
}

::selection {
  background: rgba(178, 58, 51, 0.18);
}

/* ---------- 星空画布与进度条 ---------- */

#starfield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
}

.progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transform: scaleX(0);
  transform-origin: left;
  z-index: 30;
  pointer-events: none;
}

/* ---------- 滚动入场 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) var(--d, 0s),
              transform 0.7s cubic-bezier(0.2, 0.6, 0.2, 1) var(--d, 0s);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- 导航 ---------- */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(245, 239, 227, 0.9);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.brand {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.brand i {
  font-style: normal;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-left: 10px;
}

.nav-links {
  display: flex;
  gap: 20px;
}

.nav-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.1em;
  transition: color 0.16s;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

.nav-links a.active {
  position: relative;
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--red);
}

/* ---------- Hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 120px 24px 100px;
}

.hero .eyebrow,
.hero h1,
.hero-sub,
.hero-badges {
  opacity: 0;
  transform: translateY(20px);
  animation: heroIn 0.9s ease forwards;
}

.hero .eyebrow { animation-delay: 0.1s; }
.hero h1 { animation-delay: 0.22s; }
.hero-sub { animation-delay: 0.42s; }
.hero-badges { animation-delay: 0.58s; }

@keyframes heroIn {
  to {
    opacity: 1;
    transform: none;
  }
}

.suns {
  position: relative;
  width: 120px;
  height: 44px;
  margin-bottom: 34px;
}

.suns span {
  position: absolute;
  border-radius: 50%;
  animation: sunFloat 6s ease-in-out infinite;
}

.suns .s1 {
  width: 12px;
  height: 12px;
  left: 18px;
  top: 20px;
  background: var(--red);
  box-shadow: 0 0 24px rgba(178, 58, 51, 0.35);
}

.suns .s2 {
  width: 17px;
  height: 17px;
  left: 52px;
  top: 4px;
  background: var(--gold);
  box-shadow: 0 0 28px rgba(154, 107, 31, 0.32);
  animation-delay: -2s;
}

.suns .s3 {
  width: 12px;
  height: 12px;
  left: 88px;
  top: 22px;
  background: #8d99a8;
  box-shadow: 0 0 22px rgba(90, 100, 112, 0.25);
  animation-delay: -4s;
}

@keyframes sunFloat {
  50% {
    transform: translateY(-6px);
  }
}

.eyebrow {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.35em;
  margin-bottom: 10px;
}

.hero h1 {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(72px, 13vw, 150px);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-indent: 0.22em; /* 抵消末字字距，保持光学居中 */
  line-height: 1.15;
  text-shadow: 0 2px 40px rgba(178, 58, 51, 0.12);
}

.hero-sub {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  letter-spacing: 0.18em;
}

.hero-badges {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.hero-badges span {
  font-size: 12.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.7);
}

.scroll-cue {
  position: absolute;
  bottom: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: rgba(110, 101, 89, 0.75);
  font-size: 12px;
  letter-spacing: 0.3em;
  animation: cueFloat 2.6s ease-in-out infinite;
}

.scroll-cue span {
  width: 10px;
  height: 10px;
  border-right: 1.5px solid rgba(110, 101, 89, 0.7);
  border-bottom: 1.5px solid rgba(110, 101, 89, 0.7);
  transform: rotate(45deg);
}

@keyframes cueFloat {
  50% {
    transform: translateY(6px);
  }
}

/* ---------- 数据概览 ---------- */

.stats-section {
  padding-top: 10px;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  padding: 22px 0 10px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat {
  text-align: center;
  padding: 14px 8px;
}

.stat .num {
  font-family: Georgia, "Songti SC", serif;
  font-size: 38px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #332d26, #7a6f60);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat .num .unit {
  font-size: 16px;
  margin-left: 4px;
  color: var(--muted);
  background: none;
  -webkit-text-fill-color: var(--muted);
}

.stat p {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
  margin-top: 4px;
}

/* ---------- 区块 ---------- */

main {
  position: relative;
  z-index: 1;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px 40px;
}

section {
  padding: 72px 0 12px;
  scroll-margin-top: 72px;
}

.sec-head {
  text-align: center;
  margin-bottom: 40px;
}

.kicker {
  color: var(--red);
  font-size: 12px;
  letter-spacing: 0.45em;
  text-indent: 0.45em;
  margin-bottom: 8px;
}

.sec-head h2 {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 32px;
  letter-spacing: 0.12em;
}

.sec-desc {
  color: var(--muted);
  font-size: 15px;
  margin-top: 10px;
}

/* ---------- 卡片 ---------- */

.grid {
  display: grid;
  gap: 18px;
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-auto {
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 24px;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.card:hover {
  transform: translateY(-3px);
  border-color: rgba(178, 58, 51, 0.45);
  box-shadow: 0 12px 30px rgba(74, 60, 42, 0.12);
}

.card h3 {
  font-size: 19px;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}

.card p {
  color: var(--muted);
  font-size: 14.5px;
}

.card .tag,
.card .book-tag {
  color: var(--red);
  font-size: 12.5px;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.chips span {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

/* ---------- 三部曲卡片 ---------- */

.book {
  overflow: hidden;
  padding-top: 30px;
}

.book .ghost {
  position: absolute;
  top: -18px;
  right: 2px;
  font-family: Georgia, serif;
  font-size: 110px;
  line-height: 1;
  color: rgba(58, 50, 41, 0.07);
}

.book .book-year {
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: 0.3em;
  margin-bottom: 4px;
}

.book h3 {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: 24px;
}

.book p:last-of-type {
  margin-top: 10px;
}

/* ---------- 纪元年表 ---------- */

.timeline {
  position: relative;
  max-width: 780px;
  margin: 0 auto;
  padding-left: 36px;
}

.tl-line {
  position: absolute;
  left: 9px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: linear-gradient(180deg, var(--red), rgba(178, 58, 51, 0.1));
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 1.6s cubic-bezier(0.2, 0.6, 0.2, 1) 0.15s;
}

.timeline.in .tl-line {
  transform: scaleY(1);
}

.tl-item {
  position: relative;
  padding-bottom: 26px;
  opacity: 0;
  transform: translateX(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.timeline.in .tl-item {
  opacity: 1;
  transform: none;
}

.timeline.in .tl-item:nth-child(2) { transition-delay: 0.15s; }
.timeline.in .tl-item:nth-child(3) { transition-delay: 0.3s; }
.timeline.in .tl-item:nth-child(4) { transition-delay: 0.45s; }
.timeline.in .tl-item:nth-child(5) { transition-delay: 0.6s; }
.timeline.in .tl-item:nth-child(6) { transition-delay: 0.75s; }

.tl-dot {
  position: absolute;
  left: -33px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--red);
  box-shadow: 0 0 14px rgba(178, 58, 51, 0.35);
}

.tl-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 20px;
}

.tl-era {
  color: var(--text) !important;
  font-size: 16.5px !important;
  font-weight: 600;
  letter-spacing: 0.18em;
  margin-bottom: 4px;
}

.tl-card p {
  color: var(--muted);
  font-size: 14.5px;
}

/* ---------- 末日之战 ---------- */

.war-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.war-stat {
  text-align: center;
  padding: 30px 16px;
}

.war-stat .num {
  font-family: Georgia, "Songti SC", serif;
  font-size: 46px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

.war-stat .num .unit {
  font-size: 17px;
  color: var(--muted);
  margin-left: 4px;
}

.war-stat p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13.5px;
  letter-spacing: 0.06em;
}

/* ---------- 图表 ---------- */

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.chart-card {
  padding: 24px;
}

.chart-card h3 {
  font-size: 17px;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.chart {
  width: 100%;
  height: auto;
  display: block;
}

.chart .axis {
  stroke: rgba(58, 50, 41, 0.25);
  stroke-width: 1;
}

.chart .ax-label {
  fill: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.chart .ax-label.warn {
  fill: var(--gold);
}

.chart .tech-curve {
  fill: none;
  stroke: var(--red);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.chart .tech-curve.draw {
  stroke-dasharray: 1200;
  stroke-dashoffset: 1200;
  transition: stroke-dashoffset 2s cubic-bezier(0.3, 0.6, 0.2, 1) 0.3s;
}

.chart-card.in .tech-curve.draw {
  stroke-dashoffset: 0;
}

.chart .lock-line {
  stroke: rgba(154, 107, 31, 0.5);
  stroke-width: 1.2;
  stroke-dasharray: 4 6;
}

.chart .lock-dot {
  fill: var(--gold);
  opacity: 0;
  transition: opacity 0.5s ease 1.6s;
}

.chart-card.in .lock-dot {
  opacity: 1;
}

.chart-note {
  color: rgba(110, 101, 89, 0.8);
  font-size: 13px;
  margin-top: 14px;
  line-height: 1.7;
}

/* 降维示意 */

.dimchart .face {
  stroke: rgba(58, 50, 41, 0.38);
  stroke-width: 1.2;
}

.dimchart .face.top { fill: rgba(178, 58, 51, 0.14); }
.dimchart .face.left { fill: rgba(178, 58, 51, 0.06); }
.dimchart .face.right { fill: rgba(178, 58, 51, 0.1); }

.dimchart .cube {
  transform-box: fill-box;
  transform-origin: center;
}

.chart-card.in .cube {
  animation: cubeFlatten 2s cubic-bezier(0.45, 0.05, 0.3, 1) 0.5s forwards;
}

@keyframes cubeFlatten {
  0% { transform: scaleY(1); opacity: 1; }
  55% { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(0.1); opacity: 0.7; }
}

.dimchart .beam {
  stroke: rgba(154, 107, 31, 0.8);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 5 5;
}

.chart-card.in .beam {
  animation: beamPulse 2.2s ease-in-out 0.3s infinite alternate;
}

@keyframes beamPulse {
  from { opacity: 0.35; }
  to { opacity: 1; }
}

.dimchart .plane {
  opacity: 0;
}

.chart-card.in .plane {
  animation: planeIn 0.9s ease 1.7s forwards;
}

@keyframes planeIn {
  to { opacity: 1; }
}

.dimchart .plane-body {
  fill: rgba(178, 58, 51, 0.14);
  stroke: rgba(178, 58, 51, 0.62);
  stroke-width: 1.2;
}

.dimchart .plane-line {
  stroke: rgba(178, 58, 51, 0.3);
  stroke-width: 0.8;
}

/* ---------- 金句轮播 ---------- */

.quote-stage {
  max-width: 800px;
  margin: 0 auto;
}

.quote-viewport {
  position: relative;
  min-height: 230px;
}

.quote {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 10px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
}

.quote.active {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.quote p {
  font-family: Georgia, "Songti SC", "SimSun", serif;
  font-size: clamp(18px, 2.4vw, 22px);
  line-height: 1.95;
  letter-spacing: 0.04em;
  max-width: 720px;
}

.quote cite {
  display: block;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13.5px;
  font-style: normal;
  letter-spacing: 0.15em;
}

.quote-dots {
  display: flex;
  justify-content: center;
  gap: 9px;
  margin-top: 10px;
}

.quote-dots button {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 0;
  background: rgba(58, 50, 41, 0.2);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}

.quote-dots button.active {
  background: var(--red);
  transform: scale(1.25);
}

/* ---------- 作者 ---------- */

.awards {
  list-style: none;
}

.awards li {
  color: var(--muted);
  font-size: 14px;
  padding: 7px 0 7px 16px;
  position: relative;
  border-bottom: 1px dashed rgba(58, 50, 41, 0.12);
}

.awards li:last-child {
  border-bottom: 0;
}

.awards li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--red);
}

/* ---------- 页脚 ---------- */

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  margin-top: 60px;
  padding: 30px 24px 36px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.05em;
}

footer p + p {
  margin-top: 6px;
  color: rgba(110, 101, 89, 0.75);
}

.footer-legal {
  margin-top: 14px;
}

.footer-legal a {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.66);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--red);
  border-color: rgba(178, 58, 51, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px -12px rgba(178, 58, 51, 0.55);
}

/* ---------- 响应式 ---------- */

@media (max-width: 900px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .war-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .grid-3 {
    grid-template-columns: 1fr;
    max-width: 420px;
    margin: 0 auto;
  }

  .nav {
    padding: 12px 18px;
  }

  .nav-links {
    gap: 14px;
  }

  .nav-links a {
    font-size: 13px;
  }

  .brand i {
    display: none;
  }

  .quote-viewport {
    min-height: 280px;
  }
}

@media (max-width: 520px) {
  .nav-links {
    gap: 12px;
  }

  .nav-links a {
    font-size: 12.5px;
    letter-spacing: 0.06em;
  }

  .brand {
    font-size: 15px;
  }
}

/* ---------- 减少动态 ---------- */

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.001s !important;
    animation-delay: 0s !important;
    transition-duration: 0.001s !important;
    transition-delay: 0s !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .timeline .tl-item {
    opacity: 1;
    transform: none;
  }

  .timeline .tl-line {
    transform: scaleY(1);
  }

  .quote:not(.active) {
    display: none;
  }
}
