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

:root {
  --paper: #fdfbf7;
  --paper-2: #f5f5f5;
  --ink: #1a1a1a;
  --mute: #585858;
  --rule: #e0e0e0;
  --gut: clamp(1rem, 4vw, 2.5rem);
  --ui: 'Inter', system-ui, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --num: 'JetBrains Mono', ui-monospace, monospace;
  --dsp: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --read: Georgia, 'Songti SC', 'Noto Serif SC', 'Source Han Serif SC', serif;
}

* { box-sizing: border-box; }

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

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

body {
  margin: 0;
  background-color: var(--paper);
  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='.8' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.06'/%3E%3C/svg%3E");
  color: var(--ink);
  font: 400 17px/1.75 var(--read);
  overflow-x: hidden;
}

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

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

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

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: .85rem 0 1rem;
}

/* ---------- 顶部两行 ---------- */
.topbar {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}

.brandrow {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1rem var(--gut) .75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.25rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  min-height: 44px;
  text-decoration: none;
  font-family: var(--dsp);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: .01em;
}

.mark {
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--ink);
  font-family: var(--num);
  font-size: .8125rem;
  letter-spacing: -.02em;
  
}

.brandname { line-height: 1.35; }

.srch {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--rule);
  background: #fff;
  font-family: var(--ui);
  font-size: 1rem;
}

.srch-l {
  display: flex;
  align-items: center;
  padding: 0 .6rem;
  color: var(--mute);
  white-space: nowrap;
}

.srch input {
  border: 0;
  background: transparent;
  width: 9.5rem;
  min-height: 42px;
  padding: .4rem .3rem;
  font: inherit;
  color: var(--ink);
  min-width: 0;
}

.srch button {
  border: 0;
  border-left: 1px solid var(--rule);
  background: var(--paper-2);
  color: var(--ink);
  padding: 0 .9rem;
  min-height: 42px;
  font: inherit;
  cursor: pointer;
}

.srch button:hover { background: var(--ink); color: var(--paper); }

.menurow {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 var(--gut) .55rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .15rem 1.75rem;
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.5;
}

.grp {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 .1rem;
}

.gnum {
  font-family: var(--num);
  font-size: .8125rem;
  color: var(--mute);
  padding-right: .5rem;
  margin-right: .35rem;
  border-right: 1px solid var(--rule);
  align-self: stretch;
  display: flex;
  align-items: center;
}

.grp a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .3rem .55rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.grp a:hover { border-bottom-color: var(--ink); }
.grp a[aria-current] { border-bottom-color: var(--ink); font-weight: 600; }

/* ---------- 主体骨架 ---------- */
main { display: block; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(1rem, 3vw, 2rem) var(--gut) 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16.5rem;
  gap: clamp(1.5rem, 4vw, 3.5rem);
  align-items: start;
}

.col { min-width: 0; }

/* ---------- Hero ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  align-items: center;
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-bottom: clamp(1.25rem, 3vw, 2rem);
}

.hero h1 {
  margin: 0 0 .75rem;
  font-family: var(--dsp);
  font-weight: 700;
  font-size: clamp(1.7rem, 4.4vw, 2.75rem);
  line-height: 1.22;
  letter-spacing: -.015em;
}

.lede {
  margin: 0;
  max-width: 40ch;
  color: var(--mute);
  font-size: 1.0625rem;
  line-height: 1.7;
}

.hero-media {
  min-height: 45vh;
  border: 1px solid var(--rule);
  background-color: var(--paper-2);
  background-image: radial-gradient(circle, rgba(26, 26, 26, .2) 1px, transparent 1px);
  background-size: 11px 11px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.hero-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

/* ---------- 正文纸片 ---------- */
.col article > div {
  background: #fff;
  border: 1px solid var(--rule);
  border-radius: 0;
  box-shadow: 0 2px 9px rgba(26, 26, 26, .055);
  padding: clamp(1.1rem, 3.2vw, 2rem);
  margin: 0 0 1.25rem;
  scroll-margin-top: 1rem;
}

.col article > div > :first-child { margin-top: 0; }
.col article > div > :last-child { margin-bottom: 0; }

.col article h2,
.col article h3,
.col article h4 {
  font-family: var(--dsp);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.005em;
  margin: 1.75rem 0 .4rem;
}

.col article h2 { font-size: 1.3125rem; }
.col article h3 { font-size: 1.09rem; }
.col article h4 { font-size: 1rem; }

.col article p,
.col article li { max-width: 70ch; }

.col article p { margin: 0 0 1rem; }

.col article ul,
.col article ol {
  margin: 0 0 1rem;
  padding-left: 1.35rem;
}

.col article li { margin: .3rem 0; }

.col article blockquote {
  margin: 1.1rem 0;
  padding: .1rem 0 .1rem 1rem;
  border-left: 2px solid var(--ink);
  color: var(--mute);
}

.col article code {
  font-family: var(--num);
  font-size: .925em;
  background: var(--paper-2);
  padding: .1em .35em;
}

.col article pre {
  font-family: var(--num);
  font-size: .875rem;
  line-height: 1.6;
  background: var(--paper-2);
  border: 1px solid var(--rule);
  padding: .9rem 1rem;
  overflow-x: auto;
}

.col article pre code { background: none; padding: 0; }

.col article table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-family: var(--ui);
  font-size: 1rem;
}

.col article th,
.col article td {
  border: 1px solid var(--rule);
  padding: .55rem .7rem;
  text-align: left;
  vertical-align: top;
}

.col article th { background: var(--paper-2); }

.col article strong { font-weight: 700; }

.col article img { border: 1px solid var(--rule); }

/* ---------- 右侧栏 ---------- */
.side {
  position: sticky;
  top: 1rem;
  border-top: 2px solid var(--ink);
  padding-top: .7rem;
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.55;
  min-width: 0;
}

.side h2 {
  margin: 0 0 .3rem;
  font-family: var(--num);
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--mute);
}

.side hr { margin: 0 0 .5rem; }

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

.side a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: .25rem .6rem;
  text-decoration: none;
  border-left: 2px solid var(--rule);
  line-height: 1.4;
}

.side a:hover { background: var(--paper-2); }
.side a[aria-current] { background: var(--paper-2); border-left-color: var(--ink); font-weight: 600; }

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  margin-top: .5rem;
  padding: 0 .6rem;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--rule);
}

.totop:hover { border-color: var(--ink); }

/* ---------- 页脚 ---------- */
footer {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(1rem, 3vw, 2.5rem);
  max-width: 1180px;
  margin: 2.75rem auto 0;
  padding: 2rem var(--gut) 1.25rem;
  border-top: 1px solid var(--ink);
  font-family: var(--ui);
  font-size: 1rem;
  line-height: 1.6;
}

footer h2 {
  margin: 0 0 .3rem;
  font-family: var(--dsp);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

footer hr { margin: 0 0 .7rem; }

.f-desc { margin: 0; color: var(--mute); max-width: 34ch; }

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

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .15rem 0;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.f-nav a:hover { border-bottom-color: var(--ink); }
.f-nav a[aria-current] { border-bottom-color: var(--ink); font-weight: 600; }

.sub { display: flex; flex-wrap: wrap; gap: .35rem; }

.sub-l {
  width: 100%;
  color: var(--mute);
}

.sub input {
  flex: 1 1 8rem;
  min-width: 0;
  min-height: 42px;
  padding: .4rem .6rem;
  border: 1px solid var(--rule);
  background: #fff;
  font: inherit;
  color: var(--ink);
}

.sub button {
  min-height: 42px;
  padding: 0 1rem;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  cursor: pointer;
}

.sub button:hover { background: var(--paper); color: var(--ink); }

.f-bot {
  grid-column: 1 / -1;
  margin-top: .75rem;
  padding-top: .9rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: .35rem 1.5rem;
  color: var(--mute);
  text-align: center;
}

.f-bot p { margin: 0; }

.f-bot a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 .4rem;
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}

.f-bot a:hover { border-bottom-color: var(--ink); }

/* ---------- 滚动揭示 ---------- */
.reveal { opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .reveal { transition: opacity .16s linear; }
}

.reveal.is-in { opacity: 1; }

/* ---------- 断点 ---------- */
@media (max-width: 900px) {
  .wrap { grid-template-columns: minmax(0, 1fr); }
  .side { position: static; top: auto; margin-top: .5rem; }
  .side ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .5rem; }
  footer { grid-template-columns: 1fr 1fr; }
  .f-sec:first-child { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .hero { grid-template-columns: minmax(0, 1fr); padding-bottom: 1.25rem; }
  .hero-media { min-height: 30vh; }
  .lede { max-width: none; }
}

@media (max-width: 640px) {
  .brandrow { gap: .5rem; }
  .srch { width: 100%; order: 3; }
  .srch input { flex: 1 1 auto; width: auto; }
  .menurow { gap: 0 .5rem; font-size: 1rem; }
  .gnum { padding-right: .35rem; margin-right: .1rem; }
  .grp a { padding: .3rem .4rem; }
  footer { grid-template-columns: minmax(0, 1fr); }
  .side ul { grid-template-columns: minmax(0, 1fr); }
}

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