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

:root {
  --ink: #000000;
  --paper: #ffffff;
  --soft: rgba(0, 0, 0, 0.09);
  --line: rgba(0, 0, 0, 0.17);
  --mute: rgba(0, 0, 0, 0.6);
  --sans: 'Exo', 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'Roboto Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}

* {
  box-sizing: border-box;
}

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

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

a {
  color: inherit;
}

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

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

/* ---------- 页头 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
  transition: background 0.3s ease, color 0.3s ease;
}

.head-top {
  padding: 10px 18px;
  border-bottom: 1px solid var(--ink);
  transition: border-color 0.3s ease;
}

.brand {
  display: inline-block;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  padding: 8px 0;
  line-height: 1.3;
}

.head-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
}

.burger {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.2;
  min-height: 44px;
  min-width: 44px;
  padding: 11px 15px;
  background: transparent;
  color: inherit;
  border: 1px solid currentColor;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.08em;
}

.cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  border: 1px solid var(--ink);
  border-radius: 4px;
  transition: background 0.25s ease, color 0.25s ease;
}

body.menu-open .site-head {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--paper);
}

body.menu-open .head-top {
  border-color: rgba(255, 255, 255, 0.4);
}

body.menu-open .cta {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

/* ---------- 全屏菜单 ---------- */
.veil {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-103%);
  transition: transform 0.55s cubic-bezier(0.76, 0, 0.24, 1);
  overflow-y: auto;
  padding: 126px 20px 40px;
  -webkit-overflow-scrolling: touch;
}

body.menu-open .veil {
  transform: translateY(0);
}

body.menu-open {
  overflow: hidden;
}

.nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  max-width: 900px;
  counter-reset: nl;
}

.nav li {
  counter-increment: nl;
  border-top: 1px solid rgba(255, 255, 255, 0.26);
}

.nav li:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.26);
}

.nav a {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding: 12px 0;
  min-height: 52px;
  color: var(--paper);
  text-decoration: none;
  font-size: clamp(22px, 5.4vw, 40px);
  font-weight: 600;
  line-height: 1.34;
  letter-spacing: -0.01em;
}

.nav a::before {
  content: counter(nl, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 400;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

.nav a:hover {
  opacity: 0.72;
}

/* ---------- 骨架 ---------- */
.wrap {
  max-width: 1300px;
  margin: 0 auto;
}

main {
  scroll-margin-top: 124px;
}

/* ---------- 首屏 ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 56px 18px 44px;
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}

.hero-rot {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform;
}

.hero-rot span {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 12px;
  font-size: clamp(60px, 19vw, 240px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.05em;
  opacity: 0;
  animation: rot 24s linear infinite;
}

.hero-rot span:nth-child(1) { animation-delay: 0s; }
.hero-rot span:nth-child(2) { animation-delay: 4s; }
.hero-rot span:nth-child(3) { animation-delay: 8s; }
.hero-rot span:nth-child(4) { animation-delay: 12s; }
.hero-rot span:nth-child(5) { animation-delay: 16s; }
.hero-rot span:nth-child(6) { animation-delay: 20s; }

@keyframes rot {
  0% { opacity: 0; }
  3% { opacity: 0.075; }
  14% { opacity: 0.075; }
  17% { opacity: 0; }
  100% { opacity: 0; }
}

.hero-body {
  position: relative;
  z-index: 1;
}

.hero h1 {
  margin: 0;
  text-align: right;
  font-size: clamp(34px, 8.6vw, 112px);
  font-weight: 700;
  line-height: 0.96;
  letter-spacing: -0.035em;
  overflow-wrap: break-word;
}

.lede {
  margin: 18px 0 0 auto;
  max-width: 44ch;
  text-align: right;
  font-size: 16px;
  line-height: 1.72;
  color: var(--mute);
}

/* ---------- 正文与侧栏 ---------- */
.body-sec {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.prose {
  min-width: 0;
  padding: 8px 18px 32px;
}

.prose > div {
  padding: 44px 0 36px;
  border-bottom: 1px solid var(--line);
}

.prose > div:last-child {
  border-bottom: 0;
}

.prose h2,
.prose h3 {
  margin: 34px 0 12px;
  line-height: 1.16;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.prose h2 {
  font-size: clamp(24px, 3.4vw, 42px);
}

.prose h3 {
  font-size: clamp(20px, 2.2vw, 26px);
}

.prose h2 + hr,
.prose h3 + hr {
  border: 0;
  height: 3px;
  width: 56px;
  background: var(--ink);
  margin: 0 0 22px;
}

.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 30px 0;
}

.prose p {
  margin: 0 0 1.05em;
}

.prose > div > p:first-of-type::first-letter {
  float: left;
  font-size: 3.3em;
  line-height: 0.86;
  font-weight: 700;
  padding: 0.05em 0.13em 0 0;
}

.prose blockquote {
  margin: 28px 0;
  padding: 6px 0 6px 20px;
  border-left: 5px solid var(--ink);
  font-size: 20px;
  font-weight: 500;
  line-height: 1.55;
}

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

.prose figure {
  margin: 28px 0;
}

.prose figcaption {
  font-family: var(--mono);
  font-size: 16px;
  line-height: 1.5;
  color: var(--mute);
  padding-top: 8px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}

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

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

.prose li {
  margin-bottom: 0.45em;
}

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

.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 9px 11px;
  text-align: left;
}

.prose th {
  background: rgba(0, 0, 0, 0.05);
}

.prose div {
  scroll-margin-top: 130px;
}

/* 侧栏 */
.side {
  padding: 0 18px 40px;
  border-top: 1px solid var(--ink);
  margin-top: 8px;
}

.side-t {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.16em;
  margin: 22px 0 12px;
}

.side hr {
  border: 0;
  height: 3px;
  width: 48px;
  background: var(--ink);
  margin: 0 0 18px;
}

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

.side-list li {
  counter-increment: sl;
  border-top: 1px solid var(--line);
}

.side-list li:last-child {
  border-bottom: 1px solid var(--line);
}

.side-list a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  padding: 11px 2px;
  min-height: 44px;
  text-decoration: none;
  font-size: 16px;
  line-height: 1.5;
}

.side-list a::before {
  content: counter(sl, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 16px;
  color: var(--mute);
}

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

.side-list a:hover::before {
  color: var(--paper);
}

/* ---------- 页脚 ---------- */
.site-foot {
  border-top: 2px solid var(--ink);
  margin-top: 60px;
  padding: 0 18px 26px;
  background: var(--paper);
}

.foot-mark {
  margin: 0;
  padding: 20px 0 16px;
  font-size: clamp(40px, 12vw, 176px);
  font-weight: 700;
  line-height: 0.84;
  letter-spacing: -0.05em;
  text-align: right;
  border-bottom: 1px solid var(--ink);
  white-space: nowrap;
  overflow: hidden;
}

.foot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px 18px;
  padding: 24px 0;
  border-bottom: 1px solid var(--ink);
}

.foot-grid dl {
  margin: 0;
  min-width: 0;
}

.foot-grid dt {
  font-family: var(--mono);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--mute);
  margin-bottom: 8px;
}

.foot-grid dd {
  margin: 0;
}

.foot-grid dd a {
  display: block;
  padding: 9px 0;
  min-height: 42px;
  font-size: 16px;
  line-height: 1.5;
  text-decoration: none;
  border-bottom: 1px solid var(--soft);
}

.foot-grid dd a:hover {
  background: var(--ink);
  color: var(--paper);
}

.foot-base {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 18px;
  font-family: var(--mono);
  font-size: 16px;
}

.foot-base .copy {
  margin: 0;
  line-height: 1.5;
  word-break: break-word;
}

.foot-base .to-home {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--ink);
  border-radius: 4px;
  text-decoration: none;
  white-space: nowrap;
}

.foot-base .to-home:hover {
  background: var(--ink);
  color: var(--paper);
}

/* ---------- 滚动显现 ---------- */
.js .prose > div {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.js .prose > div.in {
  opacity: 1;
  transform: none;
}

/* ---------- 断点 ---------- */
@media (min-width: 760px) {
  .head-top {
    padding: 12px 28px;
  }
  .head-foot {
    padding: 8px 28px;
  }
  .hero {
    padding: 64px 32px 52px;
  }
  .prose {
    padding: 12px 32px 40px;
  }
  .side {
    padding: 0 32px 40px;
  }
  .site-foot {
    padding: 0 28px 26px;
  }
  .foot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px 28px;
  }
  .veil {
    padding: 132px 32px 48px;
  }
}

@media (min-width: 900px) {
  .body-sec {
    grid-template-columns: minmax(0, 1fr) 296px;
    column-gap: clamp(24px, 4vw, 64px);
  }
  .side {
    position: sticky;
    top: 130px;
    align-self: start;
    border-top: 0;
    margin-top: 0;
    padding: 12px 0 40px;
  }
  .side-t {
    margin-top: 42px;
  }
}

@media (min-width: 1080px) {
  .foot-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .prose {
    padding-left: clamp(28px, 4vw, 56px);
    padding-right: clamp(28px, 4vw, 56px);
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .veil {
    transition: none;
  }
  .hero-rot span {
    animation: none;
    opacity: 0;
  }
  .hero-rot span:first-child {
    opacity: 0.075;
  }
  .js .prose > div {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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