@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@400;500;600;700&family=Comic+Neue:wght@300;400;700&display=swap');

:root{
  --pink:#eb879c;
  --pink-soft:#ffb6c1;
  --ink:#26171a;
  --bg:#fff6f8;
  --card:#ffffff;
  --line:#f2ccd6;
  --line-soft:#fae4e9;
  --muted:#6f5158;
  --link:#b84a63;
  --radius:18px;
  --shadow:0 2px 4px rgba(38,23,26,.06),0 10px 22px rgba(235,135,156,.12);
  --font:'Baloo 2','Comic Neue',"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,-apple-system,sans-serif;
}

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

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

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font);
  font-size:17px;
  line-height:1.78;
  letter-spacing:.01em;
  overflow-x:hidden;
}

img{display:block;max-width:100%;height:auto}
a{color:var(--link)}
p{margin:0 0 1.05em}

:focus-visible{
  outline:3px solid var(--pink);
  outline-offset:3px;
  border-radius:8px;
}

section[id]{scroll-margin-top:104px}

/* ---------- 顶栏 ---------- */
.top{
  position:sticky;
  top:0;
  z-index:40;
  display:flex;
  align-items:center;
  gap:12px;
  padding:9px 16px;
  background:rgba(255,246,248,.94);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line-soft);
}

.mark{
  flex:0 0 auto;
  width:44px;
  height:44px;
  display:grid;
  place-items:center;
  border-radius:14px;
  border:1px solid var(--line);
  background:linear-gradient(150deg,#ffe0e7,#f9b6c5);
  box-shadow:0 2px 4px rgba(38,23,26,.07);
  text-decoration:none;
  color:var(--ink);
  overflow:hidden;
  transition:transform .22s ease,box-shadow .22s ease;
}
.mark:hover{transform:translateY(-1px);box-shadow:var(--shadow)}
.mark-img{width:44px;height:44px;object-fit:cover}
.mark-mono{font-size:20px;font-weight:700;line-height:1}

.brand{
  font-size:17px;
  font-weight:700;
  letter-spacing:.02em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

.search{margin-left:auto;flex:0 0 auto}
.search input{
  width:148px;
  height:42px;
  padding:0 15px;
  border-radius:999px;
  border:1px solid var(--line);
  background:#fff;
  color:inherit;
  font:inherit;
  font-size:16px;
  box-shadow:0 1px 2px rgba(38,23,26,.04);
  transition:border-color .2s ease,box-shadow .2s ease;
}
.search input::placeholder{color:#a3838c}
.search input:focus{
  border-color:var(--pink);
  box-shadow:0 0 0 3px rgba(235,135,156,.22);
  outline:none;
}

/* ---------- 首屏 ---------- */
.hero{
  min-height:70vh;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:54px 20px 44px;
  text-align:center;
}
.hero h1{
  margin:0 auto;
  max-width:15ch;
  font-size:clamp(34px,8.8vw,72px);
  line-height:1.1;
  font-weight:700;
  letter-spacing:-.015em;
  text-wrap:balance;
}

/* ---------- 骨架 ---------- */
.shell{
  display:grid;
  grid-template-columns:minmax(0,1fr) 264px;
  grid-template-areas:"main dock";
  gap:36px;
  align-items:start;
  max-width:1080px;
  margin:0 auto;
  padding:0 20px 64px;
}
.shell main{grid-area:main;min-width:0}

/* ---------- 目录侧栏 ---------- */
.dock{
  grid-area:dock;
  position:sticky;
  top:78px;
  padding:16px 14px;
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
}
.dock-h{
  margin:0 0 10px;
  padding-left:4px;
  font-size:14px;
  font-weight:700;
  letter-spacing:.22em;
  color:var(--muted);
}
.dock-h > span{
  border-bottom:2px solid var(--pink-soft);
  padding-bottom:2px;
}
.dock ul{list-style:none;margin:0;padding:0;display:grid;gap:3px}
.dock a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:9px 12px;
  border-radius:12px;
  color:#5d3b43;
  text-decoration:none;
  font-size:16px;
  line-height:1.35;
  transition:background .22s ease,color .22s ease,transform .22s ease;
}
.dock a:hover{background:#fdeef2;color:var(--ink);transform:translateX(2px)}
.dock a:focus-visible{outline-offset:1px}

/* ---------- 正文 ---------- */
.wrap{min-width:0}
.prose{max-width:72ch}

.prose > section{
  padding:36px 0;
  border-top:1px solid var(--line-soft);
}
.prose > section:first-of-type{border-top:0;padding-top:4px}

.prose h2{
  margin:0 0 14px;
  font-size:clamp(22px,4.6vw,30px);
  line-height:1.32;
  letter-spacing:-.008em;
}
.prose h2 > span,
.prose h3 > span{
  background:linear-gradient(transparent 64%,var(--pink-soft) 64%);
  padding:0 .08em;
}
.prose h3{
  margin:26px 0 10px;
  font-size:20px;
  line-height:1.45;
}
.prose h4{margin:20px 0 8px;font-size:18px}

.prose ul,.prose ol{margin:0 0 1.1em;padding-left:1.25em}
.prose li{margin:.32em 0}
.prose strong{color:#180d10}

.prose blockquote{
  margin:1.4em 0;
  padding:16px 18px;
  background:#fff;
  border:1px solid var(--line);
  border-left:4px solid var(--pink);
  border-radius:0 var(--radius) var(--radius) 0;
  color:#402930;
}

.prose figure{margin:1.4em 0}
.prose figcaption{margin-top:8px;font-size:14px;color:var(--muted)}
.prose img{border-radius:var(--radius);border:1px solid var(--line)}

.prose table{
  width:100%;
  border-collapse:collapse;
  font-size:16px;
  display:block;
  overflow-x:auto;
}
.prose th,.prose td{
  border:1px solid var(--line);
  padding:10px 12px;
  text-align:left;
}
.prose th{background:#fff;font-weight:700}

.prose a{
  text-underline-offset:3px;
  text-decoration-thickness:1px;
  transition:color .2s ease;
}
.prose a:hover{color:var(--ink)}

/* ---------- 页脚 ---------- */
.foot{
  display:grid;
  grid-template-columns:1fr auto;
  gap:8px 18px;
  align-items:center;
  padding:26px 20px 40px;
  background:#fff;
  border-top:1px solid var(--line);
}
.foot p{margin:0}
.foot-l{font-weight:700;font-size:16px}
.foot-l a{
  display:inline-block;
  padding:10px 12px;
  margin-left:2px;
  min-height:42px;
  border-radius:12px;
  color:#7c4a57;
  text-decoration:none;
  transition:background .22s ease,color .22s ease;
}
.foot-l a:hover{background:#fdeef2;color:var(--ink)}
.foot-r{font-size:14px;color:var(--muted);justify-self:end}

/* ---------- 滚动显现 ---------- */
.reveal .rv{opacity:0;transform:translateY(16px)}
.reveal .rv.in{
  opacity:1;
  transform:none;
  transition:opacity .28s ease,transform .28s ease;
}

/* ---------- 移动端 ---------- */
@media (max-width:880px){
  body{font-size:16px}
  section[id]{scroll-margin-top:132px}
  .top{padding:8px 14px}
  .search input{width:124px;height:40px}
  .hero{min-height:auto;padding:64px 18px 52px}
  .shell{
    display:block;
    padding:0 16px 48px;
  }
  .dock{
    position:sticky;
    top:60px;
    z-index:30;
    margin:0 -16px 22px;
    padding:8px 12px;
    border-radius:0 0 var(--radius) var(--radius);
    border-left:0;
    border-right:0;
  }
  .dock-h{display:none}
  .dock ul{
    display:flex;
    gap:8px;
    overflow-x:auto;
    scrollbar-width:none;
  }
  .dock ul::-webkit-scrollbar{display:none}
  .dock a{
    min-height:40px;
    padding:9px 14px;
    white-space:nowrap;
    background:#fff9fb;
    border:1px solid var(--line-soft);
    font-size:15px;
  }
  .dock a:hover{transform:none}
  .prose > section{padding:30px 0}
  .foot{grid-template-columns:1fr;padding:24px 16px 36px}
  .foot-r{justify-self:start;padding-left:12px}
}

@media (max-width:360px){
  .brand{font-size:16px}
  .search input{width:104px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .reveal .rv{opacity:1;transform:none}
  .mark,.dock a,.foot-l a,.prose a{transition:none}
}

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