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

:root{
  --ink:#000;
  --paper:#fff;
  --line:#dcdcdc;
  --dim:#5f5f5f;
  --wash:#f4f4f4;
  --rail:248px;
  --r:10px;
  --mono:'Share Tech Mono','Fira Code',ui-monospace,'SFMono-Regular',Menlo,monospace;
  --sans:'Fira Code',ui-monospace,'Noto Sans SC','PingFang SC',system-ui,sans-serif;
}

*,*::before,*::after{box-sizing:border-box}

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

body{
  margin:0;
  padding-left:var(--rail);
  background:var(--paper);
  color:var(--ink);
  font:400 16px/1.78 var(--sans);
  letter-spacing:.01em;
  -webkit-font-smoothing:antialiased;
}

img{display:block;max-width:100%;height:auto}
a{color:inherit}
p{margin:0 0 1.1em}
:focus-visible{outline:2px solid var(--ink);outline-offset:3px}

.skip{
  position:absolute;
  left:10px;top:10px;z-index:80;
  background:var(--ink);color:var(--paper);
  padding:10px 16px;text-decoration:none;
  font:400 14px/1.4 var(--mono);letter-spacing:.08em;
  transform:translateY(-220%);
  transition:transform .18s ease;
}
.skip:focus{transform:none}

/* ---- 左侧竖排导航 ---- */
.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--rail);
  display:flex;
  flex-direction:column;
  gap:12px;
  padding:18px 18px 30px;
  background:var(--paper);
  border-right:1px solid var(--ink);
  overflow-y:auto;
  z-index:40;
}

.nav-toggle{
  position:absolute;
  left:0;top:0;
  width:1px;height:1px;
  opacity:0;
  pointer-events:none;
}

.rail-top{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
}

.brand{
  display:flex;
  align-items:center;
  justify-content:center;
  width:46px;height:46px;
  background:var(--ink);
  color:var(--paper);
  text-decoration:none;
  flex:0 0 auto;
}
.brand .mark{width:46px;height:46px;object-fit:contain}
.brand .mark-txt{
  display:flex;align-items:center;justify-content:center;
  width:100%;height:100%;
  font:700 22px/1 var(--mono);
}

.rail-h{
  margin:10px 0 0;
  font:400 12px/1 var(--mono);
  letter-spacing:.24em;
}
.rail hr{
  border:0;
  border-top:1px solid var(--ink);
  margin:0;
}

.rail-nav{display:block}
.rail-nav ul{
  list-style:none;
  margin:2px 0 0;
  padding:0;
  display:flex;
  flex-direction:column;
}
.rail-nav li{border-bottom:1px solid var(--line)}
.rail-nav a{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:9px 6px 9px 0;
  text-decoration:none;
  font-size:15px;
  line-height:1.4;
  transition:background .15s ease,color .15s ease,padding-left .15s ease;
}
.rail-nav .idx{
  font:400 12px/1 var(--mono);
  letter-spacing:.12em;
  color:var(--dim);
  flex:0 0 2.2em;
  transition:color .15s ease;
}
.rail-nav a:hover,
.rail-nav a:focus-visible{
  background:var(--ink);
  color:var(--paper);
  padding-left:8px;
}
.rail-nav a:hover .idx,
.rail-nav a:focus-visible .idx{color:var(--paper)}

.burger{display:none}

@media (prefers-reduced-motion: no-preference){
  .rail-nav li{
    animation:railRise .55s cubic-bezier(.2,.7,.3,1) both;
  }
  .rail-nav li:nth-child(1){animation-delay:.06s}
  .rail-nav li:nth-child(2){animation-delay:.11s}
  .rail-nav li:nth-child(3){animation-delay:.16s}
  .rail-nav li:nth-child(4){animation-delay:.21s}
  .rail-nav li:nth-child(5){animation-delay:.26s}
  .rail-nav li:nth-child(6){animation-delay:.31s}
  .rail-nav li:nth-child(7){animation-delay:.36s}
  @keyframes railRise{
    from{opacity:0;transform:translateX(-10px)}
    to{opacity:1;transform:none}
  }
}

/* ---- 斜切首屏 ---- */
.hero{
  position:relative;
  height:70vh;
  min-height:420px;
  overflow:hidden;
  isolation:isolate;
  background:var(--ink);
  color:var(--paper);
  display:flex;
  align-items:flex-end;
  justify-content:flex-end;
  clip-path:polygon(0 0,100% 0,100% 90%,0 100%);
}
.hero::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(180deg,rgba(0,0,0,.18) 0%,rgba(0,0,0,.84) 100%);
}
.hero::before{
  content:"";
  position:absolute;
  left:0;right:0;top:0;
  height:18px;
  z-index:3;
  opacity:.65;
  background:repeating-linear-gradient(90deg,rgba(255,255,255,.75) 0 1px,transparent 1px 20px);
}
.hero.has-img::after{background:linear-gradient(180deg,rgba(0,0,0,.3) 0%,rgba(0,0,0,.9) 100%)}

.hero-img{
  position:absolute;
  left:0;top:-18%;
  width:100%;height:140%;
  object-fit:cover;
  z-index:0;
  will-change:transform;
  filter:grayscale(1) contrast(1.05);
}

.hero-num{
  position:absolute;
  left:-6px;
  bottom:-16%;
  z-index:1;
  font:700 clamp(7rem,26vw,19rem)/1 var(--mono);
  letter-spacing:-.04em;
  color:var(--paper);
  opacity:.16;
  pointer-events:none;
  user-select:none;
}

.hero-in{
  position:relative;
  z-index:2;
  width:100%;
  text-align:right;
  padding:0 clamp(18px,5vw,64px) clamp(46px,9vh,96px) clamp(18px,8vw,120px);
}
.hero-in h1{
  margin:0;
  font-size:clamp(1.9rem,6vw,4.4rem);
  line-height:1.06;
  letter-spacing:-.025em;
  font-weight:700;
  overflow-wrap:break-word;
}

/* ---- 正文 ---- */
.doc{
  max-width:920px;
  margin:clamp(30px,5vw,64px) clamp(16px,4vw,56px) clamp(40px,6vw,72px) clamp(16px,7vw,104px);
}

.doc > div{
  background:var(--paper);
  border:1px solid var(--line);
  border-radius:var(--r);
  box-shadow:0 14px 34px -20px rgba(0,0,0,.4);
  padding:clamp(20px,4vw,46px);
  margin:0 0 clamp(20px,3.4vw,38px);
  scroll-margin-top:26px;
}
.doc > div:last-child{margin-bottom:0}

.doc div > *:first-child{margin-top:0}
.doc div > *:last-child{margin-bottom:0}

.doc h2{
  font-size:clamp(1.3rem,3vw,1.85rem);
  line-height:1.25;
  letter-spacing:-.01em;
  margin:0 0 .6em;
  font-weight:700;
}
.doc h3{
  font-size:clamp(1.08rem,2.2vw,1.3rem);
  line-height:1.35;
  margin:1.6em 0 .5em;
  font-weight:700;
}

.doc ul,.doc ol{padding-left:1.35em;margin:0 0 1.1em}
.doc li{margin:0 0 .5em}
.doc strong{font-weight:700}
.doc a{text-underline-offset:3px}

.doc blockquote{
  margin:1.4em 0;
  padding:.2em 0 .2em 1.1em;
  border-left:3px solid var(--ink);
  color:var(--dim);
}
.doc blockquote p:last-child{margin-bottom:0}

.doc img{border-radius:var(--r);margin:1.2em 0}

.doc table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 1.2em;
  font-size:15px;
}
.doc th,.doc td{
  border-bottom:1px solid var(--line);
  padding:10px 8px;
  text-align:left;
  vertical-align:top;
}
.doc th{font-weight:700}

.doc code,.doc pre{font-family:var(--mono)}
.doc pre{
  overflow-x:auto;
  padding:14px;
  background:var(--wash);
  border-radius:var(--r);
}

/* ---- 页脚 ---- */
.foot{
  border-top:1px solid var(--ink);
  padding:clamp(24px,4.6vw,52px) clamp(16px,4vw,56px) clamp(20px,3vw,32px);
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:16px;
  background:var(--paper);
}

.cta{
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:18px 4px;
  border-top:1px solid var(--ink);
  border-bottom:1px solid var(--ink);
  text-decoration:none;
  font-size:clamp(1.35rem,4.2vw,2.5rem);
  line-height:1.15;
  font-weight:700;
  letter-spacing:-.02em;
  transition:background .18s ease,color .18s ease,padding .18s ease;
}
.cta:hover,.cta:focus-visible{background:var(--ink);color:var(--paper);padding-left:16px;padding-right:16px}
.cta .arw{font-family:var(--mono);font-weight:400}

.foot-cols{
  grid-column:1 / -1;
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:22px;
  padding:10px 2px 6px;
}
.foot-cols dl{margin:0}
.foot-cols dt{font-weight:700;font-size:15px;line-height:1.5}
.foot-cols dd{margin:0;font-size:15px;line-height:1.5;color:var(--dim)}
.foot-cols a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  text-decoration:none;
}
.foot-cols a:hover{text-decoration:underline;text-underline-offset:3px}

.copy{
  grid-column:1 / -1;
  margin:0;
  padding-top:18px;
  border-top:1px solid var(--line);
  text-align:center;
  font:400 14px/1.7 var(--mono);
  letter-spacing:.1em;
  color:var(--dim);
}

/* ---- 窄屏 ---- */
@media (max-width:900px){
  body{padding-left:0}

  .rail{
    position:sticky;
    inset:auto;
    top:0;
    width:auto;
    padding:10px 14px;
    gap:8px;
    border-right:0;
    border-bottom:1px solid var(--ink);
    overflow:visible;
  }
  .rail-h,.rail hr{display:none}
  .rail-nav{display:none}
  .nav-toggle:checked ~ .rail-nav{display:block}
  .rail-nav ul{margin-top:4px}
  .rail-nav li:last-child{border-bottom:0}

  .burger{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-height:42px;
    min-width:72px;
    padding:0 14px;
    border:1px solid var(--ink);
    font:400 14px/1 var(--mono);
    letter-spacing:.12em;
    cursor:pointer;
    user-select:none;
  }

  .hero{height:56vh;min-height:330px}
  .hero-in{padding-bottom:clamp(30px,7vh,58px)}
  .hero-num{bottom:-10%}

  .doc{
    margin:24px 16px 40px;
    max-width:none;
  }
  .doc > div{scroll-margin-top:82px;padding:20px}

  .foot{padding:24px 16px 20px;grid-template-columns:1fr}
  .foot-cols{grid-template-columns:1fr;gap:0}
  .foot-cols dl{
    border-bottom:1px solid var(--line);
    padding:8px 0;
  }
  .foot-cols dl:last-child{border-bottom:0}
  .cta{padding:14px 2px}
}

@media (prefers-reduced-motion: reduce){
  html{scroll-behavior:auto}
  *{animation-duration:.001ms !important;animation-delay:0s !important;transition-duration:.001ms !important}
}

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