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

:root {
  --ink: #001e3c;
  --mint: #99ffcc;
  --neon: #00ff41;
  --paper: #dcf6ea;
  --line: rgba(153, 255, 204, 0.26);
  --line-soft: rgba(153, 255, 204, 0.15);
  --pad: clamp(1.1rem, 4vw, 2.6rem);
  --font-d: "Baloo 2", system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-b: "Comic Neue", system-ui, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

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

body {
  margin: 0;
  padding-bottom: 104px;
  font-family: var(--font-b);
  font-size: 1.0625rem;
  line-height: 1.78;
  color: var(--paper);
  background-color: var(--ink);
  background-image:
    radial-gradient(60vmax 55vmax at 10% -12%, rgba(0, 255, 65, 0.16), transparent 66%),
    radial-gradient(52vmax 48vmax at 92% 4%, rgba(153, 255, 204, 0.13), transparent 70%),
    radial-gradient(72vmax 60vmax at 48% 118%, rgba(0, 255, 65, 0.11), transparent 66%);
  background-attachment: fixed;
  overflow-x: hidden;
}

.menu-open body {
  overflow: hidden;
}

/* ---------- 底部固定条 ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.3rem;
  padding: 0.35rem clamp(0.45rem, 2vw, 1.2rem) calc(0.35rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(0, 30, 60, 0.7), rgba(0, 12, 26, 0.96));
  border-top: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.burger {
  position: relative;
  z-index: 80;
  width: 44px;
  height: 44px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
}

.burger span {
  display: block;
  width: 22px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.26s ease, opacity 0.2s ease;
}

.menu-open .burger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-open .burger span:nth-child(2) {
  opacity: 0;
}

.menu-open .burger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.2rem;
  min-width: 0;
}

.nav p {
  display: flex;
  gap: 0.1rem;
  margin: 0;
  padding: 0;
}

.nav-l {
  justify-content: flex-end;
}

.nav-r {
  justify-content: flex-start;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0.45rem 0.5rem;
  font-size: 1rem;
  color: var(--paper);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.nav a:hover,
.nav a:focus-visible {
  color: var(--neon);
}

.brand {
  padding: 0.45rem 0.75rem !important;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.06em;
  color: var(--mint) !important;
  text-shadow: 0 0 22px rgba(0, 255, 65, 0.42);
}

/* 全屏遮罩菜单（桌面同样生效） */
.menu-open .nav {
  position: fixed;
  inset: 0;
  z-index: 60;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 0.1rem;
  padding: 4rem 1.4rem 6.5rem;
  overflow-y: auto;
  background:
    radial-gradient(70vmax 60vmax at 50% 12%, rgba(0, 255, 65, 0.16), transparent 62%),
    radial-gradient(50vmax 40vmax at 80% 90%, rgba(153, 255, 204, 0.12), transparent 70%),
    #001e3c;
}

.menu-open .nav p {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
}

.menu-open .nav a {
  justify-content: center;
  width: 100%;
  min-height: 48px;
  font-size: 1.125rem;
}

.menu-open .brand {
  order: -1;
  justify-content: center;
  margin-bottom: 1rem;
  font-size: 1.7rem;
  text-align: center;
}

/* 搜索 */
.find {
  display: flex;
  align-items: center;
  gap: 0.1rem;
  min-width: 0;
}

.find input {
  width: clamp(78px, 13vw, 150px);
  min-width: 0;
  min-height: 42px;
  padding: 0.3rem 0.55rem;
  font: inherit;
  font-size: 1rem;
  color: var(--paper);
  background: rgba(153, 255, 204, 0.1);
  border: 1px solid var(--line);
  border-radius: 0;
}

.find input::placeholder {
  color: rgba(220, 246, 234, 0.62);
}

.find input:focus {
  outline: 2px solid var(--neon);
  outline-offset: 1px;
}

.find button {
  width: 42px;
  height: 42px;
  display: grid;
  place-content: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--mint);
  cursor: pointer;
}

/* ---------- 版心 ---------- */
main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 244px);
  gap: clamp(1.4rem, 4vw, 3.4rem);
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--pad);
}

.doc {
  min-width: 0;
  padding-bottom: 1.5rem;
}

.doc > article {
  position: relative;
  padding: clamp(1.8rem, 5vw, 3.2rem) 0;
  border-top: 1px dashed var(--line-soft);
  scroll-margin-top: 1.4rem;
}

.doc > article:first-child {
  border-top: 0;
}

.doc h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(1.4rem, 3.4vw, 2.05rem);
  line-height: 1.3;
  letter-spacing: 0.02em;
  color: var(--mint);
}

.doc h3 {
  margin: 1.6rem 0 0.5rem;
  font-family: var(--font-d);
  font-weight: 600;
  font-size: clamp(1.15rem, 2.4vw, 1.35rem);
  line-height: 1.4;
  color: var(--neon);
}

.doc hr,
.side hr {
  width: min(100%, 7rem);
  height: 2px;
  margin: 0 0 1.1rem;
  border: 0;
  background: linear-gradient(90deg, var(--neon), rgba(0, 255, 65, 0));
}

.doc p {
  margin: 0 0 1rem;
}

.doc ul,
.doc ol {
  margin: 0 0 1.1rem;
  padding-left: 1.25rem;
}

.doc li {
  margin: 0.35rem 0;
}

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

.doc strong {
  color: var(--mint);
}

.doc img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.1rem 0;
  border-radius: 0;
}

.doc blockquote {
  margin: 1.2rem 0;
  padding: 0.9rem 1.1rem;
  background: rgba(153, 255, 204, 0.09);
  border-left: 3px solid var(--neon);
  border-radius: 0;
  color: var(--paper);
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.1rem 0;
}

.doc th,
.doc td {
  padding: 0.55rem 0.6rem;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 70vh;
  padding: clamp(2.2rem, 8vh, 5rem) 0 clamp(1.6rem, 5vh, 3rem);
  overflow: clip;
  text-align: center;
}

.hero-in {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.6rem, 2vw, 1.5rem);
}

.hero-art {
  flex: 0 0 auto;
  width: clamp(54px, 12vw, 94px);
}

.hero-art .mark {
  display: block;
  width: 100%;
  height: auto;
  filter: drop-shadow(0 0 18px rgba(0, 255, 65, 0.5));
  animation: breathe 7.5s ease-in-out infinite;
}

.hero h1 {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(1.85rem, 6vw, 3.3rem);
  line-height: 1.22;
  letter-spacing: 0.02em;
  color: var(--mint);
  text-shadow: 0 0 34px rgba(0, 255, 65, 0.28);
  text-align: center;
}

.blob-field {
  position: absolute;
  inset: -12% -18%;
  z-index: 1;
  pointer-events: none;
  opacity: 0.6;
  filter: blur(46px);
  will-change: transform;
}

.blob-field i {
  position: absolute;
  display: block;
  border-radius: 48% 52% 44% 56% / 52% 46% 54% 48%;
}

.blob-field i:nth-child(1) {
  left: 6%;
  top: 10%;
  width: 34vmin;
  height: 34vmin;
  background: radial-gradient(circle at 34% 32%, rgba(153, 255, 204, 0.95), transparent 72%);
  animation: breathe 9s ease-in-out infinite;
}

.blob-field i:nth-child(2) {
  right: 4%;
  top: 22%;
  width: 28vmin;
  height: 28vmin;
  background: radial-gradient(circle at 40% 40%, rgba(0, 255, 65, 0.9), transparent 72%);
  animation: breathe 11s ease-in-out infinite reverse;
}

.blob-field i:nth-child(3) {
  left: 42%;
  bottom: 4%;
  width: 32vmin;
  height: 32vmin;
  background: radial-gradient(circle at 50% 44%, rgba(0, 255, 65, 0.65), transparent 74%);
  animation: breathe 13s ease-in-out infinite;
}

@keyframes breathe {
  0%,
  100% {
    transform: scale(1) translateY(0);
    opacity: 0.5;
  }
  50% {
    transform: scale(1.18) translateY(-14px);
    opacity: 0.9;
  }
}

/* ---------- 侧栏 ---------- */
.side {
  align-self: start;
  position: sticky;
  top: 2rem;
  padding: 1.6rem 0 2rem;
  border-top: 2px solid var(--line);
}

.side h2 {
  margin: 0 0 0.5rem;
  font-family: var(--font-d);
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--mint);
}

.toc {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: t;
}

.toc li {
  counter-increment: t;
  border-bottom: 1px dashed var(--line-soft);
}

.toc a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 42px;
  padding: 0.3rem 0;
  font-size: 0.98rem;
  line-height: 1.4;
  color: var(--paper);
  text-decoration: none;
  transition: color 0.2s ease;
}

.toc a::before {
  content: counter(t, decimal-leading-zero);
  flex: 0 0 auto;
  font-family: var(--font-d);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: var(--neon);
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--neon);
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.6rem;
  padding: clamp(1.6rem, 5vw, 2.8rem) var(--pad);
  border-top: 1px solid var(--line);
}

.foot p {
  margin: 0;
  font-family: var(--font-d);
  font-weight: 700;
  font-size: clamp(1.5rem, 7vw, 3.1rem);
  line-height: 1;
  letter-spacing: 0.03em;
  color: rgba(153, 255, 204, 0.82);
}

.foot small {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1rem;
  font-size: 0.95rem;
}

.foot small a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.1rem;
  color: var(--paper);
  text-decoration: none;
}

.foot small a:hover,
.foot small a:focus-visible {
  color: var(--neon);
}

/* ---------- 动效 ---------- */
.has-js .doc > article:not(.hero) {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.has-js .doc > article:not(.hero).in {
  opacity: 1;
  transform: none;
}

.doc > article.hit {
  background: rgba(0, 255, 65, 0.07);
  transition: background 0.5s ease;
}

/* ---------- 断点 ---------- */
@media (max-width: 1000px) {
  .nav p {
    display: none;
  }
}

@media (max-width: 900px) {
  main {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.2rem;
  }

  .side {
    position: static;
    order: 2;
    border-top: 1px solid var(--line);
    padding-top: 1.3rem;
  }

  .hero h1 {
    font-size: clamp(1.7rem, 7.6vw, 2.4rem);
  }

  .foot p {
    font-size: clamp(1.9rem, 9vw, 2.8rem);
  }
}

@media (max-width: 420px) {
  .find input {
    width: 74px;
  }

  .hero-in {
    flex-direction: column-reverse;
    gap: 0.7rem;
  }

  .hero-art {
    width: 52px;
  }
}

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

  .blob-field i,
  .hero-art .mark {
    animation: none;
  }

  .has-js .doc > article:not(.hero) {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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