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

:root{
  --paper:#fafaf8;
  --wash:#f2f0e8;
  --gray:#4a4a4a;
  --ink:#1a1a1a;
  --rule:#cfcdc5;
  --noise:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.13'/%3E%3C/svg%3E");
  --grain:repeating-linear-gradient(0deg,rgba(26,26,26,.03) 0 1px,transparent 1px 4px);
}

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

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

body{
  margin:0;
  padding-left:104px;
  overflow-x:hidden;
  font-family:Inter,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  font-size:17px;
  line-height:1.7;
  color:var(--ink);
  background-color:var(--paper);
  background-image:var(--noise),var(--grain);
  background-attachment:fixed;
}

a{color:inherit}

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

/* ---------- 左侧竖栏 ---------- */
.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:104px;
  z-index:60;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  padding:18px 6px 18px;
  border-right:3px solid var(--ink);
  background-color:var(--paper);
  background-image:var(--noise);
}

.rail::after{
  content:"";
  position:absolute;
  top:0;
  right:-8px;
  bottom:0;
  width:1px;
  background:var(--ink);
  opacity:.3;
}

.mark{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:46px;
  height:46px;
  border:3px solid var(--ink);
  background:var(--wash);
  text-decoration:none;
  transform:rotate(-3.5deg);
  margin-bottom:6px;
}

.mark-art{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
  font-size:20px;
  font-weight:800;
  line-height:1;
  display:grid;
  place-items:center;
  letter-spacing:0;
}

.rail-nav{
  width:100%;
  flex:1 1 auto;
  min-height:0;
}

.rail-nav ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:6px;
}

.rail-nav a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:8px 3px;
  font-size:13px;
  font-weight:700;
  line-height:1.3;
  text-align:center;
  letter-spacing:.02em;
  text-decoration:none;
  color:var(--ink);
  border-bottom:2px solid transparent;
}

.rail-nav a:hover{
  background:var(--ink);
  color:var(--paper);
}

.fold > ul{
  display:none;
  flex-direction:column;
  gap:4px;
  margin:4px 0 2px;
  padding:5px 0;
  list-style:none;
  background:var(--wash);
  border-top:1px dashed var(--rule);
  border-bottom:1px dashed var(--rule);
}

.fold:hover > ul,
.fold:focus-within > ul{display:flex}

.fold > ul a{
  min-height:40px;
  font-size:12px;
  font-weight:600;
  color:var(--gray);
}

.jump{
  width:100%;
  margin-top:auto;
  padding-top:12px;
  border-top:2px dashed var(--rule);
  text-align:center;
}

.jump small{
  display:block;
  font-size:10px;
  letter-spacing:.32em;
  color:var(--gray);
}

.jump h2{
  margin:1px 0 8px;
  font-size:14px;
  font-weight:800;
  letter-spacing:.2em;
}

.jump ol{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
}

.jump a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:6px 2px;
  font-size:12px;
  line-height:1.25;
  color:var(--gray);
  text-decoration:none;
}

.jump a:hover{color:var(--ink);text-decoration:underline}

/* ---------- 顶部细条 ---------- */
.strip{
  position:fixed;
  top:0;
  left:104px;
  right:0;
  height:30px;
  z-index:50;
  display:flex;
  align-items:center;
  gap:14px;
  padding:0 18px;
  overflow:hidden;
  background:var(--ink);
  color:var(--paper);
  font-size:12px;
  font-weight:600;
  letter-spacing:.3em;
}

.strip::after{
  content:"";
  flex:1 1 auto;
  height:8px;
  background:repeating-linear-gradient(112deg,var(--paper) 0 9px,transparent 9px 21px);
  opacity:.6;
}

/* ---------- 主体 ---------- */
main{padding-top:30px}

.wrap{
  max-width:880px;
  margin-left:clamp(0px,3vw,44px);
  padding:0 clamp(16px,4vw,52px);
}

.hero{
  position:relative;
  min-height:45vh;
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  padding:64px 0 46px;
}

.hero::after{
  content:"";
  position:absolute;
  left:-4vw;
  right:-4vw;
  bottom:-12px;
  height:24px;
  background:var(--ink);
  clip-path:polygon(0 55%,100% 0,100% 100%,0 100%);
  transform:rotate(-.7deg);
}

.hero-in{
  max-width:640px;
  text-align:right;
}

.hero small{
  display:inline-block;
  margin-bottom:16px;
  padding-bottom:4px;
  border-bottom:3px solid var(--ink);
  font-size:12px;
  font-weight:700;
  letter-spacing:.45em;
  color:var(--gray);
}

.hero h1{
  margin:0;
  font-size:clamp(36px,7vw,72px);
  font-weight:800;
  line-height:1.02;
  letter-spacing:-.025em;
}

.lede{
  margin:20px 0 0;
  font-size:16px;
  line-height:1.65;
  color:var(--gray);
}

.content{padding-top:60px}

.prose{
  max-width:70ch;
}

.prose section{
  padding-bottom:46px;
  scroll-margin-top:70px;
}

.prose section + section{
  border-top:2px dashed var(--rule);
  padding-top:46px;
}

html.js .prose section{
  opacity:0;
  transform:translateY(14px);
}

html.js .prose section.in{
  opacity:1;
  transform:none;
  transition:opacity .3s steps(3),transform .3s linear;
}

.prose h2{
  margin:0 0 18px;
  font-size:clamp(23px,3.6vw,32px);
  font-weight:800;
  line-height:1.2;
  letter-spacing:-.012em;
}

.prose h2::before{
  content:"";
  display:block;
  width:54px;
  height:6px;
  margin-bottom:14px;
  background:var(--ink);
  transform:rotate(-1deg);
}

.prose h3{
  margin:26px 0 10px;
  font-size:20px;
  font-weight:700;
  line-height:1.35;
}

.prose p{
  margin:0 0 18px;
  color:#262626;
  max-width:68ch;
}

.prose ul,
.prose ol{
  margin:0 0 18px;
  padding-left:22px;
}

.prose li{margin:0 0 8px}

.prose a{
  font-weight:600;
  text-decoration:none;
  border-bottom:2px solid var(--ink);
}

.prose a:hover{
  background:var(--ink);
  color:var(--paper);
}

.prose strong{font-weight:800}

.prose blockquote{
  margin:0 0 18px;
  padding:14px 18px;
  border-left:6px solid var(--ink);
  background:var(--wash);
  transform:rotate(-.35deg);
}

.prose blockquote p:last-child{margin:0}

.prose img,
.prose figure img{
  max-width:100%;
  height:auto;
  border:3px solid var(--ink);
  background:var(--wash);
  transform:rotate(-.45deg);
  margin:6px 0 18px;
}

.prose figcaption{
  font-size:13px;
  color:var(--gray);
}

.prose hr{
  border:0;
  border-top:2px dashed var(--rule);
  margin:26px 0;
}

.prose code{
  padding:1px 5px;
  background:var(--wash);
  border:1px solid var(--rule);
  font-size:15px;
}

.prose pre{
  overflow-x:auto;
  padding:14px;
  border:2px solid var(--ink);
  background:var(--wash);
}

.prose pre code{border:0;padding:0;background:none}

.prose table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 18px;
  font-size:15px;
}

.prose th,
.prose td{
  border:2px solid var(--rule);
  padding:8px 10px;
  text-align:left;
}

.prose th{background:var(--wash)}

/* ---------- 页脚 ---------- */
footer{
  margin-top:64px;
  padding:34px clamp(16px,4vw,52px) 26px;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:26px;
  border-top:3px solid var(--ink);
  background-color:var(--wash);
  background-image:var(--noise);
}

footer dl{margin:0}

footer dt{
  margin-bottom:8px;
  font-size:12px;
  font-weight:700;
  letter-spacing:.3em;
  color:var(--gray);
}

footer dd{
  margin:0;
}

footer dd a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:4px 0;
  font-size:15px;
  font-weight:600;
  text-decoration:none;
  border-bottom:2px solid transparent;
}

footer dd a:hover{border-bottom-color:var(--ink)}

.colophon{
  grid-column:1 / -1;
  margin:6px 0 0;
  padding-top:12px;
  border-top:1px dashed var(--rule);
  font-size:12px;
  letter-spacing:.12em;
  color:var(--gray);
}

/* ---------- 入场 ---------- */
@keyframes drop{
  from{opacity:0;transform:translateY(-6px)}
  to{opacity:1;transform:none}
}

html.js .rail-nav > ul > li{
  animation:drop .26s steps(2) both;
}

html.js .rail-nav > ul > li:nth-child(1){animation-delay:.02s}
html.js .rail-nav > ul > li:nth-child(2){animation-delay:.07s}
html.js .rail-nav > ul > li:nth-child(3){animation-delay:.12s}

/* ---------- 移动端 ---------- */
@media (max-width:899px){
  body{padding-left:0}

  .strip{display:none}

  .rail{
    position:sticky;
    inset:auto;
    top:0;
    width:auto;
    flex-direction:row;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    border-right:0;
    border-bottom:3px solid var(--ink);
  }

  .rail::after{display:none}

  .mark{
    width:38px;
    height:38px;
    margin-bottom:0;
  }

  .rail-nav{
    flex:1 1 auto;
    min-width:0;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
  }

  .rail-nav ul{
    flex-direction:row;
    gap:2px;
    align-items:center;
    width:max-content;
  }

  .rail-nav a{
    padding:8px 8px;
    white-space:nowrap;
    font-size:14px;
  }

  .fold{
    display:flex;
    flex-direction:row;
    align-items:center;
  }

  .fold > ul{
    display:flex;
    flex-direction:row;
    gap:2px;
    margin:0;
    padding:0;
    background:none;
    border:0;
  }

  .fold > ul a{padding:8px;font-size:14px}

  .jump{display:none}

  main{padding-top:0}

  .wrap{
    margin-left:0;
    padding:0 16px;
  }

  .hero{
    min-height:0;
    padding:36px 0 38px;
  }

  .hero::after{height:16px;bottom:-9px}

  .hero h1{font-size:clamp(30px,9vw,46px)}

  .content{padding-top:44px}

  .prose section{padding-bottom:38px;scroll-margin-top:64px}

  .prose section + section{padding-top:38px}

  footer{
    grid-template-columns:1fr;
    gap:16px;
    padding:26px 16px 22px;
  }
}

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

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