@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root {
  --mint: #99ffcc;
  --neon: #00ff41;
  --ink: #001e3c;
  --ink-2: #00294f;
  --text: #eafff5;
  --muted: #a5d5c5;
  --r: 28px;
  --pad: clamp(16px, 3.2vw, 46px);
  --rail: 248px;
  --font-head: "Lexend Mega", "Public Sans", system-ui, sans-serif;
  --font-body: "Public Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

html {
  scroll-behavior: smooth;
  background: var(--ink);
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.8;
  color: var(--text);
  background:
    radial-gradient(62vw 62vw at 84% -8%, rgba(0, 255, 65, 0.16), transparent 62%),
    radial-gradient(58vw 58vw at 8% 106%, rgba(153, 255, 204, 0.14), transparent 60%),
    var(--ink);
  background-attachment: fixed;
  overflow-x: clip;
  overflow-wrap: break-word;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--neon);
  outline-offset: 3px;
  border-radius: 14px;
}

/* ---------- 左侧竖排主导航 ---------- */

.hdr {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 24px 16px 28px;
  background: linear-gradient(172deg, rgba(0, 41, 79, 0.97), rgba(0, 26, 52, 0.99));
  backdrop-filter: blur(10px);
  border-radius: 0 44px 44px 0;
  z-index: 30;
  overflow-y: auto;
}

.hdr::before {
  content: "";
  position: absolute;
  inset: auto -30% -12% -30%;
  height: 220px;
  background: radial-gradient(closest-side, rgba(0, 255, 65, 0.34), transparent 76%);
  filter: blur(28px);
  pointer-events: none;
  animation: breathe 11s ease-in-out infinite;
}

.brand {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  padding: 8px 12px;
  border-radius: 18px;
  background: var(--mint);
  color: var(--ink);
  text-decoration: none;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-align: center;
}

.brand img {
  display: block;
  width: 26px;
  height: 26px;
  border-radius: 9px;
}

.nav {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.nav p {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  min-width: 0;
}

.nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 13px;
  border-radius: 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  transition: background 0.24s ease, color 0.24s ease, transform 0.24s ease;
}

.nav a:hover,
.nav a:focus-visible {
  background: var(--neon);
  color: var(--ink);
  transform: translateX(4px);
}

.burger {
  display: none;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 18px;
  border: 0;
  border-radius: 16px;
  background: var(--mint);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

/* ---------- 主区 ---------- */

main {
  margin-left: var(--rail);
  max-width: 1160px;
  padding: 0 var(--pad);
}

.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
  padding: clamp(48px, 9vh, 96px) 0 clamp(36px, 6vh, 64px);
  overflow: clip;
}

.hero > *:not(.blobs) {
  position: relative;
  z-index: 1;
}

.blobs {
  position: absolute;
  inset: -6% 0 auto auto;
  right: 0;
  width: min(52vw, 520px);
  aspect-ratio: 1 / 1;
  filter: blur(46px);
  opacity: 0.75;
  pointer-events: none;
}

.blobs span {
  position: absolute;
  display: block;
  border-radius: 50%;
  mix-blend-mode: screen;
  animation: breathe 9s ease-in-out infinite;
}

.blobs span:nth-child(1) {
  inset: 0 auto auto 0;
  width: 62%;
  height: 62%;
  background: radial-gradient(circle at 42% 42%, rgba(0, 255, 65, 0.92), rgba(0, 255, 65, 0) 70%);
}

.blobs span:nth-child(2) {
  inset: auto 0 0 auto;
  width: 72%;
  height: 72%;
  background: radial-gradient(circle at 50% 50%, rgba(153, 255, 204, 0.85), rgba(153, 255, 204, 0) 70%);
  animation-delay: -3s;
}

.blobs span:nth-child(3) {
  inset: 32% auto auto 38%;
  width: 46%;
  height: 46%;
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.6), rgba(0, 255, 65, 0) 68%);
  animation-delay: -6s;
}

.badge {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 8px 20px;
  border-radius: 999px;
  background: var(--neon);
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.14em;
  animation: breathe 6s ease-in-out infinite;
}

.hero h1 {
  margin: 0;
  max-width: 22ch;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(2rem, 5.4vw, 3.9rem);
  line-height: 1.1;
  letter-spacing: 0.005em;
  color: #ffffff;
  text-wrap: balance;
}

.lead {
  margin: 0;
  max-width: 56ch;
  color: var(--mint);
  font-size: clamp(17px, 1.5vw, 19px);
  line-height: 1.75;
}

.hero-fig {
  position: relative;
  margin: 10px 0 0;
  flex: none;
  height: clamp(200px, 33vh, 350px);
  border-radius: var(--r);
  overflow: hidden;
  background:
    radial-gradient(70% 120% at 18% 12%, rgba(0, 255, 65, 0.58), transparent 62%),
    radial-gradient(64% 110% at 86% 88%, rgba(153, 255, 204, 0.5), transparent 58%),
    var(--ink-2);
  animation: breathe 13s ease-in-out infinite;
}

.hero-fig img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-fig::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 30, 60, 0.06), rgba(0, 30, 60, 0.55));
  pointer-events: none;
}

/* ---------- 正文 + 右侧目录 ---------- */

.sheet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 264px;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  padding: clamp(20px, 4vh, 48px) 0 84px;
}

.body {
  min-width: 0;
}

.body > section {
  margin: 0 0 22px;
  padding: clamp(20px, 3vw, 36px);
  border-radius: var(--r);
  background: rgba(153, 255, 204, 0.075);
  scroll-margin-top: 26px;
  animation: rise 0.6s both;
}

.body > section:nth-child(2) { animation-delay: 0.05s; }
.body > section:nth-child(3) { animation-delay: 0.1s; }
.body > section:nth-child(4) { animation-delay: 0.15s; }
.body > section:nth-child(5) { animation-delay: 0.2s; }
.body > section:nth-child(6) { animation-delay: 0.25s; }
.body > section:nth-child(7) { animation-delay: 0.3s; }

.body :is(h2, h3, h4) {
  margin: 0 0 14px;
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.15rem, 2.1vw, 1.45rem);
  line-height: 1.3;
  color: #ffffff;
}

.body h2 {
  font-size: clamp(1.3rem, 2.8vw, 1.85rem);
}

.body :is(h2, h3, h4) span {
  display: inline-block;
}

.body p {
  margin: 0 0 16px;
}

.body > section > :last-child {
  margin-bottom: 0;
}

.body :is(ul, ol) {
  margin: 0 0 16px;
  padding-left: 1.2em;
}

.body li {
  margin: 0 0 9px;
  line-height: 1.75;
}

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

.body a:hover {
  color: var(--mint);
}

.body strong,
.body b {
  color: #ffffff;
}

.body blockquote {
  margin: 0 0 16px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(0, 255, 65, 0.12);
  color: var(--mint);
}

.body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 20px;
}

.body :is(table, pre) {
  max-width: 100%;
  overflow-x: auto;
}

.body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 16px;
}

.body :is(th, td) {
  padding: 10px 12px;
  text-align: left;
  background: rgba(153, 255, 204, 0.08);
  overflow-wrap: break-word;
}

.body code {
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(0, 255, 65, 0.14);
  font-size: 15px;
  overflow-wrap: break-word;
}

.side {
  position: sticky;
  top: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 16px 22px;
  border-radius: var(--r);
  background: var(--mint);
  color: var(--ink);
}

.side-h {
  margin: 0;
  font-family: var(--font-head);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.side-h span {
  display: block;
}

.side-h a {
  display: flex;
  align-items: center;
  min-height: 42px;
  color: var(--ink);
  text-decoration: none;
  transition: transform 0.2s ease;
}

.side-h a:hover {
  transform: translateX(3px);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.toc li {
  animation: rise 0.5s both;
}

.toc li:nth-child(2) { animation-delay: 0.04s; }
.toc li:nth-child(3) { animation-delay: 0.08s; }
.toc li:nth-child(4) { animation-delay: 0.12s; }
.toc li:nth-child(5) { animation-delay: 0.16s; }
.toc li:nth-child(6) { animation-delay: 0.2s; }
.toc li:nth-child(7) { animation-delay: 0.24s; }

.toc a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 11px;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  font-size: 16px;
  line-height: 1.4;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.toc a:hover,
.toc a:focus-visible {
  background: var(--ink);
  color: var(--mint);
  transform: translateX(3px);
}

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

.foot {
  margin-left: var(--rail);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px;
  padding: 24px var(--pad) 36px;
  color: var(--muted);
  font-size: 16px;
}

.foot p {
  margin: 0;
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--mint);
}

.foot small {
  font-size: 16px;
}

@keyframes breathe {
  0%, 100% { transform: scale(0.88); opacity: 0.55; }
  50% { transform: scale(1.1); opacity: 0.92; }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 窄屏 ---------- */

@media (max-width: 900px) {
  .hdr {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 0 0 26px 26px;
    overflow: visible;
  }

  .hdr::before {
    display: none;
  }

  .brand {
    font-size: 17px;
    min-height: 44px;
    padding: 8px 14px;
    flex: 0 1 auto;
    min-width: 0;
  }

  .burger {
    display: inline-flex;
    flex: none;
  }

  .nav {
    flex: 1 1 100%;
    order: 3;
  }

  .nav p {
    display: none;
  }

  .hdr.is-open .nav p {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding-bottom: 8px;
  }

  .nav a {
    min-height: 44px;
    min-width: 0;
  }

  main,
  .foot {
    margin-left: 0;
    max-width: 100%;
  }

  main {
    padding: 0 14px;
  }

  .hero {
    min-height: auto;
    padding: 34px 0 26px;
    gap: 14px;
  }

  .blobs {
    width: min(64vw, 300px);
    right: 0;
  }

  .hero-fig {
    height: clamp(170px, 27vh, 240px);
  }

  .sheet {
    grid-template-columns: 1fr;
    padding-bottom: 56px;
  }

  .side {
    position: static;
    order: 2;
  }

  .body > section {
    scroll-margin-top: 92px;
  }

  .body table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .foot {
    padding: 22px 16px 32px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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