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

:root{
  --paper:#fafaf8;
  --gray:#4a4a4a;
  --ink:#1a1a1a;
  --rail:190px;
  --serif:'Cormorant','Songti SC','SimSun',serif;
  --sans:'Montserrat','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
}

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

html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

body{
  margin:0;
  font-family:var(--sans);
  font-size:17px;
  line-height:1.85;
  color:#242424;
  background-color:var(--paper);
  background-image:
    radial-gradient(rgba(26,26,26,.06) 1px,transparent 1px),
    radial-gradient(rgba(26,26,26,.04) 1px,transparent 1px);
  background-size:9px 9px,17px 17px;
  background-position:0 0,5px 7px;
  overflow-x:hidden;
}

img{max-width:100%;display:block}
h1,h2,h3{font-family:var(--serif);font-weight:600;letter-spacing:.012em}
small{font-size:16px;line-height:1.6}

/* 左侧竖排栏 */
.rail{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--rail);
  padding:20px 14px 22px;
  display:flex;
  flex-direction:column;
  gap:18px;
  border-right:1.5px dashed var(--ink);
  background:rgba(250,250,248,.94);
  z-index:20;
}

.brand{
  width:46px;height:46px;
  flex:none;
  display:grid;place-items:center;
  border:2px solid var(--ink);
  border-radius:50%;
  transform:rotate(-7deg);
  color:var(--ink);
  text-decoration:none;
  overflow:hidden;
}
.brand-txt{font-family:var(--serif);font-size:22px;font-weight:700;line-height:1}
.brand-img{width:46px;height:46px;object-fit:contain;filter:grayscale(1) contrast(1.1)}
.brand:hover{transform:rotate(2deg)}

.search{position:relative}
.search input{
  width:100%;
  min-height:40px;
  padding:6px 12px;
  font-family:var(--sans);
  font-size:16px;
  color:var(--ink);
  background:transparent;
  border:1.5px solid var(--ink);
  border-radius:999px;
}
.search input::placeholder{color:var(--gray)}
.search input:focus{outline:none;border-width:2.5px;background:#fff}

.rail nav{flex:1;min-height:0}
.rail ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}
.pill{
  display:flex;
  align-items:center;
  gap:7px;
  min-height:44px;
  padding:6px 12px;
  font-size:16px;
  font-weight:500;
  line-height:1.3;
  color:var(--ink);
  text-decoration:none;
  white-space:nowrap;
  border:1.5px solid var(--ink);
  border-radius:999px;
  background:rgba(255,255,255,.5);
}
.pill .no{font-family:var(--serif);font-size:16px;color:var(--gray)}
.pill:hover{transform:translateX(3px) rotate(-.7deg);border-width:2.5px;background:#fff;transition:transform .12s steps(2),border-width .12s steps(2)}
.pill:focus-visible{outline:2px dashed var(--ink);outline-offset:3px}

/* 主区 */
.page{margin-left:var(--rail)}

.hero{
  display:grid;
  grid-template-columns:1.05fr 1fr;
  gap:clamp(14px,2.4vw,34px);
  align-items:center;
  min-height:45vh;
  padding:26px clamp(16px,3vw,38px);
  border-bottom:2px solid var(--ink);
}
.hero-shot{
  position:relative;
  margin:0;
  min-height:210px;
  border:2px solid var(--ink);
  border-radius:28px;
  overflow:hidden;
  transform:rotate(-1.1deg);
  background:repeating-linear-gradient(45deg,#f1f1ee 0 9px,#fafaf8 9px 18px);
}
.hero-img{
  width:100%;
  height:45vh;
  object-fit:cover;
  filter:grayscale(1) contrast(1.07);
}
.tape{
  position:absolute;
  left:14px;top:14px;
  padding:10px 14px;
  font-size:16px;
  font-weight:600;
  line-height:1;
  letter-spacing:.1em;
  color:var(--paper);
  background:var(--ink);
  border-radius:4px;
  transform:rotate(-4.5deg);
}
.hero-text{text-align:right}
.hero-text h1{
  margin:0 0 12px;
  font-size:clamp(32px,5.6vw,74px);
  line-height:1.06;
  letter-spacing:.02em;
}
.hero-desc{
  margin:0 0 0 auto;
  max-width:32ch;
  font-size:17px;
  line-height:1.8;
  color:var(--gray);
}

main{
  display:grid;
  grid-template-columns:192px minmax(0,1fr);
  gap:clamp(16px,3vw,42px);
  align-items:start;
  padding:clamp(20px,3vw,40px) clamp(16px,3vw,38px) 64px;
}

/* 目录侧栏 */
.toc{
  position:sticky;
  top:26px;
  padding:18px 15px;
  border:2px solid var(--ink);
  border-radius:28px;
  transform:rotate(.6deg);
  background:rgba(255,255,255,.62);
}
.toc small{display:block;letter-spacing:.22em;color:var(--gray)}
.toc h2{margin:4px 0 12px;font-size:26px;line-height:1.2}
.toc ol{list-style:none;margin:0 0 14px;padding:0;display:flex;flex-direction:column}
.toc a{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:5px 2px;
  font-size:16px;
  line-height:1.3;
  color:var(--gray);
  text-decoration:none;
  border-bottom:1px dashed rgba(26,26,26,.3);
}
.toc a i{font-family:var(--serif);font-style:normal;font-size:16px;color:var(--ink)}
.toc a:hover{color:var(--ink);padding-left:6px;transition:padding .12s steps(2)}
.to-top{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  font-size:16px;
  color:var(--ink);
  text-decoration:none;
  border:1.5px solid var(--ink);
  border-radius:999px;
}

/* 正文 */
.body{min-width:0;font-size:17px;line-height:1.85}
.body div{
  --rot:-.24deg;
  --ty:0px;
  margin:0 0 34px;
  padding:26px 24px 30px;
  border:1.5px solid var(--ink);
  border-bottom:5px solid var(--ink);
  border-radius:28px;
  background:rgba(255,255,255,.58);
  scroll-margin-top:92px;
  transform:rotate(var(--rot)) translateY(var(--ty));
}
.body div:nth-child(even){--rot:.2deg}
.body div:hover{border-bottom-width:7px}
.body h2{margin:0 0 12px;font-size:clamp(24px,3vw,34px);line-height:1.22}
.body h3{margin:22px 0 8px;font-size:22px;line-height:1.3}
.body div small{display:block;margin-bottom:6px;letter-spacing:.16em;color:var(--gray)}
.body p{margin:0 0 14px}
.body p:last-child{margin-bottom:0}
.body ul,.body ol{margin:0 0 14px;padding-left:1.35em}
.body li{margin:6px 0}
.body a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-style:dashed;
  text-decoration-thickness:1.5px;
  text-underline-offset:3px;
}
.body blockquote{
  margin:0 0 14px;
  padding:4px 0 4px 16px;
  border-left:3px solid var(--ink);
  font-family:var(--serif);
  font-size:19px;
  color:var(--gray);
}
.body table{width:100%;border-collapse:collapse;margin:0 0 14px;font-size:16px}
.body th,.body td{border-bottom:1px solid rgba(26,26,26,.4);padding:8px 6px;text-align:left}

/* 页脚 */
.foot{padding:28px clamp(16px,3vw,38px) 34px}
.foot-brand{
  margin:0 0 18px;
  font-family:var(--serif);
  font-size:clamp(52px,13vw,150px);
  font-weight:500;
  line-height:.92;
  letter-spacing:-.01em;
}
.foot-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin:0;
  padding-top:12px;
  border-top:1px dashed var(--ink);
}
.foot-row small{color:var(--gray)}
.foot-row a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  font-size:16px;
  color:var(--ink);
  text-decoration:none;
  border:1.5px solid var(--ink);
  border-radius:999px;
}

/* 交错显现 */
@media (prefers-reduced-motion:no-preference){
  .will{opacity:0;--ty:18px}
  .will.in{
    opacity:1;
    --ty:0px;
    transition:opacity .3s steps(3),transform .3s ease-out;
  }
}

@media (max-width:860px){
  .rail{
    position:sticky;
    top:0;
    width:auto;
    height:auto;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:8px 12px;
    border-right:0;
    border-bottom:2px solid var(--ink);
    background:var(--paper);
  }
  .brand{width:40px;height:40px}
  .brand-txt{font-size:19px}
  .brand-img{width:40px;height:40px}
  .search{width:104px;flex:none}
  .search input{min-height:40px;padding:6px 10px}
  .rail nav{flex:1;min-width:0;overflow-x:auto;overflow-y:hidden;padding-bottom:2px}
  .rail ol{flex-direction:row;gap:8px}
  .pill{min-height:40px;padding:6px 12px}
  .pill:hover{transform:none}

  .page{margin-left:0}

  .hero{
    grid-template-columns:1fr;
    min-height:0;
    gap:12px;
    padding:16px 14px 20px;
  }
  .hero-shot{min-height:110px;transform:rotate(-.7deg)}
  .hero-img{height:32vh}
  .hero-text h1{font-size:clamp(30px,9vw,48px)}
  .hero-desc{font-size:16px}

  main{grid-template-columns:1fr;gap:18px;padding:16px 14px 44px}
  .toc{position:static;transform:none;border-radius:22px;padding:14px 12px}
  .toc ol{flex-direction:row;flex-wrap:wrap;gap:6px;margin-bottom:12px}
  .toc a{min-height:40px;padding:4px 10px;border:1px solid rgba(26,26,26,.45);border-radius:999px}
  .toc a:hover{padding-left:10px}
  .body div{--rot:0deg;padding:20px 16px 24px;border-radius:22px}
  .foot{padding:22px 14px 28px}
}

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