:root{
  --paper:#fafaf8;
  --ink:#1a1a1a;
  --gray:#4a4a4a;
  --soft:#f2f1ec;
  --card:#fdfdfb;
  --line:#c9c7c2;
  --rail:132px;
}

*{box-sizing:border-box}

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

body{
  margin:0;
  padding-left:var(--rail);
  padding-bottom:96px;
  background:var(--paper);
  color:var(--ink);
  font-family:"DM Sans",-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.7;
  font-weight:400;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

/* 纸张颗粒 */
body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:5;
  pointer-events:none;
  mix-blend-mode:multiply;
  opacity:.55;
  background-image: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.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.3'/%3E%3C/svg%3E");
}

img{max-width:100%;height:auto}

p{margin:0 0 1em}
p:last-child{margin-bottom:0}

a{color:var(--ink)}

.skip{
  position:fixed;
  top:0;
  left:0;
  z-index:70;
  padding:12px 18px;
  background:var(--ink);
  color:var(--paper);
  text-decoration:none;
  transform:translateY(-130%);
}
.skip:focus{transform:none}

/* ---------- 左侧固定栏 ---------- */
header.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--rail);
  z-index:50;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  padding:22px 12px 18px;
  border-right:1.6px solid var(--ink);
  background:linear-gradient(180deg,#fafaf8 0%,#f4f3ee 100%);
}

.mark{
  display:flex;
  align-items:center;
  justify-content:center;
  width:46px;
  height:46px;
  margin:0 0 6px 4px;
  border:1.6px solid var(--ink);
  border-radius:50%;
  text-decoration:none;
  font-weight:700;
  font-size:20px;
  line-height:1;
  transform:rotate(-7deg);
  background:var(--card);
}
.mark span{transform:rotate(7deg)}

.rail nav{
  width:100%;
  margin:auto 0;
  overflow-y:auto;
  scrollbar-width:thin;
}

.rail nav p{
  display:flex;
  flex-direction:column;
  gap:1px;
  margin:0;
}

.rail nav a{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:44px;
  padding:6px 4px;
  font-size:16px;
  line-height:1.35;
  color:var(--ink);
  text-decoration:none;
  border-bottom:1px dashed transparent;
}
.rail nav a:hover,
.rail nav a:focus-visible{
  border-bottom-color:var(--ink);
  transform:translateX(2px);
}
.rail nav a[aria-current]{
  border-bottom-color:var(--ink);
  font-weight:500;
}

.ico{
  flex:0 0 auto;
  width:9px;
  height:9px;
  border:1.6px solid var(--ink);
  background:transparent;
}
.ico.i0{transform:rotate(45deg)}
.ico.i1{border-radius:50%}
.ico.i2{height:2px;width:12px;background:var(--ink);border:0}

.cta{
  position:fixed;
  right:26px;
  bottom:30px;
  z-index:60;
  display:inline-flex;
  align-items:center;
  min-height:48px;
  padding:13px 22px;
  border-radius:28px;
  border:1.6px solid var(--ink);
  background:var(--ink);
  color:var(--paper);
  font-size:16px;
  letter-spacing:.06em;
  text-decoration:none;
  transform:rotate(-4deg);
  box-shadow:4px 4px 0 rgba(26,26,26,.2);
}
.cta:hover{transform:rotate(-2deg) translateY(-1px)}

/* ---------- 布局 ---------- */
main{display:block;min-height:62vh}

.wrap{
  max-width:1180px;
  margin:0 auto;
  padding:clamp(18px,3vw,48px) clamp(16px,3vw,40px) clamp(28px,5vw,64px);
  display:grid;
  grid-template-columns:186px minmax(0,1fr);
  gap:clamp(20px,3vw,44px);
  align-items:start;
}

.col{min-width:0}

/* 侧栏 */
.side{
  position:sticky;
  top:28px;
  padding-top:6px;
  font-size:16px;
}

.side-h{
  margin:0 0 12px;
  font-size:17px;
  letter-spacing:.06em;
  color:var(--gray);
}
.side-h span{border-bottom:2px solid var(--ink);padding-bottom:2px}

.toc{
  list-style:none;
  margin:0 0 26px;
  padding:0;
}

.toc a{
  display:block;
  min-height:40px;
  padding:8px 0 8px 14px;
  border-left:2px dashed var(--line);
  color:var(--gray);
  font-size:16px;
  text-decoration:none;
}
.toc a:hover,
.toc a[aria-current]{
  color:var(--ink);
  border-left-color:var(--ink);
  border-left-style:solid;
}

.side-k{
  margin:0 0 6px;
  font-size:16px;
  letter-spacing:.06em;
  color:var(--gray);
  font-weight:400;
}
.side-k span{border-bottom:1px dashed var(--line);padding-bottom:2px}

.kw{
  font-size:16px;
  color:var(--gray);
  line-height:1.7;
}

/* ---------- hero ---------- */
.hero{
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.06fr);
  gap:clamp(16px,3vw,38px);
  align-items:center;
  min-height:45vh;
  padding:clamp(16px,2.6vw,30px);
  margin:0 0 clamp(24px,4vw,44px);
  border:1.6px solid var(--ink);
  border-bottom:5px solid var(--ink);
  border-radius:28px;
  background-color:var(--card);
  background-image:radial-gradient(var(--ink) .9px,transparent .9px);
  background-size:20px 20px;
  background-position:-5px -5px;
  text-align:right;
  transform:rotate(-.5deg);
}

.hero-fig{
  margin:0;
  transform:rotate(-1.6deg);
}

.hero-img{
  display:block;
  width:100%;
  border:1.6px solid var(--ink);
  border-radius:24px;
  filter:grayscale(1) contrast(1.08);
}

.hero-blank{
  display:block;
  width:100%;
  aspect-ratio:4/3;
  border:1.6px solid var(--ink);
  border-radius:24px;
  background-image:repeating-linear-gradient(-45deg,rgba(26,26,26,.22) 0 1px,transparent 1px 9px);
}

.hero-txt h1{
  margin:0 0 14px;
  font-size:clamp(27px,4.4vw,48px);
  line-height:1.22;
  letter-spacing:-.02em;
  font-weight:700;
}

.hero-txt p{
  margin:0;
  color:var(--gray);
  font-size:17px;
  line-height:1.7;
}

/* ---------- 正文卡片 ---------- */
article.doc > section{
  --rot:0deg;
  position:relative;
  margin:0 0 clamp(20px,3vw,32px);
  padding:clamp(18px,2.8vw,34px);
  border:1.6px solid var(--ink);
  border-bottom:5px solid var(--ink);
  border-radius:28px;
  background:var(--card);
  scroll-margin-top:96px;
  overflow-wrap:break-word;
  transform:rotate(var(--rot));
}
article.doc > section:nth-of-type(odd){--rot:-.35deg}
article.doc > section:nth-of-type(even){--rot:.3deg}
article.doc > section:target{background:#fbfaf4}

article.doc > section::before{
  content:"";
  position:absolute;
  top:-9px;
  left:clamp(20px,6%,60px);
  width:52px;
  height:16px;
  background:rgba(26,26,26,.1);
  border-radius:2px;
  transform:rotate(-4deg);
}

article.doc h2{
  margin:0 0 16px;
  font-size:clamp(20px,2.5vw,27px);
  line-height:1.34;
  letter-spacing:-.01em;
}
article.doc h2 span{
  display:inline-block;
  position:relative;
}
article.doc h2 span::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  bottom:-3px;
  height:5px;
  background-image:repeating-linear-gradient(90deg,var(--ink) 0 6px,transparent 6px 12px);
  opacity:.45;
}

article.doc h3{
  margin:24px 0 10px;
  font-size:19px;
  line-height:1.4;
}

article.doc p{margin:0 0 1em;line-height:1.78}

article.doc ul,
article.doc ol{
  margin:0 0 1em;
  padding-left:1.35em;
  line-height:1.78;
}
article.doc li{margin:.4em 0}
article.doc li::marker{color:var(--gray)}

article.doc a{
  text-decoration:underline;
  text-decoration-style:dashed;
  text-underline-offset:3px;
  text-decoration-thickness:1px;
}

article.doc strong{font-weight:700}

article.doc blockquote{
  margin:22px 0;
  padding:14px 20px;
  border-left:4px solid var(--ink);
  border-radius:0 20px 20px 0;
  background:var(--soft);
  color:var(--gray);
}

article.doc figure{margin:22px 0}
article.doc img{
  border:1.6px solid var(--ink);
  border-radius:20px;
  filter:grayscale(1) contrast(1.05);
}
article.doc figcaption{
  margin-top:8px;
  font-size:16px;
  color:var(--gray);
}

article.doc table{
  width:100%;
  margin:20px 0;
  border-collapse:collapse;
  font-size:16px;
}
article.doc th,
article.doc td{
  padding:10px 12px;
  border:1px solid var(--line);
  text-align:left;
}
article.doc th{background:var(--soft)}

article.doc hr{
  height:1px;
  margin:26px 0;
  border:0;
  background-image:repeating-linear-gradient(90deg,var(--line) 0 8px,transparent 8px 15px);
}

article.doc code{
  padding:1px 5px;
  border:1px dashed var(--line);
  font-size:15px;
}

/* ---------- 页脚 ---------- */
.foot{
  margin-top:clamp(24px,5vw,56px);
  padding:clamp(24px,4vw,46px) clamp(16px,3vw,40px) 46px;
  border-top:2px solid var(--ink);
  background:var(--soft);
}

.foot-mark{
  margin:0 0 clamp(18px,3vw,30px);
  font-size:clamp(40px,11.5vw,132px);
  line-height:.92;
  font-weight:700;
  letter-spacing:-.045em;
  color:var(--ink);
  opacity:.94;
  overflow-wrap:anywhere;
}

.foot-cols{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(14px,3vw,34px);
  max-width:1180px;
  margin:0 auto clamp(20px,3vw,28px);
}

.foot dl{margin:0}
.foot dt{
  margin-bottom:8px;
  font-size:16px;
  letter-spacing:.1em;
  color:var(--gray);
}
.foot dd{
  margin:0;
  font-size:16px;
  line-height:1.75;
  color:var(--ink);
  overflow-wrap:anywhere;
}
.foot dd a{
  display:inline-block;
  min-height:40px;
  padding:8px 0;
  margin-right:12px;
  color:var(--ink);
  text-decoration:none;
  border-bottom:1px dashed var(--line);
}
.foot dd a:hover{border-bottom-color:var(--ink);border-bottom-style:solid}

.copy{
  max-width:1180px;
  margin:0 auto;
  padding-top:14px;
  border-top:1px dashed var(--line);
  font-size:16px;
  color:var(--gray);
}

/* ---------- 动效 ---------- */
.rev{
  opacity:0;
  transform:translateY(14px) rotate(var(--rot,0deg));
}
.rev-in{
  opacity:1;
  transform:rotate(var(--rot,0deg));
  transition:opacity .3s steps(3,end),transform .3s steps(3,end);
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .rev{opacity:1;transform:rotate(var(--rot,0deg))}
  .rev-in{transition:none}
  .hero{transform:none}
  .hero-fig{transform:none}
}

/* ---------- 窄屏 ---------- */
@media (max-width:900px){
  body{
    padding-left:0;
    padding-top:64px;
    padding-bottom:86px;
    font-size:17px;
  }

  header.rail{
    inset:0 0 auto 0;
    width:auto;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:8px 10px;
    border-right:0;
    border-bottom:2px solid var(--ink);
    background:var(--paper);
  }

  .mark{
    width:42px;
    height:42px;
    margin:0;
    font-size:18px;
  }

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

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

  .rail nav a{
    min-height:44px;
    padding:6px 10px;
    white-space:nowrap;
    border-bottom:2px dashed transparent;
  }
  .rail nav a:hover,
  .rail nav a[aria-current]{transform:none;border-bottom-color:var(--ink)}

  .cta{
    right:14px;
    bottom:16px;
    padding:12px 18px;
    min-height:46px;
    transform:rotate(-3deg);
  }

  .wrap{
    display:flex;
    flex-direction:column;
    gap:18px;
    padding:16px 14px 30px;
  }

  .col{order:1;width:100%}
  .side{order:2;position:static;width:100%;padding:16px 4px 0;border-top:1px dashed var(--line)}

  .toc{
    display:flex;
    flex-wrap:wrap;
    gap:6px 14px;
    margin-bottom:16px;
  }
  .toc a{padding:6px 0 6px 10px;min-height:38px}

  .hero{
    grid-template-columns:1fr;
    gap:14px;
    min-height:auto;
    padding:16px;
    transform:none;
    text-align:right;
  }
  .hero-fig{transform:none}
  .hero-txt h1{font-size:clamp(26px,7.6vw,36px)}

  article.doc > section{--rot:0deg;transform:none;padding:18px}
  article.doc > section::before{left:22px}

  .foot-cols{grid-template-columns:1fr;gap:16px}
  .foot-mark{font-size:clamp(38px,13vw,64px)}
}

@media (max-width:420px){
  .mark{width:40px;height:40px}
  .rail nav a{padding:6px 8px}
  .hero{padding:12px}
}

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