@import url('https://fonts.googleapis.com/css2?family=Calistoga:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

:root{
  --mint:#b4fde1;
  --blue:#add8e6;
  --ink:#172620;
  --deep:#0c1a14;
  --paper:#f4fcf8;
  --r:22px;
  --bw:3px;
  --sh: inset -3px -3px 0 rgba(23,38,32,.12), inset 3px 3px 0 rgba(255,255,255,.8), 6px 7px 0 rgba(23,38,32,.14);
  --sh-s: inset -2px -2px 0 rgba(23,38,32,.12), inset 2px 2px 0 rgba(255,255,255,.8), 3px 4px 0 rgba(23,38,32,.13);
  --ease: cubic-bezier(.34,1.56,.64,1);
  scroll-behavior: smooth;
}

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

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

body{
  margin: 0;
  padding: 26px 0 200px;
  font-family: Inter, "Noto Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background:
    radial-gradient(880px 520px at 10% -8%, rgba(180,253,225,.95), rgba(180,253,225,0) 62%),
    radial-gradient(760px 460px at 98% 4%, rgba(173,216,230,.92), rgba(173,216,230,0) 60%),
    radial-gradient(720px 620px at 46% 112%, rgba(180,253,225,.75), rgba(180,253,225,0) 66%),
    var(--paper);
  background-attachment: fixed;
}

img{ display: block; max-width: 100%; height: auto; }

a{ color: var(--ink); text-decoration: none; }

h1,h2,h3,h4{
  font-family: Calistoga, "Noto Serif SC", Georgia, "Songti SC", serif;
  font-weight: 400;
  line-height: 1.35;
  margin: 0 0 .6em;
  letter-spacing: .01em;
}

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

/* ---------- 底部胶囊导航条 ---------- */
.dock{
  position: fixed;
  left: 10px; right: 10px; bottom: 10px;
  z-index: 60;
  max-width: 1040px;
  margin: 0 auto;
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  border: var(--bw) solid var(--ink);
  border-radius: 26px;
  background: linear-gradient(160deg, rgba(255,255,255,.86), rgba(180,253,225,.72) 46%, rgba(173,216,230,.78));
  box-shadow: var(--sh);
  backdrop-filter: blur(10px) saturate(1.2);
}

.dock-search{
  position: relative;
  display: flex;
  align-items: center;
  margin: 0;
}
.dock-search input{
  width: 100%;
  min-height: 42px;
  padding: 8px 44px 8px 16px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  box-shadow: var(--sh-s);
  appearance: none;
}
.dock-search input::placeholder{ color: rgba(23,38,32,.55); }
.s-ico{
  position: absolute;
  right: 15px;
  width: 15px; height: 15px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  pointer-events: none;
}
.s-ico::after{
  content: "";
  position: absolute;
  right: -6px; bottom: -5px;
  width: 8px; height: 3px;
  background: var(--ink);
  border-radius: 2px;
  transform: rotate(45deg);
}

.dock-nav{ min-width: 0; }
.dock-ol{
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 2px 2px 4px;
  list-style: none;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
}
.dock-ol::-webkit-scrollbar{ display: none; }

.dock-i{ flex: 0 0 auto; scroll-snap-align: center; }
.dock-i.is-hidden{ display: none; }

.dock-a{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, var(--mint));
  box-shadow: var(--sh-s);
  transition: transform .2s var(--ease), box-shadow .2s ease-out, background .2s ease-out;
}
.dock-a:hover, .dock-a:focus-visible{ transform: translateY(-2px); }
.dock-a:active{
  transform: translateY(2px) scale(.98);
  box-shadow: inset 2px 2px 0 rgba(23,38,32,.18), inset -2px -2px 0 rgba(255,255,255,.6);
}
.dock-a.on{
  background: linear-gradient(180deg, var(--blue), #8ec9dd);
  box-shadow: var(--sh-s), 0 0 0 3px rgba(255,255,255,.7);
}

.dock-brand{ order: -1; }
.brand{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 18px;
  font-family: Calistoga, Georgia, serif;
  font-size: 17px;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, var(--blue));
  box-shadow: var(--sh-s);
}
.brand-img{ width: 26px; height: 26px; border-radius: 50%; }
.brand-blob{
  width: 18px; height: 18px;
  border-radius: 50% 50% 46% 54%;
  background: var(--mint);
  border: 3px solid var(--ink);
}
.brand-txt{ white-space: nowrap; }

/* ---------- 首屏 ---------- */
.main{
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.hero{
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 6px 0 4px;
  text-align: left;
}
.hero-copy{ order: 1; }
.hero-h1{
  font-size: clamp(2rem, 8.4vw, 3.4rem);
  line-height: 1.15;
  margin: 0 0 .35em;
  letter-spacing: -.01em;
  text-shadow: 2px 3px 0 rgba(255,255,255,.85);
}
.hero-lede{
  margin: 0;
  max-width: 44ch;
  font-size: 17px;
  color: rgba(23,38,32,.85);
}
.hero-fig{
  order: 2;
  margin: 6px 0 0;
  min-height: 96px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: linear-gradient(150deg, var(--mint), var(--blue));
  box-shadow: var(--sh);
  overflow: hidden;
}
.hero-img{
  width: 100%;
  height: clamp(140px, 26vh, 260px);
  object-fit: cover;
}

/* ---------- 内容区 + 左栏 ---------- */
.body-row{
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 22px;
  margin-top: 28px;
}

.rail{
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: linear-gradient(175deg, rgba(255,255,255,.92), rgba(173,216,230,.75));
  box-shadow: var(--sh);
  padding: 16px 16px 18px;
}
.rail-h{
  display: flex;
  align-items: center;
  font-size: 18px;
  margin: 0 0 10px;
}
.rail-h > span{ display: inline-flex; align-items: center; gap: 9px; }
.dot{
  width: 13px; height: 13px;
  border-radius: 50%;
  border: 3px solid var(--ink);
  background: var(--mint);
  box-shadow: inset -2px -2px 0 rgba(23,38,32,.16);
}
.rail-h2{ margin-top: 18px; }
.rail-brand{
  margin: 0;
  font-size: 16px;
  color: rgba(23,38,32,.8);
}
.toc{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.toc-a{
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 16px;
  border: 2px solid rgba(23,38,32,.35);
  border-radius: 14px;
  background: rgba(255,255,255,.72);
  transition: transform .18s var(--ease), border-color .18s ease-out, background .18s ease-out;
}
.toc-a:hover{ transform: translateX(3px); border-color: var(--ink); background: var(--mint); }
.toc-i.is-hidden{ display: none; }

.to-top{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  margin-top: 14px;
  padding: 8px 18px;
  font-size: 16px;
  font-weight: 600;
  border: var(--bw) solid var(--ink);
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff, var(--mint));
  box-shadow: var(--sh-s);
  transition: transform .2s var(--ease);
}
.to-top:hover{ transform: translateY(-2px); }

/* ---------- 正文 ---------- */
.prose{
  min-width: 0;
  max-width: 70ch;
  padding: 4px 0 30px;
}
.prose div{ scroll-margin-top: 22px; }
.prose > div + div{
  margin-top: 40px;
  padding-top: 32px;
  border-top: 3px dashed rgba(23,38,32,.22);
}
.prose h2{
  font-size: clamp(1.4rem, 4.6vw, 1.9rem);
  position: relative;
  padding-bottom: 10px;
}
.prose h2::after{
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 58px; height: 6px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--mint), var(--blue));
  border: 2px solid var(--ink);
}
.prose h2 span{ display: inline; }
.prose h3{
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
  margin-top: 1.5em;
}
.prose h3 span{ display: inline; }
.prose p{ margin: 0 0 1.05em; }
.prose ul, .prose ol{ padding-left: 1.3em; margin: 0 0 1.1em; }
.prose li{ margin: .35em 0; }
.prose a{
  border-bottom: 3px solid var(--mint);
  border-radius: 2px;
}
.prose a:hover{ background: var(--mint); }
.prose blockquote{
  margin: 1.2em 0;
  padding: 14px 18px;
  border: var(--bw) solid var(--ink);
  border-left-width: 10px;
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff, rgba(180,253,225,.55));
  box-shadow: var(--sh-s);
}
.prose blockquote p:last-child{ margin-bottom: 0; }
.prose figure{
  margin: 1.2em 0;
  padding: 10px;
  border: var(--bw) solid var(--ink);
  border-radius: var(--r);
  background: #fff;
  box-shadow: var(--sh-s);
}
.prose figure img{ border-radius: 14px; }
.prose figcaption{
  margin-top: 8px;
  font-size: 16px;
  color: rgba(23,38,32,.7);
}
.prose table{
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.2em 0;
  font-size: 16px;
  border: var(--bw) solid var(--ink);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.prose th, .prose td{
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid rgba(23,38,32,.18);
}
.prose th{ background: var(--mint); }
.prose tr:last-child td{ border-bottom: 0; }
.prose code{
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: .92em;
  padding: 1px 6px;
  border-radius: 8px;
  background: rgba(173,216,230,.55);
}

/* ---------- 页脚 ---------- */
.foot{
  max-width: 1080px;
  margin: 40px auto 0;
  padding: 22px 16px 0;
  border-top: 3px dashed rgba(23,38,32,.2);
}
.foot-cols{
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.foot-dl{ margin: 0; }
.foot-dl dt{
  font-family: Calistoga, Georgia, serif;
  font-size: 16px;
  margin-bottom: 4px;
  color: rgba(23,38,32,.75);
}
.foot-dl dd{
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}
.foot-dl dd a{
  display: inline-block;
  padding: 8px 0;
  word-break: break-word;
  border-bottom: 3px solid transparent;
}
.foot-dl dd a:hover{ border-bottom-color: var(--mint); }
.foot-line{
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 2px solid rgba(23,38,32,.14);
  font-size: 16px;
  color: rgba(23,38,32,.7);
}

/* ---------- 动效 ---------- */
.js .reveal{
  opacity: 0;
  transform: translateY(16px);
}
.js .reveal.in{
  opacity: 1;
  transform: none;
  transition: opacity .45s ease-out, transform .55s var(--ease);
}

@media (prefers-reduced-motion: reduce){
  :root{ scroll-behavior: auto; }
  .js .reveal{ opacity: 1; transform: none; transition: none; }
  .dock-a, .toc-a, .to-top{ transition: none; }
}

/* ---------- 断点 ---------- */
@media (min-width: 620px){
  body{ padding-bottom: 170px; }
  .hero-h1{ text-shadow: 3px 4px 0 rgba(255,255,255,.85); }
  .foot-cols{ gap: 24px; }
}

@media (min-width: 900px){
  body{ padding-top: 40px; }
  .main{ padding: 0 22px; }
  .dock{
    left: 22px; right: 22px; bottom: 18px;
    flex-direction: row-reverse;
    align-items: center;
    padding: 12px 16px;
    border-radius: 30px;
  }
  .dock-search{ flex: 0 0 240px; }
  .dock-nav{ flex: 1 1 auto; }
  .dock-ol{
    overflow: visible;
    justify-content: center;
    flex-wrap: wrap;
  }
  .dock-brand{ order: 0; }
  .body-row{
    grid-template-columns: 262px minmax(0, 1fr);
    gap: 34px;
    align-items: start;
  }
  .rail{
    position: sticky;
    top: 24px;
  }
  .hero{ min-height: 45vh; }
  .foot{ padding: 26px 22px 0; }
  .foot-dl dt{ font-size: 17px; }
}

@media (min-width: 1100px){
  .hero-lede{ font-size: 18px; }
  .prose{ font-size: 18px; }
}

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