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

:root{
  --paper:#fdfbf7;
  --wash:#f5f5f5;
  --ink:#1a1a1a;
  --line:#e0e0e0;
  --line-strong:#c9c6c0;
  --mute:#5f5c58;
  --radius:10px;
}

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

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

body{
  margin:0;
  padding:4.75rem 0 7rem;
  background:var(--paper);
  color:var(--ink);
  font-family:Inter,"Helvetica Neue",Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  font-size:17px;
  line-height:1.75;
  font-weight:400;
  letter-spacing:.004em;
  text-rendering:optimizeLegibility;
  overflow-x:hidden;
}

body::before{
  content:"";
  position:fixed;
  inset:0;
  z-index:2;
  pointer-events:none;
  opacity:.2;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.4'/%3E%3C/svg%3E");
  background-size:160px 160px;
}

img{max-width:100%;height:auto;display:block}

a{
  color:var(--ink);
  text-decoration:none;
  border-bottom:1px solid var(--line-strong);
  padding-bottom:1px;
}
a:hover{border-bottom-color:var(--ink)}

h1,h2,h3,h4{
  font-weight:600;
  line-height:1.25;
  letter-spacing:-.015em;
  margin:0;
  text-wrap:balance;
}

p{margin:0 0 1.1em}
p:last-child{margin-bottom:0}

hr{
  border:0;
  border-top:1px solid var(--line);
  margin:.85rem 0 1.6rem;
}

/* ---------- 角落品牌图标 ---------- */
.mark{
  position:fixed;
  top:.85rem;
  left:1rem;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:center;
  width:44px;
  height:44px;
  border:1px solid var(--line-strong);
  border-radius:var(--radius);
  background:var(--paper);
  font-weight:600;
  font-size:1.05rem;
  line-height:1;
  border-bottom:1px solid var(--line-strong);
  padding:0;
}
.mark span{display:block;transform:translateY(-1px)}
.mark img{width:30px;height:30px;border-radius:4px}

/* ---------- 主布局 ---------- */
main{
  display:grid;
  grid-template-columns:minmax(0,1fr) 16.5rem;
  column-gap:3.5rem;
  max-width:1080px;
  margin:0 auto;
  padding:1rem 1.5rem 0;
}

.hero{
  grid-column:1 / -1;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:2.5rem;
  min-height:70vh;
  padding:2rem 0 3rem;
  border-bottom:1px solid var(--line-strong);
}

.hero-copy{min-width:0;max-width:34rem}

.hero h1{
  font-size:clamp(2rem,6.2vw,3.4rem);
  font-weight:600;
  letter-spacing:-.03em;
  line-height:1.08;
  margin-bottom:1rem;
}

.hero .lead{
  margin:0;
  font-size:1.06rem;
  color:var(--mute);
  max-width:28rem;
}

.hero-art{
  flex:0 0 auto;
  margin:0;
  width:min(300px,34vw);
  color:var(--ink);
  will-change:transform;
}
.hero-art svg{width:100%;height:auto;display:block;opacity:.9}
.hero-art img{
  width:100%;
  border-radius:var(--radius);
  background:var(--wash);
}

/* ---------- 正文 ---------- */
.prose{
  grid-column:1;
  min-width:0;
  padding-bottom:3rem;
  overflow-wrap:break-word;
}

.prose > section{
  padding:2.6rem 0 1rem;
  border-top:1px solid var(--line);
  scroll-margin-top:5.5rem;
}
.prose > section:first-child{border-top:0;padding-top:2.6rem}

.prose h2{
  font-size:1.55rem;
  letter-spacing:-.02em;
  margin-bottom:.55rem;
}

.prose h3{
  font-size:1.2rem;
  margin:1.8rem 0 .6rem;
}

.prose ul,.prose ol{
  margin:0 0 1.2em;
  padding-left:1.35em;
}
.prose li{margin-bottom:.5em}

.prose blockquote{
  margin:1.4rem 0;
  padding:1.1rem 1.3rem;
  background:var(--wash);
  border-radius:var(--radius);
  color:var(--mute);
}
.prose blockquote p:last-child{margin-bottom:0}

.prose figure{margin:1.4rem 0}
.prose figure img{border-radius:var(--radius);background:var(--wash)}
.prose figcaption{
  font-size:1rem;
  color:var(--mute);
  padding-top:.6rem;
}

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

.prose code{
  font-family:ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  font-size:.95em;
  background:var(--wash);
  padding:.1em .35em;
  border-radius:4px;
}

/* ---------- 侧栏 ---------- */
.side{
  grid-column:2;
  align-self:start;
  position:sticky;
  top:1.5rem;
  padding:2.6rem 0 1rem;
  min-width:0;
}

.side h2{
  font-size:1.05rem;
  letter-spacing:.08em;
  font-weight:600;
}

.side hr{margin:.6rem 0 1rem}

.side-list{
  list-style:none;
  margin:0;
  padding:0;
  counter-reset:side;
}
.side-list li{counter-increment:side}
.side-list a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:.35rem 0;
  border-bottom:1px solid var(--line);
  font-size:1rem;
  color:var(--mute);
}
.side-list a::before{
  content:counter(side,decimal-leading-zero);
  font-size:.85rem;
  letter-spacing:.06em;
  color:var(--line-strong);
  margin-right:.75rem;
  font-variant-numeric:tabular-nums;
}
.side-list a:hover{color:var(--ink)}

/* ---------- 页脚 ---------- */
.foot{
  max-width:1080px;
  margin:0 auto;
  padding:3rem 1.5rem 3.5rem;
  display:grid;
  grid-template-columns:1.3fr 1fr 1fr 1fr;
  gap:1.2rem 1.5rem;
  border-top:1px solid var(--line-strong);
}

.foot p{margin:0;font-size:1rem}
.foot a{
  display:block;
  padding:.55rem 0;
  border-bottom:1px solid transparent;
  color:var(--mute);
}
.foot a:hover{color:var(--ink);border-bottom-color:var(--line-strong)}

.foot-brand{
  font-weight:600;
  letter-spacing:.02em;
}

.foot small{
  grid-column:1 / -1;
  display:block;
  text-align:center;
  font-size:1rem;
  color:var(--mute);
  border-top:1px solid var(--line);
  padding-top:1.4rem;
  margin-top:.6rem;
}

/* ---------- 底部固定菜单 ---------- */
.drawer{
  position:fixed;
  left:0;
  right:0;
  bottom:0;
  z-index:60;
  background:var(--paper);
  border-top:1px solid var(--line-strong);
}

.drawer[open]{
  top:0;
  display:flex;
  flex-direction:column;
  border-top:0;
  background:var(--paper);
}

.drawer summary{
  list-style:none;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:space-between;
  min-height:58px;
  padding:.5rem 1.35rem;
  font-size:1rem;
  letter-spacing:.14em;
  font-weight:500;
  border-bottom:1px solid transparent;
  user-select:none;
}
.drawer[open] summary{border-bottom-color:var(--line)}
.drawer summary::-webkit-details-marker{display:none}

.drawer summary i{
  position:relative;
  width:22px;
  height:2px;
  background:var(--ink);
  display:block;
}
.drawer summary i::before,
.drawer summary i::after{
  content:"";
  position:absolute;
  left:0;
  width:22px;
  height:2px;
  background:var(--ink);
}
.drawer summary i::before{top:-7px}
.drawer summary i::after{top:7px}

.drawer menu{
  display:none;
  margin:0;
  padding:.5rem 1.35rem 5rem;
  list-style:none;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
.drawer[open] menu{display:block}

.drawer menu li a{
  display:flex;
  align-items:center;
  min-height:56px;
  padding:.6rem 0;
  font-size:1.3rem;
  font-weight:500;
  letter-spacing:-.01em;
  border-bottom:1px solid var(--line);
}
.drawer menu li:last-child a{border-bottom:0}

.drawer a{color:var(--ink)}

/* ---------- 滚动显现 ---------- */
.prose > section.reveal{
  opacity:0;
  transform:translate3d(0,12px,0);
}
.prose > section.reveal.in{
  opacity:1;
  transform:none;
  transition:opacity .18s linear,transform .18s linear;
}

/* ---------- 断点 ---------- */
@media (max-width:900px){
  main{grid-template-columns:minmax(0,1fr);column-gap:0}
  .hero{grid-column:1;flex-direction:column;align-items:flex-start;justify-content:center;gap:1.5rem;min-height:62vh;padding:2rem 0 2.5rem}
  .hero-art{width:min(220px,48vw);order:2}
  .hero-copy{order:1;max-width:none}
  .hero .lead{max-width:none}
  .prose{grid-column:1}
  .side{grid-column:1;position:static;padding:1rem 0 2rem;border-top:1px solid var(--line)}
  .foot{grid-template-columns:1fr 1fr}
}

@media (max-width:420px){
  body{font-size:16px;padding-top:4.5rem}
  main{padding:0 1.1rem}
  .foot{padding:2.4rem 1.1rem 3rem}
  .drawer summary,.drawer menu{padding-left:1.1rem;padding-right:1.1rem}
  .mark{left:.8rem}
}

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

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