:root {
  --acid: #80ff00;
  --neon: #00ff00;
  --ink: #1f2617;
  --ink-deep: #101a0d;
  --paper: #f2f7e8;
  --moss: #2b3623;
  --mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Exo", system-ui, -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
}

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

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image: radial-gradient(rgba(128, 255, 0, 0.16) 1px, transparent 1.6px);
  background-size: 18px 18px;
  color: var(--paper);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.68;
  overflow-x: hidden;
}

img { max-width: 100%; }

/* ---------- 页头 ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  padding: 6px 16px;
  background: rgba(31, 38, 23, 0.94);
  border-bottom: 3px solid var(--acid);
  backdrop-filter: blur(6px);
}

.main-nav { flex: 1 1 auto; min-width: 0; }

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-li { position: relative; }

.nav-li.nav-r-first { margin-left: auto; }

.nav-a {
  display: flex;
  align-items: center;
  min-height: 46px;
  padding: 0 10px;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}

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

.nav-sub {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 50;
  display: none;
  min-width: 190px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--ink-deep);
  border: 2px solid var(--acid);
  border-radius: 4px;
  box-shadow: 6px 6px 0 rgba(0, 255, 0, 0.35);
}

.nav-li:hover .nav-sub,
.nav-li:focus-within .nav-sub { display: block; }

.nav-sub a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 12px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}

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

.brand {
  font-family: var(--mono);
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--acid);
  text-decoration: none;
  display: inline-block;
  transform: rotate(-2.5deg);
  text-shadow: 2px 2px 0 var(--ink-deep);
}

.site-head .brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) rotate(-2.5deg);
}

/* ---------- 头图 ---------- */

.hero {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 90svh;
  overflow: hidden;
  background: var(--ink-deep);
  isolation: isolate;
}

.hero__media {
  position: absolute;
  inset: -10% 0;
  z-index: 0;
  will-change: transform;
}

.hero__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(150%) contrast(1.08);
  opacity: 0.78;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(16, 26, 13, 0.7) 0%, rgba(16, 26, 13, 0.35) 45%, rgba(16, 26, 13, 0.9) 100%),
    repeating-linear-gradient(90deg, rgba(128, 255, 0, 0.09) 0 1px, transparent 1px 6px);
  mix-blend-mode: multiply;
}

.hero__dots {
  position: absolute;
  inset: 0;
  z-index: 2;
  background-image: radial-gradient(var(--acid) 1px, transparent 1.5px);
  background-size: 13px 13px;
  opacity: 0.4;
  mix-blend-mode: screen;
  pointer-events: none;
}

.hero__in {
  position: relative;
  z-index: 4;
  max-width: 22ch;
  padding: 30px 20px;
  text-align: center;
}

.hero__h1 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(2.1rem, 8.2vw, 4.8rem);
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
  text-shadow:
    3px 3px 0 var(--ink-deep),
    7px 7px 0 rgba(128, 255, 0, 0.6);
}

.hero__cta { margin: 28px 0 0; }

.hero__cta a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 24px;
  background: var(--neon);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  border-radius: 4px;
  transform: rotate(-1.6deg);
  box-shadow: 5px 5px 0 rgba(0, 0, 0, 0.55);
}

.hero__cta a:hover { background: var(--acid); transform: rotate(1deg); }

.sticker {
  position: absolute;
  top: 17%;
  left: 5%;
  z-index: 5;
  max-width: 62vw;
  padding: 9px 15px;
  background: var(--acid);
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-radius: 4px;
  box-shadow: 5px 6px 0 rgba(0, 0, 0, 0.5);
  transform: rotate(-7deg);
  animation: jitter 4.2s ease-in-out infinite;
}

.chip {
  position: absolute;
  z-index: 3;
  border-radius: 4px;
  mix-blend-mode: screen;
  pointer-events: none;
}

.chip--a {
  width: 90px;
  height: 34px;
  right: 9%;
  bottom: 19%;
  background: var(--neon);
  transform: rotate(8deg);
  opacity: 0.75;
}

.chip--b {
  width: 46px;
  height: 46px;
  left: 12%;
  bottom: 12%;
  background: var(--acid);
  transform: rotate(-14deg);
  opacity: 0.6;
}

@keyframes jitter {
  0%, 100% { transform: rotate(-7deg) translate(0, 0); }
  25% { transform: rotate(-5deg) translate(1px, -2px); }
  50% { transform: rotate(-8deg) translate(-1px, 1px); }
  75% { transform: rotate(-6deg) translate(2px, 1px); }
}

/* ---------- 主体骨架 ---------- */

.wrap-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  gap: 30px;
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: 54px 20px 76px;
}

.prose {
  background: var(--paper);
  color: #141c0f;
  border-radius: 4px;
  padding: clamp(20px, 4vw, 44px);
  box-shadow: 11px 11px 0 rgba(128, 255, 0, 0.28);
  counter-reset: sec;
  min-width: 0;
}

.prose > div {
  counter-increment: sec;
  padding: 36px 0 30px;
  border-top: 3px dashed #b6cfa1;
  scroll-margin-top: 96px;
}

.prose > div:first-child {
  border-top: 0;
  padding-top: 0;
}

.prose > div::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  color: #5d7a46;
}

.prose h2 {
  margin: 0 0 16px;
  font-size: clamp(1.35rem, 3.4vw, 1.85rem);
  line-height: 1.24;
  letter-spacing: -0.02em;
}

.prose h2 span {
  display: inline-block;
  padding: 2px 10px;
  background: var(--acid);
  color: var(--ink);
  border-radius: 4px;
  transform: rotate(-0.8deg);
  box-shadow: 4px 4px 0 var(--ink);
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 1.12rem;
  line-height: 1.35;
  color: #101a0a;
}

.prose p {
  margin: 0 0 15px;
  max-width: 66ch;
}

.prose ul,
.prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.prose li { margin: 0 0 7px; }

.prose a {
  color: #2b4a11;
  text-decoration: underline;
  text-decoration-color: var(--acid);
  text-decoration-thickness: 3px;
  text-underline-offset: 2px;
}

.prose a:hover { background: var(--neon); color: var(--ink); }

.prose strong {
  background: var(--acid);
  padding: 0 3px;
  border-radius: 2px;
}

.prose blockquote {
  margin: 18px 0;
  padding: 14px 18px;
  background: #e4f1cf;
  border-left: 6px solid var(--neon);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 0.95rem;
}

.prose img {
  display: block;
  height: auto;
  border-radius: 4px;
  margin: 16px 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0 0 18px;
}

.prose th,
.prose td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid #cfe0bb;
}

/* ---------- 侧栏 ---------- */

.rail {
  position: sticky;
  top: 78px;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.rail__t {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.18em;
  color: var(--acid);
}

.rail__t span {
  display: inline-block;
  padding-bottom: 3px;
  border-bottom: 2px solid var(--neon);
}

.rail__list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail__list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  background: var(--moss);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 0.95rem;
  line-height: 1.3;
  text-decoration: none;
  border-radius: 4px;
  transform: rotate(-0.4deg);
}

.rail__list li:nth-child(even) a { transform: rotate(0.5deg); }

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

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

.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  padding: 26px 20px 34px;
  background: var(--ink-deep);
  border-top: 4px solid var(--acid);
}

.f-brand { flex: 0 1 auto; }

.brand--foot { font-size: 1rem; }

.f-nav { flex: 1 1 240px; min-width: 0; }

.f-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.f-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0 10px;
  color: #cfe6b5;
  font-family: var(--mono);
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 4px;
}

.f-nav a:hover,
.f-nav a:focus-visible { background: var(--acid); color: var(--ink); }

.f-cta {
  flex: 1 1 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 14px;
  background: var(--acid);
  color: var(--ink);
  border-radius: 4px;
  transform: rotate(-0.7deg);
  box-shadow: 5px 5px 0 rgba(0, 255, 0, 0.28);
}

.f-cta__t {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.f-cta__t span {
  display: inline-block;
  border-bottom: 2px dashed var(--ink);
  padding-bottom: 1px;
}

.f-cta__a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 14px;
  background: var(--ink);
  color: var(--acid);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 0.92rem;
  text-decoration: none;
  border-radius: 4px;
  white-space: nowrap;
}

.f-cta__a:hover { background: var(--neon); color: var(--ink); }

.f-copy {
  flex: 0 1 auto;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: #8fa87c;
}

/* ---------- 动效 ---------- */

html.js .prose > div {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js .prose > div.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */

@media (max-width: 940px) {
  .site-head {
    flex-wrap: wrap;
    justify-content: center;
    padding: 6px 10px;
  }

  .site-head .brand {
    position: static;
    order: -1;
    width: 100%;
    padding: 4px 0;
    text-align: center;
    transform: rotate(-2deg);
  }

  .main-nav { flex: 1 1 100%; }

  .nav-list {
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
  }

  .nav-li.nav-r-first { margin-left: 0; }

  .nav-a {
    min-height: 42px;
    padding: 0 9px;
    font-size: 0.9rem;
  }

  .nav-sub { display: none; }

  .wrap-main {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
    padding: 34px 14px 56px;
  }

  .rail { position: static; }

  .rail__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rail__list a { font-size: 0.9rem; }

  .site-foot { gap: 12px; }

  .f-copy { width: 100%; }
}

@media (max-width: 520px) {
  .hero { min-height: 84svh; }

  .sticker {
    top: 84px;
    left: 4%;
    font-size: 0.74rem;
  }

  .chip--a,
  .chip--b { display: none; }

  .prose > div { padding: 28px 0 24px; }

  .rail__list { grid-template-columns: minmax(0, 1fr); }
}

@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}
