@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;600;700&family=Orbitron:wght@300;400;700&family=Share+Tech+Mono&display=swap');

/* ── 颜色变量 ── */
:root {
  --void:   #03050a;
  --deep:   #060c18;
  --mid:    #0a1628;
  --glow:   #1a3a6e;
  --pulse:  #2a5fa8;
  --accent: #4a9eff;
  --bright: #8fcfff;
  --text:   #c8dff5;
  --dim:    #6a8ab0;
  --gold:   #d4a847;
  --red:    #ff4a6e;
  --decay:  #7a3a8e;
}

/* ── 基础重置 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--void);
  color: var(--text);
  font-family: 'Noto Serif SC', serif;
  font-weight: 300;
  line-height: 1.9;
  overflow-x: hidden;
  cursor: crosshair;
}

/* ── 星空画布 ── */
#starfield {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── 空洞边缘渐变 ── */
.void-edge {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 1;
  pointer-events: none;
  background: radial-gradient(ellipse at center,
    transparent 40%,
    rgba(10,5,30,0.4) 70%,
    rgba(5,3,15,0.8) 100%);
}

/* ── 封面 ── */
.cover {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 10;
  padding: 4rem 2rem;
  text-align: center;
}
.cover::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(42,95,168,0.12) 0%, transparent 70%);
  border-radius: 50%;
  animation: breathe 6s ease-in-out infinite;
  pointer-events: none;
}

@keyframes breathe {
  0%, 100% { transform: translate(-50%,-50%) scale(1);    opacity: 0.6; }
  50%       { transform: translate(-50%,-50%) scale(1.15); opacity: 1; }
}

.kbc-label {
  font-family: 'Orbitron', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.4em;
  color: var(--dim);
  text-transform: uppercase;
  margin-bottom: 2rem;
  animation: fadeIn 2s ease;
}

.title-main {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(3rem, 8vw, 6rem);
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1.1;
  background: linear-gradient(135deg, #ffffff 0%, var(--bright) 40%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
  animation: fadeIn 2s ease 0.3s both, glitch 8s ease-in-out 3s infinite;
}

.title-sub {
  font-family: 'Orbitron', monospace;
  font-size: clamp(0.8rem, 2vw, 1rem);
  color: var(--decay);
  letter-spacing: 0.25em;
  margin-top: 1rem;
  animation: fadeIn 2s ease 0.6s both;
}

.divider {
  width: 200px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow), transparent);
  margin: 2.5rem auto;
  animation: fadeIn 2s ease 0.9s both;
}

.tagline {
  font-size: 1rem;
  color: var(--dim);
  font-style: italic;
  max-width: 480px;
  animation: fadeIn 2s ease 1.2s both;
}

.scroll-hint {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: var(--dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  animation: fadeIn 2s ease 2s both;
}
.scroll-arrow {
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, var(--accent), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.8); }
  50%       { opacity: 1;   transform: scaleY(1); }
}

/* ── 正文容器 ── */
.content {
  position: relative;
  z-index: 10;
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem 6rem;
}

/* ── 章节标题 ── */
.chapter {
  margin: 5rem 0 3rem;
  position: relative;
}
.chapter-num {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.4em;
  display: block;
  margin-bottom: 0.8rem;
  opacity: 0.7;
}
.chapter-title {
  font-family: 'Noto Serif SC', serif;
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  font-weight: 600;
  color: #ffffff;
  position: relative;
}
.chapter-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-top: 1rem;
}

/* ── 段落 ── */
p {
  margin-bottom: 1.6rem;
  font-size: 1.05rem;
  color: var(--text);
  text-align: justify;
}

/* ── 数据块 ── */
.data-block {
  border-left: 2px solid var(--glow);
  padding: 1.2rem 1.8rem;
  margin: 2.5rem 0;
  background: rgba(26,58,110,0.08);
  position: relative;
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.82rem;
  color: var(--bright);
  line-height: 1.8;
}
.data-block::before {
  content: attr(data-label);
  position: absolute;
  top: -0.6rem;
  left: 1rem;
  background: var(--void);
  padding: 0 0.5rem;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}
.data-block .value  { color: var(--gold); }
.data-block .anomaly { color: var(--red); }

/* ── 行内强调 ── */
.highlight  { color: var(--bright); font-weight: 400; }
.decay-word { color: var(--decay);  font-style: italic; }

/* ── 场景分隔 ── */
.scene-break {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 3rem 0;
  color: var(--dim);
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  letter-spacing: 0.3em;
}
.scene-break::before,
.scene-break::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--glow));
}
.scene-break::after {
  background: linear-gradient(90deg, var(--glow), transparent);
}

/* ── 对话 ── */
.dialogue {
  margin: 2rem 0;
  padding: 0 0 0 1.5rem;
  border-left: 1px solid rgba(74,158,255,0.3);
}
.speaker {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.2em;
  margin-bottom: 0.4rem;
  opacity: 0.8;
}
.dialogue p {
  color: #ddeeff;
  font-style: italic;
  margin-bottom: 0.5rem;
}

/* ── 题词 ── */
.epigraph {
  text-align: center;
  margin: 4rem 0;
  padding: 2rem;
  border-top: 1px solid rgba(74,158,255,0.15);
  border-bottom: 1px solid rgba(74,158,255,0.15);
}
.epigraph p {
  color: var(--dim);
  font-size: 0.95rem;
  font-style: italic;
  text-align: center;
  max-width: 500px;
  margin: 0 auto;
}
.epigraph .source {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.65rem;
  color: rgba(106,138,176,0.6);
  letter-spacing: 0.2em;
  margin-top: 1rem;
  display: block;
}

/* ── 衰变指数（右侧进度条）── */
.void-meter {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  opacity: 0.75;
  transition: opacity 0.3s;
  background: rgba(3,5,10,0.6);
  border: 1px solid rgba(74,158,255,0.15);
  border-radius: 12px;
  padding: 1rem 0.6rem;
  backdrop-filter: blur(6px);
}
.void-meter:hover { opacity: 1; }

.meter-label {
  font-family: 'Share Tech Mono', monospace;
  font-size: 0.6rem;
  color: var(--accent);
  writing-mode: vertical-rl;
  letter-spacing: 0.25em;
  text-transform: uppercase;
}

.meter-bar {
  width: 6px;
  height: 200px;
  background: rgba(74,158,255,0.08);
  border-radius: 3px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(74,158,255,0.1) inset;
}
.meter-fill {
  position: absolute;
  bottom: 0;
  width: 100%;
  border-radius: 3px;
  background: linear-gradient(to top, var(--accent), #a070ff, var(--decay));
  transition: height 0.4s ease;
  box-shadow: 0 0 10px var(--accent), 0 0 20px rgba(74,158,255,0.4);
  animation: meterGlow 2.5s ease-in-out infinite;
}
.meter-ticks {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 4px 0;
  pointer-events: none;
}
.meter-tick {
  width: 100%;
  height: 1px;
  background: rgba(74,158,255,0.2);
}
.meter-pct {
  font-family: 'Orbitron', monospace;
  font-size: 0.65rem;
  color: var(--accent);
  letter-spacing: 0.05em;
  text-shadow: 0 0 8px var(--accent);
}

/* ── 动画 ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes meterGlow {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 8px var(--accent), 0 0 16px rgba(74,158,255,0.3); }
  50%       { opacity: 1;   box-shadow: 0 0 14px var(--accent), 0 0 28px rgba(74,158,255,0.6), 0 0 40px rgba(160,112,255,0.3); }
}
@keyframes glitch {
  0%, 90%, 100% { clip-path: none; transform: none; }
  92% { clip-path: polygon(0 20%,100% 20%,100% 40%,0 40%); transform: translateX(-3px); }
  94% { clip-path: polygon(0 60%,100% 60%,100% 80%,0 80%); transform: translateX(3px); }
  96% { clip-path: none; transform: translateX(-1px); }
}

/* ── 滚动淡入 ── */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ── 结尾 ── */
.finale {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid rgba(74,158,255,0.1);
  text-align: center;
}
.finale .closing-symbol {
  font-family: 'Orbitron', monospace;
  font-size: 2rem;
  color: rgba(74,158,255,0.3);
  letter-spacing: 0.5em;
  display: block;
  margin-bottom: 2rem;
  animation: breathe 4s ease-in-out infinite;
}
.finale p {
  text-align: center;
  color: var(--dim);
  font-size: 0.9rem;
  font-style: italic;
}

/* ── 滚动条 ── */
::-webkit-scrollbar       { width: 4px; }
::-webkit-scrollbar-track { background: var(--void); }
::-webkit-scrollbar-thumb { background: var(--glow); border-radius: 2px; }

/* ── 响应式 ── */
@media (max-width: 600px) {
  .void-meter { display: none; }
  .content    { padding: 0 1.2rem 4rem; }
}
