:root{
  --ink:#000;
  --paper:#fff;
  --shade:#f6f6f6;
  --line:rgba(0,0,0,.14);
  --pad:clamp(1.15rem,4vw,3.5rem);
  --rail:96px;
  --font-h:'Poppins',system-ui,-apple-system,'Segoe UI',sans-serif;
  --font-b:'Open Sans',system-ui,-apple-system,'Segoe UI',sans-serif;
}

*,*::before,*::after{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(--font-b);
  font-size:17px;
  line-height:1.75;
  overflow-x:hidden;
}

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

a{color:inherit}

h1,h2,h3,h4{
  margin:0;
  font-family:var(--font-h);
  font-weight:900;
  line-height:1.03;
  letter-spacing:-.04em;
}

p{margin:0 0 1.15em}

ul,ol{margin:0;padding:0;list-style:none}

.frame{position:relative}

/* ---------- 角标 ---------- */
.mast{
  position:fixed;
  top:20px;
  left:20px;
  z-index:60;
}

.mark{
  width:46px;
  height:46px;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid var(--ink);
  border-radius:999px;
  background:var(--paper);
  text-decoration:none;
  overflow:hidden;
  font-family:var(--font-h);
  font-weight:700;
  font-size:1rem;
  letter-spacing:0;
}

.mark-img{width:100%;height:100%;object-fit:cover}
.mark-txt{line-height:1}

/* ---------- 竖排胶囊导航 ---------- */
.rail{
  position:fixed;
  left:20px;
  top:50%;
  transform:translateY(-50%);
  z-index:50;
}

.rail ol{
  display:flex;
  flex-direction:column;
  gap:8px;
  max-height:78vh;
  overflow-y:auto;
  scrollbar-width:none;
}

.rail ol::-webkit-scrollbar{display:none}

.rail a{
  writing-mode:vertical-rl;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:18px 9px;
  border:1.5px solid var(--ink);
  border-radius:999px;
  background:var(--paper);
  text-decoration:none;
  font-size:.78rem;
  letter-spacing:.14em;
  transition:background .18s ease,color .18s ease;
}

.rail a:hover,
.rail a:focus-visible{
  background:var(--ink);
  color:var(--paper);
  outline:none;
}

@media (min-width:900px){
  body{padding-left:var(--rail)}
}

/* ---------- 满屏主视觉 ---------- */
.hero{
  position:relative;
  min-height:100vh;
  min-height:100svh;
  display:flex;
  align-items:center;
  justify-content:flex-end;
  padding:22vh var(--pad) 20vh;
  text-align:right;
  overflow:hidden;
}

.hero h1{
  margin-left:auto;
  max-width:15ch;
  font-size:clamp(3rem,10vw,12rem);
  font-weight:900;
  letter-spacing:-.055em;
  line-height:.85;
  overflow-wrap:break-word;
  will-change:transform;
}

.slash{
  position:absolute;
  left:0;
  right:0;
  bottom:-1px;
  height:18vh;
  background:var(--ink);
  clip-path:polygon(0 100%,0 62%,100% 0,100% 100%);
  pointer-events:none;
}

/* ---------- 内容骨架：aside 在左 ---------- */
.shell{
  max-width:1280px;
  margin:0 auto;
  padding:clamp(3rem,8vw,7rem) var(--pad);
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:clamp(2rem,5vw,4rem);
}

@media (min-width:900px){
  .shell{grid-template-columns:172px minmax(0,1fr)}
}

.side{align-self:start}

@media (min-width:900px){
  .side{position:sticky;top:6rem}
}

.side h2{
  font-family:var(--font-b);
  font-size:.76rem;
  font-weight:700;
  letter-spacing:.34em;
  padding-bottom:.65rem;
  border-bottom:3px solid var(--ink);
}

.side-list{
  margin-top:.9rem;
  display:flex;
  flex-wrap:wrap;
  gap:0 .9rem;
}

@media (min-width:900px){
  .side-list{flex-direction:column;gap:0}
}

.side-list a{
  display:flex;
  align-items:center;
  min-height:42px;
  padding:.4rem 0;
  font-size:.88rem;
  text-decoration:none;
  border-bottom:1px solid var(--line);
  transition:border-color .18s ease;
}

.side-list a:hover,
.side-list a:focus-visible{
  border-bottom-color:var(--ink);
  outline:none;
}

/* ---------- 正文 ---------- */
.doc{min-width:0}

.doc > article{
  padding:clamp(1.45rem,4vw,3rem);
  margin-bottom:clamp(2rem,5vw,4rem);
  background:var(--paper);
  border:1px solid var(--line);
  border-bottom:6px solid var(--ink);
  border-radius:28px;
  scroll-margin-top:1.4rem;
}

.doc h2{
  font-size:clamp(1.7rem,4.6vw,3rem);
  margin-bottom:1rem;
}

.doc h3{
  font-size:clamp(1.2rem,3vw,1.8rem);
  margin:1.9rem 0 .65rem;
}

.doc h2 > span,
.doc h3 > span{display:inline}

.doc p,
.doc li{
  max-width:66ch;
  font-size:1.02rem;
  line-height:1.85;
}

.doc ul{margin:0 0 1.2em}

.doc ul > li{
  position:relative;
  padding-left:1.5em;
  margin-bottom:.5em;
}

.doc ul > li::before{
  content:"—";
  position:absolute;
  left:0;
  top:0;
}

.doc ol{
  counter-reset:ord;
  margin:0 0 1.2em;
}

.doc ol > li{
  counter-increment:ord;
  position:relative;
  padding-left:2.3em;
  margin-bottom:.6em;
}

.doc ol > li::before{
  content:counter(ord,decimal-leading-zero);
  position:absolute;
  left:0;
  top:.15em;
  font-family:var(--font-h);
  font-weight:700;
  font-size:.82rem;
  letter-spacing:.02em;
}

.doc a{
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}

.doc a:hover{background:var(--ink);color:var(--paper);text-decoration:none}

.doc blockquote{
  margin:1.6rem 0;
  padding:.2rem 0 .2rem 1.4rem;
  border-left:6px solid var(--ink);
  font-size:1.08rem;
}

.doc blockquote p:last-child{margin-bottom:0}

.doc img{border-radius:20px}

.doc table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 1.3em;
  font-size:.96rem;
}

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

.doc th{
  font-family:var(--font-h);
  font-weight:700;
  border-bottom:2px solid var(--ink);
}

.doc code,
.doc pre{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.92em}

.doc pre{
  overflow-x:auto;
  padding:1rem;
  background:var(--shade);
  border-radius:16px;
}

/* ---------- 页脚 ---------- */
.foot{
  margin-top:clamp(3rem,8vw,7rem);
  padding:clamp(3rem,7vw,6rem) var(--pad) 2rem;
  background:var(--ink);
  color:var(--paper);
}

.foot-grid{
  max-width:1280px;
  margin:0 auto;
  display:grid;
  gap:2.5rem;
}

@media (min-width:760px){
  .foot-grid{
    grid-template-columns:1.1fr .8fr 1.2fr;
    gap:3rem;
    align-items:start;
  }
}

.addr{
  font-style:normal;
  font-family:var(--font-h);
  font-weight:900;
  font-size:clamp(1.6rem,4vw,2.6rem);
  letter-spacing:-.04em;
  line-height:1;
  overflow-wrap:break-word;
}

.foot-links ul{
  display:flex;
  flex-wrap:wrap;
  gap:0 1.4rem;
}

@media (min-width:760px){
  .foot-links ul{flex-direction:column;gap:0}
}

.foot-links a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  font-size:.95rem;
  text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.35);
}

.foot-links a:hover,
.foot-links a:focus-visible{border-bottom-color:var(--paper);outline:none}

.foot-cta{
  display:block;
  text-decoration:none;
  border-bottom:6px solid var(--paper);
  padding-bottom:.7rem;
}

.foot-cta h2{transition:transform .25s ease}
.foot-cta h2 span{
  display:block;
  font-size:clamp(1.8rem,5.5vw,3.4rem);
  letter-spacing:-.05em;
  line-height:.95;
}

.foot-cta:hover h2,
.foot-cta:focus-visible h2{transform:translateX(8px)}
.foot-cta:focus-visible{outline:none}

.foot-bar{
  max-width:1280px;
  margin:clamp(2.5rem,6vw,4rem) auto 0;
  padding-top:1.3rem;
  border-top:1px solid rgba(255,255,255,.3);
  display:flex;
  flex-wrap:wrap;
  gap:.6rem 1.6rem;
  justify-content:space-between;
  align-items:center;
}

.foot-bar p{margin:0;font-size:.85rem}

.foot-bar ul{display:flex;flex-wrap:wrap;gap:1.4rem}

.foot-bar a{
  display:inline-flex;
  align-items:center;
  min-height:42px;
  font-size:.85rem;
  text-decoration:none;
  border-bottom:1px solid rgba(255,255,255,.35);
}

.foot-bar a:hover{border-bottom-color:var(--paper)}

/* ---------- 移动端：底部横排 ---------- */
@media (max-width:899px){
  body{padding-bottom:104px}

  .rail{
    left:0;
    right:0;
    top:auto;
    bottom:0;
    transform:none;
    background:var(--paper);
    border-top:2px solid var(--ink);
    padding:10px 12px;
    padding-bottom:calc(10px + env(safe-area-inset-bottom,0px));
  }

  .rail ol{
    flex-direction:row;
    gap:8px;
    max-height:none;
    overflow-x:auto;
    overflow-y:hidden;
  }

  .rail li{flex:0 0 auto}

  .rail a{
    writing-mode:horizontal-tb;
    min-height:44px;
    padding:11px 16px;
    font-size:.85rem;
    letter-spacing:.06em;
    white-space:nowrap;
  }

  .hero{padding-top:26vh;text-align:left;justify-content:flex-start}
  .hero h1{margin-left:0;max-width:none}
  .slash{height:14vh}

  .doc > article{border-radius:22px}
}

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference){
  .js .hero,
  .js .doc > article{
    transition:opacity .7s ease,transform .7s cubic-bezier(.2,.7,.3,1);
  }

  .js .hero:not(.in),
  .js .doc > article:not(.in){
    opacity:0;
    transform:translateY(26px);
  }
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
}

:focus-visible{outline:3px solid var(--ink);outline-offset:3px}
.foot :focus-visible{outline-color:var(--paper)}

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