:root{
  --paper:#fdfbf7;
  --shell:#f5f5f5;
  --ink:#1a1a1a;
  --line:#e0e0e0;
  --mute:#5c5c5c;
  --sans:"Rubik","Outfit",-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --serif:Georgia,"Songti SC","Noto Serif SC","SimSun",serif;
}

*{box-sizing:border-box}

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

body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.75;
  padding-left:248px;
  transition:none;
}

body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:60;
  pointer-events:none;
  opacity:.55;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='0.26'/%3E%3C/svg%3E");
}

a{color:inherit}

a:focus-visible,
button:focus-visible{
  outline:2px solid var(--ink);
  outline-offset:3px;
}

/* ---------- 左侧固定书脊导航 ---------- */

.sidebar{
  position:fixed;
  left:0;
  top:0;
  bottom:0;
  width:248px;
  display:flex;
  flex-direction:column;
  gap:22px;
  padding:20px 18px 22px;
  background:var(--paper);
  border-right:1px solid var(--line);
  z-index:40;
}

.brandmark{
  width:42px;
  height:42px;
  flex:0 0 auto;
  display:flex;
  align-items:center;
  justify-content:center;
  border:1px solid var(--ink);
  border-radius:4px;
  font-weight:700;
  font-size:19px;
  line-height:1;
  text-decoration:none;
  overflow:hidden;
}

.brandmark img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
}

.sidebar nav p{
  display:flex;
  flex-direction:column;
  gap:7px;
  margin:0;
  padding:0;
}

.sidebar nav a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:9px 15px;
  border:1px solid var(--line);
  border-radius:999px;
  font-size:16px;
  letter-spacing:.02em;
  text-decoration:none;
  background:var(--paper);
}

.sidebar nav a:hover{
  border-color:var(--ink);
  background:var(--shell);
}

.side-cta{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:46px;
  padding:11px 16px;
  border-radius:999px;
  background:var(--ink);
  color:var(--paper);
  font-size:16px;
  font-weight:600;
  letter-spacing:.1em;
  text-decoration:none;
}

/* ---------- 首屏 ---------- */

.hero{
  min-height:45vh;
  display:flex;
  align-items:center;
  justify-content:center;
  text-align:center;
  padding:9vh 32px 7vh;
  border-bottom:1px solid var(--line);
  background-color:var(--shell);
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18'%3E%3Ccircle cx='1.6' cy='1.6' r='1.25' fill='%231a1a1a' fill-opacity='0.16'/%3E%3C/svg%3E");
}

.hero h1{
  margin:0;
  max-width:16ch;
  font-size:clamp(34px,5.2vw,58px);
  line-height:1.16;
  font-weight:700;
  letter-spacing:-.025em;
  text-wrap:balance;
}

/* ---------- 正文骨架 ---------- */

.wrap{
  max-width:1080px;
  margin:0 auto;
  padding:52px 32px 80px;
}

.split{
  display:grid;
  grid-template-columns:200px minmax(0,1fr);
  gap:48px;
  align-items:start;
}

/* ---------- 侧栏 ---------- */

.toc{
  position:sticky;
  top:26px;
  border-top:2px solid var(--ink);
  padding-top:14px;
}

.toc h2{
  margin:0 0 4px;
  font-size:16px;
  font-weight:700;
  letter-spacing:.16em;
}

.toc .subtitle{
  margin:0 0 16px;
  font-size:15px;
  letter-spacing:.12em;
  color:var(--mute);
}

.toc ul{
  list-style:none;
  margin:0;
  padding:0;
}

.toc li a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 0;
  font-size:16px;
  text-decoration:none;
  border-bottom:1px solid var(--line);
}

.toc li a:hover{
  border-bottom-color:var(--ink);
  padding-left:4px;
}

/* ---------- 正文排版 ---------- */

.prose{
  min-width:0;
  max-width:66ch;
}

.prose section{
  padding-bottom:34px;
  margin-bottom:34px;
  border-bottom:1px solid var(--line);
  scroll-margin-top:32px;
}

.prose section:last-child{
  border-bottom:0;
  margin-bottom:0;
  padding-bottom:0;
}

.prose h2{
  margin:0 0 16px;
  font-size:27px;
  line-height:1.3;
  font-weight:700;
  letter-spacing:-.015em;
  padding-bottom:10px;
  border-bottom:2px solid var(--ink);
}

.prose h3{
  margin:30px 0 10px;
  font-size:20px;
  line-height:1.4;
  font-weight:600;
}

.prose p,
.prose li{
  font-family:var(--serif);
  font-size:17.5px;
  line-height:1.85;
}

.prose p{
  margin:0 0 17px;
}

.prose ul,
.prose ol{
  margin:0 0 18px;
  padding-left:1.35em;
}

.prose li{
  margin-bottom:8px;
}

.prose blockquote{
  margin:22px 0;
  padding:12px 18px;
  background:var(--shell);
  border-left:3px solid var(--ink);
}

.prose blockquote p{
  margin:0;
}

.prose a{
  text-decoration:underline;
  text-underline-offset:3px;
}

.prose img{
  max-width:100%;
  height:auto;
  display:block;
  border:1px solid var(--line);
  border-radius:4px;
  margin:20px 0;
}

.prose strong{
  font-weight:700;
}

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

.prose th,
.prose td{
  border:1px solid var(--line);
  padding:9px 11px;
  text-align:left;
  vertical-align:top;
}

.prose th{
  background:var(--shell);
  font-weight:600;
}

/* ---------- 页脚 ---------- */

.colophon{
  border-top:1px solid var(--ink);
  background:var(--shell);
  padding:52px 32px 26px;
}

.col-grid{
  max-width:1080px;
  margin:0 auto;
  display:grid;
  grid-template-columns:1.1fr 1fr 1.1fr;
  gap:40px;
  align-items:start;
}

.col-brand address{
  font-style:normal;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.addr-brand{
  font-size:21px;
  font-weight:700;
  letter-spacing:-.01em;
}

.addr-key{
  font-size:16px;
  letter-spacing:.14em;
  color:var(--mute);
}

.col-nav ul{
  list-style:none;
  margin:0;
  padding:0;
  border-top:2px solid var(--ink);
}

.col-nav li a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:8px 0;
  font-size:16px;
  text-decoration:none;
  border-bottom:1px solid #d9d9d9;
}

.col-nav li a:hover{
  padding-left:5px;
}

.big-cta{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  min-height:96px;
  padding:22px 22px;
  border-radius:4px;
  background:var(--ink);
  color:var(--paper);
  font-size:23px;
  font-weight:700;
  letter-spacing:.04em;
  text-decoration:none;
  border-bottom:6px solid #000;
}

.big-cta::after{
  content:"→";
  font-size:22px;
  line-height:1;
}

.col-base{
  max-width:1080px;
  margin:34px auto 0;
  padding-top:16px;
  border-top:1px solid #d9d9d9;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:12px 24px;
}

.copy{
  margin:0;
  font-size:16px;
  letter-spacing:.06em;
  color:var(--mute);
}

.col-base .mini{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:6px 18px;
}

.col-base .mini a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-size:16px;
  text-decoration:none;
  border-bottom:1px solid transparent;
}

.col-base .mini a:hover{
  border-bottom-color:var(--ink);
}

/* ---------- 逐条浮现 ---------- */

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

.toc li,
.col-grid > *{
  animation:rise .42s steps(4,end) both;
}

.toc li:nth-child(1){animation-delay:.02s}
.toc li:nth-child(2){animation-delay:.06s}
.toc li:nth-child(3){animation-delay:.1s}
.toc li:nth-child(4){animation-delay:.14s}
.toc li:nth-child(5){animation-delay:.18s}
.toc li:nth-child(6){animation-delay:.22s}
.toc li:nth-child(7){animation-delay:.26s}
.col-grid > *:nth-child(2){animation-delay:.08s}
.col-grid > *:nth-child(3){animation-delay:.14s}

/* ---------- 窄屏 ---------- */

@media (max-width:900px){
  body{
    padding-left:0;
  }

  .sidebar{
    position:sticky;
    inset:auto;
    top:0;
    width:auto;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:8px 12px;
    border-right:0;
    border-bottom:1px solid var(--line);
    background:var(--paper);
    z-index:50;
  }

  .brandmark{
    width:38px;
    height:38px;
    font-size:17px;
  }

  .sidebar nav{
    flex:1 1 auto;
    min-width:0;
    overflow-x:auto;
    scrollbar-width:none;
  }

  .sidebar nav::-webkit-scrollbar{display:none}

  .sidebar nav p{
    flex-direction:row;
    gap:7px;
  }

  .sidebar nav a{
    white-space:nowrap;
    padding:9px 13px;
    font-size:16px;
  }

  .side-cta{
    margin-top:0;
    flex:0 0 auto;
    align-self:center;
    min-height:40px;
    padding:9px 14px;
    font-size:16px;
    letter-spacing:.04em;
  }

  .hero{
    min-height:38vh;
    padding:44px 20px 38px;
  }

  .wrap{
    padding:30px 18px 56px;
  }

  .split{
    grid-template-columns:1fr;
    gap:30px;
  }

  .toc{
    position:static;
  }

  .toc ul{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:0 16px;
  }

  .prose article{
    scroll-margin-top:88px;
  }

  .prose h2{
    font-size:23px;
  }

  .colophon{
    padding:40px 18px 22px;
  }

  .col-grid{
    grid-template-columns:1fr;
    gap:26px;
  }

  .col-base{
    flex-direction:column;
    align-items:flex-start;
  }
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .toc li,
  .col-grid > *,
  .sidebar nav a,
  .toc li a{
    animation:none;
    transition:none;
  }
}

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