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

:root{
  --mint:#b4fde1;
  --sky:#add8e6;
  --ink:#172620;
  --paper:#f2fff9;
  --card:#ffffff;
  --edge:rgba(23,38,32,.16);
  --sh-in:inset -2px -2px 8px rgba(23,38,32,.10);
  --sh-out:4px 4px 8px var(--edge);
  --bar:112px;
  --font:'Quicksand','PingFang SC','Hiragino Sans GB','Microsoft YaHei',system-ui,sans-serif;
}

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

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

body{
  margin:0;
  min-height:100svh;
  font-family:var(--font);
  font-size:17px;
  line-height:1.75;
  color:var(--ink);
  background:
    radial-gradient(1100px 560px at 10% -12%, #ffffff 0%, var(--paper) 42%, #e6fbf2 100%);
  background-attachment:fixed;
  overflow-x:hidden;
}

img{max-width:100%;height:auto}
a{color:inherit}
::selection{background:var(--mint);color:var(--ink)}

:focus-visible{
  outline:3px solid #1c6b50;
  outline-offset:3px;
  border-radius:8px;
}

.shell{min-height:100svh;display:flex;flex-direction:column}

/* ---------- 顶部两行：品牌行 + 药丸菜单 ---------- */
.topbar{
  position:sticky;
  top:0;
  z-index:30;
  display:grid;
  gap:8px;
  padding:10px 16px 12px;
  background:linear-gradient(180deg,#f4fffb 0%,#e5fcf3 76%,#ddf9ee 100%);
  border-bottom:3px solid var(--ink);
  box-shadow:0 6px 0 rgba(23,38,32,.10);
}

.brandrow{display:flex;align-items:center;min-width:0}

.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  max-width:100%;
  padding:2px 8px 2px 2px;
  font-size:1.3rem;
  font-weight:700;
  letter-spacing:.02em;
  color:var(--ink);
  text-decoration:none;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.brand:hover span{text-decoration:underline;text-decoration-thickness:3px;text-underline-offset:4px}
.brand img{
  width:36px;height:36px;
  border-radius:50%;
  border:3px solid var(--ink);
  background:#fff;
  object-fit:cover;
}

.menu{min-width:0}
.pills{
  display:flex;
  gap:8px;
  margin:0;
  padding:0 0 4px;
  list-style:none;
  overflow-x:auto;
  scrollbar-width:thin;
}
.pills::-webkit-scrollbar{height:6px}
.pills::-webkit-scrollbar-thumb{background:rgba(23,38,32,.25);border-radius:99px}
.pills li{flex:0 0 auto}

.pill{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:8px 15px;
  font-size:.95rem;
  font-weight:600;
  color:var(--ink);
  text-decoration:none;
  border:3px solid var(--ink);
  border-radius:999px;
  background:linear-gradient(180deg,#ffffff,var(--mint));
  box-shadow:var(--sh-in),3px 3px 0 var(--edge);
  transition:transform .2s ease-out,box-shadow .2s ease-out,background .2s ease-out;
}
.pill:hover{
  transform:translateY(-2px);
  background:linear-gradient(180deg,#ffffff,#d7fdf0);
  box-shadow:var(--sh-in),5px 6px 0 var(--edge);
}
.pill:active{
  transform:translateY(2px);
  box-shadow:var(--sh-in),1px 1px 0 var(--edge);
}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  overflow:hidden;
  display:grid;
  align-content:center;
  justify-items:start;
  min-height:calc(100svh - var(--bar));
  padding:34px 18px 92px;
  background:
    radial-gradient(620px 320px at 94% 6%, var(--sky) 0%, rgba(173,216,230,0) 62%),
    radial-gradient(520px 300px at 2% 94%, var(--mint) 0%, rgba(180,253,225,0) 64%);
}

.hero-copy{position:relative;z-index:2;max-width:23ch}

.hero h1{
  margin:0 0 18px;
  font-size:clamp(2.05rem,8.2vw,4.4rem);
  line-height:1.14;
  letter-spacing:.01em;
  font-weight:700;
  text-shadow:3px 3px 0 rgba(180,253,225,.95);
}

.hero-desc{
  margin:0;
  max-width:44ch;
  font-size:1.02rem;
  line-height:1.85;
  color:#2b4438;
}

.hero-band{
  position:absolute;
  left:-12%;
  right:-12%;
  bottom:-8px;
  height:74px;
  z-index:1;
  border-top:3px solid var(--ink);
  background:linear-gradient(90deg,var(--mint),var(--sky));
  transform:skewY(-4deg);
}

.hero-art{
  position:absolute;
  right:-42px;
  bottom:56px;
  width:172px;
  height:172px;
  margin:0;
  z-index:1;
  opacity:.85;
  pointer-events:none;
}

.blob{
  position:absolute;
  display:block;
  border:3px solid var(--ink);
  border-radius:50%;
  box-shadow:inset -3px -3px 10px rgba(23,38,32,.12),5px 6px 0 rgba(23,38,32,.14);
}
.b1{width:84px;height:84px;right:74px;top:6px;background:linear-gradient(160deg,#ffffff,var(--mint))}
.b2{width:62px;height:62px;right:8px;top:82px;background:linear-gradient(160deg,#ffffff,var(--sky))}
.b3{width:44px;height:44px;right:86px;top:116px;background:linear-gradient(160deg,#eafef6,var(--mint))}

/* ---------- 主体：左侧目录 + 正文 ---------- */
.board{
  flex:1 0 auto;
  width:100%;
  max-width:1140px;
  margin:0 auto;
  padding:34px 16px 54px;
  display:grid;
  gap:24px;
}

.rail{display:none}

.prose{
  min-width:0;
  max-width:70ch;
  font-size:17px;
}

.prose > article{
  position:relative;
  margin:0 0 22px;
  padding:20px 18px 22px;
  background:var(--card);
  border:3px solid var(--ink);
  border-bottom:6px solid var(--mint);
  border-radius:10px;
  box-shadow:var(--sh-in),5px 5px 0 rgba(23,38,32,.13);
}
.prose > article:last-child{margin-bottom:0}

.prose [id]{scroll-margin-top:calc(var(--bar) + 16px)}

.prose small{
  display:block;
  margin-bottom:2px;
  font-size:.8rem;
  font-weight:700;
  letter-spacing:.15em;
  color:rgba(23,38,32,.6);
}

.prose h2{
  margin:0 0 .55em;
  font-size:clamp(1.26rem,4.6vw,1.6rem);
  line-height:1.35;
  letter-spacing:.01em;
}

.prose h3{
  margin:1.2em 0 .45em;
  font-size:1.1rem;
  line-height:1.45;
}

.prose p{margin:0 0 12px;line-height:1.86;color:#20362c}
.prose p:last-child{margin-bottom:0}
.prose ul,.prose ol{margin:0 0 12px;padding-left:1.35em;line-height:1.85}
.prose li{margin-bottom:6px}
.prose strong{font-weight:700;background:linear-gradient(transparent 58%,var(--mint) 58%);padding:0 2px}
.prose em{font-style:normal;background:linear-gradient(transparent 58%,rgba(173,216,230,.85) 58%)}
.prose a{
  color:#0f5540;
  font-weight:600;
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}
.prose a:hover{background:var(--mint)}
.prose blockquote{
  margin:0 0 12px;
  padding:10px 14px;
  border-left:6px solid var(--sky);
  border-radius:0 12px 12px 0;
  background:#f6fffc;
}
.prose code{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:.92em;
  padding:1px 5px;
  border-radius:6px;
  background:var(--paper);
  border:1px solid var(--edge);
}

/* ---------- 页脚：极简一行 ---------- */
.foot{
  flex:0 0 auto;
  text-align:center;
  padding:26px 18px 34px;
  border-top:3px solid var(--ink);
  background:linear-gradient(180deg,#f4fffb,#ddf9ee);
}
.foot p{margin:0 0 4px;font-weight:700;letter-spacing:.02em}
.foot small{font-size:.82rem;color:rgba(23,38,32,.62)}

/* ---------- 滚动揭示 ---------- */
.rv{opacity:0;transform:translateY(16px)}
.rv.in{
  opacity:1;
  transform:none;
  transition:opacity .55s ease-out,transform .55s cubic-bezier(.34,1.56,.64,1);
}

/* ---------- 桌面 ---------- */
@media (min-width:900px){
  :root{--bar:132px}
  .topbar{padding:12px 32px 14px}
  .brand{font-size:1.5rem}
  .pills{flex-wrap:wrap;overflow:visible}

  .hero{padding:60px 32px 130px;min-height:calc(100svh - var(--bar))}
  .hero h1{font-size:clamp(2.6rem,6vw,4.6rem)}
  .hero-desc{font-size:1.1rem}
  .hero-band{height:96px}
  .hero-art{right:6%;bottom:118px;width:300px;height:300px;opacity:1}
  .b1{width:148px;height:148px;right:126px;top:10px}
  .b2{width:104px;height:104px;right:16px;top:142px}
  .b3{width:76px;height:76px;right:150px;top:196px}

  .board{grid-template-columns:238px minmax(0,1fr);gap:36px;padding:54px 32px 72px;align-items:start}

  .rail{
    display:block;
    position:sticky;
    top:calc(var(--bar) + 14px);
    align-self:start;
    padding:18px 16px;
    border:3px solid var(--ink);
    border-radius:22px;
    background:linear-gradient(180deg,#ffffff,#e7fcf3);
    box-shadow:var(--sh-in),var(--sh-out);
  }
  .rail-kicker{
    display:block;
    font-size:.77rem;
    font-weight:700;
    letter-spacing:.18em;
    color:rgba(23,38,32,.62);
  }
  .rail-title{
    margin:2px 0 12px;
    padding-bottom:10px;
    font-size:1.08rem;
    line-height:1.3;
    border-bottom:4px solid var(--mint);
  }
  .rail-list{list-style:none;margin:0;padding:0;display:grid;gap:6px}
  .rail-list a{
    display:flex;
    align-items:center;
    min-height:40px;
    padding:6px 11px;
    font-size:.93rem;
    font-weight:600;
    color:var(--ink);
    text-decoration:none;
    border:2px solid transparent;
    border-radius:12px;
    transition:background .18s ease-out,border-color .18s ease-out,transform .18s ease-out;
  }
  .rail-list a:hover{
    background:var(--mint);
    border-color:var(--ink);
    transform:translateX(3px);
  }
}

@media (min-width:1120px){
  .prose{font-size:17.5px}
}

/* ---------- 降级动效 ---------- */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation:none !important}
  .rv{opacity:1;transform:none;transition:none}
  .pill,.rail-list a{transition:none}
}

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