@import url('https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600;700&family=Raleway:wght@300;400;500;600;700&display=swap');

:root{
  --ink:#1f1f1f;
  --paper:#ffffff;
  --mist:#f5f5f5;
  --line:#dcdcdc;
  --mute:#575757;
  --r:4px;
  --rail:212px;
  --el1:0 1px 2px rgba(31,31,31,.07);
  --el2:0 4px 12px -3px rgba(31,31,31,.12);
  --el3:0 14px 30px -10px rgba(31,31,31,.20);
  --el4:0 28px 64px -22px rgba(31,31,31,.32);
  --serif:Lora,Georgia,"Songti SC",serif;
  --sans:Raleway,system-ui,-apple-system,"PingFang SC","Microsoft YaHei",sans-serif;
}

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

html{
  scroll-behavior:smooth;
  -webkit-text-size-adjust:100%;
  max-width:100%;
  overflow-x:hidden;
}

body{
  margin:0;
  max-width:100%;
  overflow-x:hidden;
  color:var(--ink);
  background:radial-gradient(130% 90% at 78% 0%,#ffffff 0%,var(--mist) 58%,#ededed 100%);
  font:400 17px/1.75 var(--sans);
  overflow-wrap:break-word;
}

img{max-width:100%;height:auto;display:block}
p{margin:0 0 16px}
a{color:var(--ink)}
h1,h2,h3,h4{
  font-family:var(--serif);
  font-weight:600;
  letter-spacing:-.01em;
  overflow-wrap:break-word;
  word-break:break-word;
}

pre,code{
  max-width:100%;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:15px;
}
pre{overflow-x:auto;padding:14px 16px;margin:18px 0;background:var(--mist);border-radius:var(--r)}

iframe,video,svg{max-width:100%}

.sr{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;
  overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0;
}

/* ---- 左侧竖排栏 ---- */
.rail{
  position:fixed;
  inset:0 auto 0 0;
  width:var(--rail);
  z-index:6;
  display:flex;
  flex-direction:column;
  gap:16px;
  padding:24px 20px;
  background:rgba(255,255,255,.86);
  -webkit-backdrop-filter:blur(16px);
  backdrop-filter:blur(16px);
  border-right:1px solid var(--line);
  box-shadow:var(--el2);
}

.mark{
  flex:0 0 auto;
  width:44px;height:44px;
  display:grid;place-items:center;
  background:var(--ink);
  color:#fff;
  border-radius:var(--r);
  font-family:var(--serif);
  font-size:19px;
  text-decoration:none;
  box-shadow:var(--el3);
  z-index:2;
  transition:transform .2s ease,box-shadow .2s ease;
}
.mark img{width:100%;height:100%;object-fit:cover;border-radius:var(--r)}
.mark:hover{transform:translateY(-2px);box-shadow:var(--el4)}

.railnav{flex:1 1 auto;min-width:0;min-height:0;overflow-y:auto;overflow-x:hidden}
.railnav ol{
  list-style:none;margin:0;padding:0;
  display:flex;flex-direction:column;gap:8px;
}
.railnav a{
  display:flex;align-items:center;
  min-height:44px;
  padding:10px 15px;
  font-size:16px;line-height:1.45;
  color:var(--ink);
  text-decoration:none;
  background:var(--paper);
  border:1px solid var(--line);
  border-bottom:2px solid var(--ink);
  border-radius:999px;
  box-shadow:var(--el1);
  white-space:nowrap;
  transition:transform .18s ease,box-shadow .18s ease,background .18s ease;
}
.railnav a:hover,.railnav a:focus-visible{
  transform:translateX(3px) translateY(-1px);
  box-shadow:var(--el3);
  background:#fff;
}

.search{flex:0 0 auto;min-width:0}
.search-input{
  width:100%;
  min-height:42px;
  padding:9px 14px;
  font:400 16px/1.4 var(--sans);
  color:var(--ink);
  background:var(--mist);
  border:1px solid var(--line);
  border-radius:999px;
  box-shadow:inset 0 1px 3px rgba(31,31,31,.08);
  outline-offset:2px;
}
.search-input:focus{background:#fff;border-color:var(--ink)}

/* ---- 主区 ---- */
.main{margin-left:var(--rail);min-width:0;max-width:100%}

.hero{
  position:relative;
  isolation:isolate;
  display:flex;
  flex-direction:column;
  justify-content:center;
  gap:clamp(20px,3vw,42px);
  min-height:100vh;
  min-height:100svh;
  padding:84px clamp(20px,5vw,64px) 64px;
  overflow:hidden;
}

.hero-blob{
  position:absolute;
  z-index:0;
  right:-14vw;top:6vh;
  width:52vw;height:52vw;
  max-width:620px;max-height:620px;
  border-radius:50%;
  background:radial-gradient(circle at 38% 34%,#ffffff 0%,#ececec 62%,#e2e2e2 100%);
  box-shadow:var(--el4);
  opacity:.9;
}

.hero-copy{position:relative;z-index:3;max-width:34ch;min-width:0}

.badge{
  display:inline-block;
  max-width:100%;
  margin-bottom:18px;
  padding:7px 16px;
  font-size:16px;
  letter-spacing:.14em;
  color:var(--ink);
  background:#fff;
  border:1px solid var(--ink);
  border-radius:999px;
  box-shadow:var(--el2);
  transform:rotate(-2deg);
  animation:floaty 7s ease-in-out infinite;
  overflow-wrap:anywhere;
}

.hero h1{
  font-size:clamp(31px,5.2vw,62px);
  line-height:1.14;
  margin:0 0 18px;
  letter-spacing:-.025em;
  word-break:break-word;
  overflow-wrap:anywhere;
  text-shadow:0 2px 0 #fff;
}

.hero-sub{
  font-size:clamp(16px,1.5vw,19px);
  line-height:1.7;
  color:var(--mute);
  max-width:30ch;
  margin:0 0 26px;
}

.hero-go{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:11px 22px;
  font-size:16px;
  text-decoration:none;
  color:#fff;
  background:var(--ink);
  border-radius:999px;
  box-shadow:var(--el3);
  transition:transform .18s ease,box-shadow .18s ease;
}
.hero-go:hover{transform:translateY(-2px);box-shadow:var(--el4)}

.hero-media{
  position:relative;
  z-index:2;
  margin:0;
  height:min(42vh,430px);
  border-radius:var(--r);
  border-bottom:4px solid var(--ink);
  box-shadow:var(--el4);
  overflow:hidden;
  background:var(--mist);
  will-change:transform;
}
.hero-img{
  position:absolute;inset:0;
  width:100%;height:100%;
  object-fit:cover;
}
.hero-media.multi .hero-img{opacity:0;animation:fadeCycle 15s infinite}
.hero-media.multi .hero-img:nth-child(2){animation-delay:5s}
.hero-media.multi .hero-img:nth-child(3){animation-delay:10s}
.hero-ph{
  position:absolute;inset:0;
  background:
    repeating-linear-gradient(135deg,#ffffff 0 14px,#f0f0f0 14px 28px);
}

@keyframes fadeCycle{
  0%{opacity:0}
  4%{opacity:1}
  29%{opacity:1}
  34%{opacity:0}
  100%{opacity:0}
}
@keyframes floaty{
  0%,100%{transform:rotate(-2deg) translateY(0)}
  50%{transform:rotate(-2deg) translateY(-6px)}
}

/* ---- 正文层 ---- */
.stage{
  display:grid;
  grid-template-columns:170px minmax(0,1fr);
  column-gap:clamp(22px,3vw,54px);
  padding:0 clamp(20px,5vw,64px) 88px;
  min-width:0;
  max-width:100%;
}

.stage > aside{
  grid-column:1;
  grid-row:1 / span 80;
  align-self:start;
  position:sticky;
  top:26px;
  z-index:2;
  min-width:0;
  border-left:2px solid var(--ink);
  padding-left:15px;
}
.toc-t{
  margin:0 0 10px;
  font-size:16px;
  letter-spacing:.16em;
  color:var(--mute);
}
.toc{min-width:0}
.toc ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;min-width:0}
.toc a{
  display:block;
  padding:9px 0;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
  border-bottom:1px dotted #c9c9c9;
  overflow-wrap:break-word;
}
.toc a:hover{background:#fff}
.toc .num{
  font-family:var(--serif);
  font-size:16px;
  color:var(--mute);
  margin-right:9px;
}

.stage > article{
  grid-column:2;
  min-width:0;
  max-width:100%;
  position:relative;
  margin-bottom:clamp(26px,4vw,54px);
  padding:clamp(22px,3vw,46px);
  background:var(--paper);
  border-radius:var(--r);
  border-bottom:4px solid var(--ink);
  box-shadow:var(--el2);
  scroll-margin-top:28px;
  /* 兜底：长表格/长串在卡片内横向滚动，不吃穿视口 */
  overflow-x:auto;
  overflow-wrap:break-word;
  word-break:break-word;
}
.stage > article:nth-of-type(even){
  transform:translateX(-11px);
  box-shadow:var(--el3);
}
.stage > article:nth-of-type(3n){
  transform:translateX(9px);
}
.stage > article:nth-of-type(5n){
  transform:translateX(-5px) translateY(-4px);
  box-shadow:var(--el4);
}

.stage > article h2{
  font-size:clamp(23px,2.6vw,35px);
  line-height:1.28;
  margin:0 0 14px;
  overflow-wrap:anywhere;
}
.stage > article h3{
  font-size:clamp(19px,1.8vw,23px);
  line-height:1.4;
  margin:26px 0 12px;
  overflow-wrap:anywhere;
}
.stage > article hr{
  width:66px;
  max-width:100%;
  height:0;
  margin:0 0 22px;
  border:0;
  border-top:3px solid var(--ink);
}
.stage > article ul,.stage > article ol{padding-left:1.25em;margin:0 0 16px}
.stage > article li{margin-bottom:8px;overflow-wrap:break-word}
.stage > article figure{margin:20px 0;max-width:100%}
.stage > article figure img{border-radius:var(--r);box-shadow:var(--el2);max-width:100%}
.stage > article blockquote{
  margin:20px 0;
  padding:14px 20px;
  background:var(--mist);
  border-left:3px solid var(--ink);
  border-radius:0 var(--r) var(--r) 0;
  max-width:100%;
}
.stage > article table{
  width:100%;
  max-width:100%;
  border-collapse:collapse;
  margin:18px 0;
  font-size:16px;
  display:table;
}
.stage > article th,.stage > article td{
  padding:10px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  overflow-wrap:break-word;
}

.hit{background:#ededed;box-shadow:inset 3px 0 0 var(--ink)}

/* ---- 页脚 ---- */
.foot{
  position:relative;
  z-index:1;
  margin-left:var(--rail);
  padding:clamp(28px,4vw,58px) clamp(20px,5vw,64px) 30px;
  background:var(--paper);
  border-top:1px solid var(--line);
  box-shadow:var(--el3);
  min-width:0;
  max-width:100%;
}

.foot-top{margin-bottom:34px}
.sub{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  max-width:460px;
  min-width:0;
}
.sub input{
  flex:1 1 200px;
  min-width:0;
  min-height:44px;
  padding:10px 16px;
  font:400 16px/1.4 var(--sans);
  color:var(--ink);
  background:var(--mist);
  border:1px solid var(--line);
  border-radius:999px;
}
.sub input:focus{background:#fff;border-color:var(--ink);outline-offset:2px}
.sub button{
  min-height:44px;
  padding:10px 26px;
  font:500 16px/1.4 var(--sans);
  color:#fff;
  background:var(--ink);
  border:0;
  border-radius:999px;
  box-shadow:var(--el2);
  cursor:pointer;
  transition:transform .18s ease,box-shadow .18s ease;
}
.sub button:hover{transform:translateY(-2px);box-shadow:var(--el3)}

.foot-cols{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:clamp(20px,4vw,54px);
  padding-bottom:26px;
  border-bottom:1px solid var(--line);
  min-width:0;
}
.foot-cols dl{margin:0;min-width:0}
.foot-cols dt{
  font-size:16px;
  letter-spacing:.16em;
  color:var(--mute);
  margin-bottom:8px;
}
.foot-cols dd{
  margin:0 0 12px;
  font-size:16px;
  line-height:1.6;
  overflow-wrap:break-word;
}
.foot-cols dd a{
  display:inline-block;
  padding:10px 0;
  margin-right:12px;
  min-height:40px;
  text-decoration:none;
  border-bottom:1px solid transparent;
}
.foot-cols dd a:hover{border-bottom-color:var(--ink)}
.foot-cols a.up{
  padding:10px 16px;
  background:var(--mist);
  border-radius:999px;
  border:1px solid var(--line);
}

.foot-base{
  display:flex;
  flex-wrap:wrap;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding-top:20px;
  font-size:16px;
  min-width:0;
}
.foot-base p{margin:0;color:var(--mute);overflow-wrap:break-word}
.foot-base a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:8px 18px;
  text-decoration:none;
  border:1px solid var(--ink);
  border-radius:999px;
}

/* ---- 滚动显现 ---- */
.rv{opacity:0;transform:translateY(16px);transition:opacity .6s ease,transform .6s ease}
.rv.in{opacity:1;transform:none}

/* ---- 窄屏 ---- */
@media (max-width:900px){
  .rail{
    inset:auto 0 0 0;
    width:auto;
    max-width:100%;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:9px 12px;
    border-right:0;
    border-top:1px solid var(--line);
    background:rgba(255,255,255,.95);
    box-shadow:0 -6px 20px -12px rgba(31,31,31,.4);
    z-index:9;
  }
  .mark{width:42px;height:42px;font-size:18px}
  .railnav{flex:1 1 auto;overflow-x:auto;overflow-y:hidden;min-width:0}
  .railnav ol{flex-direction:row;gap:8px;padding-bottom:2px}
  .railnav a{min-height:42px;padding:9px 14px}
  .search{flex:0 0 auto;width:104px}
  .search-input{min-height:42px;padding:9px 12px}

  .main{margin-left:0}
  .foot{margin-left:0;padding-bottom:104px}

  .hero{
    min-height:calc(100svh - 60px);
    padding:56px 20px 42px;
  }
  .hero-blob{display:none}
  .hero h1{font-size:clamp(29px,8.4vw,44px)}

  .stage{
    grid-template-columns:minmax(0,1fr);
    padding:0 20px 72px;
  }
  .stage > aside{
    grid-column:1;
    grid-row:auto;
    position:static;
    border-left:0;
    border-top:2px solid var(--ink);
    padding:12px 0 0;
    margin-bottom:24px;
  }
  .toc ol{flex-direction:row;gap:16px;overflow-x:auto;padding-bottom:2px}
  .toc a{border-bottom:0;white-space:nowrap;padding:8px 0;min-height:40px}
  .stage > article{transform:none!important}
}

@media (max-width:420px){
  .hero-sub{font-size:16px}
  .foot-cols{grid-template-columns:minmax(0,1fr);gap:8px}
  .stage > article{padding:20px 16px}
  .stage > article table{font-size:15px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation-duration:.001ms!important;animation-iteration-count:1!important;transition-duration:.001ms!important}
  .rv{opacity:1;transform:none}
}

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