@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:#000000;
  --paper:#ffffff;
  --line:#000000;
  --mute:#555555;
  --faint:#d8d8d8;
  --radius:18px;
  --page:1120px;
}

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

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

body{
  margin:0;
  padding:0 20px;
  background:var(--paper);
  color:var(--ink);
  font-family:Inter,system-ui,-apple-system,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:1.0625rem;
  line-height:1.65;
  font-weight:400;
  overflow-x:hidden;
}

a{color:inherit;text-decoration:none}
img{display:block;max-width:100%;height:auto}
menu{margin:0;padding:0;list-style:none}
hr{border:0;border-top:2px solid var(--line);margin:.5rem 0 1.2rem}

main,footer{max-width:var(--page);margin:0 auto}

/* ---------- 底部固定胶囊导航 ---------- */
.dock{
  position:fixed;
  z-index:40;
  left:0;
  right:0;
  bottom:14px;
  width:calc(100% - 24px);
  max-width:var(--page);
  margin:0 auto;
  display:grid;
  grid-template-columns:1fr auto 1fr;
  align-items:center;
  gap:8px;
  padding:9px 14px;
  background:var(--paper);
  border:2px solid var(--line);
  border-radius:999px;
}

.wing{display:flex;align-items:center;gap:8px;min-width:0}
.wing--l{justify-content:flex-start}
.wing--r{justify-content:flex-end}

.brand{
  font-size:1.15rem;
  font-weight:800;
  letter-spacing:-.03em;
  padding:10px 6px;
  white-space:nowrap;
  line-height:1;
}

.pill{
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 16px;
  border:2px solid var(--line);
  border-radius:999px;
  font-size:1rem;
  font-weight:600;
  line-height:1.2;
  white-space:nowrap;
  background:var(--paper);
  color:var(--ink);
  transition:background-color .22s ease,color .22s ease,transform .22s ease;
}
.pill:hover,.pill:focus-visible{background:var(--ink);color:var(--paper)}
.pill:active{transform:translateY(1px)}

.more{position:relative;display:flex}
.more summary{
  list-style:none;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:8px 16px;
  border:2px solid var(--line);
  border-radius:999px;
  font-size:1rem;
  font-weight:600;
  line-height:1.2;
  transition:background-color .22s ease,color .22s ease;
}
.more summary::-webkit-details-marker{display:none}
.more summary:hover,.more[open] summary{background:var(--ink);color:var(--paper)}

.more menu{
  position:absolute;
  right:0;
  bottom:calc(100% + 12px);
  min-width:12rem;
  display:grid;
  gap:2px;
  padding:8px;
  background:var(--paper);
  border:2px solid var(--line);
  border-radius:var(--radius);
}
.more:not([open]) menu{display:none}

.pill--menu{
  width:100%;
  justify-content:flex-start;
  border-width:0;
  border-radius:12px;
  padding:10px 12px;
  font-weight:500;
}

/* ---------- 首屏 ---------- */
.hero{
  min-height:70vh;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  align-items:flex-end;
  text-align:right;
  padding:14vh 0 6vh;
  background-image:radial-gradient(rgba(0,0,0,.26) 1px,transparent 1px);
  background-size:18px 18px;
  background-position:right top;
  background-repeat:repeat;
}

.hero h1{
  margin:0;
  max-width:15ch;
  font-size:clamp(2.9rem,11vw,7.4rem);
  line-height:.92;
  letter-spacing:-.045em;
  font-weight:800;
  overflow-wrap:break-word;
}

.hero .lede{
  margin:1.5rem 0 0;
  max-width:40ch;
  color:var(--mute);
  font-size:1.05rem;
  line-height:1.7;
}

/* ---------- 正文区 ---------- */
.sheet{
  display:grid;
  grid-template-columns:minmax(0,1fr) 250px;
  grid-template-areas:"prose side";
  gap:2.5rem 3rem;
  align-items:start;
  border-top:2px solid var(--line);
  padding:2.6rem 0 2rem;
}
.sheet--plate{
  grid-template-areas:"plate plate" "prose side";
}

.plate{
  grid-area:plate;
  margin:0;
  border:2px solid var(--line);
  border-radius:var(--radius);
  overflow:hidden;
}
.plate img{width:100%}

.prose{grid-area:prose;min-width:0;max-width:70ch}

.prose div{scroll-margin-top:1.5rem}
.prose div + div{
  border-top:1px solid var(--faint);
  margin-top:2.4rem;
  padding-top:1.6rem;
}
.prose div:last-child{border-bottom:0}

.prose h2{
  margin:2.6rem 0 .55rem;
  font-size:clamp(1.55rem,3.4vw,2.3rem);
  line-height:1.12;
  letter-spacing:-.03em;
  font-weight:800;
}
.prose div > h2:first-child{margin-top:0}

.prose h3{
  margin:1.8rem 0 .4rem;
  font-size:1.28rem;
  line-height:1.3;
  letter-spacing:-.015em;
  font-weight:700;
}

.prose p{margin:0 0 1.15rem}
.prose ul,.prose ol{margin:0 0 1.3rem;padding-left:1.35rem}
.prose li{margin:.35rem 0}

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

.prose blockquote{
  margin:1.6rem 0;
  padding:.3rem 0 .3rem 1.15rem;
  border-left:4px solid var(--line);
  font-weight:600;
}

.prose strong{font-weight:700}

.prose figure{margin:1.5rem 0}
.prose figure img,.prose > p img{
  width:100%;
  border:2px solid var(--line);
  border-radius:var(--radius);
}
.prose figcaption{
  margin-top:.5rem;
  font-size:.9rem;
  color:var(--mute);
}

.prose table{
  width:100%;
  margin:1.5rem 0;
  border-collapse:collapse;
  font-size:.98rem;
}
.prose th,.prose td{
  border:1px solid var(--line);
  padding:.6rem .7rem;
  text-align:left;
  vertical-align:top;
}
.prose th{font-weight:700;background:#f2f2f2}

/* ---------- 右侧栏 ---------- */
.side{
  grid-area:side;
  position:sticky;
  top:2rem;
  border-left:2px solid var(--line);
  padding-left:1.2rem;
}

.side h2{
  margin:0 0 .4rem;
  font-size:.82rem;
  font-weight:700;
  letter-spacing:.18em;
}

.toc{counter-reset:toc}
.toc li{counter-increment:toc;opacity:0;animation:rise .5s cubic-bezier(.2,.7,.3,1) forwards}
.toc li:nth-child(1){animation-delay:.04s}
.toc li:nth-child(2){animation-delay:.08s}
.toc li:nth-child(3){animation-delay:.12s}
.toc li:nth-child(4){animation-delay:.16s}
.toc li:nth-child(5){animation-delay:.2s}
.toc li:nth-child(6){animation-delay:.24s}
.toc li:nth-child(7){animation-delay:.28s}

.toc a{
  display:flex;
  align-items:center;
  gap:.55rem;
  min-height:44px;
  padding:.3rem 0;
  border-bottom:1px solid var(--faint);
  font-size:.98rem;
  line-height:1.3;
  transition:transform .22s ease;
}
.toc a::before{
  content:counter(toc,decimal-leading-zero);
  font-variant-numeric:tabular-nums;
  font-size:.76rem;
  letter-spacing:.08em;
  color:var(--mute);
}
.toc a:hover{transform:translateX(5px)}

@keyframes rise{
  from{opacity:0;transform:translateY(10px)}
  to{opacity:1;transform:none}
}

/* ---------- 页脚 ---------- */
footer{
  display:grid;
  grid-template-columns:1.1fr .8fr 1fr;
  gap:2rem;
  align-items:start;
  border-top:2px solid var(--line);
  padding:2.4rem 0 150px;
}

.foot-brand a{
  display:inline-block;
  font-size:clamp(2.1rem,6.4vw,4.4rem);
  line-height:.86;
  letter-spacing:-.05em;
  font-weight:800;
}

.foot-meta{
  text-align:center;
  font-size:.95rem;
  color:var(--mute);
  padding-top:.4rem;
}

.foot-nav{
  display:grid;
  justify-items:end;
  text-align:right;
}
.foot-nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:.1rem 0;
  font-size:.98rem;
  border-bottom:2px solid transparent;
  transition:border-color .22s ease;
}
.foot-nav a:hover{border-bottom-color:var(--line)}

/* ---------- 窄屏 ---------- */
@media (max-width:1040px){
  .wing > .pill{display:none}
}

@media (max-width:880px){
  .sheet,.sheet--plate{
    grid-template-columns:1fr;
    grid-template-areas:"prose" "side";
    gap:2rem;
  }
  .sheet--plate{grid-template-areas:"plate" "prose" "side"}
  .side{
    position:static;
    border-left:0;
    border-top:2px solid var(--line);
    padding-left:0;
    padding-top:1.2rem;
  }
  footer{
    grid-template-columns:1fr;
    gap:1.5rem;
    padding-bottom:130px;
  }
  .foot-meta{text-align:left;padding-top:0}
  .foot-nav{justify-items:start;text-align:left}
  .hero{padding:10vh 0 5vh}
  .hero .lede{font-size:1rem}
}

@media (max-width:420px){
  body{padding:0 16px}
  .dock{width:calc(100% - 16px);bottom:10px;padding:8px 10px}
  .brand{font-size:1.05rem}
}

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

@media print{
  .dock{position:static;margin:1rem 0}
  footer{padding-bottom:1rem}
}

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