:root{
  --ink:#000;
  --paper:#fff;
  --pad:clamp(1.25rem,4vw,4rem);
}
*,*::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:"Lato",-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Noto Sans SC","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.8;
  font-weight:400;
  overflow-x:hidden;
}
h1,h2,h3,h4{
  font-family:"EB Garamond","Songti SC","Noto Serif SC",Georgia,serif;
  font-weight:600;
  line-height:1.1;
  letter-spacing:-.03em;
  margin:0;
}
p{margin:0 0 1.1em}
img{max-width:100%;height:auto}
a{color:var(--ink)}
::selection{background:#000;color:#fff}
:focus-visible{outline:3px solid #000;outline-offset:3px}

/* 页头 */
.masthead{
  display:flex;
  align-items:center;
  padding:.85rem var(--pad);
  border-bottom:1px solid #000;
}
.brand{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  text-decoration:none;
  font-weight:700;
  font-size:.95rem;
  letter-spacing:.34em;
}
.brand:hover{text-decoration:underline;text-underline-offset:6px}

/* 粘性胶囊导航 */
.navwrap{
  position:sticky;
  top:0;
  z-index:60;
  background:#fff;
  border-bottom:1px solid #000;
  padding:.6rem var(--pad);
}
.drawer>summary{
  list-style:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:.55rem;
  min-height:44px;
  padding:.5rem 1.15rem;
  border:1.5px solid #000;
  border-radius:999px;
  font-size:.85rem;
  letter-spacing:.2em;
  transition:background .25s ease,color .25s ease;
}
.drawer>summary::-webkit-details-marker{display:none}
.drawer>summary::after{
  content:"";
  width:7px;height:7px;
  border-right:1.6px solid currentColor;
  border-bottom:1.6px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .3s ease;
}
.drawer[open]>summary::after{transform:rotate(-135deg) translateY(-2px)}
.drawer>summary:hover{background:#000;color:#fff}
.drawer menu{
  display:flex;
  flex-wrap:wrap;
  gap:.45rem;
  margin:.7rem 0 0;
  padding:0;
  list-style:none;
}
.drawer menu a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:.5rem 1rem;
  border:1.5px solid #000;
  border-radius:999px;
  text-decoration:none;
  font-size:.8rem;
  letter-spacing:.05em;
  transition:background .25s ease,color .25s ease,transform .25s ease;
}
.drawer menu a:hover,
.drawer menu a:focus-visible{background:#000;color:#fff;transform:translateY(-2px)}

/* 主体骨架：内容左置索引栏 */
main{
  display:grid;
  grid-template-columns:1fr;
  padding:0 var(--pad);
}
div{order:1;min-width:0}
aside.rail{order:2}

/* 首屏 */
.hero{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  gap:clamp(1.4rem,4vw,2.8rem);
  padding:clamp(2.5rem,7vw,5rem) 0 clamp(3rem,7vw,6rem);
}
.badge{
  margin:0;
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:.45rem 1.1rem;
  border-radius:999px;
  background:#000;
  color:#fff;
  font-size:.72rem;
  letter-spacing:.36em;
  animation:bob 7s ease-in-out infinite;
}
@keyframes bob{
  0%,100%{transform:translateY(0)}
  50%{transform:translateY(-8px)}
}
.hero h1{
  font-size:clamp(2.8rem,8vw,8rem);
  font-weight:600;
  line-height:.96;
  letter-spacing:-.05em;
  text-wrap:balance;
  word-break:break-word;
  margin:0;
}
.herofig{
  margin:0;
  width:100%;
  border:1px solid #000;
  border-radius:10px;
  overflow:hidden;
}
.herofig img{display:block;width:100%;border-radius:0}

/* 正文章节 */
div>article:not(.hero){
  position:relative;
  padding:clamp(2.6rem,7vw,5.5rem) 0;
  border-bottom:1px solid #000;
  scroll-margin-top:6.5rem;
}
div>article:not(.hero)::after{
  content:"";
  position:absolute;
  left:0;bottom:-1px;
  height:4px;width:0;
  background:#000;
  transition:width .55s ease;
}
div>article:not(.hero):hover::after{width:100%}
div article h2{font-size:clamp(1.7rem,3.6vw,2.9rem);margin:0 0 1.3rem}
div article h2>span{display:inline-block}
div article h3{font-size:clamp(1.15rem,2.2vw,1.55rem);margin:1.9rem 0 .8rem}
div article p,
div article ul,
div article ol,
div article blockquote{max-width:66ch}
div article ul,
div article ol{padding-left:1.3rem}
div article li{margin:.35rem 0}
div article img{border-radius:10px;margin:1.4rem 0}
div article blockquote{
  margin:1.4rem 0;
  padding-left:1.1rem;
  border-left:3px solid #000;
  font-size:1.06rem;
}
div article table{width:100%;border-collapse:collapse;margin:1.4rem 0;font-size:.95rem}
div article th,
div article td{border-bottom:1px solid #000;padding:.6rem .5rem;text-align:left}
div article a{text-underline-offset:4px}

/* 索引栏 */
aside.rail{
  padding:2.2rem 0 clamp(1rem,4vw,3rem);
  border-top:1px solid #000;
}
aside ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
aside a{
  display:block;
  padding:.6rem 0;
  min-height:44px;
  text-decoration:none;
  font-size:.82rem;
  letter-spacing:.05em;
  border-bottom:1px solid rgba(0,0,0,.2);
  transition:border-color .25s ease,padding-left .25s ease;
}
aside a:hover{border-bottom-color:#000;padding-left:.45rem}

/* 页脚 */
.colophon{
  margin-top:clamp(2.5rem,7vw,5rem);
  border-top:3px solid #000;
  padding:clamp(2.2rem,6vw,4.5rem) var(--pad) 1.6rem;
  display:grid;
  grid-template-columns:1fr;
  gap:2rem 1.6rem;
}
.f-brand p{
  margin:0;
  font-family:"EB Garamond","Songti SC","Noto Serif SC",Georgia,serif;
  font-size:clamp(1.5rem,3.2vw,2.6rem);
  letter-spacing:-.03em;
  line-height:1.15;
}
.f-nav ul{list-style:none;margin:0;padding:0}
.f-nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:.35rem 0;
  text-decoration:none;
  font-size:.85rem;
}
.f-nav a:hover{text-decoration:underline;text-underline-offset:5px}
.subform{display:flex;flex-wrap:wrap;gap:.55rem}
.subform input{
  flex:1 1 8rem;
  min-height:44px;
  padding:.65rem .9rem;
  font:inherit;
  font-size:16px;
  color:#000;
  background:#fff;
  border:1.5px solid #000;
  border-radius:10px;
}
.subform button{
  min-height:44px;
  padding:.65rem 1.25rem;
  font:inherit;
  font-size:16px;
  color:#fff;
  background:#000;
  border:1.5px solid #000;
  border-radius:999px;
  cursor:pointer;
  transition:background .25s ease,color .25s ease;
}
.subform button:hover{background:#fff;color:#000}
.copy{
  grid-column:1/-1;
  margin:0;
  padding-top:1.1rem;
  border-top:1px solid #000;
  font-size:.78rem;
  letter-spacing:.14em;
}

/* 滚动浮现 */
.reveal{opacity:0;transform:translateY(26px);transition:opacity .7s ease,transform .7s ease}
.reveal.in{opacity:1;transform:none}

/* 桌面 */
@media (min-width:900px){
  main{
    grid-template-columns:176px minmax(0,1fr);
    column-gap:clamp(2rem,5vw,5rem);
  }
  div{order:0}
  aside.rail{
    order:0;
    align-self:start;
    position:sticky;
    top:7.5rem;
    border-top:0;
    padding-top:clamp(2.5rem,7vw,5.5rem);
  }
}

@media (min-width:820px){
  .colophon{grid-template-columns:1.6fr 1fr 1.3fr}
}

@media (max-width:899px){
  aside.rail ul{flex-direction:row;flex-wrap:wrap;gap:0 1.2rem}
  aside.rail li{flex:0 0 auto}
  aside a{border-bottom:0;text-decoration:underline;text-underline-offset:4px}
  aside a:hover{padding-left:0}
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  *,*::before,*::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}

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