:root{
  --ink:#172623;
  --ink-2:#33473f;
  --mint:#5cc6b0;
  --mint-2:#2f9c86;
  --sand:#d4c4a8;
  --clay:#c67b5c;
  --olive:#6b7b3c;
  --paper:#f7f2e7;
  --paper-2:#efe6d4;
  --paper-3:#e6dbc6;
  --line:#cbbfa6;
  --radius:28px;
  --frame:1120px;
}

*{box-sizing:border-box}

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

body{
  margin:0;
  font-family:"DM Sans","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  font-size:17px;
  line-height:1.78;
  color:var(--ink);
  background-color:var(--paper);
  background-image:radial-gradient(rgba(23,38,35,.055) 1px,transparent 1px);
  background-size:6px 6px;
}

h1,h2,h3,h4,.brandmark,.chip,.cta{
  font-family:"Space Grotesk","PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
}

img{max-width:100%}

a{color:var(--mint-2)}

[ id ]{scroll-margin-top:78px}

/* ---------- 页头：品牌居中，菜单分列两侧 ---------- */
.masthead{
  border-bottom:1px solid var(--line);
  background:
    linear-gradient(180deg,var(--paper-2),var(--paper-2)) ,
    radial-gradient(rgba(23,38,35,.07) 1px,transparent 1px);
}

.mast-row{
  max-width:var(--frame);
  margin:0 auto;
  padding:12px 16px;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  grid-template-areas:"left brand right";
  align-items:center;
  gap:10px;
}

.rail{
  display:flex;
  align-items:center;
  gap:4px;
  flex-wrap:wrap;
}

.rail-left{grid-area:left;justify-self:start}

.rail-right{grid-area:right;justify-self:end}

.rail-link{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 12px;
  font-size:16px;
  color:var(--ink);
  text-decoration:none;
  border-radius:999px 16px 999px 16px;
  border:1px solid transparent;
}

.rail-link:hover,
.rail-link:focus-visible{
  background:var(--paper-3);
  border-color:var(--line);
}

.brandmark{
  grid-area:brand;
  justify-self:center;
  max-width:min(46vw,320px);
  padding:10px 16px;
  font-size:clamp(17px,2.6vw,21px);
  font-weight:700;
  letter-spacing:.02em;
  text-align:center;
  text-decoration:none;
  color:var(--ink);
  background:linear-gradient(145deg,#fdfaf3,var(--sand));
  border:1px dashed #b6a98e;
  border-radius:22px 34px 20px 30px;
}

.drawer{position:relative}

.drawer>summary{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 16px;
  font-size:16px;
  cursor:pointer;
  list-style:none;
  color:var(--ink);
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:999px;
}

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

.drawer>summary::after{
  content:"";
  width:8px;
  height:8px;
  margin-left:9px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .2s ease-out;
}

.drawer[open]>summary{
  background:var(--mint);
  border-color:var(--mint-2);
}

.drawer[open]>summary::after{transform:rotate(-135deg) translateY(-2px)}

.drawer>menu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  z-index:40;
  margin:0;
  padding:10px;
  min-width:196px;
  list-style:none;
  background:var(--paper-2);
  border:1px solid var(--line);
  border-radius:18px 26px 18px 26px;
  box-shadow:0 22px 44px -32px rgba(23,38,35,.75);
}

.drawer>menu li a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:0 12px;
  font-size:16px;
  text-decoration:none;
  color:var(--ink);
  border-radius:12px;
}

.drawer>menu li a:hover{background:var(--paper-3)}

/* ---------- 二级粘性锚点条 ---------- */
.anchorb{
  position:sticky;
  top:0;
  z-index:30;
  background:rgba(247,242,231,.95);
  border-bottom:1px solid var(--line);
}

.anchorb-in{
  max-width:var(--frame);
  margin:0 auto;
  padding:8px 16px;
  display:flex;
  gap:6px;
  overflow-x:auto;
  scrollbar-width:thin;
}

.chip{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 14px;
  font-size:16px;
  white-space:nowrap;
  text-decoration:none;
  color:var(--ink-2);
  background:var(--paper-2);
  border:1px solid var(--line);
  border-radius:999px;
}

.chip:hover,
.chip[aria-current]{
  color:var(--ink);
  background:var(--mint);
  border-color:var(--mint-2);
}

/* ---------- 首屏 ---------- */
.hero{
  max-width:var(--frame);
  margin:0 auto;
  padding:26px 16px 22px;
  display:grid;
  grid-template-columns:1.12fr .88fr;
  gap:26px;
  align-items:center;
  min-height:45vh;
}

.hero-copy{text-align:center}

h1{
  margin:0 0 14px;
  font-size:clamp(27px,5.2vw,43px);
  line-height:1.24;
  letter-spacing:.005em;
}

.lede{
  max-width:36ch;
  margin:0 auto 20px;
  font-size:17px;
  color:var(--ink-2);
}

.cta{
  display:inline-flex;
  align-items:center;
  min-height:46px;
  padding:0 24px;
  font-size:16px;
  font-weight:500;
  text-decoration:none;
  color:var(--ink);
  background:var(--mint);
  border:1px solid var(--mint-2);
  border-radius:999px 18px 999px 18px;
}

.cta:hover{background:#71d3bf}

.hero-art{
  position:relative;
  min-height:230px;
  display:grid;
  place-items:center;
  overflow:hidden;
  background:linear-gradient(155deg,var(--sand),#e9e0cd 55%,#cfe6dd);
  border:1px solid var(--line);
  border-radius:44px 26px 40px 22px;
}

.hero-art::after{
  content:"";
  position:absolute;
  inset:0;
  pointer-events:none;
  background-image:radial-gradient(rgba(23,38,35,.14) 1.2px,transparent 1.2px);
  background-size:12px 12px;
}

.hero-img{
  width:100%;
  height:100%;
  min-height:230px;
  object-fit:cover;
  display:block;
}

/* ---------- 正文骨架 ---------- */
.wrap{
  max-width:var(--frame);
  margin:0 auto;
  padding:10px 16px 58px;
}

.ledger{
  display:grid;
  grid-template-columns:236px minmax(0,1fr);
  gap:32px;
  align-items:start;
}

.aside{
  position:sticky;
  top:64px;
  padding:16px;
  background:var(--paper-2);
  border:1px solid var(--line);
  border-radius:var(--radius);
}

.aside-h{
  margin:0;
  font-size:17px;
  letter-spacing:.04em;
}

.aside hr{
  width:44px;
  margin:9px 0 12px;
  border:0;
  border-top:2px dotted var(--mint-2);
}

.toc{
  display:grid;
  gap:2px;
  margin:0;
  padding:0;
  list-style:none;
}

.toc a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:2px 10px;
  font-size:16px;
  text-decoration:none;
  color:var(--ink-2);
  border-radius:12px;
}

.toc a:hover{background:var(--paper-3);color:var(--ink)}

.body{
  min-width:0;
  padding:22px 22px 32px;
  overflow-wrap:break-word;
  background:#fbf7ee;
  border:1px solid var(--line);
  border-radius:var(--radius);
}

.body>div{
  padding:22px 0 6px;
  border-top:1px dotted var(--line);
}

.body>div:first-child{
  padding-top:2px;
  border-top:0;
}

.body h2{
  margin:0 0 8px;
  font-size:22px;
  line-height:1.4;
  letter-spacing:.005em;
}

.body h3{
  margin:18px 0 6px;
  font-size:18px;
  line-height:1.45;
}

.body p{margin:0 0 14px}

.body ul,.body ol{
  margin:0 0 14px;
  padding-left:1.25em;
}

.body li{margin:4px 0}

.body a{overflow-wrap:anywhere}

.body img{
  height:auto;
  margin:8px 0 16px;
  border:1px solid var(--line);
  border-radius:20px;
}

.body blockquote{
  margin:0 0 16px;
  padding:12px 16px;
  color:var(--ink-2);
  background:var(--paper-2);
  border-left:4px solid var(--sand);
  border-radius:0 16px 16px 0;
}

.body table{
  width:100%;
  margin:0 0 16px;
  border-collapse:collapse;
  font-size:16px;
}

.body th,.body td{
  padding:8px 10px;
  text-align:left;
  border-bottom:1px solid var(--line);
}

.body th{background:var(--paper-2)}

hr{
  width:64px;
  margin:10px 0 16px;
  border:0;
  border-top:2px dotted var(--mint-2);
}

/* ---------- 页脚：单行极简，分区 ---------- */
.footer{
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:10px;
  padding:16px max(16px,calc((100% - 1120px) / 2));
  font-size:16px;
  background:var(--paper-2);
  border-top:1px solid var(--line);
}

.footer div{margin:0}

.f-brand{font-weight:600}

.f-copy{
  justify-self:center;
  color:var(--ink-2);
}

.f-top{justify-self:end}

.f-top a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:0 8px;
  color:var(--ink);
}

/* ---------- 动效 ---------- */
@keyframes rise{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:none}
}

@media (prefers-reduced-motion:no-preference){
  .hero-copy{animation:rise .6s ease-out both}
  .hero-art{animation:rise .6s ease-out .08s both}
  .body>div{animation:rise .5s ease-out both}
  .body>div:nth-child(1){animation-delay:.02s}
  .body>div:nth-child(2){animation-delay:.06s}
  .body>div:nth-child(3){animation-delay:.1s}
  .body>div:nth-child(4){animation-delay:.14s}
  .body>div:nth-child(5){animation-delay:.18s}
  .body>div:nth-child(6){animation-delay:.22s}
  .body>div:nth-child(7){animation-delay:.26s}
}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  .ledger{grid-template-columns:minmax(0,1fr);gap:20px}
  .aside{position:static;order:2}
  .toc{grid-template-columns:repeat(auto-fill,minmax(148px,1fr))}
  .body{order:1}
}

@media (max-width:820px){
  .hero{grid-template-columns:minmax(0,1fr);gap:18px;min-height:0;padding-top:20px}
  .hero-art{min-height:180px;border-radius:32px 22px 30px 20px}
  .hero-img{min-height:180px}
}

@media (max-width:760px){
  .mast-row{
    grid-template-areas:"brand brand right" "left left left";
    grid-template-columns:1fr auto 1fr;
    row-gap:6px;
  }
  .brandmark{justify-self:center;max-width:70vw}
  .rail-left{
    justify-self:center;
    justify-content:center;
    width:100%;
    margin-top:4px;
    padding-top:6px;
    border-top:1px solid var(--line);
  }
  .rail-link{padding:0 10px}
}

@media (max-width:640px){
  .footer{
    grid-template-columns:minmax(0,1fr);
    justify-items:center;
    text-align:center;
    gap:2px;
    padding:14px 16px;
  }
  .f-copy,.f-top{justify-self:center}
  .body{padding:18px 16px 26px}
  .wrap{padding-bottom:40px}
}

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