:root {
  --bg: #001e3c;
  --mint: #99ffcc;
  --neon: #00ff41;
  --ink: #e8fff6;
  --dim: #8fc4b8;
  --line: rgba(153, 255, 204, 0.22);
  --line-2: rgba(0, 255, 65, 0.4);
  --r: 18px;
  --sans: 'Fira Sans', system-ui, -apple-system, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --mono: 'Fira Code', ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background-color: #001e3c;
  background-image:
    radial-gradient(760px 520px at 88% -8%, rgba(0, 255, 65, 0.16), transparent 68%),
    radial-gradient(680px 520px at 4% 104%, rgba(153, 255, 204, 0.13), transparent 70%),
    radial-gradient(rgba(153, 255, 204, 0.15) 1px, transparent 1.3px);
  background-size: auto, auto, 20px 20px;
  background-attachment: fixed, fixed, fixed;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  padding: 0 3rem 0 13rem;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: 0.01em;
  color: var(--ink);
}

a {
  color: var(--mint);
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  line-height: 1.28;
}

h1 {
  font-size: clamp(1.85rem, 4.6vw, 3rem);
}

h2 {
  font-size: clamp(1.28rem, 2.4vw, 1.7rem);
}

h3 {
  font-size: 1.1rem;
}

p {
  margin: 0 0 1em;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

small {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.32em;
  color: var(--neon);
}

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

/* 品牌图标 */
.mark {
  position: fixed;
  left: 1.1rem;
  top: 1.1rem;
  z-index: 50;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(0, 30, 60, 0.78);
  color: var(--mint);
  animation: breathe 7s ease-in-out infinite;
}

.mark:hover {
  color: var(--neon);
  border-color: var(--line-2);
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1);
    border-radius: 14px;
  }
  50% {
    transform: scale(1.07);
    border-radius: 22px;
  }
}

/* 左侧竖排胶囊导航 */
.side {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  width: 13rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 5.8rem 1rem 1.6rem;
  border-right: 1px solid var(--line);
  background: rgba(0, 24, 46, 0.72);
  backdrop-filter: blur(8px);
  overflow-y: auto;
  counter-reset: n;
}

.side a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.45rem 0.7rem 0.45rem 2.1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--mint);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  transition: background 0.25s, border-color 0.25s, color 0.25s, transform 0.25s;
}

.side a::before {
  counter-increment: n;
  content: counter(n, decimal-leading-zero);
  position: absolute;
  left: 0.7rem;
  font-size: 0.62rem;
  color: var(--dim);
}

.side a:hover,
.side a[aria-current='true'] {
  background: rgba(0, 255, 65, 0.14);
  border-color: var(--neon);
  color: #eafff2;
  transform: translateX(2px);
}

.side a:hover::before,
.side a[aria-current='true']::before {
  color: var(--neon);
}

/* 右侧固定主按钮 */
.cta {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 45;
  writing-mode: vertical-rl;
  padding: 1.3rem 0.6rem;
  min-width: 44px;
  background: var(--neon);
  color: #00230f;
  border-radius: 14px 0 0 14px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-decoration: none;
  animation: glow 6s ease-in-out infinite;
}

@keyframes glow {
  0%,
  100% {
    box-shadow: 0 0 0 rgba(0, 255, 65, 0);
  }
  50% {
    box-shadow: 0 0 22px rgba(0, 255, 65, 0.45);
  }
}

/* 版面 */
.wrap {
  max-width: 62rem;
  margin: 0 auto;
  padding: 3.2rem 1.6rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 2.4rem;
  align-items: start;
}

.hero {
  grid-column: 1 / -1;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  padding: 1.7rem 1.4rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--r) + 8px);
  background-image: radial-gradient(rgba(0, 255, 65, 0.22) 1px, transparent 1.4px);
  background-size: 17px 17px;
}

.hero h1 {
  text-shadow: 0 0 34px rgba(0, 255, 65, 0.2);
}

.lede {
  max-width: 46ch;
  margin: 0;
  color: var(--dim);
}

.hero-media {
  margin-top: 0.5rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

.hero-img {
  width: 100%;
  max-height: 38vh;
  object-fit: cover;
}

.body {
  min-width: 0;
}

.prose {
  max-width: 46rem;
}

.prose > section {
  position: relative;
  margin-bottom: 1.6rem;
  padding: 1.7rem 1.5rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: linear-gradient(170deg, rgba(0, 255, 65, 0.055), rgba(0, 30, 60, 0.34) 62%);
  scroll-margin-top: 1.6rem;
}

.prose > section::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r);
  pointer-events: none;
  background: radial-gradient(220px 130px at 100% 0%, rgba(0, 255, 65, 0.16), transparent 70%);
}

.prose h2,
.prose h3 {
  margin-bottom: 0.55rem;
}

.prose ul,
.prose ol {
  padding-left: 1.2rem;
}

.prose li {
  margin: 0.25rem 0;
}

.prose a {
  color: var(--neon);
  text-underline-offset: 3px;
}

.prose blockquote {
  margin: 1rem 0;
  padding: 0.8rem 1rem;
  border-left: 2px solid var(--neon);
  border-radius: 0 12px 12px 0;
  background: rgba(0, 255, 65, 0.07);
}

.prose img {
  border: 1px solid var(--line);
  border-radius: 14px;
  margin: 0.6rem 0;
}

main section[id] {
  scroll-margin-top: 1.6rem;
}

/* 右侧目录 */
.rail {
  position: sticky;
  top: 2rem;
  padding: 1.1rem 1rem 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: rgba(0, 26, 49, 0.78);
  backdrop-filter: blur(6px);
  counter-reset: m;
}

.rail h2 {
  font-size: 1.05rem;
  margin-bottom: 0.7rem;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.rail a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.4rem 0.3rem 1.9rem;
  border-radius: 10px;
  color: var(--dim);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s, background 0.2s;
}

.rail a::before {
  counter-increment: m;
  content: counter(m, decimal-leading-zero);
  position: absolute;
  left: 0.45rem;
  font-family: var(--mono);
  font-size: 0.62rem;
  color: rgba(153, 255, 204, 0.45);
}

.rail a:hover {
  color: var(--neon);
  background: rgba(0, 255, 65, 0.09);
}

/* 页脚 */
footer {
  max-width: 62rem;
  margin: 2.6rem auto 0;
  padding: 2.4rem 1.6rem 2rem;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 2rem 2.4rem;
}

footer > section {
  min-width: 0;
}

.big {
  margin: 0;
  font-family: var(--mono);
  font-size: clamp(2rem, 4.4vw, 3.3rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: transparent;
  -webkit-text-stroke: 1px rgba(153, 255, 204, 0.6);
}

footer nav dl {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

footer nav dt {
  margin: 0;
}

footer nav dd {
  margin: 0;
  display: none;
}

footer nav a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--mint);
  text-decoration: none;
  font-size: 0.9rem;
  border-bottom: 1px dashed rgba(153, 255, 204, 0.16);
}

footer nav a:hover {
  color: var(--neon);
}

.f-bar {
  grid-column: 1 / -1;
  margin-top: 0.4rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.6rem 1.4rem;
  font-size: 0.82rem;
  color: var(--dim);
}

.f-bar p {
  margin: 0;
}

.f-bar small {
  display: inline;
  margin: 0 0.45rem 0 0;
  font-size: 0.66rem;
}

.f-bar a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--mint);
  text-decoration: none;
}

/* 入场 */
.rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.7, 0.28, 1);
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .rv {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .mark,
  .cta {
    animation: none;
  }
}

@media (max-width: 900px) {
  body {
    padding: 0 0 5rem;
  }
  .mark {
    left: 0.7rem;
    top: 0.7rem;
    width: 40px;
    height: 40px;
  }
  .cta {
    display: none;
  }
  .side {
    inset: auto 0 0 0;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.5rem 0.6rem;
    border-right: 0;
    border-top: 1px solid var(--line);
    background: rgba(0, 22, 43, 0.94);
    backdrop-filter: blur(10px);
    overflow-x: auto;
    overflow-y: hidden;
  }
  .side a {
    flex: 0 0 auto;
    min-height: 44px;
    background: rgba(0, 255, 65, 0.05);
    font-size: 0.78rem;
  }
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
    padding: 3.8rem 1rem 2rem;
  }
  .hero {
    min-height: 0;
    padding: 1.2rem 1rem;
  }
  .rail {
    position: static;
    order: 3;
  }
  .prose > section {
    padding: 1.3rem 1rem 0.9rem;
  }
  footer {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.6rem;
    padding: 2rem 1rem 1.4rem;
  }
}

@media (max-width: 420px) {
  .big {
    font-size: 1.9rem;
  }
  .lede {
    font-size: 0.95rem;
  }
}

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