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

:root {
  --neon: #87ff71;
  --mustard: #ffce5c;
  --ink: #192617;
  --ink2: #1e2f1d;
  --paper: #eef7e6;
  --mute: #a2bd9a;
  --line: #3f5c3b;
}

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

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

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--ink);
  background-image: radial-gradient(rgba(135, 255, 113, 0.13) 1px, transparent 1.6px);
  background-size: 16px 16px;
  color: var(--paper);
  font-family: 'IBM Plex Sans', -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.68;
  letter-spacing: 0.012em;
}

body.menu-open {
  overflow: hidden;
}

/* ---------- 顶部两行：品牌行在上 ---------- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 18px;
  background: var(--ink);
  border-bottom: 3px dashed var(--line);
}

.brand {
  display: inline-block;
  padding: 8px 0;
  color: var(--neon);
  text-decoration: none;
  font-weight: 700;
  font-size: clamp(1.28rem, 4.6vw, 1.72rem);
  letter-spacing: 0.16em;
  line-height: 1.2;
}

.brand::after {
  content: '';
  display: block;
  height: 6px;
  margin-top: 5px;
  background: var(--mustard);
  clip-path: polygon(0 0, 100% 34%, 100% 100%, 0 66%);
}

.menu-btn {
  min-height: 46px;
  padding: 0 18px;
  background: var(--mustard);
  color: var(--ink);
  border: 3px solid var(--neon);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
  transform: rotate(-2deg);
  transition: transform 0.18s ease, background 0.18s ease;
}

.menu-btn:hover,
.menu-btn:focus-visible {
  transform: rotate(1.5deg) translateY(-2px);
  background: var(--neon);
}

/* ---------- 全屏遮罩菜单 ---------- */

.menu-shell {
  position: fixed;
  inset: 0;
  z-index: 60;
  padding: 18px;
  overflow-y: auto;
  background-color: var(--ink);
  background-image: repeating-linear-gradient(-45deg, transparent 0 14px, rgba(255, 206, 92, 0.09) 14px 15px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.menu-shell[data-open='true'] {
  opacity: 1;
  visibility: visible;
}

.menu-close {
  min-height: 46px;
  padding: 0 18px;
  float: right;
  background: transparent;
  color: var(--neon);
  border: 3px solid var(--neon);
  border-radius: 10px;
  font: inherit;
  font-weight: 700;
  letter-spacing: 0.18em;
  cursor: pointer;
}

.menu-close:hover,
.menu-close:focus-visible {
  background: var(--neon);
  color: var(--ink);
}

.menu {
  clear: both;
  max-width: 760px;
  margin: 0 auto;
  padding-top: 18px;
}

.menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: mn;
}

.menu-list li {
  counter-increment: mn;
  border-bottom: 3px dotted var(--line);
}

.menu-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 54px;
  padding: 12px 4px;
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(1.14rem, 4.4vw, 1.5rem);
  letter-spacing: 0.02em;
}

.menu-list a::before {
  content: counter(mn, decimal-leading-zero);
  flex: none;
  padding: 2px 7px;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--mustard);
  border: 2px solid var(--mustard);
  border-radius: 6px;
  transform: rotate(-3deg);
}

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

/* ---------- 主栅格 ---------- */

.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 252px;
  gap: 28px;
  align-items: start;
  max-width: 1140px;
  margin: 0 auto;
  padding: 16px 18px 0;
}

.doc {
  min-width: 0;
}

.doc > section {
  position: relative;
  padding: 26px 0;
  border-top: 3px dotted var(--line);
  scroll-margin-top: 98px;
}

.doc > section:first-child {
  border-top: 0;
  padding-top: 8px;
}

/* ---------- Hero：左图右文，斜切色带 ---------- */

.doc > .hero {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 20px;
  align-items: center;
  min-height: 45vh;
  padding-top: 6px;
  padding-bottom: 38px;
}

.hero::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 8px;
  height: 13px;
  background: var(--neon);
  clip-path: polygon(0 82%, 100% 0, 100% 100%, 0 100%);
}

.hero-figure {
  min-height: 168px;
  border: 3px dashed var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: repeating-linear-gradient(45deg, var(--ink2) 0 12px, transparent 12px 24px);
}

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

.hero-copy {
  position: relative;
  padding-right: 6px;
  text-align: right;
}

.hero-copy::before {
  content: '';
  position: absolute;
  top: -14px;
  right: -4px;
  width: 24px;
  height: 24px;
  background: var(--mustard);
  border-radius: 5px;
  mix-blend-mode: screen;
  animation: spin 19s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(378deg);
  }
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.72rem, 6vw, 2.9rem);
  line-height: 1.18;
  letter-spacing: -0.015em;
  color: var(--neon);
  text-wrap: balance;
}

.lede {
  margin: 0;
  color: var(--mute);
  font-size: 1rem;
  line-height: 1.62;
}

/* ---------- 正文排版 ---------- */

.doc p {
  margin: 0 0 14px;
}

.doc h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 34px 0 12px;
  font-size: clamp(1.28rem, 4.4vw, 1.68rem);
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: var(--mustard);
}

.doc h2::before {
  content: '';
  flex: none;
  width: 14px;
  height: 14px;
  background: var(--neon);
  transform: rotate(45deg);
}

.doc h3 {
  margin: 26px 0 8px;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--paper);
}

.doc small,
.rail small {
  display: block;
  margin-bottom: 2px;
  font-size: 0.83rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--mustard);
}

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

.doc a:hover {
  background: rgba(135, 255, 113, 0.14);
}

.doc ul,
.doc ol {
  margin: 0 0 16px;
  padding-left: 1.3em;
}

.doc li {
  margin-bottom: 6px;
}

.doc img {
  max-width: 100%;
  height: auto;
  border: 3px dashed var(--line);
  border-radius: 10px;
}

.doc blockquote {
  margin: 18px 0;
  padding: 14px 16px;
  border-left: 8px solid var(--mustard);
  border-radius: 0 10px 10px 0;
  background: rgba(255, 206, 92, 0.08);
}

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

.doc table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  font-size: 0.97rem;
}

.doc th,
.doc td {
  padding: 8px 10px;
  border: 2px dotted var(--line);
  text-align: left;
}

.doc th {
  color: var(--mustard);
}

.doc pre {
  overflow-x: auto;
  padding: 12px 14px;
  border: 2px dashed var(--line);
  border-radius: 10px;
}

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

.rail {
  position: sticky;
  top: 98px;
  padding: 16px 14px 8px;
  border: 3px dashed var(--line);
  border-radius: 10px;
  background: var(--ink2);
}

.rail h2 {
  margin: 4px 0 10px;
  font-size: 1.06rem;
  line-height: 1.35;
  letter-spacing: 0.05em;
  color: var(--mustard);
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: rl;
}

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

.rail-list a {
  display: block;
  min-height: 44px;
  padding: 11px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.96rem;
  line-height: 1.4;
  border-bottom: 2px dotted var(--line);
  transition: color 0.16s ease, padding-left 0.16s ease;
}

.rail-list a::before {
  content: counter(rl) '. ';
  color: var(--neon);
  font-size: 0.82rem;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  color: var(--neon);
  padding-left: 6px;
}

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

.foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 46px;
  padding: 30px 18px 18px;
  border-top: 8px solid var(--neon);
  background: var(--ink2);
}

.foot-mark {
  grid-column: 1 / -1;
  margin: 0 0 4px;
  font-size: clamp(2.1rem, 11.5vw, 6.4rem);
  line-height: 0.94;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--mustard);
  transform: rotate(-1.4deg);
  word-break: break-word;
}

.foot dl {
  margin: 0;
}

.foot dt {
  margin-bottom: 8px;
  font-size: 0.83rem;
  letter-spacing: 0.2em;
  color: var(--neon);
}

.foot dd {
  margin: 0 0 10px;
  color: var(--mute);
  font-size: 0.95rem;
}

.foot dd ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.foot dd a {
  display: block;
  min-height: 40px;
  padding: 9px 0;
  color: var(--paper);
  text-decoration: none;
  font-size: 0.95rem;
  border-bottom: 2px dotted var(--line);
}

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

.foot-base {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 3px dotted var(--line);
}

.copy {
  margin: 0;
  font-size: 0.9rem;
  color: var(--mute);
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  background: var(--neon);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 10px;
  transform: rotate(1.5deg);
}

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

@media (max-width: 860px) {
  .stage {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
  }

  .rail {
    position: static;
  }

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

@media (max-width: 620px) {
  .doc > .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    min-height: 0;
    padding-bottom: 32px;
  }

  .hero-copy::before {
    top: -8px;
  }

  .foot {
    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}
