:root{
  --paper:#f5e6c8;
  --paper-lit:#f8ecd4;
  --paper-deep:#ead7b2;
  --ochre:#d4a574;
  --ochre-deep:#bd8752;
  --ink:#262117;
  --ink-soft:#4d4130;
  --rail:216px;
  --edge:2px;
}

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

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

body{
  margin:0;
  font-family:'Inter',-apple-system,BlinkMacSystemFont,'PingFang SC','Hiragino Sans GB','Microsoft YaHei',sans-serif;
  font-size:17px;
  line-height:1.72;
  color:var(--ink);
  background-color:var(--paper);
  background-image:
    radial-gradient(72vw 52vh at 88% 3%,rgba(212,165,116,.52),transparent 72%),
    radial-gradient(64vw 46vh at -4% 62%,rgba(255,251,238,.78),transparent 70%),
    linear-gradient(180deg,rgba(245,230,200,0) 0%,rgba(234,215,178,.5) 100%);
  background-attachment:fixed;
  background-repeat:no-repeat;
}

h1,h2,h3,h4,p,ul,ol,figure,blockquote{ margin:0 }

a{ color:var(--ink) }

img{ max-width:100% }

body::after{
  content:"";
  position:fixed;
  inset:-24px;
  z-index:30;
  pointer-events:none;
  opacity:.15;
  mix-blend-mode:multiply;
  background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  animation:grain 1.5s steps(4) infinite;
}

@keyframes grain{
  0%{ transform:translate(0,0) }
  25%{ transform:translate(-9px,7px) }
  50%{ transform:translate(6px,-8px) }
  75%{ transform:translate(-5px,-4px) }
  100%{ transform:translate(0,0) }
}

/* ---------- 左侧竖排胶囊导航 ---------- */

.rail{
  position:fixed;
  top:0;
  left:0;
  bottom:0;
  width:var(--rail);
  z-index:20;
  display:flex;
  flex-direction:column;
  gap:18px;
  padding:22px 18px;
  border-right:var(--edge) solid var(--ink);
  background:var(--paper-deep);
  background-image:linear-gradient(180deg,rgba(255,248,232,.6),rgba(212,165,116,.28));
  overflow-y:auto;
}

.rail__brand{
  display:flex;
  align-items:center;
  gap:10px;
  min-height:48px;
  padding-bottom:14px;
  border-bottom:var(--edge) solid var(--ink);
  text-decoration:none;
  color:var(--ink);
  font-weight:600;
  font-size:1.05rem;
  letter-spacing:-.01em;
}

.rail__logo{
  width:44px;
  height:44px;
  flex:0 0 auto;
  object-fit:cover;
  border:var(--edge) solid var(--ink);
  border-radius:4px;
  background:var(--paper-lit);
  filter:sepia(.28) saturate(.9);
}

.rail__mark{
  width:44px;
  height:44px;
  flex:0 0 auto;
  display:grid;
  place-items:center;
  border:var(--edge) solid var(--ink);
  border-radius:4px;
  background:var(--ochre);
  font-weight:600;
}

.rail__name{ line-height:1.2 }

.rail__nav ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.rail__nav a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:10px 15px;
  border:var(--edge) solid var(--ink);
  border-radius:999px;
  background:var(--paper-lit);
  color:var(--ink);
  font-size:1rem;
  line-height:1.3;
  text-decoration:none;
  transition:background .18s ease,transform .18s ease,color .18s ease;
}

.rail__nav a:hover,
.rail__nav a:focus-visible{
  background:var(--ochre);
  transform:translateX(3px);
}

.rail__foot{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:2px;
  padding-top:14px;
  border-top:var(--edge) solid var(--ink);
  font-size:1rem;
  line-height:1.4;
  word-break:break-all;
}

.rail__label{ font-weight:600; letter-spacing:.04em }

.rail__host{ color:var(--ink-soft) }

/* ---------- 主体网格 ---------- */

.page{
  margin-left:var(--rail);
  max-width:1140px;
  padding:26px clamp(16px,4vw,40px) 72px;
  display:grid;
  grid-template-columns:minmax(0,1fr) 232px;
  gap:36px;
  align-items:start;
}

.prose{ min-width:0 }

/* ---------- 头图 ---------- */

.hero{
  position:relative;
  overflow:hidden;
  min-height:70vh;
  display:flex;
  align-items:flex-end;
  padding:56px clamp(20px,4vw,48px) 84px;
  border:var(--edge) solid var(--ink);
  border-radius:4px 4px 140px 4px;
  background:
    radial-gradient(120% 96% at 100% 0%,rgba(212,165,116,.92),transparent 62%),
    linear-gradient(158deg,var(--paper) 0%,var(--paper-deep) 52%,var(--ochre) 100%);
  filter:sepia(.18) contrast(1.03) saturate(.92);
}

.hero__media{
  position:absolute;
  inset:0;
  z-index:0;
}

.hero__shot{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  filter:sepia(.34) contrast(1.06) saturate(.82);
}

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  background:linear-gradient(0deg,rgba(245,230,200,.94) 0%,rgba(245,230,200,.34) 46%,rgba(245,230,200,0) 80%);
}

.hero::after{
  content:"";
  position:absolute;
  inset:0;
  z-index:1;
  pointer-events:none;
  opacity:.4;
  mix-blend-mode:multiply;
  background:repeating-linear-gradient(0deg,rgba(38,33,23,.16) 0 1px,transparent 1px 4px);
  animation:vhs 8s ease-in-out infinite;
}

@keyframes vhs{
  0%,86%,100%{ transform:translateY(0) skewY(0); opacity:.32 }
  90%{ transform:translateY(-5px) skewY(.45deg); opacity:.72 }
  94%{ transform:translateY(4px) skewY(-.35deg); opacity:.48 }
}

.hero__copy{
  position:relative;
  z-index:2;
  max-width:22ch;
}

.hero h1{
  font-size:clamp(2.1rem,6.6vw,3.9rem);
  line-height:1.08;
  font-weight:600;
  letter-spacing:-.025em;
  text-shadow:0 2px 0 rgba(245,230,200,.62);
  word-break:break-word;
}

/* ---------- 正文 ---------- */

.entry{ padding-top:6px }

.entry > div{
  padding:44px 0 38px;
  border-bottom:var(--edge) dashed rgba(38,33,23,.3);
  scroll-margin-top:18px;
}

.entry > div:first-child{ padding-top:38px }

.entry > div:last-child{ border-bottom:0 }

.entry h2{
  font-size:clamp(1.45rem,3.3vw,2.05rem);
  line-height:1.22;
  font-weight:600;
  letter-spacing:-.015em;
  margin:0 0 8px;
}

.entry h3{
  font-size:clamp(1.15rem,2.2vw,1.4rem);
  line-height:1.3;
  font-weight:600;
  margin:26px 0 6px;
}

.entry hr{
  border:0;
  height:4px;
  width:100px;
  margin:0 0 22px;
  background:linear-gradient(90deg,var(--ink) 0%,var(--ochre-deep) 62%,rgba(212,165,116,0) 100%);
}

.entry p{
  max-width:64ch;
  margin:0 0 18px;
  color:var(--ink-soft);
}

.entry p:last-child{ margin-bottom:0 }

.entry a{
  color:var(--ink);
  text-decoration:underline;
  text-decoration-thickness:2px;
  text-decoration-color:var(--ochre-deep);
  text-underline-offset:3px;
}

.entry a:hover{ background:rgba(212,165,116,.45) }

.entry ul,
.entry ol{
  margin:0 0 18px;
  padding-left:1.3em;
  max-width:64ch;
}

.entry li{ margin-bottom:8px; color:var(--ink-soft) }

.entry blockquote{
  margin:0 0 20px;
  padding:14px 18px;
  border-left:6px solid var(--ochre);
  border-radius:4px;
  background:var(--paper-deep);
}

.entry blockquote p:last-child{ margin-bottom:0 }

.entry figure{ margin:0 0 20px }

.entry img{
  display:block;
  max-width:100%;
  height:auto;
  padding:7px;
  border:var(--edge) solid var(--ink);
  border-radius:4px;
  background:#fdf6e6;
  filter:sepia(.24) saturate(.9);
}

.entry figcaption{
  font-size:1rem;
  color:var(--ink-soft);
  margin-top:6px;
}

.entry table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 20px;
  font-size:1rem;
}

.entry th,
.entry td{
  border:var(--edge) solid var(--ink);
  padding:8px 10px;
  text-align:left;
  vertical-align:top;
}

.entry th{ background:var(--paper-deep) }

/* ---------- 右侧边栏 ---------- */

.panel{
  position:sticky;
  top:28px;
  align-self:start;
  display:flex;
  flex-direction:column;
  gap:12px;
  padding-top:34px;
}

.panel__card{
  border:var(--edge) solid var(--ink);
  border-radius:4px;
  padding:14px;
  background:var(--paper-lit);
}

.panel__label{
  font-weight:600;
  letter-spacing:.1em;
  font-size:1rem;
  margin:0 0 2px;
}

.panel__host{
  color:var(--ink-soft);
  font-size:1rem;
  line-height:1.45;
  word-break:break-all;
  margin:0;
}

.panel__top{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:44px;
  padding:8px 12px;
  border:var(--edge) solid var(--ink);
  border-radius:999px;
  background:var(--paper-lit);
  color:var(--ink);
  font-size:1rem;
  text-decoration:none;
  transition:background .18s ease;
}

.panel__top:hover,
.panel__top:focus-visible{ background:var(--ochre) }

/* ---------- 页脚 ---------- */

.foot{
  margin-left:var(--rail);
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px 20px;
  padding:16px clamp(16px,4vw,40px);
  border-top:var(--edge) solid var(--ink);
  background:var(--paper-deep);
  font-size:1rem;
  line-height:1.4;
}

.foot__brand{
  display:flex;
  align-items:center;
  gap:8px;
  font-weight:600;
}

.foot__mark{
  display:grid;
  place-items:center;
  width:30px;
  height:30px;
  border:var(--edge) solid var(--ink);
  border-radius:4px;
  background:var(--ochre);
  font-size:1rem;
}

.foot__nav{ min-width:0 }

.foot__nav ul{
  list-style:none;
  margin:0;
  padding:0;
  display:flex;
  flex-wrap:wrap;
  gap:0 14px;
}

.foot__nav a{
  display:inline-flex;
  align-items:center;
  min-height:40px;
  padding:6px 0;
  color:var(--ink);
  text-decoration:none;
  border-bottom:2px solid transparent;
}

.foot__nav a:hover,
.foot__nav a:focus-visible{ border-bottom-color:var(--ochre-deep) }

.foot__copy{
  margin-left:auto;
  color:var(--ink-soft);
}

/* ---------- 滚动显现 ---------- */

.reveal{
  opacity:0;
  transform:translateY(16px);
  transition:opacity .55s ease,transform .55s ease;
}

.reveal.is-in{
  opacity:1;
  transform:none;
}

/* ---------- 断点 ---------- */

@media (max-width:1080px){
  .page{ grid-template-columns:minmax(0,1fr) 200px; gap:26px }
}

@media (max-width:980px){
  .rail{
    top:auto;
    right:0;
    bottom:0;
    width:auto;
    height:auto;
    flex-direction:row;
    align-items:center;
    gap:10px;
    padding:8px 10px;
    border-right:0;
    border-top:var(--edge) solid var(--ink);
    overflow-x:hidden;
    overflow-y:hidden;
  }

  .rail__brand{
    flex:0 0 auto;
    min-height:44px;
    padding-bottom:0;
    border-bottom:0;
    gap:8px;
    font-size:1rem;
  }

  .rail__logo,
  .rail__mark{ width:36px; height:36px }

  .rail__nav{
    flex:1 1 auto;
    min-width:0;
    overflow-x:auto;
    overflow-y:hidden;
    -webkit-overflow-scrolling:touch;
  }

  .rail__nav ul{
    flex-direction:row;
    flex-wrap:nowrap;
    gap:8px;
  }

  .rail__nav a{
    white-space:nowrap;
    min-height:44px;
    padding:8px 13px;
  }

  .rail__foot{ display:none }

  .page{
    margin-left:0;
    grid-template-columns:minmax(0,1fr);
    gap:22px;
    padding:16px 16px 64px;
  }

  .panel{
    position:static;
    flex-direction:row;
    flex-wrap:wrap;
    align-items:center;
    padding-top:0;
  }

  .panel__card{ flex:1 1 160px }

  .foot{
    margin-left:0;
    padding:14px 16px 96px;
    gap:8px 14px;
    font-size:1rem;
  }

  .foot__copy{ margin-left:0; flex:1 1 100% }

  .hero{
    min-height:64vh;
    padding:40px 20px 64px;
    border-radius:4px 4px 90px 4px;
  }

  .hero__copy{ max-width:none }

  .entry > div{ padding:34px 0 30px }
}

@media (max-width:420px){
  body{ font-size:17px }
  .hero{ min-height:58vh }
  .foot__nav ul{ gap:0 12px }
}

@media (prefers-reduced-motion:reduce){
  html{ scroll-behavior:auto }
  body::after{ animation:none }
  .hero::after{ animation:none }
  .rail__nav a,
  .panel__top,
  .reveal{ transition:none }
  .reveal{ opacity:1; transform:none }
}

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