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

:root{
  --ink:#1f1f1f;
  --paper:#ffffff;
  --mist:#f5f5f5;
  --line:#e4e4e4;
  --line-2:#c9c9c9;
  --muted:#6b6b6b;
  --r:4px;
  --max:1120px;
  --head-h:150px;
}

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

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

body{
  margin:0;
  background:var(--mist);
  color:var(--ink);
  font-family:"Jost",-apple-system,"Helvetica Neue",system-ui,"PingFang SC","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.7;
  letter-spacing:.005em;
}

img{display:block;max-width:100%;height:auto}
a{color:inherit;text-decoration:none}
p{margin:0 0 1em}
ul,ol{margin:0 0 1em}

h1,h2,h3,h4{
  margin:0;
  font-family:"Bodoni Moda",Georgia,"Songti SC",serif;
  font-weight:500;
  line-height:1.18;
  letter-spacing:.005em;
}

h1{font-size:clamp(27px,5vw,43px);letter-spacing:-.005em}
h2{font-size:clamp(21px,2.6vw,27px)}
h3{font-size:clamp(18px,2.2vw,21px)}

h2 > span,h3 > span{
  display:inline-block;
  padding-bottom:6px;
  border-bottom:1px solid currentColor;
}

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

main [id]{scroll-margin-top:var(--head-h)}
section[id],article[id]{scroll-margin-top:var(--head-h)}

/* ---------- 页头：品牌行 + 菜单行 ---------- */
.site-head{
  position:sticky;
  top:0;
  z-index:30;
  background:rgba(255,255,255,.94);
  backdrop-filter:saturate(140%) blur(12px);
  border-bottom:1px solid var(--line);
}

.head-brand{
  max-width:var(--max);
  margin:0 auto;
  padding:12px 20px 6px;
}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:2px;
}

.brand-mark{width:30px;height:30px;border-radius:50%;border:1px solid var(--line-2)}

.brand-name{
  font-family:"Bodoni Moda",Georgia,serif;
  font-size:21px;
  letter-spacing:.07em;
}

.head-nav{
  max-width:var(--max);
  margin:0 auto;
  padding:0 20px 10px;
  display:flex;
  align-items:center;
  gap:14px;
}

.head-nav p{
  display:flex;
  gap:4px;
  flex:1 1 auto;
  min-width:0;
  margin:0;
  overflow-x:auto;
  scrollbar-width:none;
  -ms-overflow-style:none;
}

.head-nav p::-webkit-scrollbar{display:none}

.head-nav p a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 12px;
  font-size:16px;
  color:var(--muted);
  border-radius:var(--r);
  white-space:nowrap;
  transition:color .2s ease,background-color .2s ease;
}

.head-nav p a:hover{color:var(--ink);background:var(--mist)}

.head-cta{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 18px;
  border-radius:var(--r);
  background:var(--ink);
  color:#fff;
  font-size:15px;
  letter-spacing:.05em;
  white-space:nowrap;
  transition:background-color .2s ease,transform .2s ease;
}

.head-cta:hover{background:#000;transform:scale(1.02)}

/* ---------- 主区 ---------- */
main{
  max-width:var(--max);
  margin:0 auto;
  padding:20px 20px 20px;
}

.hero{
  position:relative;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  min-height:clamp(250px,45vh,430px);
  padding:clamp(26px,5vw,54px) 24px clamp(22px,4vw,36px);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
}

.hero-fig{
  margin:0 auto 14px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.hero-glyph{width:40px;height:40px;opacity:.9}

.hero-lede{
  max-width:58ch;
  margin:16px auto 0;
  color:var(--muted);
  font-size:17px;
}

.hero-band{
  position:absolute;
  left:-3%;
  right:-3%;
  bottom:-2px;
  height:7px;
  background:var(--ink);
  transform:skewY(-1.4deg);
  transform-origin:left center;
}

/* ---------- 内容壳：左侧目录 + 正文 ---------- */
.shell{
  display:grid;
  grid-template-columns:248px minmax(0,1fr);
  gap:16px;
  margin-top:16px;
  align-items:start;
}

.toc{
  position:sticky;
  top:calc(var(--head-h) + 8px);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:16px 18px 12px;
}

.toc h2{font-size:19px}

.toc-body{
  display:flex;
  flex-direction:column;
  margin-top:10px;
}

.toc-body a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:2px 0;
  font-size:16px;
  color:var(--muted);
  border-bottom:1px dashed var(--line);
  transition:color .2s ease,padding-left .2s ease;
}

.toc-body a:last-child{border-bottom:0}
.toc-body a:hover{color:var(--ink);padding-left:4px}

.prose{
  min-width:0;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:clamp(20px,3.2vw,38px);
}

.prose > section,
.prose > article,
.prose > div,
.prose > aside{
  border:1px solid var(--line);
  border-radius:var(--r);
  padding:clamp(18px,3vw,30px);
  margin:0 0 16px;
  transition:transform .25s ease,border-color .25s ease;
}

.prose > section:last-child,
.prose > article:last-child{margin-bottom:0}

.prose > section:hover,
.prose > article:hover{border-color:var(--line-2);transform:scale(1.006)}

.prose h2{margin:0 0 12px}
.prose h3{margin:22px 0 8px}
.prose > section > :last-child,
.prose > article > :last-child{margin-bottom:0}
.prose ul,.prose ol{padding-left:1.25em}
.prose li{margin:.35em 0}
.prose a{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.prose a:hover{color:#000;text-decoration-thickness:2px}

.prose blockquote{
  margin:0 0 1em;
  padding:8px 0 8px 16px;
  border-left:2px solid var(--ink);
  color:var(--muted);
}

.prose img{margin:14px 0;border-radius:var(--r);border:1px solid var(--line)}

.prose figure{margin:14px 0}
.prose figcaption{font-size:15px;color:var(--muted);margin-top:6px}

.prose table{width:100%;border-collapse:collapse;font-size:16px}
.prose th,.prose td{border:1px solid var(--line);padding:8px 10px;text-align:left}
.prose th{background:var(--mist);font-weight:500}

.prose code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.92em;
  background:var(--mist);
  border:1px solid var(--line);
  border-radius:2px;
  padding:1px 4px;
}

/* ---------- 底部大 CTA ---------- */
.callout{
  margin-top:16px;
  padding:clamp(24px,4vw,46px);
  background:var(--ink);
  color:#fff;
  border-radius:var(--r);
  display:grid;
  gap:18px;
  justify-items:start;
}

.callout h2 > span{border-bottom-color:rgba(255,255,255,.55)}

.callout-links{display:flex;flex-wrap:wrap;gap:10px}

.callout-links a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 20px;
  font-size:16px;
  border:1px solid rgba(255,255,255,.45);
  border-radius:var(--r);
  transition:background-color .2s ease,color .2s ease,transform .2s ease;
}

.callout-links a:hover{background:#fff;color:var(--ink);transform:scale(1.02)}

/* ---------- 页脚：单行 ---------- */
.site-foot{
  max-width:var(--max);
  margin:16px auto 0;
  padding:24px 20px 34px;
  display:flex;
  flex-wrap:wrap;
  align-items:flex-start;
  gap:10px 26px;
  border-top:1px solid var(--line);
}

.foot-brand{flex:1 1 240px;min-width:0}

.foot-logo{
  display:inline-flex;
  align-items:center;
  gap:8px;
  min-height:40px;
}

.foot-mark{width:22px;height:22px;border-radius:50%;border:1px solid var(--line-2)}

.foot-logo span{
  font-family:"Bodoni Moda",Georgia,serif;
  font-size:18px;
  letter-spacing:.06em;
}

.foot-desc{
  margin:2px 0 0;
  font-size:15px;
  line-height:1.6;
  color:var(--muted);
  max-width:34ch;
}

.foot-nav{
  display:flex;
  flex-wrap:wrap;
  gap:0 12px;
  flex:1 1 300px;
}

.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-size:15px;
  color:var(--muted);
  transition:color .2s ease;
}

.foot-nav a:hover{color:var(--ink)}

.foot-copy{
  flex:0 0 100%;
  text-align:center;
  font-size:14px;
  color:var(--muted);
  padding-top:8px;
  border-top:1px solid var(--line);
}

/* ---------- 滚动显现 ---------- */
.js-reveal .reveal{
  opacity:0;
  transform:translateY(14px);
}

.js-reveal .reveal.in{
  opacity:1;
  transform:none;
  transition:opacity .55s ease,transform .55s ease;
}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .shell{grid-template-columns:1fr}
  .toc{position:static}
  .toc-body{flex-direction:row;flex-wrap:wrap;gap:0 14px}
  .toc-body a{border-bottom:0;padding-right:2px}
}

@media (max-width:640px){
  :root{--head-h:170px}
  body{font-size:16px}
  .head-brand{padding:8px 16px 2px}
  .head-nav{padding:0 16px 8px;gap:10px}
  .head-nav p a{padding:0 10px;font-size:15px}
  .head-cta{padding:0 14px;font-size:15px}
  main{padding:12px 14px 16px}
  .hero{padding:24px 16px 20px;min-height:0}
  .hero-lede{font-size:16px;margin-top:12px}
  .prose{padding:18px}
  .site-foot{padding:20px 16px 26px}
  .foot-nav{gap:0 10px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{transition:none !important;animation:none !important}
  .js-reveal .reveal{opacity:1;transform:none}
}

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