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

:root{
  --ink:#1f1f1f;
  --paper:#ffffff;
  --mist:#f5f5f5;
  --soft:#7c7c7c;
  --line:#1f1f1f;
  --r:4px;
  --e1:0 1px 2px rgba(31,31,31,.08);
  --e2:0 4px 10px rgba(31,31,31,.10);
  --e3:0 10px 24px rgba(31,31,31,.13);
  --e4:0 18px 44px rgba(31,31,31,.18);
}

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

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

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:"Space Grotesk",system-ui,-apple-system,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.7;
  letter-spacing:.01em;
  overflow-x:hidden;
}

a{color:var(--ink);text-decoration:none}
a:hover{text-decoration:underline;text-underline-offset:3px}
img{display:block;max-width:100%;height:auto}
menu,ul,ol{margin:0;padding:0;list-style:none}
hr{
  width:64px;
  margin:10px 0 18px;
  border:0;
  border-top:2px solid var(--line);
}
h1,h2,h3{font-weight:700;line-height:1.18;letter-spacing:-.02em;margin:0}
p{margin:0 0 1.05em}
:focus-visible{outline:3px solid var(--ink);outline-offset:2px}

/* ── 吸顶标头：品牌缩成角落图标 ───────────────────────── */
.masthead{
  position:sticky;
  top:0;
  z-index:60;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:8px clamp(12px,3vw,22px);
  background:rgba(255,255,255,.84);
  -webkit-backdrop-filter:blur(12px) saturate(140%);
  backdrop-filter:blur(12px) saturate(140%);
  border-bottom:2px solid var(--ink);
}

.mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:40px;
  height:40px;
  overflow:hidden;
  border:2px solid var(--ink);
  border-radius:var(--r);
  background:var(--paper);
  box-shadow:var(--e2);
  transform:translateZ(0);
}
.mark img{width:100%;height:100%;object-fit:cover}
.mark__glyph{font-size:20px;font-weight:700;line-height:1;transform:translateY(-1px)}
.mark--sm{
  width:34px;
  height:34px;
  color:#fff;
  border-color:#fff;
  background:transparent;
  box-shadow:none;
}

.cta{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 16px;
  border-radius:var(--r);
  background:var(--ink);
  color:#fff;
  font-size:15px;
  font-weight:600;
  letter-spacing:.06em;
  box-shadow:var(--e3);
  transition:transform .18s ease,box-shadow .18s ease;
}
.cta:hover{text-decoration:none;transform:translateY(-1px);box-shadow:var(--e4)}

/* ── 二级粘性锚点条：分组下拉 ─────────────────────────── */
.rail{
  position:sticky;
  top:57px;
  z-index:50;
  background:var(--mist);
  border-bottom:2px solid var(--ink);
}
.rail__in{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:2px;
  max-width:1120px;
  margin:0 auto;
  padding:4px clamp(10px,3vw,18px);
}
.grp{position:relative}
.grp summary{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 12px;
  border-radius:var(--r);
  font-size:15px;
  font-weight:600;
  letter-spacing:.06em;
  cursor:pointer;
  list-style:none;
}
.grp summary::-webkit-details-marker{display:none}
.grp summary::after{
  content:"";
  width:7px;
  height:7px;
  margin-left:7px;
  border-right:2px solid var(--ink);
  border-bottom:2px solid var(--ink);
  transform:rotate(45deg) translateY(-2px);
}
.grp[open] summary{background:var(--ink);color:#fff}
.grp[open] summary::after{
  border-color:#fff;
  transform:rotate(-135deg) translateY(-2px);
}

.drop{
  position:absolute;
  top:100%;
  left:0;
  z-index:70;
  min-width:190px;
  padding:6px;
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:var(--r);
  box-shadow:var(--e4);
}
.drop li a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:0 10px;
  border-radius:var(--r);
  font-size:15px;
}
.drop li a:hover{background:var(--mist);text-decoration:none}

.rail__top{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  margin-left:auto;
  padding:0 14px;
  border:2px solid var(--ink);
  border-radius:var(--r);
  background:var(--paper);
  font-size:15px;
  font-weight:600;
}

/* ── 主体：左侧目录 + 正文卡 ─────────────────────────── */
main{
  display:block;
  padding:clamp(18px,4vw,40px) 0 clamp(26px,5vw,56px);
  background:var(--mist);
}

.wrap{
  display:grid;
  grid-template-columns:230px minmax(0,1fr);
  gap:clamp(14px,2.4vw,28px);
  align-items:start;
  max-width:1120px;
  margin:0 auto;
  padding:0 clamp(12px,3vw,20px);
}

.toc{
  position:sticky;
  top:128px;
  z-index:20;
  padding:14px;
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:var(--r);
  box-shadow:var(--e2);
}
.toc h2{font-size:15px;letter-spacing:.16em}
.toc hr{width:40px;margin:8px 0 12px}
.toc ol{display:grid;gap:2px}
.toc li a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:0 8px;
  border-left:2px solid transparent;
  border-radius:var(--r);
  font-size:15px;
}
.toc li a:hover{background:var(--mist);border-left-color:var(--ink);text-decoration:none}

.page{position:relative;z-index:10;min-width:0}

.page section{
  position:relative;
  z-index:1;
  padding:clamp(18px,3vw,34px);
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:var(--r);
  box-shadow:var(--e3);
}

/* 首屏大标题 + 斜切色带 */
.hero{
  position:relative;
  z-index:2;
  margin:-4px 0 6px;
  padding:clamp(22px,6vw,54px) 0 clamp(14px,3vw,22px);
  overflow:hidden;
}
.hero__band{
  position:absolute;
  left:-30vw;
  right:-30vw;
  top:34%;
  z-index:0;
  height:clamp(38px,9vw,72px);
  background:var(--ink);
  opacity:.1;
  transform:skewY(-4deg);
}
.hero h1{
  position:relative;
  z-index:1;
  font-size:clamp(34px,7vw,68px);
  line-height:1.03;
  letter-spacing:-.03em;
}

/* 正文分节：清晰的区块分隔 */
.page section div{
  position:relative;
  padding-top:clamp(20px,3vw,32px);
  scroll-margin-top:150px;
}
.page section div + div{
  margin-top:clamp(22px,3vw,34px);
  border-top:2px solid var(--ink);
}
.page section div:first-child{padding-top:0}

.page section h2{font-size:clamp(23px,3.4vw,32px)}
.page section h2 + hr{width:52px;margin:10px 0 16px}
.page section h3{font-size:clamp(19px,2.4vw,22px);margin:1.2em 0 .5em}

.page section ul,
.page section ol{
  margin:0 0 1.05em;
  padding-left:1.2em;
  list-style:disc;
}
.page section ol{list-style:decimal}
.page section li{margin:.3em 0}
.page section a{text-decoration:underline;text-underline-offset:3px}
.page section strong{font-weight:700}
.page section blockquote{
  margin:1.2em 0;
  padding:12px 16px;
  background:var(--mist);
  border-left:4px solid var(--ink);
  border-radius:var(--r);
}
.page section blockquote p:last-child{margin:0}
.page section table{width:100%;border-collapse:collapse;font-size:15px}
.page section th,
.page section td{padding:8px 10px;border:1px solid var(--ink);text-align:left}
.page section code{
  padding:.1em .35em;
  background:var(--mist);
  border:1px solid #dcdcdc;
  border-radius:3px;
  font-size:.92em;
}

/* ── 页脚：分区直接挂在 footer 下 ───────────────────── */
.foot{
  display:grid;
  grid-template-columns:1.5fr 1fr 1fr 1fr;
  gap:clamp(14px,3vw,28px);
  margin-top:clamp(30px,5vw,56px);
  padding:clamp(24px,4vw,40px) clamp(14px,3vw,26px) 0;
  background:var(--ink);
  color:#fff;
  border-top:2px solid var(--ink);
}
.foot h2{font-size:15px;letter-spacing:.16em;color:#fff}
.foot hr{width:34px;margin:8px 0 12px;border-top-color:rgba(255,255,255,.4)}
.foot a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  color:#fff;
  font-size:15px;
}
.foot ul{display:grid}
.fcol--brand{min-width:0}
.fcol--brand h2{word-break:break-word}
.foot__end{
  grid-column:1 / -1;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:8px;
  margin-top:clamp(14px,3vw,22px);
  padding:10px 0 14px;
  border-top:1px solid rgba(255,255,255,.28);
  font-size:14px;
}
.foot__end a{font-size:14px}

/* ── 响应式 ─────────────────────────────────────────── */
@media (max-width:860px){
  .wrap{grid-template-columns:1fr}
  .toc{position:static;top:auto}
  .toc ol{grid-template-columns:repeat(auto-fit,minmax(130px,1fr))}
  .foot{grid-template-columns:1fr 1fr}
  .hero h1{font-size:clamp(30px,8.5vw,48px)}
}

@media (max-width:700px){
  .drop{
    position:static;
    min-width:0;
    margin:0 0 6px 6px;
    padding:2px 0 6px 8px;
    border:0;
    border-left:2px solid var(--ink);
    border-radius:0;
    box-shadow:none;
    background:transparent;
  }
  .grp{max-width:100%}
}

@media (max-width:420px){
  .foot{grid-template-columns:1fr}
  .foot__end{justify-content:flex-start}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{transition:none !important;animation:none !important}
}

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