:root {
  --ink: #0E1116;
  --paper: #F4F6F8;
  --neon: #22E07A;
  --panel: #151B22;
  --panel-2: #1C242D;
  --line: #2C3742;
  --mute: #9BABB8;
  --r: 28px;
}

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

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

body {
  margin: 0;
  padding-bottom: 86px;
  background: var(--ink);
  color: var(--paper);
  font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--paper);
  text-decoration: none;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

a:hover {
  color: var(--neon);
}

:focus-visible {
  outline: 2px solid var(--neon);
  outline-offset: 3px;
}

.page {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 36px);
}

.main {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: clamp(18px, 2.6vw, 40px);
  align-items: start;
}

/* ---------- 左侧索引栏 ---------- */
.rail {
  position: sticky;
  top: 28px;
  background: var(--panel);
  border-radius: var(--r);
  padding: 18px 16px;
}

.rail h2 {
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--mute);
}

.rail h2 span {
  color: var(--neon);
}

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

.rail-list li + li {
  border-top: 1px solid var(--line);
}

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 10px 4px;
  font-size: 16px;
  line-height: 1.3;
}

.rail-list a[aria-current] {
  color: var(--neon);
}

.idx {
  color: var(--mute);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.rail-list a:hover .idx,
.rail-list a:hover .lbl {
  color: var(--neon);
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: clamp(18px, 3vw, 40px);
  align-items: center;
  min-height: 100svh;
  padding: 28px 0 56px;
}

.badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--neon);
  border: 1px solid var(--neon);
  border-radius: 4px;
  font-size: 16px;
  line-height: 1;
}

.hero-media {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--r);
  overflow: hidden;
  background: var(--panel-2);
  will-change: transform;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.geo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  background: var(--ink);
  border: 1px solid var(--line);
}

.geo i {
  display: block;
  background: var(--neon);
  border-radius: 20px;
}

.geo i:nth-child(2),
.geo i:nth-child(3) {
  background: var(--panel-2);
}

.hero-copy {
  text-align: center;
  min-width: 0;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(28px, 4.6vw, 54px);
  line-height: 1.12;
  letter-spacing: -0.02em;
  font-weight: 500;
  overflow-wrap: break-word;
}

.lede {
  margin: 0 auto 28px;
  max-width: 34ch;
  color: var(--mute);
  font-size: 17px;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  background: var(--neon);
  color: var(--ink);
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.cta:hover {
  background: var(--paper);
  color: var(--ink);
}

/* ---------- 正文 ---------- */
.content {
  min-width: 0;
  counter-reset: sec;
  padding-bottom: 12px;
}

.content section {
  counter-increment: sec;
  margin-bottom: 20px;
  padding: clamp(20px, 3.2vw, 40px);
  background: var(--panel);
  border-radius: var(--r);
  scroll-margin-top: 20px;
}

.content h2 {
  margin: 0 0 16px;
  font-size: clamp(21px, 2.4vw, 30px);
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.content h2 > span::before {
  content: counter(sec, decimal-leading-zero);
  margin-right: 0.55em;
  color: var(--neon);
  font-size: 0.72em;
}

.content h3 {
  margin: 28px 0 10px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--paper);
}

.content h3 > span::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  background: var(--neon);
  border-radius: 2px;
  vertical-align: 1px;
}

.content p {
  margin: 0 0 16px;
  max-width: 70ch;
  color: #DCE3EA;
  overflow-wrap: break-word;
}

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

.content strong,
.content b {
  color: var(--neon);
  font-weight: 500;
}

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

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

.content li {
  margin-bottom: 8px;
  overflow-wrap: break-word;
}

.content li::marker {
  color: var(--neon);
}

.content blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--panel-2);
  border-left: 3px solid var(--neon);
  border-radius: 0 8px 8px 0;
}

.content blockquote p {
  margin: 0;
}

.content figure {
  margin: 20px 0;
  padding: 14px;
  background: var(--panel-2);
  border-radius: 18px;
}

.content figure img {
  width: 100%;
  border-radius: 10px;
}

.content figcaption {
  margin-top: 10px;
  font-size: 16px;
  color: var(--mute);
}

.content aside {
  margin: 20px 0;
  padding: 18px;
  background: var(--panel-2);
  border-radius: 18px;
  border-left: 3px solid var(--neon);
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}

.content th,
.content td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.content code,
.content pre {
  font-family: inherit;
  font-size: 16px;
  background: var(--ink);
  border-radius: 4px;
}

.content code {
  padding: 1px 5px;
  color: var(--neon);
}

.content pre {
  padding: 14px;
  overflow-x: auto;
}

.content pre code {
  padding: 0;
  background: none;
}

/* ---------- 页脚 ---------- */
.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin-top: 32px;
  padding: 22px 0 34px;
  border-top: 1px solid var(--line);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.copy {
  font-size: 16px;
  color: var(--mute);
}

.mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  background: var(--neon);
  color: var(--ink);
  border-radius: 4px;
}

.mark:hover {
  background: var(--paper);
  color: var(--ink);
}

.mark-svg {
  width: 20px;
  height: 20px;
  display: block;
}

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

.foot-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 9px;
  font-size: 16px;
  color: var(--mute);
}

.foot-list a:hover {
  color: var(--neon);
}

/* ---------- 底部固定条 ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px clamp(12px, 3vw, 28px);
  background: var(--ink);
  border-top: 1px solid var(--line);
}

.bar-spacer {
  flex: 1 1 auto;
}

.bar-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.bar-btn:hover {
  color: var(--neon);
  border-color: var(--neon);
}

.bar-menu {
  background: var(--neon);
  border-color: var(--neon);
  color: var(--ink);
  font-weight: 500;
}

.bar-menu:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

/* ---------- 全屏菜单 ---------- */
.menu {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  padding: clamp(16px, 4vw, 32px) clamp(16px, 5vw, 48px) 96px;
  background: var(--ink);
  overflow-y: auto;
}

.menu[hidden] {
  display: none;
}

.menu-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.menu h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--mute);
}

.menu h2 span {
  color: var(--neon);
}

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

.menu-list li + li {
  border-top: 1px solid var(--line);
}

.menu-list a {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 62px;
  padding: 14px 4px;
  font-size: clamp(20px, 3.4vw, 30px);
  line-height: 1.2;
}

.menu-list a:hover .lbl {
  color: var(--neon);
}

.menu-list .idx {
  font-size: 16px;
  color: var(--neon);
}

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .main {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    padding: 12px;
    border-radius: 18px;
  }

  .rail h2 {
    margin-bottom: 10px;
  }

  .rail-list {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: thin;
  }

  .rail-list li + li {
    border-top: 0;
  }

  .rail-list a {
    padding: 9px 12px;
    border: 1px solid var(--line);
    border-radius: 4px;
    white-space: nowrap;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    padding: 18px 0 36px;
    gap: 22px;
  }

  .hero-media {
    aspect-ratio: 16 / 11;
  }

  .geo i {
    border-radius: 14px;
  }

  .lede {
    max-width: 40ch;
  }
}

@media (max-width: 560px) {
  .foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .badge {
    top: 10px;
    left: 10px;
  }

  .bar-btn {
    padding: 0 13px;
  }

  .content section {
    padding: 20px 18px;
    border-radius: 20px;
  }
}

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

  *,
  *::before,
  *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
  }
}

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