@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  --ink: #001e3c;
  --ink-2: #012a4e;
  --mint: #99ffcc;
  --neon: #00ff41;
  --line: rgba(153, 255, 204, 0.22);
  --line-soft: rgba(153, 255, 204, 0.11);
  --text: #d9f7ea;
  --text-dim: rgba(217, 247, 234, 0.72);
  --head: #f2fffa;
  --rail: 158px;
  --f-head: 'Playfair Display', 'Songti SC', 'Noto Serif SC', Georgia, serif;
  --f-body: 'Inter', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  padding-left: var(--rail);
  background-color: var(--ink);
  background-image:
    radial-gradient(52vw 46vw at 88% -8%, rgba(0, 255, 65, 0.16), transparent 66%),
    radial-gradient(46vw 48vw at 2% 108%, rgba(153, 255, 204, 0.14), transparent 72%),
    radial-gradient(30vw 30vw at 60% 40%, rgba(0, 255, 65, 0.05), transparent 70%);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.78;
  font-weight: 400;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: var(--mint); text-decoration: none; transition: color 0.25s ease, background-color 0.25s ease; }
a:hover { color: var(--neon); }
h1, h2, h3 { font-family: var(--f-head); font-weight: 600; line-height: 1.16; color: var(--head); margin: 0 0 0.6em; }
::selection { background: var(--neon); color: var(--ink); }

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

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 80;
  padding: 10px 18px; min-height: 44px; display: inline-flex; align-items: center;
  background: var(--neon); color: var(--ink); font-weight: 600;
  transform: translateY(-250%); transition: transform 0.22s ease;
}
.skip:focus { transform: none; color: var(--ink); }

/* ---------- 左竖导航 ---------- */
.rail {
  position: fixed; inset: 0 auto 0 0; width: var(--rail); z-index: 40;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 20px 10px 26px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(1, 42, 78, 0.9), rgba(0, 18, 36, 0.94));
  backdrop-filter: blur(12px);
}
.mark {
  flex: 0 0 auto; width: 46px; height: 46px; display: grid; place-items: center;
  color: var(--neon);
  filter: drop-shadow(0 0 10px rgba(0, 255, 65, 0.5));
  animation: breathe 8s ease-in-out infinite;
}
.mark svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.mark:hover { color: var(--mint); }

.rail-list {
  list-style: none; margin: 0; padding: 0; width: 100%;
  display: flex; flex-direction: column; gap: 2px;
  overflow-y: auto; scrollbar-width: thin;
}
.rail-list li { animation: rise 0.55s cubic-bezier(0.2, 0.8, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
.rail-list a {
  display: flex; align-items: center; gap: 9px;
  min-height: 44px; padding: 4px 10px;
  font-size: 16px; color: var(--text-dim);
  border-left: 2px solid transparent;
}
.rail-list a:hover, .rail-list a:focus-visible {
  color: var(--neon); background: rgba(0, 255, 65, 0.08); border-left-color: var(--neon);
}
.ico { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.35; }

/* ---------- 右侧主按钮 ---------- */
.cta {
  position: fixed; right: clamp(14px, 3vw, 30px); bottom: clamp(14px, 3vw, 30px); z-index: 50;
  display: inline-flex; align-items: center; min-height: 50px; padding: 0 24px;
  background: var(--neon); color: var(--ink); font-weight: 700; font-size: 16px;
  letter-spacing: 0.04em;
  box-shadow: 0 20px 40px -16px rgba(0, 255, 65, 0.72);
  animation: breathe 6s ease-in-out infinite;
}
.cta:hover, .cta:focus-visible { color: var(--ink); background: var(--mint); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative; min-height: 70vh;
  display: grid; place-items: center; text-align: center;
  padding: clamp(96px, 15vh, 168px) clamp(20px, 5vw, 60px) clamp(64px, 11vh, 120px);
  overflow: hidden;
}
.hero-art { position: absolute; inset: 0; pointer-events: none; }
.cell {
  position: absolute; display: block; overflow: hidden;
  background:
    radial-gradient(circle at 32% 28%, rgba(0, 255, 65, 0.55), rgba(153, 255, 204, 0.22) 58%, rgba(0, 30, 60, 0) 76%);
  box-shadow: 0 40px 70px -40px rgba(0, 255, 65, 0.6);
  animation: breathe 11s ease-in-out infinite;
}
.cell-img { width: 100%; height: 100%; object-fit: cover; mix-blend-mode: screen; }
.cell-a {
  width: clamp(122px, 27vw, 302px); aspect-ratio: 3 / 4;
  left: 4%; top: 10%; transform: rotate(-5deg);
  clip-path: polygon(50% 0%, 79% 11%, 97% 39%, 93% 72%, 68% 97%, 33% 93%, 7% 69%, 3% 37%, 21% 9%);
}
.cell-b {
  width: clamp(116px, 24vw, 268px); aspect-ratio: 4 / 5;
  right: 4%; bottom: 6%; transform: rotate(6deg); animation-delay: -5s;
  clip-path: polygon(46% 2%, 74% 13%, 96% 34%, 88% 66%, 96% 92%, 42% 97%, 12% 76%, 5% 42%, 17% 12%);
}
.cell-c {
  width: clamp(78px, 13vw, 150px); aspect-ratio: 1;
  right: 26%; top: 12%; opacity: 0.55; animation-delay: -3s;
  clip-path: polygon(50% 3%, 84% 22%, 97% 55%, 74% 88%, 36% 96%, 8% 68%, 6% 30%, 26% 8%);
  filter: blur(1.5px);
}
.hero-copy { position: relative; z-index: 2; max-width: 34ch; }
.tag {
  display: inline-block; margin-bottom: 14px;
  font-size: 14px; letter-spacing: 0.3em; color: var(--neon);
  text-shadow: 0 0 18px rgba(0, 255, 65, 0.7);
}
.hero h1 {
  font-size: clamp(30px, 5.2vw, 60px);
  letter-spacing: 0.012em;
  margin: 0 0 0.5em;
  text-shadow: 0 22px 46px rgba(0, 0, 0, 0.55), 0 0 34px rgba(153, 255, 204, 0.28);
}
.lede { margin: 0 auto; max-width: 30ch; font-size: 17px; color: var(--text-dim); }

/* ---------- 主体 ---------- */
main {
  display: grid; grid-template-columns: 216px minmax(0, 1fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
  max-width: 1180px; margin: 0 auto;
  padding: 0 clamp(18px, 4vw, 48px) 90px;
}

.toc {
  position: sticky; top: 26px; align-self: start;
  padding: 18px 14px;
  background: linear-gradient(180deg, rgba(1, 42, 78, 0.62), rgba(0, 24, 46, 0.4));
  box-shadow: inset 0 0 0 1px var(--line-soft), 0 24px 44px -34px rgba(0, 255, 65, 0.8);
}
.toc small {
  display: block; font-size: 14px; letter-spacing: 0.26em; color: var(--neon);
}
.toc h2 { font-size: 23px; margin: 4px 0 12px; }
.toc ol { list-style: none; margin: 0; padding: 0; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a {
  display: flex; align-items: center; gap: 9px; min-height: 42px;
  font-size: 16px; color: var(--text-dim);
  border-bottom: 1px solid var(--line-soft);
}
.toc a::before {
  content: counter(t, decimal-leading-zero);
  font-size: 12px; letter-spacing: 0.06em; color: var(--neon); opacity: 0.8;
}
.toc a:hover { color: var(--neon); }

.prose { max-width: 74ch; min-width: 0; }
.prose > section {
  position: relative;
  margin: 0 0 clamp(18px, 2.6vw, 26px);
  padding: clamp(26px, 4vw, 44px);
  scroll-margin-top: 86px;
  background: linear-gradient(180deg, rgba(1, 42, 78, 0.62), rgba(0, 24, 46, 0.34));
  box-shadow: 0 30px 60px -38px rgba(0, 255, 65, 0.55), inset 0 0 0 1px var(--line-soft);
}
.prose > section::after {
  content: ''; position: absolute; left: clamp(26px, 4vw, 44px); top: 0;
  width: 54px; height: 2px; background: var(--neon); opacity: 0.85;
}
.prose small {
  display: block; margin-bottom: 8px;
  font-size: 14px; letter-spacing: 0.24em; color: var(--neon);
}
.prose h2 { font-size: clamp(24px, 3.2vw, 34px); margin-bottom: 0.45em; }
.prose h3 { font-size: clamp(20px, 2.4vw, 24px); margin-top: 1.5em; }
.prose p { margin: 0 0 1.05em; }
.prose ul, .prose ol { margin: 0 0 1.15em; padding-left: 1.3em; }
.prose li { margin: 0.35em 0; }
.prose li::marker { color: var(--neon); }
.prose a { border-bottom: 1px solid rgba(0, 255, 65, 0.5); }
.prose a:hover { border-bottom-color: var(--neon); }
.prose strong { color: var(--head); }
.prose blockquote {
  margin: 1.2em 0; padding: 12px 20px;
  border-left: 3px solid var(--neon); background: rgba(0, 255, 65, 0.07);
  color: var(--text);
}
.prose figure { margin: 1.2em 0; }
.prose img { width: 100%; height: auto; border: 1px solid var(--line); }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose table { width: 100%; border-collapse: collapse; margin: 1em 0; font-size: 16px; }
.prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em;
  background: rgba(153, 255, 204, 0.13); padding: 0.08em 0.35em;
}
.prose time { color: var(--neon); font-size: 15px; letter-spacing: 0.04em; }

/* ---------- 动效 ---------- */
.js .reveal {
  opacity: 0; transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .reveal.in { opacity: 1; transform: none; }

@keyframes breathe {
  0%, 100% { transform: scale(1) rotate(-5deg); }
  50% { transform: scale(1.045) rotate(-3deg); }
}
@keyframes rise {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(1, 42, 78, 0.55), rgba(0, 14, 28, 0.95));
  padding: clamp(36px, 6vw, 66px) clamp(18px, 4vw, 48px) 96px;
}
.foot-top {
  max-width: 1180px; margin: 0 auto 34px;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 28px;
}
.foot-brand {
  margin: 0; font-family: var(--f-head); font-size: clamp(24px, 3vw, 30px);
  color: var(--head);
}
.foot-desc { margin: 0; max-width: 52ch; color: var(--text-dim); font-size: 16px; }
.foot-cols {
  max-width: 1180px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 26px;
}
.foot dl { margin: 0; }
.foot dt { font-size: 14px; letter-spacing: 0.22em; color: var(--neon); margin-bottom: 8px; }
.foot dd { margin: 0; color: var(--text-dim); }
.foot ol { list-style: none; margin: 0; padding: 0; }
.foot-links a, .totop {
  display: inline-flex; align-items: center; min-height: 40px;
  font-size: 16px; color: var(--text-dim);
}
.foot-links a:hover, .totop:hover { color: var(--neon); }

.sub { display: flex; max-width: 330px; }
.sub input {
  flex: 1 1 auto; min-width: 0; min-height: 44px; padding: 0 12px;
  font: inherit; font-size: 16px; color: var(--head);
  background: rgba(0, 30, 60, 0.72); border: 1px solid var(--line);
}
.sub input::placeholder { color: rgba(217, 247, 234, 0.45); }
.sub input:focus { outline: 2px solid var(--neon); outline-offset: -2px; }
.sub button {
  min-height: 44px; padding: 0 18px; border: 0; cursor: pointer;
  background: var(--neon); color: var(--ink); font: inherit; font-weight: 600;
}
.sub button:hover { background: var(--mint); }

.copy {
  max-width: 1180px; margin: 30px auto 0; padding-top: 14px;
  border-top: 1px solid var(--line-soft);
  font-size: 15px; color: rgba(217, 247, 234, 0.55);
}

/* ---------- 断点 ---------- */
@media (max-width: 1000px) {
  :root { --rail: 138px; }
  main { grid-template-columns: 186px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  :root { --rail: 0px; }
  body { padding-left: 0; padding-top: 64px; }
  .rail {
    inset: 0 0 auto 0; width: auto; height: 64px;
    flex-direction: row; align-items: center; gap: 10px; padding: 8px 10px;
    border-right: 0; border-bottom: 1px solid var(--line);
    overflow: hidden;
  }
  .mark { width: 40px; height: 40px; }
  .mark svg { width: 26px; height: 26px; }
  .rail-list {
    flex-direction: row; gap: 4px; width: auto; flex: 1 1 auto;
    overflow-x: auto; overflow-y: hidden; padding-bottom: 2px;
    scrollbar-width: none;
  }
  .rail-list::-webkit-scrollbar { display: none; }
  .rail-list li { flex: 0 0 auto; }
  .rail-list a { white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .rail-list a:hover, .rail-list a:focus-visible { border-left: 0; border-bottom-color: var(--neon); }

  .hero { min-height: 0; padding: 42px 20px 56px; }
  .hero-copy { max-width: 26ch; }
  main { grid-template-columns: minmax(0, 1fr); padding-bottom: 120px; }
  .toc { position: static; }
  .toc ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
  .foot-cols { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .cta { min-height: 46px; padding: 0 18px; }
}

@media (max-width: 420px) {
  .hero h1 { font-size: clamp(28px, 8.4vw, 36px); }
  .cell-c { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rail-list li, .mark, .cta, .cell { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
