@import url('https://fonts.googleapis.com/css2?family=Space+Mono:wght@400;700&display=swap');

:root{
  --paper:#f5e6c8;
  --paper-2:#efe0c1;
  --tan:#d4a574;
  --tan-hi:#e2b98d;
  --ink:#262117;
  --ink-2:#4a3d2c;
  --line:rgba(38,33,23,.26);
  --r:18px;
}

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

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

body{
  margin:0;
  background-color:var(--paper);
  background-image:radial-gradient(circle at 50% -12%, rgba(212,165,116,.42), transparent 60%);
  color:var(--ink);
  font-family:"Space Mono",ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  font-size:16px;
  line-height:1.75;
  letter-spacing:.005em;
}

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

/* ---------- 胶片层：漏光 + 颗粒 ---------- */
body::before{
  content:"";
  position:fixed;
  inset:-12%;
  z-index:0;
  pointer-events:none;
  opacity:.85;
  background:
    radial-gradient(38% 34% at 88% 5%, rgba(255,214,160,.8), transparent 68%),
    radial-gradient(30% 26% at 4% 78%, rgba(255,196,140,.5), transparent 72%),
    radial-gradient(26% 22% at 62% 98%, rgba(255,228,186,.45), transparent 72%);
  animation:leak 17s ease-in-out infinite alternate;
}

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

@keyframes leak{
  from{ transform:translate3d(0,0,0) scale(1); opacity:.6; }
  to{ transform:translate3d(-2%,1.5%,0) scale(1.08); opacity:.95; }
}

@keyframes vhs{
  0%{ transform:translateY(-24vh); opacity:0; }
  12%{ opacity:.55; }
  100%{ transform:translateY(110vh); opacity:0; }
}

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

/* ---------- 跳转 ---------- */
.skip{ position:absolute; left:-9999px; top:0; }
.skip:focus{
  left:12px; top:8px; z-index:95;
  padding:9px 16px;
  background:var(--ink);
  color:var(--paper);
  border-radius:999px;
  text-decoration:none;
}

/* ---------- 顶部细条 ---------- */
.ticker{
  background:var(--ink);
  color:var(--paper);
  padding:7px clamp(14px,4vw,30px);
  overflow:hidden;
  border-bottom:1px solid var(--ink);
}
.ticker p{
  margin:0;
  font-size:16px;
  line-height:1.5;
  letter-spacing:.34em;
  white-space:nowrap;
  color:rgba(245,230,200,.9);
}

/* ---------- 顶栏 ---------- */
.bar{
  position:sticky;
  top:0;
  z-index:40;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:9px clamp(12px,4vw,30px);
  background:rgba(245,230,200,.9);
  -webkit-backdrop-filter:blur(8px) saturate(.9);
  backdrop-filter:blur(8px) saturate(.9);
  border-bottom:1px solid var(--line);
}

.mark{
  flex:0 0 auto;
  display:grid;
  place-items:center;
  width:44px;
  height:44px;
  border:2px solid var(--ink);
  border-radius:50%;
  background:var(--tan);
  color:var(--ink);
  font-weight:700;
  font-size:18px;
  line-height:1;
  text-decoration:none;
  transition:transform .25s ease, background .25s ease;
}
.mark img{ width:24px; height:24px; object-fit:contain; }
.mark:hover{ transform:rotate(-9deg) scale(1.07); background:var(--tan-hi); }

.navd{ position:relative; }

.navd summary{
  list-style:none;
  display:inline-flex;
  align-items:center;
  gap:9px;
  min-height:44px;
  padding:0 20px;
  border:2px solid var(--ink);
  border-radius:999px;
  background:var(--paper);
  color:var(--ink);
  font-size:16px;
  line-height:1;
  cursor:pointer;
  transition:background .2s ease;
}
.navd summary::-webkit-details-marker{ display:none; }
.navd summary::after{
  content:"";
  width:9px;
  height:9px;
  border-right:2px solid currentColor;
  border-bottom:2px solid currentColor;
  transform:rotate(45deg) translateY(-2px);
  transition:transform .25s ease;
}
.navd[open] summary::after{ transform:rotate(-135deg) translateY(-2px); }
.navd summary:hover{ background:var(--tan); }

.navmenu{
  position:absolute;
  right:0;
  top:calc(100% + 10px);
  z-index:50;
  width:min(78vw,250px);
  margin:0;
  padding:8px;
  list-style:none;
  display:grid;
  gap:4px;
  background:var(--paper-2);
  border:2px solid var(--ink);
  border-radius:var(--r);
  border-bottom-width:7px;
  box-shadow:7px 7px 0 rgba(38,33,23,.18);
}
.navmenu li{ list-style:none; }
.navmenu li a{
  display:flex;
  align-items:center;
  min-height:44px;
  padding:2px 14px;
  border-radius:12px;
  border-bottom:2px solid transparent;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
}
.navmenu li a:hover,
.navmenu li a:focus-visible{
  background:var(--tan);
  border-bottom-color:var(--ink);
}

/* ---------- 头图 ---------- */
.hero{
  position:relative;
  isolation:isolate;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  justify-content:flex-end;
  min-height:70vh;
  padding:clamp(48px,9vw,88px) clamp(16px,6vw,56px) clamp(64px,11vw,104px);
  background:var(--tan);
  border-radius:0 0 42% 42% / 0 0 9% 9%;
}
.hero-bare{ background:linear-gradient(160deg,#4a3d2c,#262117 70%); }

.hero::before{
  content:"";
  position:absolute;
  inset:0;
  z-index:-2;
  opacity:.45;
  mix-blend-mode:multiply;
  background-size:18px 18px;
  background-image:radial-gradient(rgba(38,33,23,.75) 1px, transparent 1.5px);
}

.hero-img{
  position:absolute;
  inset:0;
  z-index:-3;
  width:100%;
  height:100%;
  object-fit:cover;
  filter:sepia(.58) saturate(.82) contrast(1.06);
}

.hero-veil{
  position:absolute;
  inset:0;
  z-index:-1;
  background:linear-gradient(180deg, rgba(38,33,23,.06) 0%, rgba(38,33,23,.3) 42%, rgba(38,33,23,.82) 100%);
}

.hero::after{
  content:"";
  position:absolute;
  left:0;
  right:0;
  height:22vh;
  z-index:0;
  pointer-events:none;
  background:linear-gradient(180deg, transparent, rgba(255,255,255,.15), transparent);
  animation:vhs 9s linear infinite;
}

.hero-txt{ position:relative; z-index:2; max-width:780px; color:var(--paper); }

.hero h1{
  margin:0;
  font-size:clamp(2rem,8vw,3.5rem);
  line-height:1.16;
  letter-spacing:-.02em;
  text-shadow:0 2px 18px rgba(38,33,23,.55);
}

.hero-sub{
  margin:16px 0 0;
  max-width:54ch;
  font-size:16px;
  line-height:1.7;
  color:rgba(245,230,200,.88);
}

/* ---------- 主体 ---------- */
main{
  max-width:1140px;
  margin:0 auto;
  padding:clamp(30px,6vw,60px) clamp(14px,4vw,36px) 0;
}

.sheet{
  --railw:186px;
  --railgap:clamp(22px,3.4vw,46px);
  position:relative;
  padding-left:calc(var(--railw) + var(--railgap));
}

/* ---------- 侧栏 ---------- */
.rail{
  position:absolute;
  left:0;
  top:4px;
  width:var(--railw);
  padding:14px 12px 16px;
  background:var(--paper-2);
  border:2px solid var(--ink);
  border-bottom-width:7px;
  border-radius:var(--r);
  color:var(--ink);
}
.rail-cap{
  margin:0 0 8px;
  font-size:16px;
  line-height:1.4;
  letter-spacing:.18em;
  color:var(--ink-2);
}
.rail-list{
  margin:0;
  padding:0;
  list-style:none;
  display:grid;
  gap:2px;
}
.rail-list li{ list-style:none; }
.rail-list a{
  display:block;
  min-height:40px;
  padding:8px;
  border-bottom:1px solid var(--line);
  border-radius:9px;
  font-size:16px;
  line-height:1.4;
  text-decoration:none;
}
.rail-list a:hover{ background:var(--tan); }

/* ---------- 正文区 ---------- */
.sheet-head h2{
  margin:0;
  font-size:clamp(1.15rem,3vw,1.5rem);
  line-height:1.4;
  letter-spacing:.02em;
}
.sheet-head hr{
  margin:10px 0 0;
  border:0;
  height:3px;
  background:linear-gradient(90deg,var(--ink) 0 20%, var(--tan) 20% 100%);
}

.sheet > div{
  scroll-margin-top:96px;
  padding:clamp(26px,5vw,44px) 0;
  border-bottom:1px solid var(--line);
  animation:rise .5s ease both;
}
.sheet > div:last-child{ border-bottom:0; padding-bottom:0; }

.sheet h2{
  margin:0 0 6px;
  font-size:clamp(1.45rem,4.2vw,2.1rem);
  line-height:1.28;
  letter-spacing:-.015em;
}
.sheet h2 + hr{
  margin:0 0 22px;
  border:0;
  height:3px;
  background:linear-gradient(90deg,var(--ink) 0 15%, var(--tan) 15% 100%);
}
.sheet h3{
  margin:34px 0 10px;
  font-size:clamp(1.15rem,2.8vw,1.35rem);
  line-height:1.42;
}
.sheet h3 + hr{
  margin:0 0 16px;
  border:0;
  height:2px;
  background:var(--tan);
}
.sheet h4{
  margin:26px 0 8px;
  font-size:16px;
  line-height:1.5;
  letter-spacing:.04em;
}

.sheet p,
.sheet ul,
.sheet ol,
.sheet blockquote{ margin:0 0 18px; }
.sheet p{ max-width:66ch; }
.sheet ul,
.sheet ol{ max-width:62ch; padding-left:1.4em; }
.sheet li{ margin-bottom:8px; }
.sheet li::marker{ color:var(--ink-2); }

.sheet blockquote{
  padding:14px 18px;
  border-left:5px solid var(--tan);
  border-radius:0 var(--r) var(--r) 0;
  background:var(--paper-2);
}
.sheet blockquote p:last-child{ margin-bottom:0; }

.sheet a{
  text-decoration:none;
  border-bottom:2px solid var(--tan-hi);
}
.sheet a:hover{ background:var(--tan); }

.sheet strong{ font-weight:700; }

.sheet img{
  margin:24px 0;
  max-width:100%;
  height:auto;
  background:#fff;
  border:10px solid #fff;
  border-bottom-width:34px;
  border-radius:2px;
  box-shadow:0 12px 26px rgba(38,33,23,.22);
  filter:sepia(.32) saturate(.92);
  transform:rotate(-.6deg);
}

.sheet code,
.sheet pre{
  font-family:inherit;
  background:var(--paper-2);
  border-radius:6px;
}
.sheet code{ padding:1px 5px; }
.sheet pre{ padding:14px; overflow-x:auto; }

.sheet table{
  width:100%;
  border-collapse:collapse;
  margin:0 0 20px;
  font-size:16px;
}
.sheet th,
.sheet td{
  border:1px solid var(--line);
  padding:9px 11px;
  text-align:left;
  vertical-align:top;
}
.sheet th{ background:var(--paper-2); }

.sheet hr{
  border:0;
  height:1px;
  margin:26px 0;
  background:var(--line);
}

/* ---------- 页脚 ---------- */
.foot{
  margin-top:clamp(48px,8vw,96px);
  padding:clamp(38px,7vw,66px) clamp(16px,5vw,48px) 30px;
  background:var(--ink);
  color:var(--paper);
  border-top:6px solid var(--tan);
  display:flex;
  flex-wrap:wrap;
  align-items:flex-end;
  justify-content:space-between;
  gap:18px 28px;
}
.foot-big{
  flex:1 1 auto;
  margin:0 0 16px;
  padding-bottom:18px;
  border-bottom:2px solid var(--tan);
  font-size:clamp(1.6rem,6vw,2.9rem);
  font-weight:700;
  line-height:1.16;
  letter-spacing:-.01em;
}
.foot-note{
  flex:0 0 auto;
  font-size:16px;
  line-height:1.5;
  color:rgba(245,230,200,.66);
}

/* ---------- 交互 ---------- */
@media (prefers-reduced-motion: no-preference){
  .navd[open] .navmenu li{ animation:rise .26s ease both; }
  .navd[open] .navmenu li:nth-child(1){ animation-delay:0s; }
  .navd[open] .navmenu li:nth-child(2){ animation-delay:.035s; }
  .navd[open] .navmenu li:nth-child(3){ animation-delay:.07s; }
  .navd[open] .navmenu li:nth-child(4){ animation-delay:.105s; }
  .navd[open] .navmenu li:nth-child(5){ animation-delay:.14s; }
  .navd[open] .navmenu li:nth-child(6){ animation-delay:.175s; }
  .navd[open] .navmenu li:nth-child(7){ animation-delay:.21s; }
}

/* ---------- 断点 ---------- */
@media (max-width:880px){
  .sheet{ padding-left:0; }
  .rail{
    position:static;
    width:auto;
    margin-bottom:28px;
  }
  .rail-list{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .hero{ min-height:64vh; border-radius:0 0 34% 34% / 0 0 7% 7%; }
}

@media (max-width:560px){
  .hero{ padding-bottom:clamp(52px,14vw,74px); }
  .hero h1{ font-size:clamp(1.85rem,9vw,2.4rem); }
  .ticker p{ letter-spacing:.24em; }
  .sheet p,
  .sheet ul,
  .sheet ol{ max-width:none; }
  .sheet img{ border-width:8px; border-bottom-width:26px; }
  .foot{ padding-bottom:24px; }
}

@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior:auto; }
  *,
  *::before,
  *::after{
    animation-duration:.01ms !important;
    animation-iteration-count:1 !important;
    transition-duration:.01ms !important;
  }
}

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