@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

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

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

body{
  margin:0;
  background:#fdfbf7;
  color:#1a1a1a;
  font-family:"EB Garamond","Crimson Text",Georgia,"Songti SC","Noto Serif SC",serif;
  font-size:17px;
  line-height:1.75;
  letter-spacing:.005em;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:3;
  pointer-events:none;
  opacity:.16;
  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='0.85' numOctaves='2'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

img{max-width:100%}

a{color:#1a1a1a}
a:focus-visible,
button:focus-visible,
input:focus-visible{outline:2px solid #1a1a1a;outline-offset:2px}

.sr-only{
  position:absolute;
  width:1px;height:1px;
  padding:0;margin:-1px;
  overflow:hidden;
  clip:rect(0 0 0 0);
  white-space:nowrap;
  border:0;
}

/* 顶部：图标角标 + 检索 */
.masthead{
  display:flex;
  align-items:center;
  gap:14px;
  max-width:1120px;
  margin:0 auto;
  padding:12px 20px;
}

.mark{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border:1px solid #1a1a1a;
  border-radius:4px;
  text-decoration:none;
  font-size:21px;
  font-weight:600;
  line-height:1;
}
.mark span{transform:translateY(-1px)}
.mark:hover{background:#1a1a1a;color:#fdfbf7}

.find{
  display:flex;
  margin-left:auto;
  min-width:0;
  border:1px solid #1a1a1a;
  border-radius:4px;
  overflow:hidden;
  background:#fdfbf7;
}
.find input{
  flex:1 1 120px;
  min-width:0;
  width:120px;
  height:40px;
  padding:0 12px;
  border:0;
  background:transparent;
  color:#1a1a1a;
  font:inherit;
  font-size:16px;
}
.find input:focus{outline:2px solid #1a1a1a;outline-offset:-3px}
.find button{
  flex:0 0 auto;
  height:40px;
  padding:0 14px;
  border:0;
  border-left:1px solid #1a1a1a;
  background:#1a1a1a;
  color:#fdfbf7;
  font:inherit;
  font-size:16px;
  cursor:pointer;
}

/* 锚点条 */
.rail{
  position:sticky;
  top:0;
  z-index:6;
  background:#f5f5f5;
  border-top:1px solid #1a1a1a;
  border-bottom:1px solid #1a1a1a;
}
.rail ol{
  display:flex;
  margin:0 auto;
  padding:0;
  max-width:1120px;
  list-style:none;
  overflow-x:auto;
  scrollbar-width:none;
}
.rail ol::-webkit-scrollbar{display:none}
.rail li{flex:0 0 auto}
.rail li + li{border-left:1px solid #e0e0e0}
.rail a{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:10px 16px;
  text-decoration:none;
  font-size:16px;
  white-space:nowrap;
}
.rail a:hover,
.rail a:focus-visible{background:#fdfbf7}
.rail a.cur{background:#fdfbf7;box-shadow:inset 0 -3px 0 #1a1a1a}
.tick{
  flex:0 0 auto;
  width:6px;
  height:6px;
  border:1px solid #1a1a1a;
  transform:rotate(45deg);
}

/* 首屏 */
.hero{
  position:relative;
  display:flex;
  align-items:center;
  min-height:100vh;
  min-height:100svh;
  overflow:hidden;
  background:#1a1a1a;
  color:#fdfbf7;
}
.hero-media{position:absolute;inset:-12% 0;z-index:0}
.hero-media img,
.hero-img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(1) contrast(1.08);
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:#1a1a1a;
  opacity:.62;
}
.hero-inner{
  position:relative;
  z-index:4;
  width:100%;
  max-width:1120px;
  margin:0 auto;
  padding:110px 20px 150px;
}
.eyebrow{
  margin:0 0 18px;
  font-size:16px;
  letter-spacing:.26em;
  color:#d9d5cc;
}
.hero h1{
  margin:0 0 22px;
  max-width:20ch;
  font-size:clamp(30px,7vw,66px);
  line-height:1.1;
  font-weight:600;
}
.lede{
  margin:0 0 34px;
  max-width:44ch;
  font-size:18px;
  line-height:1.65;
  color:#e8e4dc;
}
.cta{
  display:inline-flex;
  align-items:center;
  min-height:46px;
  padding:10px 22px;
  border:1px solid #fdfbf7;
  border-radius:4px;
  color:#fdfbf7;
  text-decoration:none;
  font-size:16px;
  letter-spacing:.16em;
}
.cta:hover,
.cta:focus-visible{background:#fdfbf7;color:#1a1a1a}
.hero a:focus-visible,
.cta:focus-visible{outline-color:#fdfbf7}
.slant{
  position:absolute;
  left:-6%;
  right:-6%;
  bottom:-2px;
  z-index:2;
  height:48px;
  background:#fdfbf7;
  transform:rotate(-1.3deg);
  transform-origin:0 100%;
}

/* 主体栏位 */
.wrap{
  display:grid;
  grid-template-columns:236px minmax(0,1fr);
  gap:56px;
  max-width:1120px;
  margin:0 auto;
  padding:64px 20px 88px;
}

.side{
  position:sticky;
  top:60px;
  align-self:start;
  font-size:16px;
}
.side h2{
  margin:0 0 4px;
  font-size:16px;
  font-weight:600;
  letter-spacing:.22em;
}
.side hr{
  width:36px;
  margin:6px 0 18px;
  border:0;
  border-top:2px solid #1a1a1a;
}
.toc{
  margin:0;
  padding:0;
  list-style:none;
  counter-reset:toc;
  border-left:1px solid #cfccc4;
}
.toc li{counter-increment:toc}
.toc a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:40px;
  margin-left:-1px;
  padding:8px 0 8px 14px;
  border-left:1px solid transparent;
  color:#3c3c39;
  text-decoration:none;
  font-size:16px;
  line-height:1.4;
}
.toc a::before{
  content:counter(toc,decimal-leading-zero);
  flex:0 0 auto;
  color:#8a8780;
  font-size:15px;
  font-variant-numeric:tabular-nums;
}
.toc a:hover,
.toc a.cur{
  color:#1a1a1a;
  border-left-color:#1a1a1a;
  background:#f5f5f5;
}

/* 正文 */
.sheet{min-width:0}
.prose{
  max-width:70ch;
  font-size:17.5px;
  line-height:1.78;
}
.prose section[id]{scroll-margin-top:76px}
.prose > section + section{
  margin-top:56px;
  padding-top:40px;
  border-top:1px solid #e0e0e0;
}
.prose h2{
  margin:0 0 4px;
  font-size:clamp(24px,3.4vw,32px);
  line-height:1.22;
  font-weight:600;
}
.prose h2 + hr{
  width:56px;
  margin:0 0 26px;
  border:0;
  border-top:3px solid #1a1a1a;
}
.prose hr{
  margin:32px 0;
  border:0;
  border-top:1px solid #e0e0e0;
}
.prose h3{
  margin:30px 0 10px;
  font-size:20px;
  line-height:1.4;
  font-weight:600;
}
.prose p{margin:0 0 18px}
.prose ul,
.prose ol{margin:0 0 20px;padding-left:24px}
.prose li{margin-bottom:8px}
.prose a{
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
}
.prose a:hover{background:#f5f5f5}
.prose strong{font-weight:700}
.prose blockquote{
  margin:24px 0;
  padding:2px 0 2px 20px;
  border-left:2px solid #1a1a1a;
  color:#3c3c39;
}
.prose img{
  display:block;
  width:auto;
  margin:22px 0;
  border:1px solid #e0e0e0;
  border-radius:4px;
}
.prose figure{margin:24px 0}
.prose figcaption{font-size:16px;color:#5b5b58}
.prose table{
  width:100%;
  margin:20px 0;
  border-collapse:collapse;
  font-size:16px;
}
.prose th,
.prose td{
  padding:10px 12px;
  border:1px solid #e0e0e0;
  text-align:left;
  vertical-align:top;
}
.prose pre{
  margin:20px 0;
  padding:14px 16px;
  overflow-x:auto;
  border:1px solid #e0e0e0;
  border-radius:4px;
  background:#f5f5f5;
  font-size:16px;
  line-height:1.6;
}
.prose code{
  font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  font-size:.95em;
}
.prose div.hit{
  background:#f5f5f5;
  outline:1px solid #1a1a1a;
  outline-offset:14px;
}

/* 页脚 */
footer{
  border-top:1px solid #1a1a1a;
  background:#f5f5f5;
}
footer{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:6px 16px;
  align-items:baseline;
  width:100%;
  max-width:1120px;
  margin:0 auto;
  padding:22px 20px;
  font-size:16px;
}
footer p{
  grid-column:1 / span 3;
  margin:0;
}
footer small{
  grid-column:4;
  text-align:right;
  font-size:16px;
}
footer small a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  text-decoration:none;
}
footer small a:hover{text-decoration:underline;text-underline-offset:3px}

/* 入场 */
@keyframes rvIn{
  from{opacity:0;transform:translateY(12px)}
  to{opacity:1;transform:none}
}
.hero-inner,
.prose > div{animation:rvIn .3s steps(6,end) both}
.prose > div:nth-child(2){animation-delay:.06s}
.prose > div:nth-child(3){animation-delay:.12s}
.prose > div:nth-child(4){animation-delay:.18s}
.prose > div:nth-child(5){animation-delay:.24s}
.prose > div:nth-child(6){animation-delay:.3s}
.prose > div:nth-child(7){animation-delay:.36s}
.prose > div:nth-child(n+8){animation-delay:.4s}

@media (max-width:860px){
  .wrap{
    grid-template-columns:minmax(0,1fr);
    gap:34px;
    padding:36px 20px 64px;
  }
  .sheet{order:1}
  .side{
    order:2;
    position:static;
    padding-top:22px;
    border-top:1px solid #1a1a1a;
  }
  .toc{
    display:flex;
    flex-wrap:wrap;
    gap:8px;
    border-left:0;
  }
  .toc li{flex:0 0 auto}
  .toc a{
    margin-left:0;
    padding:8px 12px;
    min-height:40px;
    border:1px solid #cfccc4;
    border-radius:4px;
  }
  .toc a::before{display:none}
  .toc a:hover,
  .toc a.cur{border-color:#1a1a1a}
  .hero-inner{padding:96px 20px 130px}
  footer{grid-template-columns:minmax(0,1fr)}
  footer p{grid-column:1}
  footer small{grid-column:1;text-align:left}
}

@media (max-width:520px){
  .masthead{padding:10px 16px;gap:10px}
  .find input{width:auto;flex:1 1 90px}
  .rail a{padding:10px 13px;font-size:16px}
  .prose{font-size:17px}
  .prose div.hit{outline-offset:8px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .hero-inner,
  .prose > div{animation:none}
}

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