@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,600;0,700;0,800;1,400&display=swap');

:root {
  --cream: #f5e6c8;
  --paper: #faf1dd;
  --tan: #d4a574;
  --ink: #262117;
  --line: rgba(38, 33, 23, 0.16);
  --line-soft: rgba(38, 33, 23, 0.09);
  --rail: 120px;
}

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

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

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.82;
  letter-spacing: 0.012em;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: -20px;
  z-index: 70;
  pointer-events: none;
  opacity: 0.15;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.6'/></svg>");
  animation: grain 1.1s steps(3) infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58vw 58vh at 92% -12%, rgba(212, 165, 116, 0.5), rgba(212, 165, 116, 0) 66%),
    radial-gradient(46vw 42vh at -10% 104%, rgba(212, 165, 116, 0.34), rgba(212, 165, 116, 0) 72%);
  animation: leak 9s ease-in-out infinite;
}

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

main,
.site-foot,
.brand-mark,
.rail { position: relative; z-index: 2; }

/* ---------- 角落品牌 ---------- */
.brand-mark {
  position: fixed;
  top: 18px;
  left: 18px;
  z-index: 60;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 4px;
  background: var(--ink);
  color: var(--cream);
  text-decoration: none;
  box-shadow: 0 3px 0 0 var(--tan);
}
.brand-mark img {
  display: block;
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 2px;
}
.mark-glyph {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
}

/* ---------- 左侧竖排胶囊导航 ---------- */
.rail {
  position: fixed;
  left: 18px;
  top: 82px;
  bottom: 16px;
  width: calc(var(--rail) - 36px);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 14px 0 4px;
  border-left: 1px solid var(--line-soft);
  z-index: 50;
}
.rail-nav {
  width: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  overflow-y: auto;
  scrollbar-width: none;
}
.rail-nav::-webkit-scrollbar { display: none; }
.rail-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}
.pill {
  display: grid;
  place-items: center;
  min-width: 46px;
  min-height: 46px;
  padding: 16px 9px;
  writing-mode: vertical-rl;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(250, 241, 221, 0.74);
  color: var(--ink);
  text-decoration: none;
  font-size: 0.94rem;
  letter-spacing: 0.1em;
  transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.pill:hover,
.pill.on {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
  transform: translateX(2px);
}
.pill:focus-visible {
  outline: 2px solid var(--tan);
  outline-offset: 2px;
}

.rail-search { width: 100%; }
.srch {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(250, 241, 221, 0.8);
}
.srch::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border: 1.6px solid rgba(38, 33, 23, 0.5);
  border-radius: 50%;
}
.srch input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
  padding: 2px 0;
  outline: none;
}
.srch input::placeholder { color: rgba(38, 33, 23, 0.42); }

/* ---------- 主体 ---------- */
main {
  margin-left: var(--rail);
  padding: 0 8px 0 0;
}
.wrap {
  max-width: 840px;
  margin: 0 auto;
  padding: 0 34px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 26px;
  padding: 54px 0 8px;
  text-align: right;
}
.hero-ghost {
  position: absolute;
  top: -0.16em;
  right: -0.05em;
  font-size: clamp(3.4rem, 12.5vw, 9.5rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.05em;
  color: rgba(38, 33, 23, 0.075);
  pointer-events: none;
  white-space: nowrap;
  animation: vhs 7.5s ease-in-out infinite;
}
.hero-text { position: relative; z-index: 1; }
h1 {
  margin: 0 0 14px;
  font-size: clamp(1.85rem, 4.1vw, 2.9rem);
  line-height: 1.28;
  letter-spacing: -0.025em;
  font-weight: 800;
}
.hero-sub {
  max-width: 34em;
  margin: 0 0 0 auto;
  color: rgba(38, 33, 23, 0.74);
  font-size: 1rem;
  line-height: 1.75;
}

.hero-frame {
  margin: 0 0 6px;
  padding: 11px 11px 36px;
  background: #fffdf6;
  border-radius: 4px;
  border-bottom: 3px solid var(--tan);
  box-shadow: 0 12px 26px rgba(38, 33, 23, 0.16);
  transform: rotate(-1.1deg);
}
.hero-frame img,
.hero-img {
  display: block;
  width: 100%;
  border-radius: 2px;
  filter: sepia(0.18) contrast(1.05) saturate(0.82);
}

/* ---------- 正文 ---------- */
.film {
  padding: 54px 0 0;
}
.film::before {
  content: "";
  display: block;
  height: 1px;
  margin-bottom: 44px;
  background: linear-gradient(90deg, var(--tan), rgba(212, 165, 116, 0));
}
.prose {
  max-width: 70ch;
}
.prose > article {
  padding-bottom: 40px;
  margin-bottom: 44px;
  border-bottom: 1px dashed var(--line);
  scroll-margin-top: 26px;
}
.prose > article:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 8px;
}
.prose h2 {
  position: relative;
  margin: 0 0 24px;
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  line-height: 1.35;
  letter-spacing: -0.015em;
  font-weight: 800;
}
.prose h2 > span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--tan);
}
.prose h3 {
  margin: 30px 0 12px;
  font-size: 1.14rem;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: -0.005em;
}
.prose h3 > span {
  display: inline-block;
  color: rgba(38, 33, 23, 0.9);
}
.prose p {
  margin: 0 0 18px;
  color: rgba(38, 33, 23, 0.88);
}
.prose p:last-child { margin-bottom: 0; }
.prose ul,
.prose ol {
  margin: 0 0 20px;
  padding-left: 1.3em;
}
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--tan); }
.prose a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--tan);
  padding-bottom: 1px;
}
.prose a:hover { background: rgba(212, 165, 116, 0.3); }
.prose blockquote {
  margin: 0 0 22px;
  padding: 14px 20px;
  border-left: 3px solid var(--tan);
  background: rgba(250, 241, 221, 0.72);
  border-radius: 0 4px 4px 0;
  color: rgba(38, 33, 23, 0.8);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose figure {
  margin: 0 0 24px;
  padding: 10px 10px 30px;
  background: #fffdf6;
  border-radius: 4px;
  border-bottom: 3px solid var(--tan);
  box-shadow: 0 8px 18px rgba(38, 33, 23, 0.12);
}
.prose figure img {
  display: block;
  width: 100%;
  filter: sepia(0.16) saturate(0.85);
}
.prose figcaption {
  margin-top: 10px;
  font-size: 0.9rem;
  color: rgba(38, 33, 23, 0.6);
}
.prose img { border-radius: 2px; filter: sepia(0.16) saturate(0.85); }
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 22px;
  font-size: 0.96rem;
  background: rgba(250, 241, 221, 0.6);
}
.prose th,
.prose td {
  border: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: rgba(212, 165, 116, 0.28);
  font-weight: 700;
}
.prose hr {
  border: 0;
  height: 1px;
  background: var(--line);
  margin: 28px 0;
}
.prose strong { font-weight: 700; }

/* ---------- 页脚 ---------- */
.site-foot {
  margin-left: var(--rail);
  margin-top: 70px;
  padding: 48px 34px 26px;
  background: var(--ink);
  color: var(--cream);
}
.foot-cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px;
  max-width: 840px;
  margin: 0 auto;
}
.foot-cols h2 {
  margin: 0 0 12px;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--tan);
}
.foot-cols h2 > span {
  display: inline-block;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(212, 165, 116, 0.45);
}
.foot-cols dl {
  margin: 0;
  display: grid;
  gap: 2px;
}
.foot-cols dd {
  margin: 0;
  font-size: 0.94rem;
  line-height: 1.6;
}
.foot-cols dd.muted { color: rgba(245, 230, 200, 0.6); }
.foot-cols a {
  display: inline-block;
  padding: 9px 0;
  min-height: 40px;
  color: rgba(245, 230, 200, 0.86);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.foot-cols a:hover {
  color: var(--cream);
  border-bottom-color: var(--tan);
}

.foot-word {
  max-width: 840px;
  margin: 40px auto 14px;
  font-size: clamp(2.2rem, 10vw, 6.4rem);
  font-weight: 800;
  line-height: 0.9;
  letter-spacing: -0.05em;
  color: rgba(245, 230, 200, 0.16);
  white-space: nowrap;
  overflow: hidden;
}
.foot-bottom {
  max-width: 840px;
  margin: 0 auto;
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-top: 1px solid rgba(245, 230, 200, 0.18);
  font-size: 0.9rem;
  color: rgba(245, 230, 200, 0.72);
}
.foot-bottom p { margin: 0; }
.foot-bottom a {
  color: rgba(245, 230, 200, 0.9);
  text-decoration: none;
  display: inline-block;
  padding: 8px 0;
  min-height: 40px;
}
.foot-bottom a:hover { color: var(--tan); }

/* ---------- 动效 ---------- */
.reveal {
  transition: opacity 0.75s ease, transform 0.75s ease;
}
.reveal.pre {
  opacity: 0;
  transform: translateY(20px);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@keyframes grain {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-1.5%, 1%); }
  66% { transform: translate(1%, -1.5%); }
  100% { transform: translate(0, 0); }
}
@keyframes leak {
  0%, 100% { opacity: 0.58; }
  50% { opacity: 0.85; }
}
@keyframes vhs {
  0%, 100% { transform: translate3d(0, 0, 0) skewX(0deg); }
  47% { transform: translate3d(-3px, 0, 0) skewX(-0.7deg); }
  53% { transform: translate3d(3px, 0, 0) skewX(0.6deg); }
}

/* ---------- 移动端 ---------- */
@media (max-width: 880px) {
  :root { --rail: 0px; }

  body { font-size: 16px; }

  .brand-mark {
    top: 10px;
    left: 12px;
    width: 42px;
    height: 42px;
    z-index: 62;
  }

  .rail {
    left: 0;
    right: 0;
    top: 0;
    bottom: auto;
    width: auto;
    height: auto;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 10px 12px 10px 62px;
    border-left: 0;
    border-bottom: 1px solid var(--line);
    background: rgba(245, 230, 200, 0.95);
    backdrop-filter: blur(6px);
  }
  .rail-nav {
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }
  .rail-nav ul {
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .pill {
    writing-mode: horizontal-tb;
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.95rem;
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .pill:hover,
  .pill.on { transform: none; }

  .rail-search { flex: 0 0 100px; }
  .srch { padding: 5px 8px; }
  .srch input { font-size: 16px; }

  main {
    margin-left: 0;
    padding: 84px 0 0;
  }
  .wrap { padding: 0 18px; }

  .hero {
    min-height: 45vh;
    padding-top: 6px;
    gap: 20px;
  }
  .hero-ghost { font-size: clamp(2.6rem, 16vw, 5rem); }

  .film { padding-top: 40px; }
  .film::before { margin-bottom: 32px; }
  .prose > article { scroll-margin-top: 96px; }

  .site-foot {
    margin-left: 0;
    margin-top: 54px;
    padding: 38px 18px 22px;
  }
  .foot-cols { grid-template-columns: 1fr; gap: 18px; }
  .foot-word { margin-top: 30px; }
}

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

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