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

:root {
  --lime: #80ff00;
  --flash: #00ff00;
  --ink: #1f2617;
  --paper: #f2ffd6;
  --rail: 14.5rem;
  --edge: clamp(1rem, 3vw, 3.2rem);
  --font: 'Outfit', system-ui, -apple-system, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  margin: 0;
  padding-left: var(--rail);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  background: var(--lime);
  color: var(--ink);
  overflow-x: clip;
  overflow-wrap: break-word;
}

img,
svg,
video {
  max-width: 100%;
  height: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .26;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='150' height='150'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='150' height='150' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--flash);
  outline-offset: 3px;
}

/* ---------- 左侧固定竖排导航 ---------- */
.rail {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--rail);
  max-width: 100%;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 0 0 1.2rem;
  background: var(--ink);
  color: var(--lime);
  overflow-y: auto;
  overflow-x: hidden;
}

.ticker {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 2.4rem;
  line-height: 2.4rem;
  overflow: hidden;
  background: var(--lime);
  color: var(--ink);
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .04em;
}

.ticker-track {
  display: inline-block;
  white-space: nowrap;
  padding-right: 1.4rem;
  animation: marq 18s linear infinite;
}

@keyframes marq {
  to { transform: translateX(-50%); }
}

.mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 3rem;
  height: 3rem;
  margin: 1.1rem 0 0 .9rem;
  background: var(--flash);
  color: var(--ink);
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
  box-shadow: 5px 5px 0 rgba(128, 255, 0, .85);
  transform: rotate(-6deg);
  animation: jitter 6s steps(2, end) infinite;
}

.mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@keyframes jitter {
  0%, 90%, 100% { transform: rotate(-6deg) translate(0, 0); }
  93% { transform: rotate(-2deg) translate(2px, -2px); }
  96% { transform: rotate(-9deg) translate(-2px, 1px); }
}

.rail nav {
  min-width: 0;
  padding: 0 .85rem;
}

.rail nav p {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .45rem;
}

.rail nav a {
  display: block;
  min-height: 42px;
  padding: .6rem .95rem;
  border-radius: 999px;
  color: var(--lime);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.rail nav a:hover,
.rail nav a:focus-visible,
.rail nav a.on {
  background: var(--lime);
  color: var(--ink);
  transform: rotate(-1.6deg);
}

/* ---------- 首屏 ---------- */
.hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .8fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding: clamp(2rem, 5vw, 4rem) var(--edge);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  min-width: 0;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.3rem, 6.4vw, 5.2rem);
  line-height: 1.06;
  font-weight: 900;
  letter-spacing: -.02em;
  transform: rotate(-1.2deg);
  text-wrap: balance;
  overflow-wrap: break-word;
}

.lede {
  margin: 0;
  max-width: 34ch;
  font-size: 1.125rem;
  font-weight: 500;
}

.hero-fig {
  margin: 0;
  min-width: 0;
  background: var(--ink);
  box-shadow: 14px 14px 0 rgba(31, 38, 23, .85);
  transform: rotate(2.6deg);
}

.hero-fig img {
  display: block;
  width: 100%;
  height: auto;
  filter: saturate(160%) contrast(1.05);
}

/* ---------- 左侧目录 + 正文 ---------- */
.stage {
  display: grid;
  grid-template-columns: 15rem minmax(0, 1fr);
  align-items: start;
  gap: clamp(1rem, 2.4vw, 2.6rem);
  padding: 0 var(--edge) 3rem;
}

.toc {
  position: sticky;
  top: 1rem;
  min-width: 0;
  padding: 1rem .9rem;
  background: var(--ink);
  color: var(--lime);
  transform: rotate(-.7deg);
}

.toc h2 {
  margin: 0 0 .5rem;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: .16em;
}

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

.toc a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: .45rem .4rem;
  color: var(--lime);
  text-decoration: none;
  font-size: 1rem;
  border-bottom: 1px dashed rgba(128, 255, 0, .35);
}

.toc a:hover,
.toc a:focus-visible,
.toc a.on {
  background: var(--lime);
  color: var(--ink);
}

.prose {
  display: grid;
  gap: 1.4rem;
  min-width: 0;
}

.prose > section {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  padding: clamp(1.3rem, 3vw, 2.6rem);
  background: var(--paper);
  box-shadow: 8px 8px 0 rgba(31, 38, 23, .16);
}

.prose > section:nth-child(even) {
  background: var(--ink);
  color: var(--paper);
  box-shadow: 8px 8px 0 rgba(0, 255, 0, .55);
}

.prose h2,
.prose h3 {
  margin: 0 0 .6rem;
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -.01em;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.prose h2 { font-size: clamp(1.5rem, 3.3vw, 2.1rem); }
.prose h3 { font-size: clamp(1.25rem, 2.5vw, 1.55rem); }

.prose h2 span,
.prose h3 span {
  background: var(--flash);
  color: var(--ink);
  padding: 0 .18em;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
}

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

.prose a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.prose ul,
.prose ol {
  margin: 0 0 1rem;
  padding-left: 1.3rem;
}

.prose li { margin-bottom: .4rem; }

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

.prose iframe {
  display: block;
  width: 100%;
  max-width: 100%;
}

.prose figure {
  margin: 1rem 0;
  max-width: 100%;
  transform: rotate(-1deg);
}

.prose blockquote {
  margin: 1rem 0;
  padding: .8rem 1rem;
  background: var(--flash);
  color: var(--ink);
  font-weight: 500;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
}

.prose th,
.prose td {
  padding: .5rem;
  text-align: left;
  border-bottom: 2px solid currentColor;
}

.prose pre {
  margin: 1rem 0;
  max-width: 100%;
  overflow-x: auto;
}

.prose code {
  font-family: ui-monospace, 'SFMono-Regular', monospace;
  background: rgba(31, 38, 23, .12);
  padding: .1em .3em;
  overflow-wrap: anywhere;
}

article[id] { scroll-margin-top: 2rem; }

/* ---------- 表单块 ---------- */
.outro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding: clamp(2rem, 4vw, 3.5rem) var(--edge);
  background: var(--ink);
  color: var(--lime);
}

.outro h2 {
  margin: 0;
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  line-height: 1.2;
  overflow-wrap: break-word;
}

.outro h2 span {
  background: var(--flash);
  color: var(--ink);
  padding: 0 .18em;
}

.signup {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
  min-width: 0;
}

.signup label {
  width: 100%;
  font-weight: 700;
  font-size: 1rem;
}

.signup input {
  flex: 1 1 11rem;
  min-width: 0;
  min-height: 48px;
  padding: .6rem .9rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 3px solid var(--lime);
  border-radius: 0;
}

.signup button {
  flex: 0 0 auto;
  min-height: 48px;
  padding: .6rem 1.4rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  color: var(--ink);
  background: var(--flash);
  border: 0;
  border-radius: 0;
  cursor: pointer;
  transform: rotate(-2deg);
  transition: transform .18s ease;
}

.signup button:hover { transform: rotate(1deg) scale(1.05); }

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 1.3rem;
  padding: 2.2rem var(--edge) 1.4rem;
  background: var(--ink);
  color: var(--lime);
  border-top: 7px solid var(--flash);
}

footer p {
  margin: 0;
  font-weight: 700;
  overflow-wrap: break-word;
}

footer p a {
  color: var(--lime);
  text-decoration: none;
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: .1rem;
  min-width: 0;
}

.foot-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: .3rem .55rem;
  border-bottom: 2px solid transparent;
}

.foot-links a:hover { border-bottom-color: var(--flash); }

footer small {
  grid-column: 1 / -1;
  display: block;
  padding-top: .9rem;
  border-top: 1px solid rgba(128, 255, 0, .3);
  font-size: 1rem;
  opacity: .85;
  overflow-wrap: break-word;
}

/* ---------- 滚动出现 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s cubic-bezier(.2, .8, .3, 1);
}

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

/* ---------- 移动端 ---------- */
@media (max-width: 900px) {
  body { padding-left: 0; }

  .rail {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    width: auto;
    max-width: 100vw;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: .3rem;
    padding: 0 0 .5rem;
    overflow: visible;
  }

  .ticker {
    flex: 1 1 100%;
    height: 2.2rem;
    line-height: 2.2rem;
  }

  .mark {
    width: 2.5rem;
    height: 2.5rem;
    margin: .5rem 0 .5rem .6rem;
    font-size: 1.3rem;
  }

  .rail nav {
    flex: 1 1 0;
    max-width: 100%;
    padding: 0 .5rem .35rem 0;
    overflow-x: auto;
  }

  .rail nav p {
    flex-direction: row;
    gap: .4rem;
  }

  .rail nav a {
    white-space: nowrap;
    padding: .5rem .85rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: calc(100svh - 7.5rem);
    padding: 1.6rem var(--edge) 2.4rem;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 9.4vw, 3.3rem);
    transform: none;
  }

  .hero-fig {
    transform: none;
    margin-right: 6px;
    box-shadow: 6px 6px 0 rgba(31, 38, 23, .8);
  }

  .stage {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 var(--edge) 2rem;
  }

  .toc {
    position: static;
    transform: none;
  }

  .toc ul {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .toc a {
    border-bottom: 0;
    padding: .4rem .5rem;
  }

  .prose > article {
    margin-right: 6px;
    box-shadow: 5px 5px 0 rgba(31, 38, 23, .16);
  }

  .prose > article:nth-child(even) {
    box-shadow: 5px 5px 0 rgba(0, 255, 0, .55);
  }

  .prose figure { transform: none; }

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

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

  article[id] { scroll-margin-top: 7.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ticker-track,
  .mark { animation: none; }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
    transition: none;
  }
  .signup button { transform: none; }
}

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