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

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

:root {
  --paper: #fafaf8;
  --mid: #4a4a4a;
  --ink: #1a1a1a;
  --line: #d8d6ce;
  --faint: #8c8981;
  --wash: #f0efea;
  --rail: 236px;
  --strip: 36px;
  --rot: 0deg;
}

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

body {
  margin: 0;
  padding-top: var(--strip);
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .002em;
  overflow-x: hidden;
}

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

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

/* ---------- 顶部细条 ---------- */
.strip {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--strip);
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 0 1rem;
  z-index: 40;
  background: var(--paper);
  border-bottom: 1px dashed var(--line);
}

.strip-line {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  font-size: 13px;
  letter-spacing: .28em;
  color: var(--faint);
  white-space: nowrap;
}

.strip-line span:nth-child(odd) { color: var(--mid); }

/* ---------- 左侧竖栏 ---------- */
.rail {
  position: fixed;
  top: var(--strip);
  left: 0;
  width: var(--rail);
  height: calc(100vh - var(--strip));
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  padding: 1.5rem 1.1rem 1.2rem;
  border-right: 1px solid var(--line);
  background: var(--paper);
  z-index: 35;
  overflow-y: auto;
}

.brand {
  display: inline-block;
  align-self: flex-start;
  min-height: 44px;
  padding: .35rem .1rem;
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: -.02em;
  color: var(--ink);
  text-decoration: none;
  transform: rotate(-1.4deg);
  border-bottom: 2px solid var(--ink);
}

.nav { margin-top: .1rem; }

.menu summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  min-height: 44px;
  padding: .5rem .8rem;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--ink);
  border-radius: 14px 18px 15px 20px;
  transform: rotate(.7deg);
  user-select: none;
}

.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: "+"; font-size: 18px; font-weight: 400; line-height: 1; }
.menu[open] summary::after { content: "\2013"; }

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

.menu menu a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: .4rem .5rem;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

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

.rail-mark {
  margin: auto 0 0;
  font-size: 22px;
  line-height: 1;
  color: var(--line);
  transform: rotate(9deg);
}

/* ---------- 主体 ---------- */
main { margin-left: var(--rail); }

.wrap {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 2.2rem;
  max-width: 1160px;
  margin: 0 auto;
  padding: 2.4rem 2rem 4.5rem;
}

.side {
  position: sticky;
  top: calc(var(--strip) + 1.4rem);
  align-self: start;
  padding-top: .4rem;
}

.side small {
  display: block;
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--faint);
}

.side h2 {
  margin: .1rem 0 .8rem;
  font-size: 1.02rem;
  font-weight: 600;
  letter-spacing: .06em;
  line-height: 1.4;
}

.side ol {
  list-style: none;
  counter-reset: side;
  margin: 0;
  padding: 0;
}

.side li { counter-increment: side; }

.side li a {
  display: flex;
  align-items: center;
  gap: .45rem;
  min-height: 40px;
  padding: .3rem 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

.side li a::before {
  content: counter(side, decimal-leading-zero);
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--faint);
}

.side li a:hover { color: var(--ink); }

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  padding: 2rem 0 3rem;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 4%;
  top: 16%;
  width: 92px;
  height: 26px;
  background: #e7e5de;
  opacity: .9;
  transform: rotate(-7deg);
}

.ghost {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: .04em;
  font-size: clamp(3rem, 10.5vw, 8.4rem);
  font-weight: 700;
  line-height: .95;
  letter-spacing: -.05em;
  color: transparent;
  -webkit-text-stroke: 1px #cfccc4;
  transform: rotate(-1.5deg);
  pointer-events: none;
  user-select: none;
  word-break: break-word;
}

.hero h1 {
  position: relative;
  margin: 0;
  max-width: 20ch;
  font-size: clamp(1.85rem, 4vw, 2.9rem);
  font-weight: 700;
  line-height: 1.28;
  letter-spacing: -.02em;
}

.hero-desc {
  position: relative;
  margin: 1rem 0 0 auto;
  max-width: 34ch;
  font-size: 16px;
  line-height: 1.8;
  color: var(--mid);
}

.hero-side {
  position: relative;
  margin-top: 1.5rem;
  color: var(--mid);
}

.hero-art {
  display: block;
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 18px;
  color: var(--mid);
  transform: rotate(6deg);
}

svg.hero-art { border-radius: 0; }

/* ---------- 正文 ---------- */
.prose { max-width: 730px; }

.prose > article {
  --rot: 0deg;
  position: relative;
  margin: 0 0 1.7rem;
  padding: 1.7rem 1.6rem 1.4rem;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: 0 12px 26px rgba(26, 26, 26, .075);
  transform: rotate(var(--rot));
  scroll-margin-top: calc(var(--strip) + 1.4rem);
}

.prose > article:nth-of-type(odd) { --rot: -.32deg; }
.prose > article:nth-of-type(even) { --rot: .38deg; }
.prose > article:nth-of-type(3n) { --rot: -.14deg; }

html.js .prose > article {
  opacity: 0;
  transform: rotate(var(--rot)) translateY(16px);
}

html.js .prose > article.in {
  opacity: 1;
  transform: rotate(var(--rot)) translateY(0);
  transition: opacity .34s steps(4), transform .34s ease-out;
}

.prose small {
  display: block;
  margin-bottom: .15rem;
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--faint);
}

.prose h2 {
  margin: .1rem 0 .9rem;
  font-size: 1.42rem;
  font-weight: 700;
  line-height: 1.42;
  letter-spacing: -.01em;
}

.prose h3 {
  margin: 1.5rem 0 .6rem;
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.5;
}

.prose p {
  margin: 0 0 1.05rem;
  color: #2c2c2c;
}

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

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-style: dashed;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.prose ul,
.prose ol {
  margin: 0 0 1.05rem;
  padding-left: 1.3rem;
}

.prose li { margin-bottom: .45rem; }

.prose blockquote {
  margin: 0 0 1.05rem;
  padding: .4rem 0 .4rem 1rem;
  border-left: 2px dashed var(--line);
  color: var(--mid);
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: 20px;
  filter: grayscale(1) contrast(1.04);
}

.prose hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 1.6rem 0;
}

/* ---------- 页脚 ---------- */
footer {
  margin-left: var(--rail);
  border-top: 1px solid var(--line);
  background: var(--wash);
  padding: 3rem 2rem 1.4rem;
}

.foot-cols {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2rem;
  max-width: 1060px;
}

.foot-brand {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3.4rem);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.045em;
  transform: rotate(-1.6deg);
  transform-origin: left top;
}

footer dl { margin: 0; }

footer dt {
  font-size: 12px;
  letter-spacing: .3em;
  color: var(--faint);
  margin-bottom: .5rem;
}

footer dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--mid);
}

footer dd a {
  display: flex;
  align-items: center;
  min-height: 40px;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px dashed var(--line);
}

footer dd a:hover { color: var(--ink); }

.foot-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.5rem;
  margin-top: 2.4rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--line);
  font-size: 14px;
  color: var(--faint);
}

.foot-base p { margin: 0; }

.foot-base a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: var(--mid);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
}

/* ---------- 断点 ---------- */
@media (max-width: 1080px) {
  .wrap { grid-template-columns: 148px minmax(0, 1fr); gap: 1.6rem; }
}

@media (max-width: 900px) {
  :root { --rail: 0px; }

  .rail {
    position: static;
    width: auto;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1.2rem;
    padding: .85rem 1rem;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .brand { transform: none; border-bottom-width: 1px; }

  .nav { margin: 0; flex: 1 1 auto; min-width: 132px; }

  .menu { position: relative; }

  .menu summary { min-height: 44px; }

  .menu menu {
    margin-top: .5rem;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: .3rem .5rem;
  }

  .rail-mark { display: none; }

  main, footer { margin-left: 0; }

  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.4rem;
    padding: 1.6rem 1rem 3rem;
  }

  .side { position: static; padding-top: 0; }

  .side ol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 .9rem;
  }

  .side li a { font-size: 14px; }

  .hero {
    min-height: 0;
    padding: 1rem 0 2rem;
  }

  .ghost { font-size: clamp(2.6rem, 13vw, 5rem); }

  .hero::after { display: none; }

  .hero h1 { font-size: clamp(1.6rem, 6.4vw, 2.2rem); }

  .prose > article { padding: 1.35rem 1.15rem 1.1rem; }

  .foot-cols { grid-template-columns: 1fr 1fr; gap: 1.4rem; }

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

@media (max-width: 420px) {
  body { font-size: 16px; }
  .foot-cols { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .prose > article { opacity: 1; transform: rotate(var(--rot)); transition: none; }
  .ghost { transform: rotate(-1.5deg) !important; }
}

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