@import url('https://fonts.googleapis.com/css2?family=Lexend+Mega:wght@100..900&family=Public+Sans:wght@100..900&display=swap');

:root{
  --cream:#f5e6c8;
  --tan:#d4a574;
  --ink:#262117;
  --paper:#efe1c2;
  --paper2:#e8d7b3;
  --white:#fbf3e2;
  --rust:#7c4a1c;
  --line:rgba(38,33,23,.24);
  --r:28px;
  --head:106px;
}

*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0;
  background:var(--cream);
  color:var(--ink);
  font-family:'Public Sans',system-ui,-apple-system,'PingFang SC','Noto Sans SC',sans-serif;
  font-size:17px;
  line-height:1.7;
  overflow-x:clip;
}

/* 漏光 */
body::before{
  content:"";
  position:fixed;
  inset:-6%;
  z-index:0;
  pointer-events:none;
  background:
    radial-gradient(38% 26% at 6% 4%, rgba(255,186,110,.55), rgba(255,186,110,0) 70%),
    radial-gradient(32% 24% at 94% 10%, rgba(255,122,86,.34), rgba(255,122,86,0) 72%),
    radial-gradient(46% 34% at 72% 96%, rgba(212,165,116,.40), rgba(212,165,116,0) 74%);
  mix-blend-mode:multiply;
  animation:leak 20s ease-in-out infinite alternate;
}

/* 胶片颗粒 */
body::after{
  content:"";
  position:fixed;
  inset:0;
  z-index:60;
  pointer-events:none;
  opacity:.17;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23g)' opacity='0.55'/%3E%3C/svg%3E");
}

@keyframes leak{
  0%{transform:translate3d(0,0,0) scale(1)}
  100%{transform:translate3d(-2%,1.5%,0) scale(1.07)}
}
@keyframes vhs{
  0%,94%{transform:none;opacity:1}
  95%{transform:skewX(-1.3deg) translateX(4px);opacity:.88}
  96%{transform:none}
  97%{transform:translateX(-3px)}
  98%{transform:none}
}

a:focus-visible,
button:focus-visible{outline:3px solid var(--rust);outline-offset:2px}

.skip{
  position:absolute;
  left:-9999px;
  top:0;
  z-index:90;
  background:var(--ink);
  color:var(--cream);
  padding:12px 18px;
  font-weight:700;
}
.skip:focus{left:10px;top:10px}

/* 顶栏 */
.head{
  position:sticky;
  top:0;
  z-index:50;
  background:var(--cream);
  border-bottom:2px solid var(--ink);
}
.bar{
  max-width:1180px;
  margin:0 auto;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:10px 16px;
}
.brand-dot{
  width:40px;
  height:40px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  background:var(--ink);
  color:var(--cream);
  border-radius:50%;
  text-decoration:none;
  font-family:'Lexend Mega',sans-serif;
  font-weight:800;
  font-size:18px;
  line-height:1;
}
.burger{
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:40px;
  padding:8px 15px;
  border:2px solid var(--ink);
  border-radius:999px;
  background:transparent;
  color:var(--ink);
  font:inherit;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
}
.burger-box{display:grid;gap:3px;width:18px}
.burger-box i{display:block;height:2px;background:var(--ink);transition:transform .25s ease,opacity .25s ease}
.burger[aria-expanded="true"] .burger-box i:nth-child(1){transform:translateY(5px) rotate(45deg)}
.burger[aria-expanded="true"] .burger-box i:nth-child(2){opacity:0}
.burger[aria-expanded="true"] .burger-box i:nth-child(3){transform:translateY(-5px) rotate(-45deg)}

.rail{
  display:flex;
  gap:2px;
  overflow-x:auto;
  padding:0 8px;
  background:var(--ink);
}
.rail a{
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  min-height:44px;
  padding:0 13px;
  color:var(--cream);
  text-decoration:none;
  font-size:16px;
  font-weight:600;
  white-space:nowrap;
  border-bottom:3px solid transparent;
  transition:background .2s ease,color .2s ease;
}
.rail a:hover,
.rail a:focus-visible,
.rail a.active{
  background:var(--tan);
  color:var(--ink);
  border-bottom-color:var(--cream);
}

/* 全屏遮罩菜单 */
.overlay{
  position:fixed;
  inset:0;
  z-index:40;
  background:var(--paper);
  transform:translateY(-101%);
  transition:transform .45s cubic-bezier(.6,.02,.2,1);
  overflow:auto;
  padding:calc(var(--head) + 20px) 18px 40px;
}
.overlay.open{transform:none}
.ov ol{list-style:none;margin:0 auto;padding:0;display:grid;gap:2px;max-width:640px}
.ov a{
  display:flex;
  align-items:center;
  gap:12px;
  min-height:54px;
  padding:6px 2px;
  border-bottom:1px solid var(--line);
  color:var(--ink);
  text-decoration:none;
  font-family:'Lexend Mega',sans-serif;
  font-weight:800;
  font-size:clamp(20px,6vw,30px);
  line-height:1.2;
}
.ov a:hover{color:var(--rust)}
.ov-n{font-size:16px;font-weight:700;color:#906f45;min-width:28px}
body.lock{overflow:hidden}

/* 版心 */
.shell{
  max-width:1180px;
  margin:0 auto;
  padding:22px 16px 60px;
  display:grid;
  grid-template-columns:200px minmax(0,1fr);
  gap:26px;
  align-items:start;
  position:relative;
  z-index:1;
}

.toc{
  position:sticky;
  top:calc(var(--head) + 14px);
  background:var(--paper2);
  border-radius:22px;
  padding:10px;
}
.toc ol{list-style:none;margin:0;padding:0}
.toc a{
  display:flex;
  align-items:center;
  min-height:40px;
  padding:4px 9px;
  color:var(--ink);
  text-decoration:none;
  font-size:16px;
  line-height:1.3;
  border-bottom:1px dashed var(--line);
  border-radius:12px;
}
.toc li:last-child a{border-bottom:0}
.toc a:hover{background:var(--tan)}

main{min-width:0;scroll-margin-top:calc(var(--head) + 12px)}

.hero{
  position:relative;
  overflow:hidden;
  display:grid;
  gap:20px;
  min-height:45vh;
  padding:8px 0 6px;
}
.hero h1{
  margin:0;
  font-family:'Lexend Mega',sans-serif;
  font-weight:800;
  font-size:clamp(30px,7vw,56px);
  line-height:1.06;
  letter-spacing:-.01em;
  animation:vhs 9s steps(1) infinite;
}
.hero h1 + hr{
  width:76px;
  height:4px;
  border:0;
  background:var(--ink);
  margin:18px 0 0;
}

.shots{position:relative;height:262px}
.shot{
  position:absolute;
  margin:0;
  width:62%;
  padding:9px 9px 30px;
  background:var(--white);
  border-radius:4px;
  box-shadow:7px 9px 0 rgba(38,33,23,.22);
  transform:rotate(-4deg);
}
.shot.s1{left:0;top:0}
.shot.s2{right:0;top:62px;width:55%;transform:rotate(5deg);z-index:2}
.shot img{
  display:block;
  width:100%;
  height:170px;
  object-fit:cover;
  filter:sepia(.3) contrast(1.06) saturate(.85);
}

.prose{display:grid;gap:20px;padding-top:26px}

article section[id]{
  background:var(--paper);
  border-radius:var(--r);
  padding:24px 20px;
  scroll-margin-top:calc(var(--head) + 16px);
}
article section[id] h2,
.prose > h2{
  font-family:'Lexend Mega',sans-serif;
  font-weight:800;
  font-size:clamp(21px,3.4vw,30px);
  line-height:1.22;
  letter-spacing:-.01em;
  margin:0 0 10px;
}
article section[id] h2 + hr,
.prose > h2 + hr{
  width:56px;
  height:3px;
  border:0;
  background:var(--ink);
  margin:0 0 16px;
}
article section[id] h3{
  font-family:'Lexend Mega',sans-serif;
  font-weight:800;
  font-size:20px;
  line-height:1.3;
  margin:22px 0 8px;
}
article section[id] p{margin:0 0 14px}
article section[id] p:last-child{margin-bottom:0}
article section[id] a{color:var(--rust);text-decoration-thickness:2px;text-underline-offset:3px}
article section[id] ul,
article section[id] ol{padding-left:22px;margin:0 0 14px}
article section[id] li{margin:0 0 8px}
article section[id] hr{
  border:0;
  height:2px;
  background:var(--line);
  margin:20px 0;
}
article section[id] blockquote{
  margin:0 0 14px;
  padding:10px 16px;
  border-left:5px solid var(--tan);
  background:var(--paper2);
  border-radius:0 14px 14px 0;
}

/* 页脚 */
footer{
  position:relative;
  z-index:1;
  margin-top:24px;
  padding:38px 16px 22px;
  background:var(--ink);
  color:var(--cream);
  border-radius:var(--r) var(--r) 0 0;
}
.foot-grid{
  max-width:1180px;
  margin:0 auto;
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:18px;
}
footer dl{margin:0}
footer dt{
  font-family:'Lexend Mega',sans-serif;
  font-weight:800;
  font-size:16px;
  color:var(--tan);
  margin-bottom:6px;
}
footer dd{margin:0}
footer a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  color:var(--cream);
  text-decoration:none;
  font-size:16px;
  border-bottom:1px solid rgba(245,230,200,.3);
}
footer a:hover{color:var(--tan)}
.foot-copy{
  max-width:1180px;
  margin:26px auto 0;
  padding-top:14px;
  border-top:1px solid rgba(245,230,200,.25);
  font-size:16px;
}

@media (min-width:820px){
  .hero{
    grid-template-columns:1.05fr .95fr;
    align-items:center;
  }
}

@media (max-width:819px){
  .shell{grid-template-columns:minmax(0,1fr);gap:18px}
  .toc{position:static;background:transparent;padding:0}
  .toc ol{display:flex;flex-wrap:wrap;gap:6px}
  .toc a{
    min-height:40px;
    padding:4px 13px;
    background:var(--paper2);
    border:0;
    border-radius:999px;
    line-height:1.2;
  }
  .toc a:hover{background:var(--tan)}
  .shots{height:236px}
  .shot img{height:150px}
  .foot-grid{grid-template-columns:minmax(0,1fr);gap:10px}
}

@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *,
  *::before,
  *::after{animation:none !important;transition:none !important}
}

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