:root{
  --paper:#fafaf8;
  --gray:#4a4a4a;
  --ink:#1a1a1a;
  --card:#ffffff;
}

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

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

body{
  margin:0;
  font-family:'Atkinson Hyperlegible',system-ui,-apple-system,'Segoe UI','PingFang SC','Noto Sans SC',sans-serif;
  font-size:17px;
  line-height:1.65;
  color:var(--ink);
  background-color:var(--paper);
  background-image:
    radial-gradient(rgba(26,26,26,.055) .8px,transparent .9px),
    repeating-linear-gradient(0deg,rgba(74,74,74,.035) 0 1px,transparent 1px 26px);
  background-size:6px 6px,100% 26px;
  overflow-x:hidden;
}

p{margin:0 0 14px}
a{color:var(--ink);text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px}
img{max-width:100%;height:auto;display:block}
ul,ol{padding-left:1.25em}
li{margin-bottom:6px}

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

.skip{
  position:absolute;
  left:8px;
  top:-60px;
  z-index:90;
  padding:10px 14px;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:4px;
  text-decoration:none;
  transition:top .15s ease-out;
}
.skip:focus{top:8px}

.wrap{
  width:100%;
  max-width:1240px;
  margin:0 auto;
  padding-left:clamp(104px,12vw,184px);
  padding-right:clamp(16px,3vw,36px);
}

/* 角标 */
.brandpin{
  position:fixed;
  top:16px;
  right:16px;
  z-index:70;
  width:50px;
  height:50px;
  display:grid;
  place-items:center;
  font-size:22px;
  line-height:1;
  text-decoration:none;
  color:var(--ink);
  background:#fff;
  border:2px solid var(--ink);
  border-radius:4px;
  box-shadow:3px 3px 0 var(--ink);
  transform:rotate(3deg);
  transition:transform .16s ease-out;
}
.brandpin:hover{transform:rotate(-2deg) translateY(-1px)}

/* 左侧竖排胶囊导航 */
.sidenav{
  position:fixed;
  left:14px;
  top:50%;
  transform:translateY(-50%);
  z-index:60;
  display:flex;
  flex-direction:column;
  gap:8px;
  max-width:152px;
}
.sidenav a{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:8px 14px;
  font-size:15px;
  line-height:1.25;
  text-align:center;
  text-decoration:none;
  color:var(--ink);
  background:#fff;
  border:1.5px solid var(--ink);
  border-radius:999px;
  box-shadow:2px 2px 0 rgba(26,26,26,.85);
  transition:transform .16s ease-out,box-shadow .16s ease-out;
}
.sidenav a:hover,
.sidenav a:focus-visible{
  transform:translate(1px,-2px) rotate(-1.2deg);
  box-shadow:4px 4px 0 rgba(26,26,26,.85);
}

/* 主区 */
.entry{
  display:grid;
  grid-template-columns:206px minmax(0,1fr);
  column-gap:clamp(18px,2.6vw,40px);
  padding-top:clamp(28px,6vh,64px);
  align-items:start;
}

.hero-text{
  grid-column:2;
  grid-row:1;
  min-height:32vh;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  padding-bottom:16px;
}

.hero-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:16px;
}

.sticker{
  display:inline-block;
  margin:0;
  padding:5px 12px;
  font-size:14px;
  letter-spacing:.06em;
  background:#fff;
  border:1.5px dashed var(--ink);
  border-radius:3px;
  box-shadow:2px 2px 0 rgba(26,26,26,.7);
  transform:rotate(-2.2deg);
}
.sticker--link{
  text-decoration:none;
  transform:rotate(1.6deg);
}

h1{
  margin:0 0 16px;
  font-size:clamp(2rem,5vw,3.7rem);
  line-height:1.06;
  letter-spacing:-.015em;
  text-decoration:underline wavy var(--ink) 2px;
  text-underline-offset:9px;
  text-decoration-skip-ink:none;
}

.lede{
  margin:0;
  max-width:56ch;
  font-size:clamp(17px,1.9vw,20px);
  color:var(--gray);
}

.hero-fig{
  grid-column:2;
  grid-row:2;
  margin:20px 0 0;
  padding:10px;
  min-height:34vh;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:4px;
  box-shadow:7px 7px 0 rgba(26,26,26,.16);
  transform:rotate(-.5deg);
}
.hero-fig img{
  width:100%;
  height:100%;
  max-height:46vh;
  object-fit:cover;
  border-radius:2px;
  will-change:transform;
}
.hero-fig svg{width:100%;height:auto;max-height:38vh}

/* 左侧目录 */
.entry-aside{
  grid-column:1;
  grid-row:1 / span 4;
  position:sticky;
  top:74px;
  padding:16px 14px;
  background:#fff;
  border:1.5px solid var(--ink);
  border-radius:4px;
  box-shadow:4px 4px 0 rgba(26,26,26,.12);
  transform:rotate(-.4deg);
}
.entry-aside h2{
  margin:0;
  font-size:16px;
  letter-spacing:.14em;
}
.entry-aside hr{
  border:0;
  border-top:2px dashed var(--ink);
  margin:8px 0 12px;
}
.aside-list{
  list-style:none;
  margin:0 0 10px;
  padding:0;
  display:grid;
  gap:2px;
}
.aside-list a{
  display:flex;
  align-items:center;
  gap:8px;
  min-height:40px;
  padding:4px 2px;
  font-size:15px;
  color:var(--gray);
  text-decoration:none;
  border-bottom:1px dotted rgba(26,26,26,.28);
}
.aside-list a:hover{color:var(--ink)}
.aside-list .n{
  font-size:12px;
  letter-spacing:.06em;
  font-variant-numeric:tabular-nums;
  color:var(--gray);
}
.to-top{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-size:14px;
  text-decoration:underline wavy 1px;
}

/* 正文 */
.entry-body{
  grid-column:2;
  grid-row:3;
  margin-top:clamp(28px,5vh,52px);
  min-width:0;
}
.entry-body > section{
  position:relative;
  margin:0 0 clamp(22px,3vw,34px);
  padding:clamp(18px,3.4vw,36px);
  background:var(--card);
  border:1.5px solid var(--ink);
  border-radius:4px;
  box-shadow:0 10px 0 -6px rgba(26,26,26,.12),0 3px 12px rgba(26,26,26,.07);
}
.entry-body > section:nth-child(odd){transform:rotate(.22deg)}
.entry-body > section:nth-child(even){transform:rotate(-.26deg)}
.entry-body > section::before{
  content:"";
  position:absolute;
  top:-9px;
  left:26px;
  width:86px;
  height:19px;
  background:repeating-linear-gradient(90deg,rgba(74,74,74,.17) 0 6px,rgba(74,74,74,.07) 6px 12px);
  border-left:1px dashed rgba(26,26,26,.45);
  border-right:1px dashed rgba(26,26,26,.45);
  border-radius:2px;
  transform:rotate(-2.4deg);
}

.entry-body h2{
  margin:0 0 10px;
  font-size:clamp(1.28rem,2.6vw,1.72rem);
  line-height:1.25;
  letter-spacing:-.01em;
}
.entry-body hr{
  border:0;
  border-top:2px solid var(--ink);
  width:72px;
  margin:0 0 16px;
}
.entry-body h3{
  margin:24px 0 8px;
  font-size:1.12rem;
}
.entry-body blockquote{
  margin:18px 0;
  padding:10px 16px;
  color:var(--gray);
  background:rgba(74,74,74,.05);
  border-left:3px dashed var(--gray);
}
.entry-body img{
  margin:12px 0;
  border:1.5px solid var(--ink);
  border-radius:3px;
}
.entry-body table{
  display:block;
  width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  font-size:16px;
}
.entry-body th,
.entry-body td{
  padding:8px 10px;
  text-align:left;
  border-bottom:1px solid rgba(26,26,26,.25);
}
.entry-body code,
.entry-body pre{
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:15px;
}
.entry-body pre{
  overflow-x:auto;
  padding:12px 14px;
  background:rgba(74,74,74,.07);
  border:1px dashed var(--gray);
  border-radius:3px;
}

/* 页脚 */
.foot{
  margin-top:clamp(40px,7vh,80px);
  padding:clamp(26px,5vw,44px) 0 20px;
  background:rgba(255,255,255,.5);
  border-top:2px dashed var(--ink);
}
.foot-brand{
  margin:0 0 26px;
  font-size:clamp(2.2rem,8.5vw,4.6rem);
  line-height:.92;
  letter-spacing:-.03em;
  transform:rotate(-.6deg);
}
.foot-cols{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(14px,3vw,30px);
  margin-bottom:26px;
}
.foot dl{margin:0}
.foot dt{
  margin-bottom:6px;
  padding-bottom:4px;
  font-size:13px;
  letter-spacing:.14em;
  color:var(--gray);
  border-bottom:1px solid rgba(26,26,26,.3);
}
.foot dd{margin:0;font-size:15px}
.foot a{
  display:flex;
  align-items:center;
  min-height:40px;
  text-decoration:none;
  color:var(--ink);
  border-bottom:1px dotted transparent;
}
.foot a:hover{
  text-decoration:underline wavy 1px;
  border-bottom-color:rgba(26,26,26,.35);
}
.foot-copy{
  margin:0;
  padding-top:12px;
  font-size:13px;
  color:var(--gray);
  border-top:1px solid rgba(26,26,26,.2);
}

/* 动效 */
.js .rv{opacity:0;translate:0 12px}
.js .rv.in{
  opacity:1;
  translate:0 0;
  transition:opacity .28s ease-out,translate .28s ease-out;
}

@media (max-width:900px){
  .wrap{
    padding-left:16px;
    padding-right:16px;
    padding-bottom:108px;
  }
  .sidenav{
    top:auto;
    bottom:10px;
    left:10px;
    right:10px;
    transform:none;
    max-width:none;
    flex-direction:row;
    gap:6px;
    padding:6px;
    overflow-x:auto;
    background:var(--paper);
    border:1.5px solid var(--ink);
    border-radius:14px;
    box-shadow:3px 3px 0 rgba(26,26,26,.22);
    -webkit-overflow-scrolling:touch;
  }
  .sidenav a{flex:0 0 auto;font-size:14px;padding:8px 12px}
  .entry{grid-template-columns:minmax(0,1fr)}
  .hero-text,.hero-fig,.entry-aside,.entry-body{grid-column:1}
  .hero-text{grid-row:1;min-height:0;padding-top:26px;padding-bottom:0}
  .hero-fig{grid-row:2;min-height:0;margin-top:16px;transform:none}
  .hero-fig img{max-height:38vh}
  .entry-aside{
    grid-row:3;
    position:static;
    margin-top:26px;
    transform:none;
  }
  .entry-body{grid-row:4;margin-top:26px}
  .brandpin{top:12px;right:12px;width:44px;height:44px;font-size:19px}
  .foot-cols{grid-template-columns:repeat(2,minmax(0,1fr))}
}

@media (max-width:430px){
  body{font-size:16px}
  h1{font-size:clamp(1.9rem,8vw,2.4rem)}
  .foot-cols{grid-template-columns:1fr}
  .foot-brand{transform:none}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js .rv{opacity:1;translate:none}
  .sidenav a,.brandpin,.skip{transition:none}
}

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