@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;500;600;700&family=Share+Tech+Mono&display=swap');

:root{
  --mint:#5cc6b0;
  --sand:#d4c4a8;
  --ink:#172623;
  --clay:#c67b5c;
  --olive:#6b7b3c;
  --paper:#fbf7ef;
  --bg:#f4ede2;
  --line:#ddceb6;
  --mono:'Fira Code','Share Tech Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  --sans:ui-sans-serif,system-ui,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --r:28px;
  --sh:0 18px 42px -24px rgba(23,38,35,.55);
}

*{box-sizing:border-box}

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

body{
  margin:0;
  font-family:var(--sans);
  font-size:16px;
  line-height:1.78;
  color:var(--ink);
  background-color:var(--bg);
  background-image:
    radial-gradient(rgba(23,38,35,.09) 1px, transparent 1px),
    radial-gradient(circle at 15% -8%, rgba(92,198,176,.24), transparent 52%),
    radial-gradient(circle at 92% 2%, rgba(198,123,92,.18), transparent 46%);
  background-size:20px 20px, auto, auto;
  background-attachment:scroll, fixed, fixed;
  overflow-wrap:break-word;
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  z-index:60;
  opacity:.35;
  background-image:repeating-linear-gradient(115deg, rgba(23,38,35,.05) 0 1px, transparent 1px 4px);
  mix-blend-mode:multiply;
}

a{color:inherit}

/* ---------- 左侧固定栏 ---------- */
.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:250px;
  z-index:30;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:20px 18px 30px;
  overflow-y:auto;
  background-color:var(--ink);
  background-image:radial-gradient(rgba(212,196,168,.16) 1px, transparent 1px);
  background-size:16px 16px;
  border-right:1px solid rgba(212,196,168,.18);
}

.mark{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:46px;
  height:46px;
  border-radius:16px;
  border:1px dashed rgba(92,198,176,.55);
  background:rgba(92,198,176,.1);
  color:var(--mint);
  font-family:var(--mono);
  font-size:18px;
  text-decoration:none;
  align-self:flex-start;
}
.mark-img{width:36px;height:36px;object-fit:contain;border-radius:10px}

.rail-h{
  margin:2px 0 0;
  font-family:var(--mono);
  font-size:11px;
  font-weight:500;
  letter-spacing:.4em;
  color:var(--mint);
  line-height:1;
}
.rail-h span{display:inline-block}

.find{display:flex}
.find input{
  width:100%;
  min-height:42px;
  padding:9px 12px;
  font-family:var(--mono);
  font-size:15px;
  color:var(--sand);
  background:rgba(255,255,255,.06);
  border:1px solid rgba(212,196,168,.34);
  border-radius:16px;
  outline:none;
  -webkit-appearance:none;
}
.find input::placeholder{color:rgba(212,196,168,.72)}
.find input:focus{
  border-color:var(--mint);
  background:rgba(92,198,176,.12);
  box-shadow:0 0 0 3px rgba(92,198,176,.18);
}

.rail-nav{display:flex;flex-direction:column;gap:2px;margin-top:2px}
.rail-nav a{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:9px 9px;
  color:var(--sand);
  text-decoration:none;
  font-size:16px;
  line-height:1.4;
  border-radius:14px;
  border-left:2px solid transparent;
  transition:background .25s ease-out, border-color .25s ease-out, color .25s ease-out;
}
.rail-nav a i{
  font-style:normal;
  font-family:var(--mono);
  font-size:11px;
  color:rgba(92,198,176,.72);
  min-width:18px;
  flex:none;
}
.rail-nav a:hover,
.rail-nav a:focus-visible{
  color:#fff;
  background:rgba(92,198,176,.14);
  border-left-color:var(--mint);
}

/* ---------- 主体 ---------- */
.stage{
  margin-left:250px;
  max-width:1180px;
  padding:0 clamp(14px,3vw,38px);
}

/* ---------- Hero ---------- */
.hero{
  position:relative;
  min-height:45vh;
  display:grid;
  place-items:center;
  text-align:center;
  padding:clamp(26px,5vw,52px) 0 clamp(24px,4vw,44px);
  overflow:hidden;
  isolation:isolate;
}
.hero::before{
  content:"";
  position:absolute;
  inset:8% 6%;
  z-index:-1;
  border-radius:calc(var(--r) + 12px);
  background:radial-gradient(ellipse at 50% 45%, rgba(251,247,239,.92), rgba(251,247,239,.35) 62%, transparent 78%);
}
.collage{position:absolute;inset:0;pointer-events:none;z-index:-1;will-change:transform}
.shot{
  position:absolute;
  width:clamp(92px,13vw,158px);
  aspect-ratio:4/5;
  object-fit:cover;
  border-radius:22px;
  border:6px solid var(--paper);
  box-shadow:0 24px 46px -26px rgba(23,38,35,.7);
  filter:saturate(.95);
}
.shot-a{top:5%;left:1%;transform:rotate(-6deg)}
.shot-b{bottom:3%;right:1%;transform:rotate(5deg)}

.hero-in{max-width:640px;padding:0 6px}
.hero h1{
  margin:0;
  font-family:var(--mono);
  font-weight:600;
  font-size:clamp(29px,5.6vw,52px);
  line-height:1.14;
  letter-spacing:-.01em;
}
.hero h1::after{
  content:"";
  display:block;
  width:76px;
  height:5px;
  margin:18px auto 0;
  border-radius:3px;
  background:linear-gradient(90deg, var(--mint), var(--sand));
}
.lede{
  margin:16px auto 0;
  max-width:44ch;
  color:#3b504b;
  font-size:16px;
}

/* ---------- 内容区 ---------- */
.content{
  display:grid;
  grid-template-columns:212px minmax(0,1fr);
  gap:clamp(18px,2.4vw,30px);
  align-items:start;
  padding:clamp(16px,2vw,26px) 0 clamp(34px,5vw,64px);
  border-top:1px solid var(--line);
}

.toc{
  position:sticky;
  top:22px;
  padding:18px 15px 14px;
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--sh);
}
.toc h2{
  margin:0 0 10px;
  font-family:var(--mono);
  font-size:12px;
  font-weight:600;
  letter-spacing:.34em;
  color:var(--olive);
  line-height:1;
}
.toc ol{
  list-style:none;
  counter-reset:toc;
  margin:0;
  padding:0;
}
.toc li{counter-increment:toc}
.toc li a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:7px 0;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
  color:#2c403d;
  border-bottom:1px dashed var(--line);
  transition:color .2s ease-out, padding-left .2s ease-out;
}
.toc li a::before{
  content:counter(toc,decimal-leading-zero);
  font-family:var(--mono);
  font-size:11px;
  color:var(--clay);
  margin-right:8px;
}
.toc li a:hover,
.toc li a:focus-visible{color:#0f5147;padding-left:5px}
.toc .top{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  margin-top:6px;
  font-family:var(--mono);
  font-size:13px;
  color:var(--olive);
  text-decoration:none;
  border-bottom:1px solid transparent;
}
.toc .top:hover{border-bottom-color:var(--mint)}

.prose{min-width:0}
.prose > div{
  margin:0 0 24px;
  padding:clamp(18px,3vw,34px);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:var(--sh);
  scroll-margin-top:26px;
  animation:rise .62s cubic-bezier(.18,.7,.28,1) both;
}
.prose > div:nth-child(1){animation-delay:.02s}
.prose > div:nth-child(2){animation-delay:.07s}
.prose > div:nth-child(3){animation-delay:.12s}
.prose > div:nth-child(4){animation-delay:.17s}
.prose > div:nth-child(5){animation-delay:.22s}
.prose > div:nth-child(6){animation-delay:.27s}
.prose > div:nth-child(7){animation-delay:.32s}
.prose > div:nth-child(8){animation-delay:.37s}

@keyframes rise{
  from{opacity:0;transform:translateY(16px)}
  to{opacity:1;transform:none}
}

.prose h2,
.prose h3{
  font-family:var(--mono);
  font-weight:600;
  line-height:1.26;
  letter-spacing:-.01em;
  margin:0 0 .55em;
}
.prose h2{font-size:clamp(21px,2.9vw,29px);color:var(--ink)}
.prose h3{font-size:clamp(18px,2.2vw,22px);color:#243b37}
.prose h2 span,
.prose h3 span{display:inline}
.prose h2::before{
  content:"";
  display:block;
  width:34px;
  height:4px;
  margin-bottom:12px;
  border-radius:2px;
  background:var(--mint);
}
.prose p{margin:0 0 1.05em}
.prose p:last-child{margin-bottom:0}
.prose ul,
.prose ol{margin:0 0 1.05em;padding-left:1.3em}
.prose li{margin:.25em 0}
.prose a{
  color:#0e5248;
  text-decoration:underline;
  text-decoration-color:rgba(92,198,176,.75);
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}
.prose a:hover{background:rgba(92,198,176,.18)}
.prose strong{color:#12312c}
.prose blockquote{
  margin:1.1em 0;
  padding:.2em 0 .2em 16px;
  border-left:4px solid var(--sand);
  color:#3b504b;
  font-style:normal;
}
.prose img{
  max-width:100%;
  height:auto;
  border-radius:18px;
  border:1px solid var(--line);
}
.prose figure{margin:1.1em 0}
.prose table{width:100%;border-collapse:collapse;font-size:15px}
.prose th,
.prose td{border-bottom:1px solid var(--line);padding:8px 6px;text-align:left}
.prose code{
  font-family:var(--mono);
  font-size:.94em;
  background:rgba(23,38,35,.07);
  padding:.12em .38em;
  border-radius:6px;
}

/* ---------- 页脚 ---------- */
.foot{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:14px 22px;
  padding:22px 0 44px;
  border-top:1px solid var(--line);
}
.foot-brand h3{
  margin:0;
  font-family:var(--mono);
  font-weight:700;
  font-size:clamp(23px,3.6vw,36px);
  line-height:1.05;
  letter-spacing:-.03em;
  color:var(--ink);
}
.foot-brand h3 span{
  background:linear-gradient(90deg, var(--ink) 0%, #2f6d61 68%, var(--mint) 100%);
  -webkit-background-clip:text;
  background-clip:text;
  -webkit-text-fill-color:transparent;
}
.foot-nav dl{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:0 12px;
  margin:0;
}
.foot-nav dt{
  font-family:var(--mono);
  font-size:11px;
  letter-spacing:.32em;
  color:var(--olive);
  margin-right:2px;
}
.foot-nav dd{margin:0}
.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 2px;
  font-size:16px;
  color:#2c403d;
  text-decoration:none;
  border-bottom:1px solid transparent;
}
.foot-nav a:hover,
.foot-nav a:focus-visible{color:#0f5147;border-bottom-color:var(--mint)}
.foot-copy{
  font-family:var(--mono);
  font-size:13px;
  color:#5b6e68;
}

.rail-nav a.off,
.toc a.off{display:none}

:focus-visible{outline:2px solid var(--mint);outline-offset:2px}

/* ---------- 窄屏 ---------- */
@media (max-width:980px){
  .rail{
    position:static;
    width:auto;
    inset:auto;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    gap:10px;
    padding:14px;
    overflow:visible;
    border-right:0;
    border-bottom:1px solid rgba(212,196,168,.2);
    border-radius:0 0 var(--r) var(--r);
  }
  .rail-h{display:none}
  .mark{width:42px;height:42px}
  .find{flex:1 1 150px;min-width:120px}
  .rail-nav{
    flex-direction:row;
    flex-wrap:wrap;
    width:100%;
    gap:6px;
    margin-top:0;
  }
  .rail-nav a{
    min-height:40px;
    padding:8px 12px;
    font-size:15px;
    border:1px solid rgba(212,196,168,.28);
    border-radius:999px;
  }
  .rail-nav a i{display:none}
  .stage{margin-left:0;padding:0 14px;max-width:none}
  .hero{min-height:0;padding:22px 0 26px}
  .hero-in{padding:0}
  .content{grid-template-columns:1fr;padding-top:16px}
  .toc{position:static}
  .prose > div{padding:20px 16px}
  .foot{justify-content:flex-start;padding-bottom:34px}
}

@media (max-width:420px){
  .shot{width:88px;border-width:4px;border-radius:16px;opacity:.9}
  .hero h1{font-size:clamp(26px,8.4vw,34px)}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .prose > div{animation:none}
  *{transition-duration:.01ms !important}
  .collage{transform:none !important}
}

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