:root{
  --ink:#000000;
  --blue:#3bb1ff;
  --red:#ff5252;
  --paper:#fbf7f0;
  --white:#ffffff;
  --line:3px solid #000000;
  --dash:2px solid #000000;
  --shadow:5px 5px 0 #000000;
  --sans:'Lato',"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  --serif:'EB Garamond',"Songti SC","Source Han Serif SC",Georgia,serif;
  --mast:120px;
}
*{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font:16px/1.7 var(--sans);
  font-weight:400;
  overflow-x:hidden;
}
img{max-width:100%;height:auto;display:block}
a{color:inherit;text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
a:hover{background:var(--blue)}
:focus-visible{outline:3px solid var(--red);outline-offset:2px}

/* ---------- 顶部两行导航 ---------- */
.masthead{
  position:sticky;
  top:0;
  z-index:30;
  background:var(--white);
  border-bottom:var(--line);
  box-shadow:0 5px 0 rgba(0,0,0,.12);
}
.masthead-bar{
  max-width:1180px;
  margin:0 auto;
  padding:8px 16px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:46px;
  padding:4px 12px 4px 4px;
  border:var(--line);
  border-radius:10px;
  background:var(--paper);
  font-family:var(--serif);
  font-weight:700;
  font-size:22px;
  letter-spacing:.02em;
  text-decoration:none;
}
.brand:hover{background:var(--white)}
.brand-mark{
  width:34px;height:34px;
  display:grid;place-items:center;
  background:var(--red);
  border:var(--line);
  border-radius:50%;
}
.brand-name{white-space:nowrap}
.contact-pill{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 16px;
  border:var(--line);
  background:var(--blue);
  box-shadow:4px 4px 0 #000000;
  border-radius:10px;
  font-weight:700;
  text-decoration:none;
}
.contact-pill:hover{background:var(--red)}
.dock{
  max-width:1180px;
  margin:0 auto;
  padding:0 16px 10px;
  overflow-x:auto;
  overscroll-behavior-x:contain;
}
.dock ul{
  list-style:none;
  margin:0;padding:0;
  display:flex;
  flex-wrap:nowrap;
  gap:8px;
}
.dock a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:6px 12px;
  border:var(--line);
  border-radius:10px;
  background:var(--white);
  font-weight:700;
  font-size:16px;
  white-space:nowrap;
  text-decoration:none;
}
.dock a:hover,.dock a:focus-visible{background:var(--blue)}

/* ---------- 内容骨架：main > section > article ---------- */
main{
  max-width:1180px;
  margin:0 auto;
  padding:20px 16px 56px;
}
main.stage{
  display:grid;
  grid-template-columns:236px minmax(0,1fr);
  gap:26px;
  align-items:start;
}
section{min-width:0}

/* ---------- 左侧栏 ---------- */
.rail{
  position:sticky;
  top:calc(var(--mast) + 16px);
  border:var(--line);
  border-radius:10px;
  background:var(--white);
  padding:14px;
  box-shadow:var(--shadow);
}
.rail h2{
  display:flex;
  align-items:center;
  gap:8px;
  margin:0 0 10px;
  font-family:var(--sans);
  font-size:16px;
  letter-spacing:.06em;
}
.rail h2::before{
  content:"";
  width:12px;height:12px;
  background:var(--red);
  border:var(--dash);
  flex:0 0 auto;
}
.rail h2 span{border-bottom:3px solid var(--blue);padding-bottom:2px}
.rail h2:not(:first-child){
  margin-top:16px;
  padding-top:14px;
  border-top:var(--dash);
}
.toc{
  list-style:none;
  margin:0;padding:0;
}
.toc li:last-child a{border-bottom:0}
.toc a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:4px 2px;
  border-bottom:var(--dash);
  font-weight:700;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
}
.toc a:hover,.toc a.on{background:var(--blue)}
.to-top{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  padding:4px 12px;
  border:var(--line);
  border-radius:10px;
  background:var(--paper);
  font-weight:700;
  text-decoration:none;
}
.to-top:hover{background:var(--red)}

/* ---------- 首屏 ---------- */
.hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:26px;
  min-height:52vh;
  padding:4px 0 30px;
  flex-wrap:wrap;
}
.hero-copy{flex:1 1 320px;min-width:0}
.kicker{
  display:inline-block;
  margin:0 0 12px;
  padding:3px 12px;
  border:var(--line);
  border-radius:10px;
  background:var(--blue);
  font-weight:700;
  font-size:16px;
  letter-spacing:.04em;
}
h1{
  margin:0 0 16px;
  font-family:var(--serif);
  font-weight:700;
  font-size:clamp(30px,5.2vw,54px);
  line-height:1.22;
  letter-spacing:.005em;
}
.lede{
  margin:0;
  max-width:44ch;
  font-size:18px;
  line-height:1.75;
}
.hero-art{flex:0 0 auto}
.art-peach{width:150px;height:auto}

/* ---------- 正文 ---------- */
.prose{counter-reset:sec}
.prose article{
  counter-increment:sec;
  position:relative;
  margin:0 0 32px;
  padding:26px 22px 22px;
  border:var(--line);
  border-radius:10px;
  background:var(--white);
  box-shadow:var(--shadow);
  scroll-margin-top:calc(var(--mast) + 24px);
}
.prose article::before{
  content:"0" counter(sec);
  position:absolute;
  top:-16px;
  left:18px;
  padding:1px 9px;
  border:var(--line);
  border-radius:10px;
  background:var(--ink);
  color:var(--white);
  font-weight:700;
  font-size:15px;
  letter-spacing:.08em;
}
.prose p{margin:0 0 1em;font-size:18px;line-height:1.8}
.prose p:last-child{margin-bottom:0}
.prose h2{
  margin:.1em 0 .8em;
  padding-bottom:8px;
  border-bottom:3px solid var(--blue);
  font-family:var(--serif);
  font-size:clamp(22px,2.8vw,30px);
  line-height:1.3;
}
.prose h3{
  margin:1.2em 0 .6em;
  padding-bottom:6px;
  border-bottom:3px solid var(--red);
  font-family:var(--serif);
  font-size:clamp(19px,2.2vw,23px);
  line-height:1.35;
}
.prose h2 span,.prose h3 span{display:inline-block}
.prose ul,.prose ol{margin:0 0 1em;padding-left:22px;font-size:18px;line-height:1.8}
.prose li{margin-bottom:.4em}
.prose blockquote{
  margin:0 0 1em;
  padding:12px 16px;
  border:var(--line);
  border-left-width:10px;
  border-radius:10px;
  background:var(--paper);
  font-size:18px;
}
.prose blockquote p:last-child{margin-bottom:0}
.prose strong{font-weight:700;background:#ffe9a8}
.prose img{
  border:var(--line);
  border-radius:10px;
  box-shadow:var(--shadow);
  margin:0 0 1em;
}
.prose :is(table,pre){
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  margin:0 0 1em;
  padding:10px;
  border:var(--line);
  border-radius:10px;
  background:var(--paper);
}
.prose table{border-collapse:collapse}
.prose th,.prose td{border:2px solid #000000;padding:6px 10px;font-size:17px}
.prose code{font-family:ui-monospace,SFMono-Regular,Menlo,monospace}

/* ---------- 页脚 ---------- */
footer{
  border-top:var(--line);
  background:var(--ink);
  color:var(--white);
  padding:26px 16px;
  text-align:center;
}
footer p{
  margin:0 0 8px;
  font-size:17px;
  font-weight:700;
  letter-spacing:.04em;
}
footer small{
  display:block;
  font-size:16px;
  line-height:1.6;
  opacity:.82;
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference){
  .reveal{
    opacity:0;
    transform:translateY(20px);
    transition:opacity .5s ease-out,transform .5s ease-out;
  }
  .reveal.in{opacity:1;transform:none}
}

/* ---------- 窄屏：正文在前，侧栏下沉 ---------- */
@media (max-width:900px){
  :root{--mast:118px}
  main.stage{grid-template-columns:minmax(0,1fr);gap:22px}
  section{order:1}
  .rail{position:static;order:2}
  .rail h2:not(:first-child){margin-top:12px}
  .toc{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:6px}
  .toc a{min-height:44px;padding:8px 10px;border:var(--dash);border-radius:10px}
  .hero{min-height:0;padding-top:2px;gap:16px}
  .art-peach{width:112px}
  .prose article::before{font-size:14px}
}
@media (max-width:560px){
  .masthead-bar{padding:7px 12px}
  .brand{font-size:19px;min-height:44px}
  .brand-mark{width:30px;height:30px}
  .dock{padding:0 12px 9px}
  .dock a{padding:6px 12px;font-size:16px}
  main{padding:14px 12px 44px}
  .hero-copy{flex:1 1 100%}
  .hero-art{width:96px}
  h1{font-size:clamp(26px,8.4vw,36px);margin-bottom:12px}
  .lede,.prose p,.prose ul,.prose ol,.prose blockquote{font-size:17px}
  .prose article{padding:22px 14px 16px}
  .contact-pill{padding:8px 12px}
}

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