@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=JetBrains+Mono:wght@400&family=Playfair+Display:ital@1&display=swap');

:root{
  --ink:#1f1f1f;
  --paper:#ffffff;
  --mist:#f5f5f5;
  --rail:252px;
  --r:28px;
  --edge:rgba(31,31,31,.1);
  --shadow:0 4px 6px rgba(0,0,0,.05);
  --shadow-lg:0 18px 40px rgba(31,31,31,.08);
}

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

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

body{
  margin:0;
  background:var(--mist);
  color:var(--ink);
  font-family:Inter,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",system-ui,sans-serif;
  font-size:17px;
  line-height:1.68;
  -webkit-font-smoothing:antialiased;
}

a{color:inherit}
img{max-width:100%}

.skip{
  position:absolute;
  left:8px;
  top:-60px;
  z-index:80;
  padding:12px 20px;
  border-radius:999px;
  background:var(--ink);
  color:#fff;
  text-decoration:none;
  transition:top .25s;
}
.skip:focus{top:10px}

/* ---------- 左侧固定竖排导航 ---------- */
.rail{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:var(--rail);
  z-index:30;
  display:flex;
  flex-direction:column;
  gap:14px;
  padding:32px 20px 26px;
  background:var(--paper);
  border-right:1px solid var(--edge);
  overflow-y:auto;
}

.brand{
  margin:0;
  padding:4px 6px 16px;
  font-size:1.2rem;
  font-weight:800;
  letter-spacing:-.03em;
  line-height:1.25;
  border-bottom:1px solid var(--edge);
}

.rail-title{
  margin:0;
  padding-left:6px;
  font-size:.76rem;
  font-weight:600;
  letter-spacing:.24em;
  color:#8d8d8d;
}
.rail-title > span{display:inline-block}

.rail-nav{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.pill{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 17px;
  border-radius:999px;
  background:var(--mist);
  color:var(--ink);
  font-size:16px;
  font-weight:500;
  text-decoration:none;
  transition:background .25s ease,color .25s ease,transform .25s ease;
}
.pill:hover,
.pill:focus-visible{
  background:var(--ink);
  color:#fff;
  transform:translateX(3px);
}

/* ---------- 内容骨架 ---------- */
main{margin-left:var(--rail)}

.wrap{
  max-width:1080px;
  margin:0 auto;
  padding:0 28px;
}

/* ---------- 首屏 ---------- */
.hero{
  position:relative;
  min-height:100svh;
  display:grid;
  grid-template-columns:1.06fr .94fr;
  align-items:center;
  gap:44px;
  padding:76px 0 60px;
  background-image:
    linear-gradient(rgba(31,31,31,.045) 1px,transparent 1px),
    linear-gradient(90deg,rgba(31,31,31,.045) 1px,transparent 1px);
  background-size:46px 46px;
  background-position:center;
}

.hero-copy{text-align:center}

.hero h1{
  margin:0;
  font-size:clamp(2.3rem,5.4vw,4.6rem);
  font-weight:800;
  line-height:1.05;
  letter-spacing:-.05em;
  text-wrap:balance;
}

.hero-art{
  position:relative;
  aspect-ratio:4/5;
  border-radius:var(--r);
  background:var(--paper);
  box-shadow:var(--shadow-lg);
  overflow:hidden;
}
.hero-art::before{
  content:"";
  position:absolute;
  inset:-25%;
  background:
    radial-gradient(circle at 32% 28%,rgba(31,31,31,.18),transparent 56%),
    radial-gradient(circle at 72% 74%,rgba(31,31,31,.1),transparent 62%);
}
.hero-img{
  position:relative;
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}

/* ---------- 正文 ---------- */
.body{padding:8px 0 76px}

.prose{
  max-width:800px;
  margin:0 auto;
}

.prose > div{
  background:var(--paper);
  border-radius:var(--r);
  padding:34px 32px 26px;
  margin-bottom:16px;
  box-shadow:var(--shadow);
  scroll-margin-top:110px;
  transition:transform .4s ease,box-shadow .4s ease,opacity .5s ease;
}
.prose > div:nth-child(3n+2){
  background:var(--ink);
  color:#fff;
}
.prose > div.in:hover{
  transform:translateY(-3px);
  box-shadow:0 16px 30px rgba(0,0,0,.08);
}

.prose h2{
  margin:0 0 14px;
  font-size:clamp(1.5rem,2.9vw,2.05rem);
  font-weight:800;
  line-height:1.24;
  letter-spacing:-.035em;
  text-wrap:balance;
}
.prose h2 > span,
.prose h3 > span{display:inline-block}

.prose h3{
  margin:24px 0 10px;
  font-size:clamp(1.14rem,1.9vw,1.36rem);
  font-weight:700;
  line-height:1.35;
  letter-spacing:-.02em;
}

.prose p{margin:0 0 14px}
.prose p:last-child{margin-bottom:0}

.prose ul,
.prose ol{
  margin:0 0 14px;
  padding-left:1.25em;
}
.prose li{margin:0 0 8px}

.prose a{
  color:inherit;
  text-decoration:underline;
  text-decoration-thickness:1.5px;
  text-underline-offset:3px;
}

.prose strong{font-weight:700}

.prose blockquote{
  margin:0 0 14px;
  padding:14px 18px;
  border-radius:18px;
  background:rgba(31,31,31,.06);
}
.prose > div:nth-child(3n+2) blockquote{background:rgba(255,255,255,.13)}

.prose img{
  display:block;
  height:auto;
  border-radius:18px;
  margin:0 0 14px;
}

.prose table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 14px;
  font-size:16px;
}
.prose th,
.prose td{
  padding:10px 12px;
  border-bottom:1px solid var(--edge);
  text-align:left;
}
.prose > div:nth-child(3n+2) th,
.prose > div:nth-child(3n+2) td{border-bottom-color:rgba(255,255,255,.22)}

/* ---------- 页脚 ---------- */
.ft{
  display:grid;
  grid-template-columns:1.3fr 1fr;
  gap:28px 44px;
  align-items:start;
  margin-left:var(--rail);
  padding:64px 48px 26px;
  background:var(--ink);
  color:#fff;
}

.ft-big{
  margin:0;
  font-family:"Playfair Display",Inter,serif;
  font-size:clamp(2rem,6.6vw,4.2rem);
  font-weight:800;
  line-height:.96;
  letter-spacing:-.045em;
  overflow-wrap:anywhere;
}

.ft-title{
  margin:0 0 14px;
  font-size:.76rem;
  font-weight:600;
  letter-spacing:.24em;
  color:rgba(255,255,255,.6);
}
.ft-title > span{display:inline-block}

.ft dl{
  margin:0;
  display:grid;
  gap:6px;
}
.ft dt{margin:0}
.ft dt a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  font-size:16px;
  color:#fff;
  text-decoration:none;
  border-bottom:1px solid transparent;
  transition:border-color .25s;
}
.ft dt a:hover,
.ft dt a:focus-visible{border-bottom-color:#fff}
.ft dd{
  margin:0;
  height:0;
  border-top:1px solid rgba(255,255,255,.14);
}

.ft-copy{
  grid-column:1/-1;
  margin:22px 0 0;
  padding-top:18px;
  border-top:1px solid rgba(255,255,255,.18);
  font-size:.86rem;
  color:rgba(255,255,255,.62);
}

/* ---------- 回到顶部 ---------- */
.totop{
  position:fixed;
  right:20px;
  bottom:20px;
  z-index:60;
  min-width:44px;
  min-height:44px;
  padding:0 18px;
  border:0;
  border-radius:999px;
  background:var(--ink);
  color:#fff;
  font:inherit;
  font-size:16px;
  cursor:pointer;
  opacity:0;
  transform:translateY(12px);
  pointer-events:none;
  transition:opacity .3s,transform .3s;
}
.totop.on{opacity:1;transform:none;pointer-events:auto}

/* ---------- 入场 ---------- */
.js .prose > div{
  opacity:0;
  transform:translateY(18px);
}
.js .prose > div.in{
  opacity:1;
  transform:none;
}

/* ---------- 平板 ---------- */
@media (max-width:1040px){
  .hero{gap:30px}
  .ft{padding:52px 30px 24px}
}

/* ---------- 移动 ---------- */
@media (max-width:880px){
  .rail{
    position:sticky;
    top:0;
    left:auto;
    bottom:auto;
    width:100%;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:10px 14px;
    border-right:0;
    border-bottom:1px solid var(--edge);
    overflow-x:auto;
    overflow-y:hidden;
  }
  .brand{
    padding:0;
    border-bottom:0;
    font-size:1rem;
    white-space:nowrap;
  }
  .rail-title{display:none}
  .rail-nav{
    flex-direction:row;
    gap:8px;
  }
  .pill{
    min-height:44px;
    white-space:nowrap;
    font-size:16px;
  }
  .pill:hover{transform:none}

  main{margin-left:0}

  .wrap{padding:0 16px}

  .hero{
    grid-template-columns:1fr;
    min-height:0;
    gap:26px;
    padding:38px 0 32px;
    background-size:38px 38px;
  }
  .hero h1{font-size:clamp(2rem,9vw,2.8rem)}
  .hero-art{aspect-ratio:16/10}

  .body{padding:4px 0 48px}

  .prose > div{
    padding:24px 20px 18px;
    border-radius:22px;
    scroll-margin-top:118px;
  }
  .prose > div.in:hover{transform:none}

  .ft{
    grid-template-columns:1fr;
    margin-left:0;
    padding:38px 20px 22px;
    gap:24px;
  }

  .totop{right:14px;bottom:14px}
}

@media (max-width:420px){
  .hero h1{font-size:1.95rem}
  .ft-big{font-size:2rem}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  .js .prose > div{opacity:1;transform:none}
  .hero-art{transform:none!important}
  .pill:hover{transform:none}
  .prose > div.in:hover{transform:none}
}

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