:root {
  --paper: #fafaf8;
  --gray: #4a4a4a;
  --ink: #1a1a1a;
  --line: #cdcac4;
  --dot: rgba(26, 26, 26, .18);
  --tape: rgba(74, 74, 74, .12);
  --sans: "VT323", ui-sans-serif, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --pixel: "Press Start 2P", ui-monospace, "PingFang SC", "Microsoft YaHei", monospace;
  --rail: 210px;
  --bar: 66px;
}

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

html {
  overflow-x: hidden;
  overflow-x: clip;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--bar) + 14px);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.7;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 13px 13px;
  opacity: .55;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: repeating-linear-gradient(0deg, rgba(26, 26, 26, .05) 0 1px, transparent 1px 3px);
  opacity: .55;
  mix-blend-mode: multiply;
}

body > * {
  position: relative;
  z-index: 1;
}

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

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

a:focus-visible,
button:focus-visible {
  outline: 2px dashed var(--ink);
  outline-offset: 3px;
}

small {
  display: inline-block;
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .08em;
  color: var(--gray);
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: var(--bar);
  padding: 8px 16px;
  background: rgba(250, 250, 248, .94);
  border-bottom: 2px solid var(--ink);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 6px 4px;
  text-decoration: none;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1.45;
  letter-spacing: .01em;
  color: var(--ink);
  transform: rotate(-.6deg);
}

.brand-txt {
  min-width: 0;
  overflow-wrap: anywhere;
}

.brand-img {
  display: block;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border: 2px solid var(--ink);
  border-radius: 10px 4px 10px 4px;
  filter: grayscale(1) contrast(1.1);
}

.brand:hover .brand-txt,
.brand:focus-visible .brand-txt {
  background: var(--tape);
}

.menu-btn {
  justify-self: end;
  min-height: 44px;
  min-width: 58px;
  padding: 10px 12px;
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--ink);
  border-radius: 10px 4px 10px 4px;
  cursor: pointer;
  transform: rotate(.8deg);
  transition: transform 90ms steps(2, end), background-color 90ms linear;
}

.menu-btn:hover {
  background: var(--tape);
  transform: rotate(-1.2deg) translateY(-1px);
}

.sitenav {
  min-width: 0;
}

.sitenav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sitenav-list li {
  display: flex;
}

.sitenav a,
.contact {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 10px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: 10px 4px 10px 4px;
  transition: transform 90ms steps(2, end), background-color 90ms linear, border-color 90ms linear;
}

.sitenav a:hover,
.sitenav a:focus-visible,
.sitenav a[aria-current="true"] {
  background: var(--tape);
  border-color: var(--ink);
  transform: translate(-1px, -2px) rotate(-1deg);
}

.contact {
  justify-self: end;
  border-color: var(--ink);
  font-size: 16px;
  white-space: nowrap;
  transform: rotate(.7deg);
}

.contact:hover,
.contact:focus-visible {
  background: var(--ink);
  color: var(--paper);
  transform: rotate(-1deg) translateY(-1px);
}

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: 28px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 56px 20px 48px;
  min-height: calc(100vh - var(--bar));
  border-bottom: 2px dashed var(--line);
}

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

.eyebrow {
  color: var(--gray);
  border-bottom: 2px dotted var(--gray);
  padding-bottom: 2px;
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 18px;
  font-family: var(--pixel);
  font-size: clamp(26px, 3.6vw, 42px);
  line-height: 1.45;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.lede {
  max-width: 46ch;
  margin: 0 auto 26px;
  color: var(--gray);
  font-size: 18px;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 46px;
  padding: 10px 22px;
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1.5;
  text-decoration: none;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 255px 12px 225px 12px / 12px 225px 12px 255px;
  transform: rotate(-1.4deg);
  transition: transform 90ms steps(2, end), background-color 90ms linear;
}

.cta:hover,
.cta:focus-visible {
  background: var(--gray);
  transform: rotate(1.2deg) translateY(-2px);
}

.hero-fig {
  position: relative;
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 10px 10px 22px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px 3px 12px 3px;
  transform: rotate(1.2deg);
}

.hero-fig--blank {
  min-height: 240px;
  background-image: radial-gradient(var(--dot) 1px, transparent 1px);
  background-size: 11px 11px;
}

.hero-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  filter: grayscale(1) contrast(1.08);
  border: 1px solid var(--line);
}

.tape {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 92px;
  height: 22px;
  margin-left: -46px;
  background: rgba(74, 74, 74, .16);
  border-left: 1px dashed rgba(26, 26, 26, .35);
  border-right: 1px dashed rgba(26, 26, 26, .35);
  transform: rotate(-3deg);
}

/* 主体分栏 */
.binder {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  gap: 34px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 44px 20px 72px;
}

.rail {
  position: sticky;
  top: calc(var(--bar) + 16px);
  align-self: start;
  min-width: 0;
  padding: 16px 14px 18px;
  border: 2px solid var(--ink);
  border-radius: 12px 4px 12px 4px;
  background: var(--paper);
  transform: rotate(-.7deg);
}

.rail-h {
  margin: 2px 0 12px;
  font-family: var(--pixel);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: .04em;
}

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

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 4px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
  transition: transform 90ms steps(2, end), color 90ms linear;
}

.toc li:last-child a {
  border-bottom: 0;
}

.toc a:hover,
.toc a:focus-visible {
  color: var(--gray);
  transform: translateX(3px);
}

.toc a[aria-current="true"] {
  color: var(--gray);
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 4px;
}

/* 正文 */
.prose {
  max-width: 74ch;
  min-width: 0;
  overflow-wrap: break-word;
  word-break: break-word;
}

.prose > * {
  max-width: 100%;
}

.prose div {
  scroll-margin-top: calc(var(--bar) + 18px);
}

.prose > div + div {
  margin-top: 40px;
  padding-top: 34px;
  border-top: 2px dashed var(--line);
}

.prose h2 {
  margin: 0 0 14px;
  font-family: var(--pixel);
  font-size: clamp(19px, 2.1vw, 24px);
  line-height: 1.5;
  letter-spacing: .01em;
  overflow-wrap: anywhere;
}

.prose h3 {
  margin: 26px 0 10px;
  font-family: var(--pixel);
  font-size: 17px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.prose p {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 1.78;
}

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

.prose li {
  margin-bottom: 8px;
  line-height: 1.75;
}

.prose li::marker {
  color: var(--gray);
}

.prose a {
  text-decoration: underline;
  text-decoration-style: wavy;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.prose a:hover {
  background: var(--tape);
}

.prose time {
  font-family: var(--pixel);
  font-size: 14px;
  color: var(--gray);
  letter-spacing: .04em;
}

.prose figure {
  margin: 22px 0;
  padding: 8px;
  background: #fff;
  border: 2px solid var(--ink);
  border-radius: 10px 3px 12px 3px;
  transform: rotate(-.8deg);
}

.prose figure img {
  display: block;
  width: 100%;
  filter: grayscale(1) contrast(1.08);
}

.prose figcaption {
  padding-top: 6px;
  font-size: 16px;
  color: var(--gray);
}

.prose blockquote {
  margin: 20px 0;
  padding: 12px 16px;
  border-left: 4px solid var(--ink);
  background: rgba(74, 74, 74, .06);
}

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

.prose aside {
  margin: 22px 0;
  padding: 14px 16px;
  border: 2px dashed var(--ink);
  border-radius: 10px 4px 10px 4px;
  background: rgba(74, 74, 74, .04);
}

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 17px;
}

.prose th,
.prose td {
  padding: 8px 10px;
  border: 1px solid var(--line);
  text-align: left;
  overflow-wrap: break-word;
}

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  margin: 0 0 18px;
  padding: 12px 14px;
  background: rgba(74, 74, 74, .08);
  border-radius: 6px;
}

.prose code {
  font-family: var(--pixel);
  font-size: 14px;
  background: rgba(74, 74, 74, .1);
  padding: 1px 4px;
  border-radius: 4px;
}

.prose pre code {
  display: block;
  background: none;
  padding: 0;
  white-space: pre;
}

/* 页脚 */
.foot {
  border-top: 3px solid var(--ink);
  background: rgba(74, 74, 74, .05);
  padding: 40px 20px 22px;
}

.foot-brand {
  max-width: 1180px;
  margin: 0 auto 30px;
  font-family: var(--pixel);
  font-size: clamp(24px, 6.4vw, 62px);
  line-height: 1.25;
  letter-spacing: -.01em;
  word-break: break-all;
  transform: rotate(-.5deg);
}

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

.foot dl {
  margin: 0;
  min-width: 0;
  padding-top: 10px;
  border-top: 2px dotted var(--line);
}

.foot dt {
  font-family: var(--pixel);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: .08em;
  color: var(--gray);
  margin-bottom: 6px;
}

.foot dd {
  margin: 0;
  font-size: 17px;
  line-height: 1.6;
  overflow-wrap: break-word;
}

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  text-decoration: none;
  border-bottom: 1px dashed var(--gray);
}

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

.copy {
  max-width: 1180px;
  margin: 26px auto 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 16px;
  color: var(--gray);
}

/* 动效 */
@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(-.6deg);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.reveal > li {
  animation: rise .26s steps(4, end) both;
}

.reveal > li:nth-child(1) { animation-delay: .02s; }
.reveal > li:nth-child(2) { animation-delay: .05s; }
.reveal > li:nth-child(3) { animation-delay: .08s; }
.reveal > li:nth-child(4) { animation-delay: .11s; }
.reveal > li:nth-child(5) { animation-delay: .14s; }
.reveal > li:nth-child(6) { animation-delay: .17s; }
.reveal > li:nth-child(7) { animation-delay: .2s; }

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

  *,
  *::before,
  *::after {
    animation-duration: .001s !important;
    animation-delay: 0s !important;
    transition-duration: .001s !important;
  }
}

/* 窄屏 */
@media (max-width: 980px) {
  .menu-btn {
    display: block;
  }

  .sitenav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 2px solid var(--ink);
  }

  .sitenav.is-open {
    display: block;
  }

  .sitenav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 12px 14px;
  }

  .sitenav-list li,
  .sitenav a {
    width: 100%;
    min-width: 0;
  }

  .sitenav a {
    border-color: var(--line);
  }
}

@media (min-width: 981px) {
  .menu-btn {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    min-height: 0;
    padding: 34px 18px 40px;
  }

  .hero-fig {
    transform: rotate(.8deg);
  }

  .binder {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding: 30px 18px 56px;
  }

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

  .toc {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .toc li {
    min-width: 0;
  }

  .toc a {
    min-height: 44px;
    border: 1px dashed var(--line);
    border-radius: 10px 4px 10px 4px;
    padding: 8px 10px;
    overflow-wrap: break-word;
  }

  .toc li:last-child a {
    border-bottom: 1px dashed var(--line);
  }

  .prose table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    border-collapse: collapse;
  }

  .prose th,
  .prose td {
    min-width: 84px;
  }
}

@media (max-width: 560px) {
  body {
    font-size: 17px;
  }

  .topbar {
    gap: 6px;
    padding: 8px 12px;
  }

  .brand {
    font-size: 14px;
    gap: 6px;
  }

  .brand-img {
    width: 30px;
    height: 30px;
  }

  .menu-btn {
    min-width: 52px;
    padding: 10px 8px;
    font-size: 13px;
  }

  .contact {
    padding: 8px 6px;
    font-size: 15px;
  }

  .foot-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .prose p,
  .lede {
    font-size: 17px;
  }
}

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