:root {
  --lime: #87ff71;
  --amber: #ffce5c;
  --ink: #192617;
  --ink-deep: #0e160d;
  --paper: #f1fbe8;
  --muted: #c2d5b8;
  --line: rgba(135, 255, 113, 0.34);
  --glass: rgba(20, 33, 19, 0.62);
  --maxw: 1180px;
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Space Grotesk', system-ui, -apple-system, 'Segoe UI', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(rgba(135, 255, 113, 0.17) 1px, transparent 1.6px);
  background-size: 22px 22px;
}

body::after {
  content: "";
  position: fixed;
  right: -16vw;
  bottom: -12vw;
  z-index: 0;
  width: 62vw;
  height: 62vw;
  pointer-events: none;
  background: radial-gradient(circle, rgba(255, 206, 92, 0.14) 0 34%, transparent 72%);
}

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

a {
  color: var(--lime);
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  z-index: 90;
  padding: 12px 18px;
  background: var(--lime);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.skip-link:focus {
  left: 8px;
  top: 8px;
}

/* ---------- 顶栏 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 22, 13, 0.9);
  border-bottom: 3px solid var(--lime);
  backdrop-filter: blur(10px);
}

.masthead-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 4px 14px 4px 4px;
  border: 2px solid var(--lime);
  background: rgba(135, 255, 113, 0.1);
  color: var(--paper);
  text-decoration: none;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.06em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--lime);
  color: var(--ink);
  flex: 0 0 auto;
}

.brand-mark:empty::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--ink);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
}

.brand:hover .brand-name {
  color: var(--amber);
}

.top-nav {
  margin-left: auto;
  max-width: 100%;
}

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

.top-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 3px dashed transparent;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--amber);
  color: var(--ink);
  border-bottom-color: var(--ink);
}

/* ---------- 版心 ---------- */

main {
  position: relative;
  z-index: 1;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 18px 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 272px;
  gap: 34px;
  align-items: start;
}

.stage {
  min-width: 0;
}

/* ---------- 首屏 ---------- */

.hero {
  position: relative;
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  align-content: center;
  align-items: center;
  gap: 26px;
  padding: 48px 0 36px;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  right: 24%;
  top: 6%;
  z-index: 0;
  width: 210px;
  height: 210px;
  background: rgba(135, 255, 113, 0.1);
  clip-path: polygon(0 0, 100% 16%, 84% 100%, 10% 86%);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  left: -30px;
  bottom: 8%;
  z-index: 0;
  width: 180px;
  height: 12px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 10px, transparent 10px 22px);
  transform: rotate(-2deg);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  animation: rise 0.7s cubic-bezier(0.2, 0.9, 0.3, 1) both;
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7.6vw, 5rem);
  line-height: 0.99;
  font-weight: 700;
  letter-spacing: -0.03em;
  transform: rotate(-1.4deg);
  transform-origin: left top;
  text-shadow: 5px 5px 0 rgba(255, 206, 92, 0.24);
}

.subtitle {
  max-width: 54ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.72;
}

.hero .subtitle {
  border-left: 7px solid var(--amber);
  padding-left: 15px;
}

.hero-art {
  position: relative;
  z-index: 1;
  min-height: 220px;
  will-change: transform;
}

.hero-img {
  display: block;
  width: 100%;
  height: auto;
  border: 3px solid var(--lime);
}

.shape {
  position: absolute;
  display: block;
}

.sh-tri {
  top: 4px;
  left: 0;
  width: 104px;
  height: 104px;
  background: var(--amber);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  transform: rotate(9deg);
}

.sh-circle {
  top: 122px;
  right: -8px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--lime);
  mix-blend-mode: screen;
}

.sh-sq {
  left: 10px;
  bottom: 4px;
  width: 88px;
  height: 88px;
  border: 2px solid var(--paper);
  background: repeating-linear-gradient(45deg, var(--paper) 0 3px, transparent 3px 10px);
}

.sh-wave {
  right: 0;
  bottom: 16px;
  width: 118px;
  height: 26px;
}

/* ---------- 正文 ---------- */

.prose {
  position: relative;
  margin-top: 22px;
  padding: 6px 28px 36px;
  background: var(--glass);
  border: 2px dashed var(--line);
  border-top: 7px solid var(--lime);
  backdrop-filter: blur(8px);
  overflow-wrap: break-word;
}

.prose > article {
  padding: 36px 0 8px;
  scroll-margin-top: 104px;
}

.prose > article + article {
  border-top: 2px dotted rgba(255, 206, 92, 0.42);
}

.prose h2 {
  margin: 0 0 16px;
  padding-bottom: 10px;
  font-size: clamp(1.45rem, 3.3vw, 2rem);
  line-height: 1.22;
  letter-spacing: -0.01em;
  border-bottom: 2px dashed rgba(255, 206, 92, 0.36);
}

.prose h3 {
  margin: 28px 0 10px;
  font-size: 1.2rem;
  line-height: 1.35;
  color: var(--amber);
}

.prose p {
  margin: 0 0 15px;
}

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

.prose a:hover {
  background: var(--lime);
  color: var(--ink);
  text-decoration: none;
}

.prose ul,
.prose ol {
  margin: 0 0 18px;
  padding-left: 1.4em;
}

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

.prose li::marker {
  color: var(--amber);
  font-weight: 700;
}

.prose strong {
  color: var(--amber);
}

.prose blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 7px solid var(--amber);
  background: rgba(255, 206, 92, 0.09);
}

.prose blockquote p:last-child {
  margin-bottom: 0;
}

.prose img {
  height: auto;
  border: 2px solid var(--lime);
}

.prose hr {
  margin: 28px 0;
  border: 0;
  border-top: 2px dashed var(--line);
}

.prose table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 16px;
}

.prose th,
.prose td {
  padding: 9px 11px;
  border: 1px dashed var(--line);
  text-align: left;
}

.prose th {
  background: rgba(135, 255, 113, 0.12);
  color: var(--amber);
}

.prose code {
  padding: 1px 5px;
  font-size: 15px;
  background: rgba(135, 255, 113, 0.16);
}

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

.rail {
  position: sticky;
  top: 104px;
  margin-top: 22px;
  padding: 20px 18px 18px;
  background: rgba(255, 206, 92, 0.09);
  border: 2px solid var(--amber);
  backdrop-filter: blur(6px);
}

.rail h2 {
  margin: 0;
  font-size: 1.06rem;
  letter-spacing: 0.22em;
  font-weight: 700;
}

.rail .subtitle {
  margin: 6px 0 16px;
  max-width: none;
  font-size: 16px;
}

.rail-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: railc;
}

.rail-list li {
  counter-increment: railc;
}

.rail-list a {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-height: 42px;
  padding: 7px 9px;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  border-left: 4px solid rgba(135, 255, 113, 0.55);
}

.rail-list a::before {
  content: counter(railc, decimal-leading-zero);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--amber);
}

.rail-list a:hover,
.rail-list a:focus-visible {
  background: var(--lime);
  color: var(--ink);
  border-left-color: var(--ink);
}

.rail-flag {
  display: block;
  height: 10px;
  margin-top: 16px;
  background: repeating-linear-gradient(90deg, var(--lime) 0 9px, transparent 9px 18px);
}

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

footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 26px;
  margin-top: 40px;
  padding: 42px 18px 0;
  max-width: 100%;
  background: var(--ink-deep);
  border-top: 7px solid var(--lime);
}

footer > article {
  min-width: 0;
  padding-top: 14px;
  border-top: 3px solid rgba(135, 255, 113, 0.42);
}

.f-cap {
  margin: 0 0 12px;
  font-size: 16px;
  letter-spacing: 0.24em;
  color: var(--amber);
}

.f-logo {
  margin: 0 0 12px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.f-flag {
  display: block;
  width: 72px;
  height: 10px;
  margin-top: 14px;
  background: repeating-linear-gradient(90deg, var(--amber) 0 7px, transparent 7px 14px);
}

.f-nav ol {
  margin: 0;
  padding: 0;
  list-style: none;
  columns: 2;
  column-gap: 12px;
}

.f-nav li {
  break-inside: avoid;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 1px dashed transparent;
}

.f-nav a:hover,
.f-nav a:focus-visible {
  color: var(--lime);
  border-bottom-color: var(--lime);
}

.f-host {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  word-break: break-all;
}

.sub-form {
  display: grid;
  gap: 10px;
}

.sub-form input {
  min-height: 46px;
  padding: 10px 12px;
  font: inherit;
  font-size: 16px;
  color: var(--paper);
  background: rgba(135, 255, 113, 0.09);
  border: 2px solid var(--line);
  border-radius: 0;
}

.sub-form input::placeholder {
  color: #a3ba9c;
}

.sub-form button {
  min-height: 46px;
  padding: 10px 18px;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
  background: var(--lime);
  border: 2px solid var(--lime);
  border-radius: 0;
  cursor: pointer;
}

.sub-form button:hover,
.sub-form button:focus-visible {
  background: var(--amber);
  border-color: var(--amber);
}

.f-bar {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 28px -18px 0;
  padding: 16px 18px 22px;
  border-top: 2px dashed rgba(255, 206, 92, 0.4);
}

.copy {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
}

.to-top {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 16px;
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  background: var(--amber);
  text-decoration: none;
}

.to-top:hover,
.to-top:focus-visible {
  background: var(--lime);
}

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

.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.65s cubic-bezier(0.2, 0.9, 0.3, 1);
}

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

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

@media (max-width: 1080px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 244px;
    gap: 26px;
  }
  footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 880px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 46px;
  }
  .rail {
    position: static;
    order: 2;
    margin-top: 4px;
  }
  .top-nav {
    width: 100%;
    margin-left: 0;
  }
  .nav-list {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .top-nav a {
    white-space: nowrap;
  }
  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 84svh;
    padding-top: 32px;
  }
  .hero-art {
    min-height: 168px;
    max-width: 300px;
  }
  .prose {
    padding: 6px 18px 28px;
  }
  .prose > article {
    scroll-margin-top: 148px;
  }
}

@media (max-width: 560px) {
  footer {
    grid-template-columns: minmax(0, 1fr);
    padding-top: 34px;
  }
  .f-nav ol {
    columns: 1;
  }
  .hero h1 {
    font-size: clamp(2.1rem, 11vw, 3rem);
  }
  .hero::before {
    right: 0;
    width: 150px;
    height: 150px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .hero-copy {
    animation: none;
  }
  .hero h1 {
    transform: none;
  }
  .js .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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