:root{
  --paper:#fafaf8;
  --soft:#4a4a4a;
  --ink:#1a1a1a;
  --rail:192px;
  --line:rgba(26,26,26,.28);
  --wash:rgba(26,26,26,.045);
}

*{box-sizing:border-box}

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

body{
  margin:0;
  padding:0;
  background-color:var(--paper);
  color:var(--ink);
  font-family:'Lato',-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.78;
  font-weight:400;
  overflow-x:hidden;
  background-image:
    repeating-linear-gradient(0deg,rgba(26,26,26,.02) 0 1px,transparent 1px 4px),
    repeating-linear-gradient(90deg,rgba(26,26,26,.016) 0 1px,transparent 1px 6px),
    radial-gradient(circle at 14% 6%,rgba(26,26,26,.065),transparent 58%),
    radial-gradient(circle at 86% 92%,rgba(26,26,26,.05),transparent 55%);
}

img{max-width:100%;height:auto;display:block}
a{color:var(--ink)}
p{margin:0 0 1.05em}

h1,h2,h3,h4{
  font-family:'EB Garamond','Songti SC','Times New Roman',serif;
  font-weight:600;
  letter-spacing:.005em;
  line-height:1.22;
  color:var(--ink);
}

.shell{position:relative;min-height:100vh}

/* ---------- 品牌小章 ---------- */
.brand-mark{
  position:fixed;
  top:16px;
  left:18px;
  z-index:40;
  width:60px;
  height:60px;
  display:grid;
  place-items:center;
  overflow:hidden;
  text-decoration:none;
  color:var(--ink);
  font-family:'EB Garamond','Songti SC',serif;
  font-size:24px;
  line-height:1;
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:255px 14px 225px 15px/15px 225px 15px 255px;
  transform:rotate(-2deg);
  transition:transform .1s steps(2),background .1s steps(2);
}
.brand-mark:hover{transform:rotate(1.5deg) scale(1.04);background:#fff}
.brand-img{width:100%;height:100%;object-fit:contain;padding:6px}

/* ---------- 左侧竖排导航 ---------- */
.rail{
  position:fixed;
  top:92px;
  left:0;
  bottom:0;
  width:var(--rail);
  padding:14px 12px 40px;
  overflow-y:auto;
  border-right:1px dashed var(--line);
  background-image:repeating-linear-gradient(180deg,rgba(26,26,26,.022) 0 1px,transparent 1px 22px);
  z-index:30;
}

.rail-list{
  list-style:none;
  margin:0;
  padding:0;
}
.rail-list li{margin:0}
.rail-list a{
  display:block;
  padding:11px 8px;
  min-height:44px;
  font-size:16px;
  line-height:1.35;
  color:var(--soft);
  text-decoration:none;
  border-bottom:1px dashed var(--line);
  transition:color .08s steps(2),background .08s steps(2),transform .08s steps(2);
}
.rail-list a:hover,
.rail-list a:focus-visible{
  color:var(--ink);
  background:var(--wash);
  transform:translateX(3px) rotate(-.5deg);
}

/* ---------- 主区域 ---------- */
.paper{margin-left:var(--rail);min-width:0}

.hero{
  position:relative;
  display:flex;
  align-items:flex-end;
  min-height:45vh;
  overflow:hidden;
  background-color:var(--paper);
  background-image:
    repeating-linear-gradient(45deg,rgba(26,26,26,.05) 0 1px,transparent 1px 9px);
  border-bottom:2px solid var(--ink);
}
.hero-fig{
  position:absolute;
  inset:-6% 0 0 0;
  margin:0;
}
.hero-img{
  width:100%;
  height:112%;
  object-fit:cover;
  filter:grayscale(1) contrast(1.1) brightness(1.02);
  opacity:.78;
  transform:scale(1.04);
  will-change:transform;
}
.hero::after{
  content:'';
  position:absolute;
  inset:0;
  pointer-events:none;
  background:linear-gradient(to top,rgba(250,250,248,.98) 4%,rgba(250,250,248,.55) 42%,rgba(250,250,248,.06) 88%);
}
.hero-copy{
  position:relative;
  z-index:2;
  padding:26px 28px 22px;
  max-width:min(100%,30ch);
  transform:rotate(-.4deg);
}
.hero-copy h1{
  margin:0;
  font-size:clamp(27px,4.6vw,50px);
  line-height:1.16;
  text-wrap:balance;
}

/* ---------- 正文 + 左侧便签 ---------- */
.sheet{
  display:grid;
  grid-template-columns:198px minmax(0,1fr);
  gap:14px 34px;
  padding:42px 34px 64px 28px;
}

.margin{
  position:sticky;
  top:24px;
  align-self:start;
  padding-top:6px;
  transform:rotate(-.7deg);
}

.stamp{
  display:inline-block;
  margin:0 0 22px;
  padding:8px 12px;
  font-family:'EB Garamond','Songti SC',serif;
  font-size:16px;
  line-height:1.3;
  letter-spacing:.08em;
  color:var(--soft);
  border:2px solid var(--soft);
  border-radius:4px;
  background:
    linear-gradient(rgba(250,250,248,.72),rgba(250,250,248,.72)),
    repeating-linear-gradient(135deg,rgba(26,26,26,.1) 0 2px,transparent 2px 7px);
  transform:rotate(1.6deg);
  box-shadow:3px 3px 0 rgba(26,26,26,.12);
}

.margin small,
.stream small{
  display:block;
  font-family:'EB Garamond','Songti SC',serif;
  font-size:16px;
  line-height:1.4;
  letter-spacing:.22em;
  color:var(--soft);
  transform:rotate(-1deg);
}

.margin h2{
  margin:.1em 0 .7em;
  font-size:22px;
  letter-spacing:.02em;
  padding-bottom:6px;
  border-bottom:2px solid rgba(26,26,26,.75);
}

.margin-list{
  list-style:none;
  margin:0;
  padding:0;
  counter-reset:idx;
}
.margin-list li{counter-increment:idx}
.margin-list a{
  display:block;
  padding:9px 4px 9px 26px;
  min-height:40px;
  position:relative;
  font-size:16px;
  line-height:1.35;
  color:var(--soft);
  text-decoration:none;
  transition:color .08s steps(2),transform .08s steps(2);
}
.margin-list a::before{
  content:counter(idx,decimal-leading-zero);
  position:absolute;
  left:0;
  top:9px;
  font-family:'EB Garamond',serif;
  font-size:14px;
  color:rgba(74,74,74,.7);
  letter-spacing:.04em;
}
.margin-list a:hover{color:var(--ink);transform:translateX(2px)}

.stream{min-width:0;max-width:72ch}

.stream > article{
  padding:24px 0 26px;
  border-top:1px dashed var(--line);
  scroll-margin-top:28px;
}
.stream > article:first-child{border-top:0;padding-top:0}
.stream > article:last-child{padding-bottom:0}

.stream h2{
  margin:.12em 0 .62em;
  font-size:clamp(23px,3vw,31px);
  padding-bottom:8px;
  border-bottom:2px solid rgba(26,26,26,.82);
}
.stream h3{
  margin:1.6em 0 .5em;
  font-size:clamp(19px,2.2vw,23px);
}
.stream h4{margin:1.3em 0 .4em;font-size:18px}
.stream small{margin-bottom:.1em}

.stream p{margin:0 0 1.05em}
.stream ul,
.stream ol{margin:0 0 1.1em;padding-left:1.3em}
.stream li{margin:.3em 0}
.stream ul{list-style:square}
.stream ul li::marker{color:var(--soft);font-size:.8em}

.stream a{
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-underline-offset:3px;
  text-decoration-color:rgba(26,26,26,.55);
}
.stream a:hover{
  text-decoration-style:wavy;
  text-decoration-color:var(--ink);
  background:rgba(26,26,26,.05);
}

.stream blockquote{
  margin:1.4em 0;
  padding:.2em 0 .2em 18px;
  border-left:3px solid var(--soft);
  color:var(--soft);
}
.stream blockquote p:last-child{margin-bottom:0}

.stream figure{margin:1.4em 0}
.stream figcaption{
  font-size:16px;
  line-height:1.5;
  color:var(--soft);
  padding-top:8px;
}

.stream img{
  border:1px solid rgba(26,26,26,.35);
  filter:grayscale(1) contrast(1.05);
  transform:rotate(-.35deg);
}

.stream hr{
  border:0;
  border-top:2px dashed var(--line);
  margin:2em 0;
}

.stream table{
  width:100%;
  border-collapse:collapse;
  margin:1.2em 0;
  font-size:16px;
}
.stream th,
.stream td{
  border:1px solid rgba(26,26,26,.35);
  padding:8px 10px;
  text-align:left;
  vertical-align:top;
}

.stream code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.94em;
  background:var(--wash);
  padding:.1em .3em;
  border-radius:3px;
}

/* ---------- 页脚 ---------- */
.foot{
  margin-left:var(--rail);
  border-top:2px solid var(--ink);
  background-image:repeating-linear-gradient(180deg,rgba(26,26,26,.02) 0 1px,transparent 1px 26px);
}

.foot-cta{
  padding:34px 26px 30px;
  text-align:center;
  border-bottom:1px dashed var(--line);
  background:rgba(26,26,26,.032);
  overflow:hidden;
}
.foot-cta span{
  display:inline-block;
  font-family:'EB Garamond','Songti SC',serif;
  font-size:clamp(29px,6vw,60px);
  line-height:1.1;
  letter-spacing:.03em;
  transform:rotate(-1.6deg);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:10px;
  text-decoration-color:rgba(26,26,26,.3);
}

.foot-row{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:center;
  gap:10px 22px;
  padding:20px 22px 30px;
}

.foot-logo{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  overflow:hidden;
  text-decoration:none;
  color:var(--ink);
  font-family:'EB Garamond','Songti SC',serif;
  font-size:20px;
  border:2px solid var(--ink);
  border-radius:255px 14px 225px 15px/15px 225px 15px 255px;
  transform:rotate(2deg);
  transition:transform .1s steps(2);
}
.foot-logo:hover{transform:rotate(-2deg)}
.foot-logo .brand-img{padding:4px}

.foot-list{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  gap:0 12px;
  list-style:none;
  margin:0;
  padding:0;
}
.foot-list a{
  display:inline-block;
  padding:10px 4px;
  min-height:40px;
  font-size:16px;
  line-height:1.35;
  color:var(--soft);
  text-decoration:none;
  transition:color .08s steps(2);
}
.foot-list a:hover{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-style:wavy;
  text-underline-offset:4px;
}

.foot-copy{
  margin:0;
  font-size:16px;
  line-height:1.5;
  color:var(--soft);
  letter-spacing:.02em;
}

/* ---------- 移动端 ---------- */
@media (max-width:860px){
  .shell{display:block}
  .brand-mark{
    position:static;
    margin:14px 0 10px 16px;
    width:52px;
    height:52px;
    font-size:21px;
  }
  .rail{
    position:static;
    width:auto;
    top:auto;
    bottom:auto;
    padding:0 8px;
    overflow-x:auto;
    overflow-y:hidden;
    border-right:0;
    border-top:1px dashed var(--line);
    border-bottom:1px dashed var(--line);
    background-image:none;
    -webkit-overflow-scrolling:touch;
  }
  .rail-list{
    display:flex;
    gap:0;
    width:max-content;
  }
  .rail-list a{
    padding:12px 12px;
    min-height:46px;
    border-bottom:0;
    border-right:1px dashed var(--line);
    white-space:nowrap;
  }
  .rail-list a:hover{transform:none}
  .rail-list li:last-child a{border-right:0}

  .paper{margin-left:0}
  .hero{min-height:42vh}
  .hero-copy{padding:20px 18px 16px;max-width:100%}
  .sheet{
    display:block;
    padding:26px 18px 44px;
  }
  .margin{
    position:static;
    margin-bottom:26px;
    padding-bottom:18px;
    border-bottom:2px dashed var(--line);
    transform:none;
  }
  .stamp{margin-bottom:16px;font-size:16px}
  .margin-list{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 8px;
  }
  .margin-list a{font-size:16px}
  .stream{max-width:none}
  .stream img{transform:none}
  .foot{margin-left:0}
  .foot-cta{padding:26px 18px 22px}
  .foot-row{padding:16px 16px 26px}
}

@media (max-width:420px){
  .margin-list{grid-template-columns:1fr}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .hero-img{transform:none}
  .brand-mark,
  .rail-list a,
  .margin-list a,
  .foot-logo,
  .foot-list a{transition:none}
  .stamp,.hero-copy,.foot-cta span,.foot-logo{transform:none}
}

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