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

:root {
  --paper: #fafaf8;
  --ink: #1a1a1a;
  --gray: #4a4a4a;
  --line: #d5d2c8;
  --card: #fffdf8;
  --mono: "JetBrains Mono", "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", monospace;
  --sans: "IBM Plex Sans", "JetBrains Mono", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  background: var(--paper);
  color-scheme: light;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

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

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  opacity: .2;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.86' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.45'/%3E%3C/svg%3E");
  background-size: 140px 140px;
}

.paper {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 clamp(14px, 3vw, 34px);
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 200px;
  column-gap: clamp(18px, 3vw, 40px);
  align-items: start;
}

/* 左侧竖排胶囊导航 */
.rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 0 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-self: start;
}

.stamp {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: 1.04rem;
  line-height: 1.2;
  letter-spacing: .01em;
  color: var(--ink);
  text-decoration: none;
  padding: 4px 2px 8px;
  border-bottom: 2.4px solid var(--ink);
  transform: rotate(-1.4deg);
}

.stamp .logo {
  display: block;
  max-width: 100%;
  height: auto;
  border: 0;
  padding: 0;
}

.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 9px;
}

.rail-nav a {
  display: block;
  padding: 10px 15px;
  min-height: 42px;
  font-family: var(--mono);
  font-size: .84rem;
  line-height: 1.3;
  color: var(--ink);
  text-decoration: none;
  border: 1.6px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  transition: background .16s steps(2), color .16s steps(2);
}

.rail-nav li:nth-child(odd) a { transform: rotate(-1.6deg); }
.rail-nav li:nth-child(even) a { transform: rotate(1.3deg); }
.rail-nav li:nth-child(3n) a { border-style: dashed; }
.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* 主体 */
.sheet {
  padding: clamp(18px, 3vw, 38px) 0 28px;
  min-width: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 1fr);
  gap: 24px;
  align-items: center;
  min-height: 45vh;
}

.hero-copy { order: 2; text-align: right; }

.hero-copy small {
  display: block;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .55em;
  color: var(--gray);
  margin-bottom: 10px;
}

.hero h1 {
  font-family: var(--mono);
  font-size: clamp(1.85rem, 5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  margin: 0 0 14px;
}

.lede {
  margin: 0;
  color: var(--gray);
  font-size: .94rem;
  line-height: 1.65;
}

.collage {
  position: relative;
  order: 1;
  margin: 0;
  min-height: clamp(200px, 32vh, 300px);
}

.shot {
  position: absolute;
  height: auto;
  background: #fff;
  border: 1.7px solid var(--ink);
  border-radius: 5px;
  padding: 5px;
}

.shot-a {
  width: 66%;
  top: 0;
  left: 1%;
  transform: rotate(-3.4deg);
  z-index: 2;
}

.shot-b {
  width: 52%;
  right: 0;
  bottom: 0;
  transform: rotate(3.2deg);
  filter: grayscale(1) contrast(1.06);
  z-index: 1;
}

.collage figcaption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 3;
  font-family: var(--mono);
  font-size: .7rem;
  letter-spacing: .16em;
  padding: 3px 9px;
  color: var(--paper);
  background: var(--ink);
  transform: rotate(-2deg);
}

.cut {
  height: 20px;
  margin: 26px 0 0;
  border-top: 1.6px solid var(--ink);
  border-bottom: 1.6px solid var(--ink);
  background-color: #fff;
  background-image: repeating-linear-gradient(135deg, var(--ink) 0 9px, transparent 9px 20px);
  transform: skewY(-1.5deg);
}

/* 正文区块 */
.sheet > section:not(.hero) {
  position: relative;
  margin: 32px 0;
  padding: 24px clamp(16px, 3vw, 30px) 26px;
  background: var(--card);
  border: 1.7px solid var(--ink);
  border-radius: 28px;
  scroll-margin-top: 18px;
}

.sheet > section:nth-of-type(odd):not(.hero) { transform: rotate(-.27deg); }
.sheet > section:nth-of-type(even):not(.hero) { transform: rotate(.25deg); }
.sheet > section:nth-of-type(3n):not(.hero) { border-style: dashed; }

section > small {
  display: block;
  font-family: var(--mono);
  font-size: .71rem;
  letter-spacing: .34em;
  color: var(--gray);
  margin-bottom: 5px;
}

.sheet h2 {
  font-family: var(--mono);
  font-size: clamp(1.28rem, 3.4vw, 1.66rem);
  line-height: 1.25;
  letter-spacing: -.01em;
  margin: .15em 0 .55em;
}

.sheet h2::after {
  content: "";
  display: block;
  width: 54px;
  height: 3px;
  margin-top: 11px;
  background: var(--ink);
  transform: rotate(-1.5deg);
}

.sheet h3 {
  font-family: var(--mono);
  font-size: 1.06rem;
  line-height: 1.4;
  margin: 1.5em 0 .4em;
}

.sheet p { margin: 0 0 1em; }
.sheet ul, .sheet ol { margin: 0 0 1.1em; padding-left: 1.3em; }
.sheet li { margin: .35em 0; }

.sheet a {
  color: var(--ink);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 3px;
}

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

.sheet figure { margin: 1.2em 0; }

.sheet img {
  max-width: 100%;
  height: auto;
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 5px;
  padding: 4px;
}

.sheet blockquote {
  margin: 1.2em 0;
  padding: .3em 0 .3em 16px;
  border-left: 3px solid var(--ink);
  color: var(--gray);
}

.sheet table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.sheet th, .sheet td { border: 1.4px solid var(--line); padding: 8px 10px; text-align: left; }

/* 右侧目录 */
.side {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 36px 0 26px 16px;
  border-left: 1.7px dashed var(--line);
}

.side-key {
  display: block;
  font-family: var(--mono);
  font-size: .71rem;
  letter-spacing: .34em;
  color: var(--gray);
  margin-bottom: 10px;
}

.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}

.side-list a {
  display: block;
  padding: 9px 0;
  font-family: var(--mono);
  font-size: .79rem;
  color: var(--gray);
  text-decoration: none;
  border-bottom: 1px dotted var(--line);
}

.side-list a:hover { color: var(--ink); border-bottom-style: solid; }

/* 页脚 */
.foot {
  max-width: 1320px;
  margin: clamp(28px, 5vw, 56px) auto 0;
  padding: 38px clamp(14px, 3vw, 34px) 46px;
  border-top: 2.4px solid var(--ink);
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 18px 30px;
}

.foot-brand { margin: 0; }

.big {
  display: block;
  font-family: var(--mono);
  font-weight: 700;
  font-size: clamp(1.85rem, 6.6vw, 4rem);
  line-height: .98;
  letter-spacing: -.045em;
}

.foot-desc {
  display: block;
  margin-top: 12px;
  max-width: 46ch;
  font-size: .85rem;
  line-height: 1.65;
  color: var(--gray);
}

.foot-links {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-content: flex-start;
}

.foot-links a {
  display: inline-block;
  padding: 10px 14px;
  min-height: 41px;
  font-family: var(--mono);
  font-size: .79rem;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--line);
  border-radius: 999px;
}

.foot-links a:hover { border-color: var(--ink); }

.foot-copy {
  grid-column: 1 / -1;
  text-align: center;
  font-family: var(--mono);
  font-size: .74rem;
  letter-spacing: .16em;
  color: var(--gray);
  border-top: 1px dashed var(--line);
  padding-top: 14px;
}

/* 动效 */
.js .js-rv {
  opacity: 0;
  translate: 0 16px;
  transition: opacity .34s steps(3), translate .34s steps(3);
}

.js .js-rv.in { opacity: 1; translate: 0 0; }

.js .js-rv > * {
  opacity: 0;
  translate: 0 10px;
  transition: inherit;
  transition-property: opacity, translate;
}

.js .js-rv.in > * { opacity: 1; translate: 0 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .js-rv,
  .js .js-rv > * {
    opacity: 1;
    translate: 0 0;
    transition: none;
  }
  .sheet > article,
  .rail-nav a { transform: none; }
}

/* 窄屏 */
@media (max-width: 900px) {
  .paper {
    grid-template-columns: minmax(0, 1fr);
    padding: 0 16px;
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 6;
    height: auto;
    padding: 12px 0 10px;
    gap: 10px;
    background: var(--paper);
    border-bottom: 1.7px solid var(--ink);
  }

  .stamp {
    transform: rotate(-1deg);
    font-size: .95rem;
    padding-bottom: 6px;
  }

  .rail-nav ul {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 7px;
  }

  .rail-nav a {
    padding: 9px 12px;
    font-size: .77rem;
  }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    padding-top: 10px;
  }

  .hero-copy { order: 1; text-align: left; }
  .collage { order: 2; min-height: 210px; }

  .sheet > article:not(.hero) {
    scroll-margin-top: 128px;
    border-radius: 22px;
    padding: 20px 16px 22px;
  }

  .side {
    position: static;
    padding: 18px 0 0;
    margin-top: 8px;
    border-left: 0;
    border-top: 1.7px dashed var(--line);
  }

  .side-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0 16px;
  }

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

  .foot-copy { grid-column: 1 / -1; }
}

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