@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible:wght@400;700&family=Crimson+Pro:wght@400;500;600;700&display=swap');

:root {
  --cream: #f5e6c8;
  --caramel: #d4a574;
  --ink: #262117;
  --ink-2: #4d4234;
  --paper: #fbf4e4;
  --line: rgba(38, 33, 23, 0.18);
  --glass: rgba(255, 250, 238, 0.58);
  --serif: 'Crimson Pro', Georgia, 'Songti SC', 'SimSun', serif;
  --sans: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --wrap: 1180px;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  max-width: 100%;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.78;
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    radial-gradient(120% 90% at 50% 0%, rgba(251, 244, 228, 0.9), transparent 60%);
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 42% at 88% -8%, rgba(212, 165, 116, 0.42), transparent 68%),
    radial-gradient(46% 38% at -8% 26%, rgba(255, 244, 219, 0.85), transparent 70%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 900;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: multiply;
  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='0.86' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23g)' opacity='0.6'/%3E%3C/svg%3E");
}

img,
svg,
video,
canvas { max-width: 100%; height: auto; }

a { color: #8a5a2b; }

p,
li,
h1,
h2,
h3,
h4,
dt,
dd,
address,
figcaption { overflow-wrap: break-word; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 100%;
  padding: 0.55rem 1rem;
  background: rgba(245, 230, 200, 0.88);
  backdrop-filter: blur(6px) saturate(0.9);
  border-bottom: 1px solid var(--line);
}

.topbar > * { min-width: 0; }

.mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: #fffdf6;
  color: var(--ink);
  text-decoration: none;
}

.mark-img { width: 26px; height: 26px; object-fit: contain; }
.mark-svg { filter: sepia(0.35) contrast(1.05); }

.burger {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 44px;
  padding: 0.45rem 0.85rem;
  font: inherit;
  font-size: 1rem;
  letter-spacing: 0.1em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.burger-bars { display: inline-flex; flex-direction: column; gap: 3px; }
.burger-bars i { display: block; width: 18px; height: 2px; background: currentColor; }

body.menu-open .topbar {
  z-index: 120;
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
}

body.menu-open .burger {
  color: var(--cream);
  border-color: var(--caramel);
  background: rgba(255, 255, 255, 0.07);
}

body.menu-open { overflow: hidden; }

/* ---------- 全屏遮罩菜单 ---------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  max-width: 100%;
  padding: 5rem 1.2rem 3rem;
  overflow: hidden;
  background: #1d1913;
  color: var(--cream);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.03);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}

.drawer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    rgba(255, 255, 255, 0.045) 0 1px,
    transparent 1px 3px
  );
}

body.menu-open .drawer { opacity: 1; visibility: visible; transform: none; }

.drawer-links {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem 1.5rem;
  width: 100%;
  max-width: 44rem;
  margin: 0;
  text-align: center;
}

.drawer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0.45rem 0.15rem;
  font-family: var(--serif);
  font-size: 1.45rem;
  line-height: 1.3;
  color: var(--cream);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.drawer-links a:hover,
.drawer-links a:focus-visible { color: #fff; border-bottom-color: var(--caramel); }

.drawer-meta {
  position: relative;
  z-index: 2;
  max-width: 100%;
  margin: 0;
  font-size: 1rem;
  letter-spacing: 0.12em;
  text-align: center;
  color: rgba(245, 230, 200, 0.62);
}

.drawer-meta .sep { padding: 0 0.4rem; }

/* ---------- 主区域 ---------- */
main {
  position: relative;
  z-index: 1;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 1.15rem 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 268px;
  gap: 2.4rem;
  align-items: start;
}

main > article { min-width: 0; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 45vh;
  padding: 2.2rem 0.4rem 3.6rem;
  text-align: center;
  overflow: hidden;
  isolation: isolate;
}

.hero::before {
  content: '';
  position: absolute;
  inset: -8% -25% auto;
  height: 130%;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(48% 58% at 78% 6%, rgba(255, 216, 154, 0.65), transparent 66%);
  animation: leak 12s ease-in-out infinite alternate;
}

.hero > * { position: relative; z-index: 2; }

.hero-shot {
  display: inline-block;
  max-width: 100%;
  margin-bottom: 1rem;
  padding: 7px 7px 12px;
  background: #fffdf6;
  border: 1px solid rgba(38, 33, 23, 0.12);
  box-shadow: 0 10px 22px rgba(38, 33, 23, 0.22);
  transform: rotate(-3deg);
  border-radius: 3px;
}

.hero-mark { display: block; width: 62px; height: 62px; object-fit: contain; }

.hero h1 {
  margin: 0;
  max-width: 22em;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.85rem, 6vw, 3.15rem);
  line-height: 1.28;
  letter-spacing: 0.01em;
}

.lede {
  margin: 1rem auto 0;
  max-width: 30em;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.hero > .slash {
  position: absolute;
  left: -6%;
  right: -6%;
  bottom: 0;
  z-index: 1;
  height: 78px;
  background: linear-gradient(100deg, rgba(212, 165, 116, 0.58), rgba(212, 165, 116, 0.14));
  clip-path: polygon(0 64%, 100% 0, 100% 100%, 0 100%);
}

.hero > .vhs {
  position: absolute;
  left: 0;
  right: 0;
  top: 26%;
  z-index: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.75), rgba(212, 165, 116, 0.9), transparent);
  animation: vhs 9s linear infinite;
}

@keyframes vhs {
  0% { transform: translateY(0) skewX(0); opacity: 0.4; }
  45% { transform: translateY(120px) skewX(-5deg); opacity: 0.95; }
  100% { transform: translateY(0) skewX(0); opacity: 0.4; }
}

@keyframes leak {
  from { opacity: 0.6; transform: translate3d(0, 0, 0) scale(1); }
  to { opacity: 1; transform: translate3d(-3%, 2%, 0) scale(1.06); }
}

/* ---------- 正文 ---------- */
.content {
  min-width: 0;
  max-width: 100%;
  padding-bottom: 1rem;
  overflow-x: auto;
  overflow-wrap: break-word;
}

.content > div {
  max-width: 100%;
  padding: 2.4rem 0 2.6rem;
  border-top: 1px dashed var(--line);
}

.content > div:first-child { border-top: 0; padding-top: 0.6rem; }

.content div[id] { scroll-margin-top: 96px; }

.content h2 {
  margin: 0 0 1rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.4rem, 3.6vw, 2rem);
  line-height: 1.35;
}

.content h2 > span,
.content h3 > span {
  display: inline-block;
  max-width: 100%;
  border-bottom: 2px solid rgba(212, 165, 116, 0.85);
  padding-bottom: 0.15rem;
}

.content h2 > span > span,
.content h3 > span > span {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 0.45rem;
  vertical-align: 0.35em;
  border-radius: 50%;
  background: var(--caramel);
}

.content h3 {
  margin: 1.6rem 0 0.7rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.26rem;
  line-height: 1.4;
}

.content p { margin: 0 0 1.05rem; }

.content ul,
.content ol { margin: 0 0 1.1rem; padding-left: 1.3rem; }

.content li { margin: 0.4rem 0; }

.content blockquote {
  margin: 1.3rem 0;
  padding: 0.9rem 1rem;
  border-left: 3px solid var(--caramel);
  border-radius: 4px;
  background: var(--glass);
  color: var(--ink-2);
}

.content table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 1rem;
}

.content th,
.content td {
  border: 1px solid var(--line);
  padding: 0.5rem 0.6rem;
  text-align: left;
  overflow-wrap: break-word;
}

.content pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 0.8rem 0.9rem;
  border-radius: 4px;
  background: rgba(38, 33, 23, 0.06);
  font-size: 1rem;
}

.content code { overflow-wrap: break-word; }

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

.content iframe { max-width: 100%; }

/* ---------- 侧栏 ---------- */
.sidebar {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  padding-top: 1.8rem;
}

.glass {
  padding: 1rem 1.05rem;
  border: 1px solid rgba(212, 165, 116, 0.55);
  border-radius: 4px;
  background: var(--glass);
  backdrop-filter: blur(7px) saturate(0.9);
  box-shadow: 0 8px 20px rgba(38, 33, 23, 0.07);
}

.bar {
  margin: 0 0 0.6rem;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.16em;
}

.bar > span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.bar .deco {
  display: inline-block;
  width: 22px;
  height: 2px;
  background: var(--caramel);
}

.toc { list-style: none; margin: 0; padding: 0; }

.toc li + li { border-top: 1px dotted var(--line); }

.toc a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0;
  font-size: 1rem;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.toc a:hover { color: var(--ink); padding-left: 0.35rem; }

.note-line { margin: 0; font-size: 1rem; color: var(--ink-2); overflow-wrap: anywhere; }

/* ---------- 页脚 ---------- */
.sitefoot {
  position: relative;
  z-index: 1;
  margin-top: 2.5rem;
  padding: 2.8rem 1.15rem 1.4rem;
  background: #211c16;
  color: var(--cream);
  border-top: 3px solid var(--caramel);
}

.foot-grid {
  max-width: var(--wrap);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 2rem 1.6rem;
  align-items: start;
}

.foot-grid > * { min-width: 0; }

.sitefoot .bar { color: var(--caramel); }

.sitefoot ul { list-style: none; margin: 0; padding: 0; }

.sitefoot a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding-right: 0.5rem;
  color: rgba(245, 230, 200, 0.86);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.sitefoot a:hover { color: #fff; border-bottom-color: var(--caramel); }

.sitefoot address {
  font-style: normal;
  font-size: 1rem;
  line-height: 1.9;
  color: rgba(245, 230, 200, 0.72);
  overflow-wrap: anywhere;
}

.huge {
  grid-column: 1 / -1;
  max-width: 100%;
  margin: 0.6rem 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.4rem, 14vw, 7.5rem);
  line-height: 1;
  letter-spacing: 0.01em;
  color: rgba(245, 230, 200, 0.16);
  overflow-wrap: anywhere;
}

.colophon {
  max-width: var(--wrap);
  margin: 1.8rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(245, 230, 200, 0.16);
  font-size: 1rem;
  text-align: center;
  color: rgba(245, 230, 200, 0.5);
}

/* ---------- 回到顶部 ---------- */
.to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 70;
  max-width: calc(100% - 2rem);
  min-height: 44px;
  padding: 0.55rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: rgba(255, 251, 240, 0.9);
  border: 1px solid rgba(38, 33, 23, 0.35);
  border-radius: 4px;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}

.to-top.show { opacity: 1; visibility: visible; transform: none; }

/* ---------- 滚动显现 ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

/* ---------- 响应式 ---------- */
@media (max-width: 940px) {
  main { grid-template-columns: minmax(0, 1fr); gap: 1.6rem; }
  .sidebar { padding-top: 0; }
  .sidebar .glass { max-width: 34rem; }
}

@media (max-width: 640px) {
  body { font-size: 16.5px; }

  main { padding-left: 1rem; padding-right: 1rem; }

  .sitefoot { padding-left: 1rem; padding-right: 1rem; }

  .topbar { padding-left: 0.85rem; padding-right: 0.85rem; gap: 0.7rem; }

  .hero { min-height: 45vh; padding: 1.6rem 0.2rem 3.2rem; }

  .hero h1 { font-size: clamp(1.55rem, 7.4vw, 2.2rem); }

  .content h2 { font-size: clamp(1.28rem, 5.6vw, 1.7rem); }

  .lede { font-size: 1rem; }

  .foot-grid { grid-template-columns: 1fr; gap: 1.4rem; }

  .huge { font-size: clamp(2rem, 13vw, 3.4rem); }

  .drawer { padding-left: 1rem; padding-right: 1rem; }

  .drawer-links { gap: 0.1rem 1.1rem; }

  .drawer-links a { font-size: 1.28rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero::before,
  .hero > .vhs { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .drawer { transition: none; }
}

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