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

:root {
  --ac: #80ff00;
  --ac2: #00ff00;
  --ink: #1f2617;
  --ink2: #171d10;
  --paper: #d9f7c4;
  --rail: 148px;
  --mono: 'JetBrains Mono', ui-monospace, 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', monospace;
  --head: 'Orbitron', 'JetBrains Mono', 'Noto Sans SC', 'PingFang SC', sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  padding-left: var(--rail);
  background:
    radial-gradient(60vw 50vw at 88% -8%, rgba(0, 255, 0, .16), transparent 70%),
    radial-gradient(50vw 40vw at 4% 92%, rgba(128, 255, 0, .12), transparent 72%),
    var(--ink);
  color: var(--paper);
  font: 16px/1.7 var(--mono);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 55;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .38) 0 1px, rgba(0, 0, 0, 0) 1px 4px),
    repeating-linear-gradient(90deg, rgba(128, 255, 0, .05) 0 1px, rgba(0, 0, 0, 0) 1px 5px);
  mix-blend-mode: multiply;
  opacity: .55;
}

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

a { color: var(--ac); text-decoration: none; }

a:hover,
a:focus-visible { color: var(--ac2); }

:focus-visible { outline: 3px dashed var(--ac2); outline-offset: 2px; }

/* ---- 左侧固定竖排导航 ---- */
.rail {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 12px 18px;
  background: rgba(23, 29, 16, .96);
  border-right: 2px solid rgba(128, 255, 0, .35);
  overflow-y: auto;
}

.logo {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 2px solid var(--ac);
  background: var(--ac);
  color: var(--ink);
  font: 900 22px/1 var(--head);
  transform: rotate(-6deg);
  overflow: hidden;
}

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

.rail-nav { display: flex; flex-direction: column; gap: 8px; }

.pill {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid var(--ac);
  border-radius: 999px;
  color: var(--ac);
  font-size: 15px;
  line-height: 1.2;
  animation: flyin .5s backwards;
  animation-delay: calc(var(--i) * 60ms);
}

.pill i {
  font-style: normal;
  font-size: 11px;
  letter-spacing: .08em;
  opacity: .75;
}

.pill:hover,
.pill:focus-visible {
  background: var(--ac);
  color: var(--ink);
}

.search input {
  width: 100%;
  min-height: 40px;
  padding: 6px 10px;
  border: 2px dashed rgba(128, 255, 0, .6);
  border-radius: 0;
  background: transparent;
  color: var(--paper);
  font: 14px/1.4 var(--mono);
}

.search input::placeholder { color: rgba(217, 247, 196, .55); }

@keyframes flyin {
  from { opacity: 0; transform: translateX(-14px) rotate(-3deg); }
  to { opacity: 1; transform: none; }
}

/* ---- 满屏斜切 hero ---- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 90px 20px 110px;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 64px), 0 100%);
  background: linear-gradient(160deg, #2b3a1c 0%, #12170c 55%, #1f2617 100%);
}

.hero-fig { position: absolute; inset: 0; z-index: 0; }

.hero-fig img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(160%) contrast(115%);
  mix-blend-mode: luminosity;
  opacity: .55;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .42) 0 2px, rgba(0, 0, 0, 0) 2px 6px);
}

.hero-ghost {
  position: absolute;
  left: -6%;
  bottom: -2vw;
  z-index: 1;
  width: 118%;
  font: 900 clamp(72px, 17vw, 220px)/0.86 var(--head);
  color: var(--ac);
  opacity: .12;
  white-space: nowrap;
  overflow: hidden;
  letter-spacing: -.03em;
}

.hero-in {
  position: relative;
  z-index: 3;
  max-width: 24ch;
  text-align: center;
}

.hero h1 {
  margin: 0;
  font: 900 clamp(34px, 8.4vw, 86px)/1.02 var(--head);
  letter-spacing: -.02em;
  color: var(--ac);
  text-shadow: 4px 4px 0 rgba(0, 255, 0, .28), -2px -2px 0 rgba(31, 38, 23, .9);
  word-break: break-word;
}

.hero-d {
  margin: 18px auto 0;
  max-width: 30ch;
  font-size: 15px;
  line-height: 1.65;
  color: rgba(217, 247, 196, .82);
}

/* 贴纸 */
.sticker {
  position: absolute;
  z-index: 4;
  padding: 7px 13px;
  border: 2px solid var(--ink);
  background: var(--ac);
  color: var(--ink);
  font: 500 16px/1.2 var(--mono);
  animation: jitter 2.6s ease-in-out infinite;
}

.sticker.s1 { left: 7%; top: 20%; transform: rotate(-9deg); animation-delay: .1s; }
.sticker.s2 { right: 6%; top: 32%; transform: rotate(6deg); background: transparent; border-color: var(--ac); color: var(--ac); animation-delay: .5s; }
.sticker.s3 { left: 12%; bottom: 24%; transform: rotate(-3deg); background: var(--ac2); animation-delay: .9s; }

@keyframes jitter {
  0%, 100% { translate: 0 0; }
  40% { translate: 2px -3px; }
  70% { translate: -2px 2px; }
}

/* marquee */
.mq {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 46px;
  z-index: 4;
  overflow: hidden;
  border-top: 2px solid var(--ac);
  border-bottom: 2px solid var(--ac);
  background: rgba(31, 38, 23, .82);
  padding: 6px 0;
}

.mq-run {
  display: inline-block;
  white-space: nowrap;
  font: 500 16px/1.4 var(--mono);
  color: var(--ac);
  letter-spacing: .12em;
  animation: slide 22s linear infinite;
}

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ---- 主体：左侧目录 + 正文 ---- */
main { position: relative; z-index: 5; }

.wrap {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  gap: 42px;
  max-width: 1240px;
  margin: 0 auto;
  padding: 58px 28px 84px;
}

.toc {
  position: sticky;
  top: 26px;
  align-self: start;
  border: 2px solid var(--ac);
  padding: 16px 14px;
  background: rgba(23, 29, 16, .78);
}

.toc h2 { margin: 0 0 14px; }

.toc h2 > span {
  font: 900 16px/1.35 var(--head);
  color: var(--ac);
  letter-spacing: .02em;
  word-break: break-word;
}

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

.toc li + li { border-top: 1px dashed rgba(128, 255, 0, .3); }

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 2px;
  font-size: 16px;
  color: var(--paper);
}

.toc a:hover,
.toc a:focus-visible { color: var(--ac); background: rgba(128, 255, 0, .1); }

.stage { min-width: 0; }

.post { max-width: 72ch; font-size: 17px; }

.post div {
  scroll-margin-top: 18px;
  padding: 46px 0;
  border-top: 2px dashed rgba(128, 255, 0, .3);
}

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

.post h2,
.post h3 { margin: 0 0 18px; line-height: 1.25; font-family: var(--head); }

.post h2 > span,
.post h3 > span {
  display: inline-block;
  background: var(--ac);
  color: var(--ink);
  padding: 3px 12px;
  transform: skewX(-7deg);
}

.post h2 > span { font-size: clamp(20px, 3vw, 30px); font-weight: 900; }
.post h3 > span { font-size: 18px; font-weight: 700; background: transparent; color: var(--ac2); padding-left: 0; }

.post p { margin: 0 0 16px; }

.post ul,
.post ol { margin: 0 0 18px; padding-left: 22px; }

.post li { margin-bottom: 8px; }

.post blockquote {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-left: 4px solid var(--ac2);
  background: rgba(0, 255, 0, .07);
}

.post strong { color: var(--ac2); }

.post a { text-decoration: underline; text-underline-offset: 3px; }

.post img { border: 2px solid var(--ac); margin: 18px 0; }

.post table { width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 16px; }

.post th,
.post td { border: 2px solid rgba(128, 255, 0, .4); padding: 8px 10px; text-align: left; }

.post div.rv {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}

.post div.rv.in { opacity: 1; transform: none; }

/* ---- 页脚 ---- */
.ft {
  position: relative;
  z-index: 5;
  border-top: 2px solid var(--ac);
  background: var(--ink2);
  padding: 42px 28px 22px;
}

.ft-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
  max-width: 1180px;
  margin: 0 auto 30px;
}

.ft-col { border-left: 2px solid rgba(128, 255, 0, .35); padding-left: 14px; }

.ft address { font-style: normal; display: grid; gap: 8px; }

.ft-brand { font: 900 20px/1.3 var(--head); color: var(--ac); }

.ft-host { font-size: 15px; color: rgba(217, 247, 196, .7); word-break: break-all; }

.ft h2 { margin: 0 0 12px; }

.ft h2 > span {
  font: 700 16px/1.3 var(--mono);
  color: var(--ac);
  border-bottom: 2px solid var(--ac);
  padding-bottom: 2px;
}

.ft-nav dl { margin: 0; display: grid; gap: 4px; }

.ft-nav dt { font-size: 16px; }

.ft-nav dt a { display: inline-flex; align-items: center; min-height: 40px; }

.ft-nav dd { margin: 0 0 2px; }

.ft-nav dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 15px;
  color: rgba(217, 247, 196, .62);
}

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

.ft-list a { display: inline-flex; align-items: center; min-height: 40px; font-size: 16px; }

.ft-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border-top: 1px dashed rgba(128, 255, 0, .35);
  padding-top: 16px;
  font-size: 15px;
  color: rgba(217, 247, 196, .68);
  text-align: center;
}

.top {
  min-height: 40px;
  padding: 6px 16px;
  border: 2px solid var(--ac);
  border-radius: 999px;
  background: transparent;
  color: var(--ac);
  font: 500 15px/1.2 var(--mono);
  cursor: pointer;
}

.top:hover { background: var(--ac); color: var(--ink); }

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

  .rail {
    left: 0;
    right: 0;
    top: auto;
    bottom: 0;
    width: auto;
    height: 76px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    border-right: 0;
    border-top: 2px solid var(--ac);
    padding: 10px 10px 12px;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .logo { width: 42px; height: 42px; flex: 0 0 auto; }

  .rail-nav { flex-direction: row; flex: 0 0 auto; gap: 8px; }

  .pill { flex: 0 0 auto; font-size: 15px; }

  .search { flex: 0 0 auto; width: 104px; }

  .hero {
    min-height: 82svh;
    padding: 78px 14px 96px;
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 34px), 0 100%);
  }

  .hero-ghost { font-size: 28vw; }

  .hero h1 { font-size: clamp(30px, 10vw, 56px); }

  .sticker.s3 { display: none; }

  .mq { bottom: 26px; }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 30px 16px 56px;
  }

  .toc { position: static; padding: 12px 12px 10px; }

  .toc h2 { margin-bottom: 8px; }

  .toc ul { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }

  .toc li { flex: 0 0 auto; border-top: 0 !important; }

  .toc a { min-height: 40px; padding: 6px 10px; border: 1px solid rgba(128, 255, 0, .45); }

  .ft { padding: 32px 16px 18px; }

  .ft-grid { grid-template-columns: minmax(0, 1fr); gap: 20px; }

  .ft-col { padding-left: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pill, .sticker, .mq-run { animation: none; }
  .post div.rv { opacity: 1; transform: none; transition: none; }
}

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