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

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

:root {
  --ink: #001e3c;
  --ink-deep: #00121f;
  --mint: #99ffcc;
  --neon: #00ff41;
  --paper: #e8fff6;
  --muted: #9ed9c5;
  --line: rgba(153, 255, 204, 0.2);
  --card: rgba(2, 42, 72, 0.66);
  --font: "Space Grotesk", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--paper);
  background:
    radial-gradient(70vw 55vw at 8% -12%, rgba(0, 255, 65, 0.16), transparent 62%),
    radial-gradient(60vw 45vw at 105% 22%, rgba(153, 255, 204, 0.13), transparent 68%),
    radial-gradient(80vw 60vw at 50% 110%, rgba(0, 255, 65, 0.1), transparent 70%),
    var(--ink);
  background-attachment: fixed;
  padding-bottom: 108px;
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--mint); text-decoration: none; }
a:hover { color: var(--neon); }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; border-radius: 4px; }

div[id] { scroll-margin-top: 28px; scroll-margin-bottom: 130px; }

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 60;
  padding: 8px clamp(10px, 3vw, 26px) calc(8px + env(safe-area-inset-bottom));
  background: rgba(0, 20, 36, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid rgba(153, 255, 204, 0.22);
  box-shadow: 0 -18px 40px -28px #000;
}

.dock-nav {
  max-width: 1120px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
}

.dock-side { display: flex; align-items: center; gap: 4px; min-width: 0; }
.dock-side.right { justify-content: flex-end; }

.dock-link,
.dock-group > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--paper);
  border: 1px solid transparent;
  white-space: nowrap;
  cursor: pointer;
  background: none;
  font-family: inherit;
  line-height: 1;
}

.dock-link:hover,
.dock-group > summary:hover {
  color: var(--neon);
  border-color: rgba(0, 255, 65, 0.42);
  background: rgba(0, 255, 65, 0.1);
}

.dock-brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-weight: 700;
  font-size: clamp(1rem, 2.3vw, 1.18rem);
  letter-spacing: 0.02em;
  color: var(--mint);
  text-shadow: 0 0 22px rgba(0, 255, 65, 0.45);
}
.dock-brand:hover { color: var(--neon); }

.dock-group { position: relative; }
.dock-group > summary { list-style: none; gap: 6px; }
.dock-group > summary::-webkit-details-marker { display: none; }
.dock-group > summary::after { content: "+"; font-size: 0.95rem; color: var(--neon); }
.dock-group[open] > summary::after { content: "–"; }
.dock-group[open] > summary { color: var(--neon); border-color: rgba(0, 255, 65, 0.5); background: rgba(0, 255, 65, 0.1); }

.dock-pop {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 0;
  min-width: 172px;
  display: grid;
  gap: 2px;
  padding: 8px;
  background: rgba(1, 30, 52, 0.98);
  border: 1px solid rgba(153, 255, 204, 0.3);
  border-radius: 10px;
  box-shadow: 0 26px 52px -22px #000;
}
.dock-side.right .dock-pop { left: auto; right: 0; }

.pop-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  color: var(--paper);
  font-size: 0.95rem;
}
.pop-link:hover { background: rgba(0, 255, 65, 0.13); color: var(--neon); }

/* ---------- 骨架 ---------- */
.shell {
  display: grid;
  grid-template-columns: minmax(0, 232px) minmax(0, 1fr);
  column-gap: clamp(24px, 3.4vw, 52px);
  align-items: start;
  max-width: 1300px;
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 56px);
}

/* ---------- hero ---------- */
.hero {
  grid-column: 1 / -1;
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  margin-inline: calc(-1 * clamp(16px, 4vw, 56px));
  padding: 72px clamp(16px, 4vw, 56px) 140px;
  display: grid;
  align-content: center;
  justify-items: end;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(rgba(153, 255, 204, 0.34) 1px, transparent 1px);
  background-size: 26px 26px;
  -webkit-mask-image: radial-gradient(72% 70% at 72% 42%, #000 12%, transparent 76%);
  mask-image: radial-gradient(72% 70% at 72% 42%, #000 12%, transparent 76%);
  opacity: 0.55;
}

.hero-mesh { position: absolute; inset: 0; z-index: 0; }
.hero-mesh i {
  position: absolute;
  display: block;
  border-radius: 58% 42% 46% 54% / 48% 54% 46% 52%;
  filter: blur(38px);
  opacity: 0.6;
  animation: breathe 12s ease-in-out infinite, morph 19s ease-in-out infinite;
}
.hero-mesh i:nth-child(1) {
  width: 46vw; height: 46vw; left: -8vw; top: 4vh;
  background: radial-gradient(circle at 40% 40%, rgba(0, 255, 65, 0.55), rgba(0, 30, 60, 0) 72%);
}
.hero-mesh i:nth-child(2) {
  width: 34vw; height: 34vw; right: 4vw; bottom: 6vh;
  background: radial-gradient(circle at 55% 45%, rgba(153, 255, 204, 0.5), rgba(0, 30, 60, 0) 70%);
  animation-delay: -4s, -7s;
}
.hero-mesh i:nth-child(3) {
  width: 26vw; height: 26vw; left: 32vw; bottom: 26vh;
  background: radial-gradient(circle at 50% 50%, rgba(0, 255, 65, 0.36), rgba(0, 30, 60, 0) 70%);
  animation-delay: -8s, -12s;
}

.hero-inner { position: relative; z-index: 1; text-align: right; max-width: 100%; }

.hero-title {
  margin: 0;
  font-size: clamp(2.6rem, 11vw, 8.4rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.035em;
  color: var(--mint);
  text-shadow: 0 0 46px rgba(0, 255, 65, 0.32);
  word-break: break-word;
}

.hero-loop {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 22px 0 0;
  font-size: clamp(1rem, 2.2vw, 1.28rem);
  letter-spacing: 0.12em;
  color: var(--muted);
}
.loop-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--neon);
  box-shadow: 0 0 14px var(--neon);
  animation: pulse 2.2s ease-in-out infinite;
  flex: none;
}
.loop-item { display: none; }
.loop-item.on { display: inline; }

/* ---------- 目录 ---------- */
.toc {
  grid-column: 1;
  position: sticky;
  top: 34px;
  padding-top: 56px;
  align-self: start;
}
.toc h2 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--muted);
}
.toc h2 > span { display: inline-block; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: toc;
  border-left: 1px solid var(--line);
}
.toc-list li { counter-increment: toc; }
.toc-list a {
  display: block;
  padding: 10px 10px 10px 13px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  color: var(--paper);
  font-size: 0.95rem;
  line-height: 1.4;
}
.toc-list a::before {
  content: counter(toc, decimal-leading-zero);
  margin-right: 9px;
  font-size: 0.72rem;
  color: var(--neon);
  letter-spacing: 0.06em;
}
.toc-list a:hover {
  color: var(--neon);
  border-left-color: var(--neon);
  background: rgba(0, 255, 65, 0.07);
}

/* ---------- 正文 ---------- */
.body { grid-column: 2; min-width: 0; padding-top: 56px; }

.body > div {
  position: relative;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: clamp(22px, 3.2vw, 44px);
  margin-bottom: 26px;
  box-shadow: 0 26px 48px -30px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(153, 255, 204, 0.08);
  backdrop-filter: blur(6px);
}
.body > div::before {
  content: "";
  position: absolute;
  right: -70px; bottom: -90px;
  width: 260px; height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 255, 65, 0.2), transparent 68%);
  filter: blur(24px);
  pointer-events: none;
}

.body h2 {
  margin: 0 0 0.65em;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--mint);
}
.body h2 > span { display: inline; }
.body h3 {
  margin: 1.5em 0 0.5em;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.3;
  color: var(--mint);
}
.body h3 > span { display: inline; }

.body p { margin: 0 0 1.1em; max-width: 66ch; }
.body p:last-child { margin-bottom: 0; }
.body ul, .body ol { margin: 0 0 1.1em; padding-left: 1.35em; }
.body li { margin: 0.36em 0; }
.body li::marker { color: var(--neon); }
.body strong { color: var(--neon); font-weight: 600; }
.body blockquote {
  margin: 1.4em 0;
  padding: 4px 0 4px 18px;
  border-left: 2px solid var(--neon);
  color: var(--muted);
}
.body table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 0.97rem; }
.body th, .body td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.body th { color: var(--mint); font-weight: 600; }
.body code {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(0, 255, 65, 0.12);
  color: var(--mint);
}
.body a { border-bottom: 1px solid rgba(0, 255, 65, 0.45); }
.body a:hover { border-bottom-color: var(--neon); }

/* ---------- 页脚 ---------- */
.foot {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 42px);
  max-width: 1300px;
  margin: 72px auto 0;
  padding: 46px clamp(16px, 4vw, 56px) 40px;
  border-top: 1px solid var(--line);
}

.foot-cta { grid-column: 1 / -1; }
.foot-cta a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(20px, 3vw, 34px);
  border-radius: 10px;
  border: 1px solid rgba(0, 255, 65, 0.32);
  background: linear-gradient(118deg, rgba(0, 255, 65, 0.18), rgba(153, 255, 204, 0.06));
  color: var(--mint);
  font-size: clamp(1.35rem, 4vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  box-shadow: 0 26px 50px -34px #000;
}
.foot-cta a:hover {
  color: var(--neon);
  border-color: var(--neon);
  background: linear-gradient(118deg, rgba(0, 255, 65, 0.28), rgba(153, 255, 204, 0.1));
}
.foot-cta i { font-style: normal; font-size: 0.9em; }

.foot h3 {
  margin: 0 0 16px;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
}
.foot h3 > span { display: inline-block; padding-bottom: 6px; border-bottom: 1px solid var(--line); }

.foot-brandname {
  display: block;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  color: var(--mint);
}
.foot-logo { max-height: 56px; width: auto; margin-bottom: 12px; }

.foot dl { margin: 0; }
.foot dt {
  margin: 14px 0 4px;
  font-size: 0.76rem;
  letter-spacing: 0.18em;
  color: var(--neon);
}
.foot dt:first-child { margin-top: 0; }
.foot dd { margin: 0; }
.foot dd a,
.foot-hotlist a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--paper);
  font-size: 0.97rem;
}
.foot dd a:hover,
.foot-hotlist a:hover { color: var(--neon); }

.foot-hotlist { list-style: none; margin: 0; padding: 0; }
.foot-hotlist li { margin: 0; }
.foot-hotlist li::before { content: "·"; color: var(--neon); margin-right: 8px; }

.foot-about p { margin: 0; color: var(--muted); font-size: 0.95rem; max-width: 34ch; }

.foot-base {
  grid-column: 1 / -1;
  text-align: center;
  padding-top: 26px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.9rem;
}
.foot-base p { margin: 0; }

/* ---------- 动效 ---------- */
@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
@keyframes morph {
  0%, 100% { border-radius: 58% 42% 46% 54% / 48% 54% 46% 52%; }
  50% { border-radius: 42% 58% 60% 40% / 55% 42% 58% 45%; }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.7); }
}

html.js .reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.75s cubic-bezier(0.2, 0.7, 0.3, 1);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .toc { grid-column: 1; position: static; padding-top: 40px; }
  .toc-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-left: 0; gap: 2px 12px; }
  .toc-list a { border-left: 2px solid var(--line); border-radius: 0; }
  .body { grid-column: 1; padding-top: 26px; }
  .foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  body { font-size: 16px; padding-bottom: 96px; }
  .dock-link, .dock-group > summary { padding: 0 9px; font-size: 0.9rem; }
  .dock-brand { font-size: 0.96rem; padding: 0 6px; }
  .dock-top { display: none; }
  .hero { padding-top: 56px; padding-bottom: 120px; }
  .foot { grid-template-columns: minmax(0, 1fr); padding-bottom: 26px; }
  .foot-cta a { font-size: 1.3rem; }
  .toc-list { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  html.js .reveal { opacity: 1; transform: none; }
}

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