:root{
  --blue:#3bb1ff;
  --red:#ff5252;
  --ink:#000000;
  --paper:#f4f1ea;
  --white:#ffffff;
  --tint-b:#e4f4ff;
  --tint-r:#ffe8e8;
  --rail:268px;
  --serif:"Cormorant Infant","Songti SC","Noto Serif SC",Georgia,serif;
  --sans:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  --script:"Great Vibes","Cormorant Infant","Songti SC",cursive;
}

*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;overflow-x:clip}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  font-size:17px;
  line-height:1.72;
  -webkit-text-size-adjust:100%;
}
img{max-width:100%;height:auto}
a{color:inherit}
h1,h2,h3,h4{
  font-family:var(--serif);
  font-weight:600;
  line-height:1.14;
  letter-spacing:-.01em;
  margin:0 0 .6em;
}
h1{font-size:clamp(2rem,5.4vw,4.4rem);text-shadow:5px 5px 0 var(--blue)}
h2{font-size:clamp(1.35rem,2.6vw,1.75rem)}
h3{font-size:1.2rem}
p{margin:0 0 1em}
a:focus-visible,button:focus-visible{outline:3px solid var(--red);outline-offset:3px}

/* ---------- 左侧固定栏 ---------- */
.rail{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--rail);
  background:var(--blue);
  border-right:3px solid var(--ink);
  box-shadow:7px 0 0 var(--ink);
  padding:22px 18px 20px;
  display:flex;
  flex-direction:column;
  gap:20px;
  z-index:40;
  overflow-y:auto;
  overscroll-behavior:contain;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  text-decoration:none;
  color:var(--ink);
  min-height:48px;
}
.brand-logo{width:44px;height:44px;object-fit:contain;border:3px solid var(--ink);background:var(--white);flex:0 0 auto}
.brand-name{
  font-family:var(--script);
  font-size:2.05rem;
  line-height:1;
  font-weight:400;
  padding-bottom:4px;
  border-bottom:3px solid var(--ink);
}
.rail-nav ol{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:9px;
}
.rail-link{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:10px 12px;
  background:var(--white);
  border:3px solid var(--ink);
  box-shadow:4px 4px 0 var(--ink);
  text-decoration:none;
  font-weight:700;
  font-size:.95rem;
  line-height:1.3;
  color:var(--ink);
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}
.rail-link:hover,.rail-link:focus-visible{
  transform:translate(-2px,-2px);
  box-shadow:7px 7px 0 var(--ink);
  background:var(--red);
}
.rail-link .mark{width:10px;height:10px;background:var(--ink);flex:0 0 auto}
.rail-nav li:nth-child(2n) .mark{border-radius:50%}
.rail-nav li:nth-child(3n) .mark{transform:rotate(45deg)}
.rail-nav li:nth-child(4n) .mark{background:var(--red)}
.rail-cta{
  margin-top:auto;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:48px;
  background:var(--ink);
  color:var(--white);
  text-decoration:none;
  font-weight:700;
  letter-spacing:.2em;
  border:3px solid var(--ink);
  box-shadow:5px 5px 0 var(--red);
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease,color .15s ease;
}
.rail-cta:hover,.rail-cta:focus-visible{
  background:var(--red);
  color:var(--ink);
  transform:translate(-2px,-2px);
  box-shadow:7px 7px 0 var(--ink);
}

/* ---------- 主区 ---------- */
.main{
  margin-left:calc(var(--rail) + 22px);
  display:grid;
  grid-template-columns:minmax(0,1fr) 296px;
  gap:34px;
  padding:26px 26px 64px;
  align-items:start;
}
.doc{max-width:764px;min-width:0}

/* ---------- 首屏 ---------- */
.hero{
  min-height:100vh;
  display:flex;
  flex-direction:column;
  gap:30px;
  padding:34px 0 44px;
  border-bottom:3px solid var(--ink);
}
.hero-text{
  text-align:right;
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:14px;
}
.hero-text h1{margin:0}
.lead{
  margin:0;
  max-width:44ch;
  text-align:left;
  background:var(--white);
  border:3px solid var(--ink);
  box-shadow:7px 7px 0 var(--ink);
  padding:14px 16px;
  font-size:1rem;
  line-height:1.7;
}
.hero-fig{margin:0}
.hero-fig .hero-img,
.hero-img{
  display:block;
  width:100%;
  aspect-ratio:16/10;
  object-fit:cover;
  border:3px solid var(--ink);
  box-shadow:10px 10px 0 var(--ink);
  background:var(--white);
}

/* ---------- 正文 ---------- */
.doc > article{
  padding:28px 26px;
  margin:0 0 26px;
  background:var(--white);
  box-shadow:7px 7px 0 var(--ink);
  scroll-margin-top:96px;
}
.doc > article:nth-of-type(odd){background:var(--tint-b)}
.doc > article:nth-of-type(3n){background:var(--tint-r)}
.doc > article:last-child{margin-bottom:0}
.doc > article > h2:first-child{margin-top:0}
.doc p,.doc li{max-width:70ch}
.doc ul,.doc ol{padding-left:1.35em;margin:0 0 1.1em}
.doc li{margin:0 0 .45em}
.doc a{text-decoration:underline;text-decoration-thickness:2px;text-underline-offset:3px;font-weight:600}
.doc a:hover{background:var(--red)}
.doc strong{background:var(--ink);color:var(--white);padding:0 4px}
.doc blockquote{
  margin:0 0 1.2em;
  padding:14px 16px;
  background:var(--blue);
  border-left:9px solid var(--ink);
  box-shadow:5px 5px 0 var(--ink);
}
.doc blockquote p:last-child{margin:0}
.doc table{
  display:block;
  width:100%;
  max-width:100%;
  overflow-x:auto;
  border-collapse:collapse;
  font-size:.95rem;
  margin:0 0 1.2em;
  background:var(--white);
}
.doc th,.doc td{border:2px solid var(--ink);padding:8px 10px;text-align:left;vertical-align:top}
.doc th{background:var(--blue)}
.doc code{
  font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  font-size:.92em;
  background:var(--ink);
  color:var(--white);
  padding:1px 5px;
}

/* ---------- 右侧边栏 ---------- */
.side{
  position:sticky;
  top:24px;
  background:var(--red);
  border:3px solid var(--ink);
  box-shadow:7px 7px 0 var(--ink);
  padding:18px 16px 20px;
  min-width:0;
}
.side-h{
  font-family:var(--script);
  font-size:1.95rem;
  line-height:1.1;
  margin:0 0 2px;
  text-shadow:3px 3px 0 var(--white);
}
.subtitle{
  margin:0 0 14px;
  padding-bottom:10px;
  border-bottom:3px solid var(--ink);
  font-size:.9rem;
  line-height:1.5;
  font-weight:600;
}
.side-list{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.side-list a{
  display:flex;
  align-items:center;
  gap:9px;
  min-height:42px;
  padding:8px 11px;
  background:var(--white);
  border:2px solid var(--ink);
  box-shadow:3px 3px 0 var(--ink);
  text-decoration:none;
  font-weight:700;
  font-size:.92rem;
  line-height:1.3;
  transition:transform .15s ease,box-shadow .15s ease,background .15s ease;
}
.side-list a:hover,.side-list a:focus-visible{
  background:var(--blue);
  transform:translate(-2px,-2px);
  box-shadow:5px 5px 0 var(--ink);
}
.side-list .num{
  font-family:var(--serif);
  font-weight:700;
  font-size:.85rem;
  color:var(--red);
}

/* ---------- 页脚 ---------- */
.foot{
  margin-left:calc(var(--rail) + 22px);
  border-top:3px solid var(--ink);
  background:var(--ink);
  color:var(--white);
  padding:46px 26px 40px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:14px;
  text-align:center;
}
.foot-big{
  margin:0;
  font-family:var(--serif);
  font-weight:700;
  font-size:clamp(2.1rem,7vw,4rem);
  line-height:1;
  letter-spacing:-.02em;
}
.foot-big a{
  color:var(--blue);
  text-decoration:none;
  text-shadow:5px 5px 0 var(--red);
  transition:color .15s ease;
}
.foot-big a:hover,.foot-big a:focus-visible{color:var(--white)}
.foot small{font-size:.85rem;letter-spacing:.06em;color:#cfcfcf}

/* ---------- 滚动显现 ---------- */
.rv{
  opacity:0;
  transform:translateY(20px);
  transition:opacity .55s ease var(--d,0ms),transform .55s ease var(--d,0ms);
}
.rv.in{opacity:1;transform:none}

/* ---------- 中屏 ---------- */
@media (max-width:1180px){
  :root{--rail:232px}
  .main{grid-template-columns:minmax(0,1fr) 250px;gap:24px;padding:22px 20px 56px}
  .side{padding:15px 13px 16px}
  .doc > article{padding:24px 20px}
}

/* ---------- 窄屏：栏转顶部横条 ---------- */
@media (max-width:920px){
  .rail{
    position:sticky;
    top:0;
    left:auto;
    bottom:auto;
    width:auto;
    flex-direction:row;
    align-items:center;
    gap:12px;
    padding:10px 12px;
    border-right:0;
    border-bottom:3px solid var(--ink);
    box-shadow:0 5px 0 var(--ink);
    overflow-x:auto;
    overflow-y:hidden;
  }
  .brand{flex:0 0 auto;min-height:44px}
  .brand-logo{width:34px;height:34px}
  .brand-name{font-size:1.5rem;padding-bottom:2px;border-bottom-width:2px}
  .rail-nav{flex:1 1 auto;min-width:0;overflow-x:auto}
  .rail-nav ol{flex-direction:row;gap:8px}
  .rail-link{white-space:nowrap;min-height:44px;padding:10px 12px;box-shadow:3px 3px 0 var(--ink)}
  .rail-cta{margin-top:0;flex:0 0 auto;min-height:44px;padding:0 14px;letter-spacing:.08em}
  .main{margin-left:0;grid-template-columns:minmax(0,1fr);gap:22px;padding:14px 14px 44px}
  .doc{max-width:none}
  .hero{min-height:0;padding:16px 0 30px;gap:22px}
  .hero-text{text-align:left;align-items:flex-start}
  .lead{max-width:none}
  .hero-img{aspect-ratio:4/3;box-shadow:7px 7px 0 var(--ink)}
  .doc > article{padding:22px 16px;box-shadow:5px 5px 0 var(--ink);scroll-margin-top:88px}
  .side{position:static;box-shadow:5px 5px 0 var(--ink);margin-top:6px}
  .foot{margin-left:0;padding:38px 16px 34px}
}

@media (max-width:420px){
  body{font-size:16px}
  .doc > article{padding:20px 14px}
  .foot-big{font-size:1.9rem}
  .brand-name{font-size:1.3rem}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .rv{opacity:1;transform:none;transition:none}
  .rail-link:hover,.rail-cta:hover,.side-list a:hover{transform:none}
}

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