@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,500;0,700;1,300;1,500&family=Crimson+Pro:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

:root{
  --paper:#fafaf8;
  --pencil:#4a4a4a;
  --ink:#1a1a1a;
  --line:rgba(26,26,26,.5);
  --rail:156px;
  --serif:"Crimson Pro","Cormorant Garamond","Songti SC","SimSun",Georgia,serif;
  --hand:"Segoe Print","Bradley Hand","Kaiti SC","KaiTi",var(--serif);
}

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

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

body{
  margin:0;
  padding-left:var(--rail);
  overflow-x:hidden;
  color:var(--ink);
  font-family:var(--serif);
  font-size:17px;
  line-height:1.85;
  background-color:var(--paper);
  background-image:
    radial-gradient(rgba(26,26,26,.07) .8px, transparent .8px),
    repeating-linear-gradient(-1.2deg, rgba(74,74,74,.045) 0 1px, transparent 1px 6px);
  background-size:3px 3px, 100% 6px;
}

/* 左侧竖排导航 */
.rail{
  position:fixed;
  left:0;top:0;bottom:0;
  width:var(--rail);
  z-index:30;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:18px 12px 30px;
  border-right:1.5px solid var(--line);
  background:var(--paper);
  overflow-y:auto;
}

.mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:48px;height:48px;
  flex:0 0 auto;
  border:2px solid var(--ink);
  border-radius:50% 46% 52% 48% / 48% 52% 46% 50%;
  transform:rotate(-6deg);
  overflow:hidden;
  background:#fff;
  text-decoration:none;
  color:var(--ink);
}
.markImg{width:100%;height:100%;object-fit:cover;filter:grayscale(1) contrast(1.3)}
.markTxt{font-size:22px;font-weight:700;line-height:1}

.railH,
.tiny{
  font-family:var(--hand);
  font-size:13px;
  font-weight:400;
  letter-spacing:.22em;
  margin:16px 0 8px;
  line-height:1.4;
}
.railH span,
.tiny span{
  display:inline-block;
  border-bottom:2px solid var(--ink);
  padding-bottom:2px;
  transform:rotate(-1deg);
}

.railNav ul,
.tocNav ul{list-style:none;margin:0;padding:0}

.railNav a{
  position:relative;
  display:flex;
  align-items:center;
  min-height:42px;
  padding:8px 4px 8px 18px;
  color:var(--ink);
  text-decoration:none;
  font-size:16.5px;
  line-height:1.4;
  transition:transform .09s steps(2);
}
.railNav a::before{
  content:"";
  position:absolute;
  left:2px;top:50%;
  width:7px;height:7px;
  margin-top:-4px;
  border:1.5px solid var(--pencil);
  transform:rotate(38deg);
}
.railNav a:hover{
  transform:translateX(3px) rotate(-1.2deg);
  text-decoration:underline;
  text-decoration-style:wavy;
  text-decoration-thickness:1.5px;
  text-underline-offset:5px;
}

/* 主列 */
.cols{
  display:grid;
  grid-template-columns:minmax(0,1fr) 212px;
  gap:clamp(18px,3vw,44px);
  max-width:1120px;
  margin:0 auto;
  padding:0 clamp(16px,3vw,38px);
}

.hero{
  position:relative;
  min-height:70vh;
  display:grid;
  place-items:center;
  padding:80px 10px 60px;
  overflow:hidden;
}

.collage{position:absolute;inset:0;z-index:0}
.collage figure{
  position:absolute;
  margin:0;
  padding:7px;
  min-height:96px;
  background:#fff;
  background-image:repeating-linear-gradient(45deg,#fff 0 6px,#f0efea 6px 12px);
  border:2px solid var(--ink);
  border-radius:4px;
  box-shadow:7px 9px 0 rgba(26,26,26,.13);
}
.collage figure:nth-child(odd){left:1%;top:10%;width:45%;transform:rotate(-3.4deg)}
.collage figure:nth-child(even){right:1%;bottom:6%;width:41%;transform:rotate(2.8deg)}
.collage img{
  display:block;
  width:100%;height:auto;
  filter:grayscale(.75) contrast(1.15);
}

.heroText{position:relative;z-index:2;text-align:center;max-width:34ch}
.heroText h1{
  margin:0;
  font-size:clamp(30px,6.4vw,62px);
  line-height:1.24;
  letter-spacing:.05em;
  font-weight:700;
  padding:14px 18px;
  background:rgba(250,250,248,.94);
  border:2px solid var(--ink);
  border-radius:4px 9px 5px 8px;
  box-shadow:5px 6px 0 rgba(26,26,26,.14);
  transform:rotate(-.7deg);
}
.scribble{
  display:block;
  width:132px;height:12px;
  margin:16px auto 0;
  border-bottom:3px solid var(--ink);
  border-radius:70% 30% 60% 40%;
  transform:rotate(-2deg);
}

/* 正文纸面 */
.paper{
  max-width:44rem;
  margin:0 auto;
  padding:6px 0 70px;
}
.paper section{
  padding:34px 0 30px;
  border-bottom:1.5px dashed rgba(26,26,26,.3);
  scroll-margin-top:26px;
  animation:rise .46s steps(4,end) both;
}
.paper section:nth-child(1){animation-delay:.02s}
.paper section:nth-child(2){animation-delay:.07s}
.paper section:nth-child(3){animation-delay:.12s}
.paper section:nth-child(4){animation-delay:.17s}
.paper section:nth-child(5){animation-delay:.22s}
.paper section:nth-child(6){animation-delay:.27s}
.paper section:nth-child(7){animation-delay:.32s}
.paper section:last-child{border-bottom:0}

.paper h2{
  font-size:clamp(21px,3vw,29px);
  line-height:1.35;
  margin:.1em 0 .7em;
  font-weight:700;
  letter-spacing:.02em;
}
.paper h2 span{
  display:inline;
  border-bottom:3px double var(--ink);
  padding-bottom:3px;
}
.paper h3{font-size:clamp(18px,2.4vw,22px);margin:1.4em 0 .5em;line-height:1.4}
.paper h3 span{border-bottom:2px solid var(--line);padding-bottom:2px}

.paper p{margin:0 0 1.05em}
.paper a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-style:wavy;
  text-decoration-thickness:1.5px;
  text-underline-offset:4px;
}
.paper a:hover{background:rgba(26,26,26,.07)}
.paper ul,.paper ol{padding-left:1.4em;margin:0 0 1.1em}
.paper li{margin:.3em 0}
.paper img{
  max-width:100%;
  height:auto;
  padding:5px;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:4px;
  transform:rotate(-.6deg);
}
.paper blockquote{
  margin:1.2em 0;
  padding:.6em 1em;
  border-left:4px solid var(--ink);
  background:rgba(26,26,26,.04);
  font-style:italic;
  color:var(--pencil);
}
.paper strong{font-weight:700}

/* 右侧便签栏 */
.margin{
  position:sticky;
  top:22px;
  align-self:start;
  padding:26px 0 40px;
  font-size:15.5px;
  line-height:1.6;
}
.tocNav a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 0;
  color:var(--pencil);
  text-decoration:none;
  border-bottom:1px dashed rgba(26,26,26,.22);
}
.tocNav a:hover{color:var(--ink);background:rgba(26,26,26,.05)}
.topBox{margin-top:26px}
.arrow{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:44px;height:44px;
  border:2px solid var(--ink);
  border-radius:4px 7px 5px 8px;
  color:var(--ink);
  text-decoration:none;
  font-size:20px;
  transform:rotate(-2deg);
}
.arrow:hover{background:rgba(26,26,26,.07)}

/* 页脚 */
.foot{
  max-width:1120px;
  margin:0 auto;
  padding:26px clamp(16px,3vw,38px) 40px;
  border-top:2px solid var(--ink);
}
.footCols{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
}
.foot dl{margin:0}
.foot dt{
  font-family:var(--hand);
  font-size:13px;
  letter-spacing:.2em;
  color:var(--pencil);
  margin-bottom:4px;
}
.foot dd{margin:0}
.foot a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  color:var(--ink);
  text-decoration:none;
  font-size:15.5px;
  line-height:1.4;
}
.foot a:hover{text-decoration:underline;text-decoration-style:wavy;text-underline-offset:4px}
.copy{
  margin:18px 0 0;
  font-size:14px;
  color:var(--pencil);
  letter-spacing:.06em;
}

@keyframes rise{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}

@media (max-width:860px){
  body{padding-left:0}
  .rail{
    position:sticky;
    top:0;bottom:auto;
    width:auto;height:auto;
    flex-direction:row;
    align-items:center;
    gap:8px;
    padding:6px 10px;
    border-right:0;
    border-bottom:1.5px solid var(--line);
    overflow-x:auto;
    overflow-y:hidden;
  }
  .mark{width:40px;height:40px}
  .markTxt{font-size:18px}
  .railH{display:none}
  .railNav{flex:1 1 auto;min-width:0;overflow-x:auto}
  .railNav ul{display:flex;gap:4px}
  .railNav a{
    min-height:44px;
    padding:8px 12px;
    white-space:nowrap;
    font-size:16px;
  }
  .railNav a::before{display:none}
  .cols{display:block;padding:0 16px}
  .margin{
    position:static;
    padding:18px 0 26px;
    border-bottom:1.5px dashed rgba(26,26,26,.3);
  }
  .hero{min-height:60vh;padding:56px 0 44px}
  .collage figure:nth-child(odd){left:0;top:6%;width:50%}
  .collage figure:nth-child(even){right:0;bottom:4%;width:46%}
  .heroText h1{font-size:clamp(26px,8.4vw,40px);padding:12px 12px}
  .paper section{scroll-margin-top:72px}
  .foot{padding:22px 16px 36px}
  .footCols{gap:8px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation:none !important;transition:none !important}
}

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