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

:root{
  --ink:#1f1f1f;
  --ink-soft:#454545;
  --ink-mute:#7d7d7d;
  --paper:#ffffff;
  --mist:#f5f5f5;
  --line:#e4e4e4;
  --e1:0 1px 2px rgba(31,31,31,.07);
  --e2:0 8px 18px rgba(31,31,31,.08);
  --e3:0 16px 38px rgba(31,31,31,.12);
  --e4:0 30px 70px rgba(31,31,31,.18);
  --r:28px;
  --rail:272px;
}

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

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

body{
  margin:0;
  padding-left:var(--rail);
  background:var(--mist);
  color:var(--ink);
  font-family:'Exo',system-ui,-apple-system,'Segoe UI','Noto Sans SC',sans-serif;
  font-size:17px;
  line-height:1.75;
  letter-spacing:.01em;
  overflow-wrap:break-word;
}

img{max-width:100%;}

/* ---------- 左侧固定层叠导航 ---------- */
.rail{
  position:fixed;
  top:0;left:0;bottom:0;
  width:var(--rail);
  z-index:60;
  display:flex;
  flex-direction:column;
  padding:26px 18px 22px;
  background:rgba(255,255,255,.96);
  -webkit-backdrop-filter:blur(10px);
  backdrop-filter:blur(10px);
  border-right:1px solid var(--line);
  box-shadow:var(--e3);
  overflow-y:auto;
}

.rail-brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  text-decoration:none;
  color:var(--ink);
  font-weight:700;
  font-size:17px;
  letter-spacing:.02em;
}

.rail-logo{
  width:36px;height:36px;
  border-radius:12px;
  object-fit:cover;
  box-shadow:var(--e1);
}

.rail-links{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-top:20px;
}

.rail-link{
  position:relative;
  display:flex;
  align-items:center;
  gap:10px;
  min-height:44px;
  padding:10px 12px;
  border-radius:14px;
  text-decoration:none;
  color:var(--ink-soft);
  transition:transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}

.rail-link:hover,
.rail-link:focus-visible{
  background:#fff;
  color:var(--ink);
  transform:translate3d(4px,-1px,0);
  box-shadow:var(--e2);
}

.rail-no{
  font-family:'Roboto Mono',monospace;
  font-size:12px;
  font-weight:500;
  letter-spacing:.08em;
  color:var(--ink-mute);
}

.rail-search{
  margin-top:auto;
  padding-top:20px;
}

.rail-search input{
  width:100%;
  min-height:44px;
  padding:0 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:var(--mist);
  color:var(--ink);
  font-family:inherit;
  font-size:16px;
}

.rail-search input::placeholder{color:var(--ink-mute);}

.rail-search input:focus{
  outline:2px solid var(--ink);
  outline-offset:1px;
  background:#fff;
}

.rail-hits{
  display:flex;
  flex-direction:column;
  gap:4px;
  margin-top:10px;
}

.rail-hits a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:8px 10px;
  border-radius:12px;
  background:#fff;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  box-shadow:var(--e1);
}

.rail-hits a:hover{box-shadow:var(--e2);}

/* ---------- 顶部斜切大图 ---------- */
.hero{
  position:relative;
  z-index:1;
  overflow:hidden;
  display:grid;
  place-items:center;
  min-height:70vh;
  padding:96px 32px 132px;
  text-align:center;
  background:#fff;
  clip-path:polygon(0 0,100% 0,100% 90%,0 100%);
}

.hero-media{
  position:absolute;
  inset:0;
  z-index:0;
}

.hero-img{
  width:100%;height:100%;
  object-fit:cover;
  display:block;
  filter:grayscale(.15) contrast(1.03);
}

.hero-media::after{
  content:"";
  position:absolute;
  inset:0;
  background:linear-gradient(180deg,rgba(255,255,255,.92),rgba(245,245,245,.87));
}

.hero-big{
  position:absolute;
  z-index:1;
  left:50%;top:50%;
  transform:translate(-50%,-50%);
  font-size:clamp(72px,12vw,186px);
  font-weight:700;
  line-height:1;
  letter-spacing:.02em;
  color:rgba(31,31,31,.06);
  white-space:nowrap;
  pointer-events:none;
  user-select:none;
}

.hero-copy{
  position:relative;
  z-index:2;
  max-width:780px;
}

h1{
  margin:0;
  font-size:clamp(30px,4.4vw,56px);
  line-height:1.18;
  font-weight:700;
  letter-spacing:-.01em;
}

.hero-desc{
  margin:18px auto 0;
  max-width:600px;
  font-size:17px;
  line-height:1.7;
  color:var(--ink-soft);
}

/* ---------- 主舞台 ---------- */
.stage{
  position:relative;
  z-index:2;
  max-width:1280px;
  margin:-58px auto 0;
  padding:0 32px 72px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 300px;
  gap:36px;
  align-items:start;
}

.paper{
  position:relative;
  z-index:2;
  min-width:0;
}

.paper > article{
  position:relative;
  z-index:1;
  margin:0 0 34px;
  padding:36px 38px 46px;
  background:var(--paper);
  border-radius:var(--r);
  border-bottom:4px solid var(--ink);
  box-shadow:var(--e2);
  scroll-margin-top:96px;
  transition:transform .22s ease, box-shadow .22s ease;
}

.paper > article::after{
  content:"";
  position:absolute;
  left:18px;right:18px;bottom:-9px;
  height:22px;
  border-radius:0 0 var(--r) var(--r);
  background:#fff;
  box-shadow:var(--e1);
  z-index:-1;
}

.paper > article:hover{
  transform:translateY(-3px);
  box-shadow:var(--e3);
}

.paper h2{
  margin:0 0 16px;
  font-size:clamp(23px,2.5vw,30px);
  line-height:1.3;
  font-weight:600;
}

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

.paper p{margin:0 0 16px;}
.paper p:last-child{margin-bottom:0;}

.paper ul,
.paper ol{
  margin:0 0 16px;
  padding-left:22px;
}

.paper li{margin:0 0 8px;}

.paper a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-underline-offset:3px;
}

.paper a:hover{background:var(--mist);}

.paper img{
  height:auto;
  border-radius:18px;
  box-shadow:var(--e2);
}

.paper blockquote{
  margin:0 0 16px;
  padding:14px 18px;
  background:var(--mist);
  border-left:4px solid var(--ink);
  border-radius:18px;
}

.paper small{
  display:block;
  font-family:'Roboto Mono',monospace;
  font-size:16px;
  letter-spacing:.14em;
  color:var(--ink-mute);
  margin-bottom:6px;
}

time{
  font-family:'Roboto Mono',monospace;
  font-size:15px;
  color:var(--ink-mute);
}

/* ---------- 右侧浮动目录 ---------- */
.side{
  position:sticky;
  top:26px;
  z-index:3;
  background:#fff;
  border-radius:var(--r);
  border-bottom:4px solid var(--ink);
  box-shadow:var(--e3);
  padding:26px 22px 22px;
}

.side small{
  display:block;
  font-size:16px;
  letter-spacing:.12em;
  color:var(--ink-mute);
  margin-bottom:6px;
}

.side h2{
  margin:0 0 14px;
  font-size:22px;
  line-height:1.3;
  font-weight:600;
}

.side-toc{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:2px;
}

.side-toc a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:6px 10px;
  border-radius:12px;
  color:var(--ink-soft);
  text-decoration:none;
  font-size:16px;
}

.side-toc a:hover{
  background:var(--mist);
  color:var(--ink);
  box-shadow:var(--e1);
}

/* ---------- 回到顶部 ---------- */
.to-top{
  position:fixed;
  right:22px;bottom:22px;
  z-index:70;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:0 20px;
  border-radius:999px;
  background:#fff;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  box-shadow:var(--e3);
  transition:transform .2s ease, box-shadow .2s ease;
}

.to-top:hover{
  transform:translateY(-2px);
  box-shadow:var(--e4);
}

/* ---------- 单行页脚 ---------- */
.site-foot{
  position:relative;
  z-index:2;
  margin-top:24px;
  padding:24px 32px;
  background:var(--ink);
  color:#fff;
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  justify-content:space-between;
  gap:14px 24px;
}

.foot-brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:600;
}

.foot-logo{
  width:32px;height:32px;
  border-radius:10px;
  object-fit:cover;
}

.foot-nav dl{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:2px 16px;
  margin:0;
}

.foot-nav dt{
  color:#a5a5a5;
  font-size:16px;
}

.foot-nav dd{margin:0;}

.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 2px;
  color:#f5f5f5;
  text-decoration:none;
  font-size:16px;
}

.foot-nav a:hover{
  color:#fff;
  box-shadow:0 2px 0 #fff;
}

.foot-copy{
  font-size:16px;
  color:#c9c9c9;
}

/* ---------- 动画 ---------- */
@keyframes rise{
  from{opacity:0;transform:translateY(22px);}
  to{opacity:1;transform:none;}
}

@media (prefers-reduced-motion: no-preference){
  .paper > article{animation:rise .55s cubic-bezier(.2,.7,.3,1) backwards;}
  .paper > article:nth-child(1){animation-delay:.04s;}
  .paper > article:nth-child(2){animation-delay:.10s;}
  .paper > article:nth-child(3){animation-delay:.16s;}
  .paper > article:nth-child(4){animation-delay:.22s;}
  .paper > article:nth-child(5){animation-delay:.28s;}
  .paper > article:nth-child(6){animation-delay:.34s;}
  .paper > article:nth-child(7){animation-delay:.40s;}
  .paper > article:nth-child(n+8){animation-delay:.46s;}
  .hero-copy{animation:rise .7s ease backwards;}
  .side{animation:rise .7s ease .18s backwards;}
}

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

/* ---------- 移动端 ---------- */
@media (max-width:900px){
  body{padding-left:0;}

  .rail{
    position:sticky;
    top:0;left:auto;right:auto;bottom:auto;
    width:100%;
    height:auto;
    flex-direction:row;
    align-items:center;
    gap:12px;
    padding:8px 14px;
    overflow:visible;
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
    border-right:0;
    border-bottom:1px solid var(--line);
  }

  .rail-brand{flex:0 0 auto;}

  .rail-links{
    flex:1 1 auto;
    min-width:0;
    flex-direction:row;
    gap:4px;
    margin-top:0;
    padding-bottom:2px;
    overflow-x:auto;
    overflow-y:hidden;
  }

  .rail-link{
    white-space:nowrap;
    min-height:44px;
    padding:10px;
  }

  .rail-link:hover{transform:none;}

  .rail-search{
    flex:0 0 128px;
    margin-top:0;
    padding-top:0;
  }

  .rail-search input{min-height:40px;}

  .rail-hits{
    position:fixed;
    top:66px;
    left:14px;
    right:14px;
    z-index:90;
    max-height:52vh;
    overflow-y:auto;
    padding:8px;
    border-radius:18px;
    background:#fff;
    box-shadow:var(--e4);
  }

  .hero{
    min-height:62vh;
    padding:64px 18px 104px;
    clip-path:polygon(0 0,100% 0,100% 94%,0 100%);
  }

  .hero-desc{font-size:16px;}

  .stage{
    grid-template-columns:minmax(0,1fr);
    gap:26px;
    margin-top:-40px;
    padding:0 16px 48px;
  }

  .paper > article{
    padding:28px 20px 34px;
    scroll-margin-top:78px;
  }

  .paper > article:hover{transform:none;}

  .paper > article::after{left:12px;right:12px;}

  .side{
    position:static;
    order:2;
    padding:22px 18px 18px;
  }

  .to-top{
    right:14px;
    bottom:14px;
    padding:0 16px;
  }

  .site-foot{
    flex-direction:column;
    align-items:flex-start;
    gap:10px;
    padding:20px 16px;
  }
}

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