@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;500;600;700&family=Varela+Round&display=swap');

:root{
  --paper:#fafaf8;
  --ink:#1a1a1a;
  --soft:#4a4a4a;
  --wash:#f1eee8;
  --line:#d8d2c7;
}

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

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

body{
  margin:0;
  font-family:'Nunito Sans',-apple-system,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  font-size:17px;
  line-height:1.68;
  color:var(--ink);
  background-color:var(--paper);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='170' height='170'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.88' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='170' height='170' filter='url(%23n)' opacity='0.15'/%3E%3C/svg%3E");
  background-repeat:repeat;
  overflow-x:hidden;
}

h1,h2,h3,h4,summary,.brand,.pill,.tag,.cta a{
  font-family:'Varela Round','Nunito Sans',system-ui,sans-serif;
  font-weight:400;
}

a{color:var(--ink)}

/* ---------- 顶栏：品牌独占一行，菜单行在下 ---------- */
.top{
  border-bottom:2px dashed var(--ink);
  padding:16px 22px 0;
  background:rgba(250,250,248,0.86);
}

.brandline{
  margin:0 0 8px;
  font-size:clamp(24px,4.4vw,32px);
  letter-spacing:.02em;
}

.brand{
  display:inline-block;
  padding:2px 2px 4px;
  text-decoration:none;
  color:var(--ink);
  border-bottom:3px solid var(--ink);
  transform:rotate(-1.2deg);
}

.brand:hover{border-bottom-style:dotted}

.menubar{padding-bottom:14px}

.drawer > summary{
  list-style:none;
  cursor:pointer;
  user-select:none;
}

.drawer > summary::-webkit-details-marker{display:none}

.drawer > summary::after{
  content:"＋";
  margin-left:8px;
  font-size:14px;
}

.drawer[open] > summary::after{content:"－"}

.pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:10px 18px;
  font-size:16px;
  line-height:1.2;
  color:var(--ink);
  background:#fff;
  border:2px solid var(--ink);
  border-radius:999px 980px 999px 970px;
  text-decoration:none;
  transform:rotate(-0.7deg);
  transition:transform .12s steps(2,end), background-color .12s steps(2,end), color .12s steps(2,end);
}

.pill:nth-child(even){transform:rotate(0.8deg)}

.pill:hover,
.pill:focus-visible{
  background:var(--ink);
  color:var(--paper);
  transform:rotate(-1.8deg);
}

.pills{
  display:flex;
  flex-wrap:wrap;
  gap:9px;
  margin:12px 0 0;
  padding:0;
  list-style:none;
}

.drawer:not([open]) > .pills{display:none}

/* ---------- 主区 ---------- */
.stage{
  display:grid;
  grid-template-columns:224px minmax(0,1fr);
  gap:0 36px;
  max-width:1080px;
  margin:0 auto;
  padding:24px 22px 72px;
}

.stage > div{scroll-margin-top:110px}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  min-height:70vh;
  padding:26px 0 46px;
}

.hero-fig{
  position:absolute;
  inset:0;
  margin:0;
  z-index:0;
  overflow:hidden;
  border:2px solid var(--ink);
  border-radius:26px 32px 46% 42% / 22px 26px 96px 84px;
}

.hero-fig img,
.hero-img{
  width:100%;
  height:100%;
  object-fit:cover;
  filter:grayscale(1) contrast(1.12);
  border:0;
  border-radius:0;
}

.scribble{
  display:block;
  width:100%;
  height:100%;
  background:repeating-linear-gradient(-45deg,#ece7de 0 13px,#e0dacc 13px 26px);
}

.hero-txt{
  position:relative;
  z-index:1;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:14px;
  max-width:640px;
  padding:24px 26px 26px;
  background:rgba(250,250,248,0.95);
  border:2px solid var(--ink);
  border-radius:18px 22px 18px 24px;
  transform:rotate(-0.5deg);
}

.tag{
  display:inline-block;
  padding:6px 14px;
  font-size:15px;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:14px 18px 12px 20px;
  transform:rotate(-3.5deg);
}

.hero h1{
  margin:0;
  font-size:clamp(30px,5.6vw,54px);
  line-height:1.16;
  letter-spacing:-.01em;
}

.lede{
  margin:0;
  font-size:17px;
  color:var(--soft);
}

/* ---------- 左侧目录 ---------- */
.rail{
  grid-column:1;
  grid-row:2;
  padding-top:8px;
}

.toc{
  padding:16px 15px 18px;
  background:#fff;
  border:2px solid var(--ink);
  border-radius:18px;
  transform:rotate(-0.9deg);
}

.toc small{
  display:block;
  font-size:15px;
  letter-spacing:.22em;
  color:var(--soft);
}

.toc h2{
  margin:1px 0 12px;
  font-size:20px;
  line-height:1.3;
}

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

.toc li + li{border-top:1px dashed var(--line)}

.toc a{
  display:block;
  min-height:40px;
  padding:9px 4px;
  font-size:16px;
  text-decoration:none;
  transition:transform .1s steps(2,end), background-color .1s steps(2,end);
}

.toc a:hover,
.toc a:focus-visible{
  background:var(--wash);
  transform:translateX(4px);
}

/* ---------- 正文 ---------- */
.stage > div:not(.hero):not(.rail){
  grid-column:2;
  padding:10px 0 34px;
  border-top:2px dashed var(--line);
}

.stage > div:not(.hero):not(.rail):first-of-type{border-top:0}

.stage h2{
  margin:.5em 0 .55em;
  font-size:clamp(22px,3.4vw,30px);
  line-height:1.28;
}

.stage h3{
  margin:1.2em 0 .5em;
  font-size:clamp(19px,2.4vw,22px);
  line-height:1.35;
}

.stage p{margin:.75em 0;color:var(--soft)}

.stage div a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-style:wavy;
  text-decoration-thickness:1.5px;
  text-underline-offset:3px;
}

.stage ul,.stage ol{padding-left:1.35em;color:var(--soft)}

.stage li{margin:.4em 0}

.stage img{
  max-width:100%;
  height:auto;
  margin:.6em 0;
  border:2px solid var(--ink);
  border-radius:18px;
  filter:grayscale(1) contrast(1.06);
}

.stage figure{margin:1em 0}

.stage blockquote{
  margin:1.1em 0;
  padding:.6em 0 .6em 18px;
  border-left:4px solid var(--ink);
  color:var(--soft);
}

.stage code{
  padding:1px 6px;
  font-size:15px;
  background:var(--wash);
  border:1px solid var(--line);
  border-radius:6px;
}

/* ---------- 页脚 ---------- */
.end{
  padding:36px 22px 46px;
  text-align:center;
  background:var(--wash);
  border-top:2px solid var(--ink);
}

.end .cta{margin:0 0 24px}

.end .cta a{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:60px;
  padding:14px 40px;
  font-size:23px;
  color:var(--ink);
  background:var(--paper);
  border:2px solid var(--ink);
  border-radius:999px 960px 999px 950px;
  text-decoration:none;
  transform:rotate(-1.1deg);
  transition:transform .12s steps(2,end), background-color .12s steps(2,end), color .12s steps(2,end);
}

.end .cta a:hover,
.end .cta a:focus-visible{
  background:var(--ink);
  color:var(--paper);
  transform:rotate(1.6deg);
}

.end small{
  font-size:15px;
  color:var(--soft);
  letter-spacing:.06em;
}

/* ---------- 滚动显现 ---------- */
.has-rev .rev{
  opacity:.001;
  transform:translateY(16px);
}

.has-rev .rev.on{
  opacity:1;
  transform:none;
  transition:opacity .3s steps(3,end), transform .3s steps(3,end);
}

/* ---------- 移动端 ---------- */
@media (max-width:760px){
  .stage{
    grid-template-columns:1fr;
    gap:0;
    padding:16px 16px 52px;
  }

  .hero,
  .rail,
  .stage > div:not(.hero):not(.rail){grid-column:1}

  .rail{grid-row:auto;padding-top:20px}

  .hero{min-height:auto;padding:14px 0 26px}

  .hero-fig{border-radius:18px 22px 64px 54px / 16px 18px 72px 62px}

  .hero-txt{max-width:none;padding:18px}

  .top{padding:14px 16px 0}

  .end{padding:30px 16px 38px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}

  *,
  *::before,
  *::after{
    transition:none !important;
    animation:none !important;
  }
}

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