:root{
  --paper:#f5e6c8;
  --clay:#d4a574;
  --ink:#262117;
  --cream:#fff7e6;
  --line:rgba(38,33,23,.18);
  --muted:#7b6a51;
  --nav-w:252px;
  --r:18px;
}
*,*::before,*::after{box-sizing:border-box}
html{scroll-behavior:smooth;-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:'Inter',system-ui,-apple-system,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  font-size:17px;
  line-height:1.75;
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}
body::before{
  content:"";position:fixed;inset:0;z-index:70;pointer-events:none;
  opacity:.16;mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)' opacity='0.5'/%3E%3C/svg%3E");
}
body::after{
  content:"";position:fixed;inset:0;z-index:0;pointer-events:none;
  background:
    radial-gradient(58% 40% at 88% -6%,rgba(212,165,116,.5),transparent 72%),
    radial-gradient(46% 34% at 4% 102%,rgba(212,165,116,.32),transparent 72%);
}
a{color:inherit}
svg{display:block}
:focus-visible{outline:2px solid var(--clay);outline-offset:2px}

/* ---------- 左侧竖排导航 ---------- */
.side-nav{
  position:fixed;inset:0 auto 0 0;width:var(--nav-w);z-index:40;
  display:flex;flex-direction:column;gap:14px;
  padding:24px 16px 26px;
  background:linear-gradient(180deg,#2c2619 0%,#262117 55%,#211c14 100%);
  color:var(--paper);
  border-right:1px solid rgba(245,230,200,.16);
  overflow-y:auto;
  box-shadow:12px 0 34px -30px rgba(0,0,0,.9);
}
.brand{
  display:flex;align-items:center;gap:10px;
  min-height:44px;padding:6px 4px;
  color:var(--paper);text-decoration:none;
  font-weight:600;font-size:16px;letter-spacing:.02em;
}
.brand .mark,.brand img{width:34px;height:34px;flex:0 0 auto;color:var(--clay)}
.brand-img{border-radius:8px;object-fit:cover}
.mark{fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round}
.brand:hover .mark{transform:rotate(28deg);transition:transform .6s ease}

.find{
  display:flex;align-items:center;gap:6px;
  background:rgba(245,230,200,.08);
  border:1px solid rgba(245,230,200,.22);
  border-radius:999px;padding:2px 4px 2px 12px;
}
.find input{
  flex:1;min-width:0;min-height:40px;
  background:none;border:0;outline:none;
  color:var(--paper);font:inherit;font-size:16px;
}
.find input::placeholder{color:rgba(245,230,200,.55)}
.find input::-webkit-search-cancel-button{filter:invert(1) opacity(.5)}
.find button{
  flex:0 0 auto;width:40px;height:40px;display:grid;place-items:center;
  border:0;border-radius:999px;cursor:pointer;
  background:rgba(212,165,116,.2);color:var(--paper);
  transition:background .25s ease;
}
.find button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round}
.find button:hover{background:var(--clay);color:var(--ink)}

.nav-links{display:flex;flex-direction:column;gap:3px;margin-top:2px}
.nav-link{
  display:flex;align-items:center;gap:10px;
  min-height:44px;padding:10px 10px;
  border-radius:12px;
  color:rgba(245,230,200,.86);text-decoration:none;
  font-size:16px;line-height:1.4;
  transition:background .25s ease,color .25s ease,transform .25s ease;
}
.nav-link svg{width:18px;height:18px;flex:0 0 auto;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;stroke-linejoin:round;opacity:.72}
.nav-link:hover{background:rgba(212,165,116,.18);color:var(--cream);transform:translateX(3px)}
.nav-link:hover svg{opacity:1}

/* ---------- 主区 ---------- */
main{margin-left:var(--nav-w);position:relative;z-index:1}
.wrap{max-width:1180px;margin:0 auto;padding:34px 34px 76px}
.stage{display:grid;grid-template-columns:minmax(0,1fr) 292px;gap:34px;align-items:start}
.doc{min-width:0}

.hero{
  position:relative;
  min-height:42vh;
  display:flex;align-items:center;
  padding:44px 0 26px;
  border-bottom:1px dashed var(--line);
}
.hero-row{display:flex;align-items:center;gap:22px;flex-wrap:wrap}
.hero h1{
  margin:0;max-width:20ch;
  font-size:clamp(29px,4.3vw,50px);
  line-height:1.16;letter-spacing:-.022em;font-weight:700;
  animation:vhs 11s steps(1,end) infinite;
}
.hero-art{width:72px;height:72px;flex:0 0 auto;fill:none;stroke:var(--ink);stroke-width:1.2;opacity:.68;transform:rotate(-7deg)}
.stamp{
  position:absolute;top:16px;right:2px;
  transform:rotate(5deg);
  background:var(--ink);color:var(--paper);
  font-size:12.5px;letter-spacing:.16em;
  padding:6px 12px;border-radius:4px;
  box-shadow:0 10px 22px -16px rgba(0,0,0,.95);
  animation:drift 10s ease-in-out infinite;
}

/* ---------- 正文 ---------- */
.doc section{padding:40px 0;border-bottom:1px dashed var(--line);scroll-margin-top:26px}
.doc section:last-child{border-bottom:0;padding-bottom:8px}
.doc p{margin:0 0 1.05em;max-width:68ch}
.doc h2,.doc h3{
  position:relative;padding-left:16px;
  line-height:1.32;letter-spacing:-.01em;
}
.doc h2{margin:0 0 .72em;font-size:clamp(22px,2.5vw,30px);font-weight:700}
.doc h3{margin:1.5em 0 .6em;font-size:19px;font-weight:600}
.doc h2::before,.doc h3::before{
  content:"";position:absolute;left:0;top:.3em;bottom:.3em;width:3px;
  background:var(--clay);border-radius:2px;
}
.doc h2 span,.doc h3 span{display:inline}
.doc a{color:#8a5323;text-decoration:underline;text-underline-offset:3px;text-decoration-color:rgba(138,83,35,.42)}
.doc a:hover{text-decoration-color:currentColor}
.doc ul,.doc ol{margin:0 0 1.1em;padding-left:1.25em}
.doc li{margin:.35em 0}
.doc li::marker{color:var(--clay)}
.doc strong{font-weight:600}
.doc img{
  max-width:100%;height:auto;display:block;margin:1.4em 0;
  border:8px solid #fffaf0;border-radius:4px;
  box-shadow:0 16px 30px -22px rgba(38,33,23,.9);
  filter:sepia(.25) contrast(1.03) saturate(.82);
}
.doc time{
  display:inline-block;
  font-size:12.5px;letter-spacing:.12em;
  color:var(--muted);
  border:1px solid var(--line);border-radius:999px;
  padding:2px 10px;
}
.doc blockquote{
  margin:0 0 1.1em;padding:14px 18px;
  border-left:3px solid var(--clay);
  background:rgba(255,247,230,.55);
  border-radius:0 12px 12px 0;
}
.doc blockquote p:last-child{margin-bottom:0}
.doc hr{border:0;border-top:1px dashed var(--line);margin:1.6em 0}
.doc table{width:100%;border-collapse:collapse;font-size:16px;margin:0 0 1.2em}
.doc th,.doc td{border:1px solid var(--line);padding:8px 10px;text-align:left}

/* ---------- 右侧栏 ---------- */
.rail{position:sticky;top:24px;display:flex;flex-direction:column;gap:16px}
.glass{
  background:rgba(255,247,231,.55);
  border:1px solid rgba(255,255,255,.62);
  border-radius:var(--r);
  padding:16px 18px;
  box-shadow:0 20px 42px -34px rgba(38,33,23,.95);
  -webkit-backdrop-filter:blur(9px) saturate(.9);
  backdrop-filter:blur(9px) saturate(.9);
}
.rail-h{
  margin:0 0 8px;font-size:13px;font-weight:600;
  letter-spacing:.2em;color:var(--muted);
}
.rail-list{list-style:none;margin:0;padding:0;counter-reset:r}
.rail-list li{display:flex;align-items:baseline;gap:8px;border-bottom:1px dotted var(--line)}
.rail-list li:last-child{border-bottom:0}
.rail-list li::before{
  counter-increment:r;content:counter(r,decimal-leading-zero);
  font-size:11px;letter-spacing:.1em;color:var(--clay);
}
.rail-list a{
  display:block;flex:1;min-height:40px;padding:9px 0;
  text-decoration:none;font-size:15.5px;line-height:1.45;
}
.rail-list a:hover{color:#8a5323}
.rail-card--up{text-align:left}
.rail-top{
  display:grid;place-items:center;
  min-height:44px;border:1px dashed var(--line);border-radius:999px;
  text-decoration:none;
  transition:background .25s ease,transform .25s ease;
}
.rail-top:hover{background:rgba(212,165,116,.35);transform:translateY(-2px)}
.ico-up{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}

/* ---------- 页脚 ---------- */
.site-foot{
  position:relative;z-index:1;margin-left:var(--nav-w);
  display:flex;flex-wrap:wrap;gap:26px;align-items:flex-start;justify-content:space-between;
  padding:36px 34px 30px;
  background:#262117;color:rgba(245,230,200,.82);
  border-top:3px solid var(--clay);
}
.foot-col{flex:1 1 180px;min-width:0}
.foot-id{display:flex;align-items:center;gap:10px;flex:0 1 auto}
.foot-mark{color:var(--clay)}
.foot-mark svg,.foot-mark img{width:32px;height:32px}
.foot-brand{margin:0;font-weight:600;font-size:16px;letter-spacing:.02em;color:var(--paper)}
.foot-cta{flex:1.5 1 240px;border:1px dashed rgba(245,230,200,.35);border-radius:var(--r);padding:16px 18px}
.cta-h{margin:0 0 10px;font-size:20px;line-height:1.3;font-weight:700;color:var(--clay);letter-spacing:-.01em}
.cta-btn{
  display:inline-flex;align-items:center;min-height:44px;padding:9px 20px;
  border-radius:999px;background:var(--clay);color:#241f16;
  text-decoration:none;font-size:15.5px;font-weight:600;
  transition:transform .25s ease,background .25s ease;
}
.cta-btn:hover{background:var(--paper);transform:translateY(-2px)}
.foot-nav dl{margin:0;display:flex;flex-direction:column}
.foot-nav dt{font-size:12.5px;letter-spacing:.18em;color:var(--clay);margin-bottom:4px}
.foot-nav dd{margin:0}
.foot-nav dd a{
  display:inline-flex;align-items:center;min-height:40px;
  text-decoration:none;font-size:15.5px;color:rgba(245,230,200,.82);
}
.foot-nav dd a:hover{color:var(--cream);text-decoration:underline;text-underline-offset:3px}
.foot-meta{flex:0 1 auto;display:flex;align-items:center;gap:14px;justify-content:flex-end}
.copy{margin:0;font-size:13.5px;letter-spacing:.04em;white-space:nowrap}
.to-top{
  display:grid;place-items:center;width:44px;height:44px;
  border:1px solid rgba(245,230,200,.4);border-radius:999px;
  text-decoration:none;transition:background .25s ease;
}
.to-top:hover{background:rgba(212,165,116,.25)}

/* ---------- 动效 ---------- */
.js .doc article{opacity:0;transform:translateY(14px);transition:opacity .6s ease,transform .6s ease}
.js .doc article.in{opacity:1;transform:none}
@keyframes vhs{
  0%,91%,100%{transform:none;text-shadow:none}
  92%{transform:translateX(-1.6px);text-shadow:2px 0 rgba(212,165,116,.85)}
  94%{transform:translateX(1.6px);text-shadow:-2px 0 rgba(38,33,23,.45)}
  96%{transform:none;text-shadow:none}
}
@keyframes drift{
  0%,100%{transform:rotate(5deg) translateY(0)}
  50%{transform:rotate(3deg) translateY(-4px)}
}

/* ---------- 窄屏 ---------- */
@media (max-width:960px){
  .side-nav{
    position:static;width:auto;flex-direction:row;flex-wrap:wrap;align-items:center;
    gap:8px;padding:10px 14px;overflow:visible;box-shadow:none;
  }
  .brand{order:1}
  .find{order:2;flex:1 1 140px;min-width:120px}
  .nav-links{
    order:3;flex-direction:row;width:100%;gap:6px;
    overflow-x:auto;padding-bottom:4px;scrollbar-width:none;
  }
  .nav-links::-webkit-scrollbar{display:none}
  .nav-link{white-space:nowrap;background:rgba(245,230,200,.08);padding:10px 12px}
  .nav-link:hover{transform:none}
  main,.site-foot{margin-left:0}
  .wrap{padding:16px 16px 48px}
  .stage{grid-template-columns:1fr;gap:24px}
  .rail{position:static;flex-direction:row;flex-wrap:wrap}
  .rail-card{flex:1 1 220px}
  .hero{min-height:0;padding:16px 0 22px}
  .stamp{position:static;display:inline-block;margin-bottom:14px;animation:none}
  .hero-art{width:52px;height:52px}
  .site-foot{padding:26px 16px;gap:20px}
  .foot-col{flex:1 1 100%}
  .foot-id{justify-content:flex-start}
  .foot-meta{justify-content:space-between}
}
@media (max-width:420px){
  body{font-size:16.5px}
  .hero h1{font-size:28px}
}
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto}
  *{animation:none!important;transition:none!important}
}

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