@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;600;700&family=Noto+Sans+SC:wght@400;500;700&display=swap');

@font-face {
  font-family: 'LetterXingkai';
  src: url('../assets/fonts/MaShanZheng-Subset.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --red: #b22222;
  --dark-red: #8b0000;
  --gold: #c9a84c;
  --cream: #f5f0e8;
  --dark: #1a1a1a;
  --darker: #111;
  --text: #d4cfc4;
  --text-light: #a09a8c;
  --border: #333;
  --bg-body: #0a0a0a;
  --bg-card: #1e1e1e;
  --bg-card-alt: #222;
  --serif: 'Noto Serif SC', 'Source Han Serif CN', 'Songti SC', 'SimSun', serif;
  --sans: 'Noto Sans SC', 'Source Han Sans CN', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --letter: 'LetterXingkai', 'STXingkai', '华文行楷', 'Xingkai SC', 'Kaiti SC', 'KaiTi', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--serif);
  background: var(--bg-body);
  color: var(--text);
  line-height: 1.8;
  animation: page-enter .18s ease-out both;
  transition: opacity .16s ease, filter .16s ease;
}
body.is-page-leaving {
  opacity: .68;
  filter: blur(.7px);
}
@keyframes page-enter {
  from { opacity: .88; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body {
    animation: none;
    transition: none;
  }
  body.is-page-leaving {
    opacity: 1;
    filter: none;
  }
  body.home-page .hero,
  body.home-page nav {
    transition: none;
  }
  .scroll-cue {
    animation: none;
  }
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    repeating-linear-gradient(90deg, rgba(245,240,232,.018) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(201,168,76,.018) 0 1px, transparent 1px 96px),
    linear-gradient(180deg, rgba(201,168,76,.025), transparent 34%, rgba(178,34,34,.025));
  opacity: .72;
}
a { color: var(--gold); text-decoration: none; transition: color .3s; }
a:hover { color: var(--red); }

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10,10,10,.95); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
nav .inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; height: 56px;
}
nav .logo { font-size: 18px; font-weight: 700; color: var(--gold); letter-spacing: 4px; }
nav .links { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
nav .links a {
  font-size: 11px; color: var(--text-light); letter-spacing: 1px;
  padding: 4px 10px; border-radius:0; transition: all .3s;
  font-family: var(--sans); text-align: center; line-height: 1.4;
  opacity: .68;
}
nav .links a:hover, nav .links a.active {
  color: var(--gold); background: rgba(178,34,34,.15);
  opacity: 1;
}
nav .links a small { display: block; }
nav .links a:hover, nav .links a.active {
  color: var(--gold); background: rgba(178,34,34,.15);
}
nav .links a .nav-years {
  display: block; font-size: 9px; color: var(--text-light);
  letter-spacing: 0; opacity: .5; margin-top: 1px;
}
nav .links a:hover .nav-years, nav .links a.active .nav-years {
  opacity: 1; color: var(--gold);
}
nav .links .sep { color: var(--border); padding: 0 2px; user-select: none; }

.side-rail {
  display: none;
}
@media (min-width: 1220px) {
  .side-rail {
    position: fixed;
    left: 20px;
    top: calc(56px + (100vh - 56px) / 2);
    transform: translateY(-50%);
    z-index: 900;
    display: flex;
    flex-direction: column;
    gap: 5px;
    width: 136px;
    max-height: calc(100vh - 88px);
    overflow: visible;
    padding: 8px;
    border: 1px solid rgba(245,240,232,.08);
    border-radius:0;
    background: rgba(10,10,10,.72);
    backdrop-filter: blur(10px);
  }
  .side-rail-item {
    position: relative;
  }
  .side-rail-main {
    display: block;
    width: 100%;
    padding: 7px 8px;
    border-radius:0;
    color: var(--text-light);
    font-family: var(--sans);
    text-align: center;
    border: 1px solid transparent;
  }
  .side-rail-main:hover,
  .side-rail-main.active {
    color: var(--cream);
    border-color: rgba(201,168,76,.32);
    background: rgba(201,168,76,.075);
  }
  .side-rail-main.active {
    border-color: rgba(201,168,76,.62);
    background:
      linear-gradient(90deg, rgba(178,34,34,.18), rgba(201,168,76,.095)),
      rgba(201,168,76,.07);
    box-shadow: inset 0 -1px 0 rgba(201,168,76,.55);
  }
  .side-rail-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: 2px;
  }
  .side-rail-meta {
    display: block;
    margin-top: 3px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0;
    opacity: .7;
  }
  .side-rail-meta:empty {
    display: none;
  }
  .side-rail-main.active .side-rail-meta {
    color: var(--gold);
    opacity: 1;
  }
  .side-rail-appendix {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(245,240,232,.12);
  }
  .side-rail-appendix + .side-rail-appendix {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }
  .side-rail-submenu {
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    display: none;
    min-width: 138px;
    padding: 6px;
    border: 1px solid rgba(201,168,76,.28);
    border-radius:0;
    background: rgba(10,10,10,.92);
    backdrop-filter: blur(10px);
    box-shadow: 0 12px 28px rgba(0,0,0,.32);
  }
  .side-rail-submenu::before {
    content: '';
    position: absolute;
    left: -8px;
    top: 0;
    width: 8px;
    height: 100%;
  }
  .side-rail-item:hover .side-rail-submenu,
  .side-rail-item:focus-within .side-rail-submenu {
    display: block;
  }
  .side-rail-submenu a {
    display: block;
    padding: 6px 7px;
    border-radius:0;
    color: var(--text-light);
    font-family: var(--sans);
    font-size: 11px;
    font-weight: 500;
    line-height: 1.35;
    letter-spacing: 0;
    text-align: left;
    text-decoration: none;
  }
  .side-rail-submenu a:hover {
    color: var(--gold);
    background: rgba(201,168,76,.08);
  }
}

/* HERO */
.hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  text-align: center; position: relative; overflow: hidden;
  background: #070707;
}
body.home-page .hero {
  min-height: 100svh;
  display: grid;
  grid-template-columns: minmax(280px, 520px) minmax(360px, 620px);
  gap: clamp(24px, 6vw, 90px);
  align-items: center;
  justify-content: center;
  padding: 64px clamp(28px, 7vw, 110px) 34px;
  text-align: left;
  transition: opacity .42s ease, transform .42s ease;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(5,5,5,.68), rgba(12,4,4,.82) 52%, rgba(5,5,5,.92)),
    linear-gradient(90deg, rgba(0,0,0,.92), rgba(0,0,0,.28) 45%, rgba(0,0,0,.9)),
    url('../assets/images/zhang-diary-facsimile.webp') center 47% / cover no-repeat;
  filter: sepia(.22) saturate(.82) contrast(1.02);
  transform: scale(1.03);
}
body.home-page .hero::before {
  background:
    linear-gradient(180deg, rgba(5,5,5,.68), rgba(12,4,4,.82) 52%, rgba(5,5,5,.92)),
    linear-gradient(90deg, rgba(0,0,0,.92), rgba(0,0,0,.28) 45%, rgba(0,0,0,.9)),
    url('../assets/images/zhang-diary-facsimile.webp') center 47% / cover no-repeat;
  filter: sepia(.22) saturate(.82) contrast(1.02);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(178,34,34,.12) 0%, transparent 55%),
    linear-gradient(180deg, transparent 74%, var(--bg-body) 100%);
}
body.home-page .hero::after {
  background:
    radial-gradient(circle at 34% 56%, rgba(245,240,232,.08) 0 15%, transparent 32%),
    radial-gradient(circle at 78% 47%, rgba(178,34,34,.15), transparent 26%),
    linear-gradient(180deg, transparent 72%, var(--bg-body) 100%);
}
.hero-content { position: relative; z-index: 1; padding: 24px; max-width: 800px; }
body.home-page .hero-content {
  padding-bottom: 0;
  max-width: 620px;
  justify-self: center;
  text-align: center;
  transform: translateY(-3vh);
}
.hero-content::before {
  content: '';
  display: block;
  width: 42px;
  height: 1px;
  margin: 0 auto 24px;
  background: var(--gold);
  opacity: .55;
}
.hero h1 {
  font-size: 48px; font-weight: 700; color: var(--cream);
  letter-spacing: 10px; margin-bottom: 16px;
  text-shadow: 0 0 40px rgba(178,34,34,.42), 0 2px 16px rgba(0,0,0,.7);
}
body.home-page .hero h1 {
  font-family: var(--letter);
  font-size: clamp(72px, 8vw, 128px);
  font-weight: 400;
  letter-spacing: 12px;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(178,34,34,.72);
}
.hero .subtitle {
  font-size: 16px; color: var(--gold); letter-spacing: 6px; margin-bottom: 24px;
  font-family: var(--sans);
}
body.home-page .hero .subtitle {
  font-family: "Times New Roman", Times, serif;
  font-size: 17px;
  font-weight: 400;
  color: rgba(245,240,232,.82);
  letter-spacing: 4px;
  margin-bottom: 28px;
}
.hero .subtitle span {
  font-size: .75em;
  letter-spacing: 4px;
  font-family: var(--sans);
}
.hero .years {
  font-size: 20px; color: var(--red); font-weight: 700; letter-spacing: 8px; margin-bottom: 40px;
}
.hero-summary {
  font-size: 15px;
  color: var(--text-light);
  line-height: 2.2;
  max-width: 600px;
  margin: 0 auto 40px;
  text-align: center;
}
body.home-page .hero-summary {
  margin-bottom: 26px;
}
.hero-question {
  max-width: 760px;
  margin: 0 auto 36px;
  color: #eee5d7;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.9;
  letter-spacing: 1px;
  text-shadow: 0 2px 18px rgba(0,0,0,.72);
}
body.home-page .hero-question {
  margin: 0 auto;
  max-width: 620px;
  color: rgba(245,240,232,.88);
  font-size: 26px;
  line-height: 1.7;
  text-align: center;
}
.hero-portrait {
  position: relative;
  z-index: 1;
  width: min(35vw, 470px);
  min-width: 260px;
  aspect-ratio: .62 / 1;
  align-self: center;
  justify-self: center;
  display: grid;
  place-items: center;
  transform: translateY(-3vh);
}
.hero-portrait img {
  position: relative;
  z-index: 1;
  width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  opacity: .92;
  filter: saturate(.9) contrast(1.02) brightness(.9) drop-shadow(0 22px 34px rgba(0,0,0,.26));
  border-radius:0;
  transform: scaleX(.82) scaleY(1.08);
}
.scroll-cue {
  appearance: none;
  border: 0;
  background: transparent;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding: 0;
  font-size: 12px;
  color: var(--text-light);
  letter-spacing: 2px;
  font-family: var(--sans);
  cursor: pointer;
  animation: scroll-cue-float 2.1s ease-in-out infinite;
}
.scroll-cue-arrow {
  font-size: 18px;
  line-height: 1;
  color: var(--gold);
}
.scroll-cue-text {
  line-height: 1.7;
  text-align: center;
}
.scroll-cue:hover,
.scroll-cue:focus-visible {
  color: var(--cream);
}
body.home-page nav {
  transition: opacity .42s ease, transform .42s ease;
}
body.home-page.is-home-leaving nav {
  opacity: .32;
  transform: translateY(-8px);
}
body.home-page.is-home-leaving .hero {
  opacity: .18;
  transform: translateY(-12px);
}
@keyframes scroll-cue-float {
  0%, 100% { transform: translateY(0); opacity: .84; }
  50% { transform: translateY(5px); opacity: 1; }
}

.home-intro {
  background:
    linear-gradient(180deg, var(--bg-body), #11100d 42%, #090909);
}
.home-panel {
  min-height: 68vh;
  display: flex;
  align-items: center;
  padding: 58px 24px;
  border-top: 1px solid rgba(245,240,232,.07);
  position: relative;
  overflow: hidden;
}
.home-panel::before {
  content: '';
  position: absolute;
  top: 50%;
  right: max(24px, calc((100vw - 1060px) / 2));
  width: 210px;
  height: 310px;
  border-radius:0;
  background:
    radial-gradient(circle at 50% 19%, rgba(201,168,76,.26) 0 18%, transparent 19%),
    linear-gradient(180deg, rgba(245,240,232,.08), rgba(178,34,34,.12) 44%, rgba(0,0,0,.38));
  border: 1px solid rgba(201,168,76,.12);
  opacity: .18;
  transform: translateY(-50%);
  pointer-events: none;
}
.home-panel:nth-child(even)::before {
  right: auto;
  left: max(24px, calc((100vw - 1060px) / 2));
  opacity: .13;
}
.home-panel-question {
  scroll-margin-top: 56px;
}
.home-panel-inner {
  position: relative;
  z-index: 1;
  width: min(900px, 100%);
  margin: 0 auto;
}
.home-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 3px;
}
.home-kicker::before {
  content: '';
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius:0;
  background: url('../assets/images/home-section-dot.webp') center / contain no-repeat;
  filter: saturate(.82) brightness(.92);
  opacity: .88;
}
.home-panel h2 {
  max-width: 900px;
  margin-bottom: 24px;
  color: var(--cream);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.32;
  letter-spacing: 2px;
}
.home-panel-inner > p:not(.home-kicker) {
  max-width: 760px;
  color: #c8c1b5;
  font-size: 18px;
  line-height: 2.05;
  letter-spacing: 0;
}
.home-panel-method {
  min-height: 66vh;
}
.home-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}
.home-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid rgba(201,168,76,.52);
  border-radius:0;
  background: rgba(201,168,76,.1);
  color: var(--cream);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 2px;
}
.home-action.secondary {
  border-color: rgba(245,240,232,.16);
  background: rgba(245,240,232,.04);
  color: var(--text);
}
.home-action:hover,
.home-action:focus-visible {
  border-color: rgba(201,168,76,.8);
  color: var(--gold);
}

.about-page-main {
  max-width: 980px;
  margin: 0 auto;
  padding: 70px 20px 48px;
}
.about-hero {
  max-width: 800px;
  margin: 0 auto 36px;
  text-align: center;
}
.about-eyebrow {
  margin-bottom: 10px;
  color: var(--gold);
  font-family: "Times New Roman", Times, serif;
  font-size: 14px;
  letter-spacing: 4px;
}
.about-hero h1 {
  margin-bottom: 18px;
  color: var(--cream);
  font-size: 34px;
  letter-spacing: 6px;
}
.about-hero p {
  max-width: 820px;
  margin: 0 auto;
  color: #d0c8bc;
  font-size: 17px;
  line-height: 2.08;
  text-align: center;
}
.about-overview {
  display: grid;
  gap: 0;
  margin-bottom: 54px;
  border-top: 1px solid rgba(201,168,76,.32);
}
.about-credit,
.about-citation {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  column-gap: 42px;
  padding: 24px 0;
  border-bottom: 1px solid rgba(245,240,232,.1);
  align-items: start;
}
.about-credit span,
.about-citation span {
  display: block;
  color: #e0c46a;
  font-family: var(--sans);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.7;
}
.about-item-body {
  grid-column: 2;
}
.about-credit strong {
  display: block;
  margin-bottom: 10px;
  color: var(--cream);
  font-size: 22px;
  letter-spacing: 2px;
}
.about-credit p,
.about-citation p {
  color: #c7c0b4;
  font-size: 14px;
  line-height: 1.95;
  text-indent: 2em;
}
.about-credit p.advisor-credit,
.about-credit p.project-credit {
  margin-bottom: 8px;
  padding-left: 0;
  text-indent: 0 !important;
}
.advisor-line {
  color: var(--cream);
  font-size: 20px;
  font-weight: 700;
  font-family: var(--serif);
  letter-spacing: 0;
}
.advisor-line a {
  color: inherit;
}
.about-credit a,
.about-citation a,
.about-essay a {
  border-bottom: 1px solid rgba(201,168,76,.5);
  padding: 0 2px 1px;
  border-radius:0;
  letter-spacing: 0;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.about-credit a:hover,
.about-credit a:focus-visible,
.about-citation a:hover,
.about-citation a:focus-visible,
.about-essay a:hover,
.about-essay a:focus-visible {
  color: #fff3bf;
  background: rgba(201,168,76,.14);
  border-bottom-color: #fff3bf;
  outline: none;
}
.about-essay {
  display: grid;
  gap: 0;
  border-top: 1px solid rgba(245,240,232,.1);
}
.about-essay article {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  column-gap: 42px;
  padding: 32px 0;
  border-bottom: 1px solid rgba(245,240,232,.1);
}
.about-essay h2 {
  color: #e0c46a;
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 2px;
  line-height: 1.7;
}
.about-essay p {
  grid-column: 2;
  margin-bottom: 12px;
  color: #c7c0b4;
  font-size: 15px;
  line-height: 2.06;
  text-indent: 2em;
}
.about-essay p:last-child {
  margin-bottom: 0;
}
.about-download {
  display: inline-flex;
  margin-top: 14px;
  padding: 7px 13px;
  border: 1px solid rgba(201,168,76,.42);
  border-radius:0;
  background: rgba(201,168,76,.08);
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 1px;
  text-indent: 0;
}
.source-inline-link {
  color: var(--gold);
  border-bottom: 1px solid rgba(201,168,76,.55);
  padding: 0 2px 1px;
  border-radius:0;
  text-decoration: none;
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.source-inline-link:hover,
.source-inline-link:focus-visible {
  color: #fff3bf;
  background: rgba(201,168,76,.16);
  border-bottom-color: #fff3bf;
  outline: none;
}

body.sources-page .section > div {
  max-width: 880px !important;
}
body.sources-page .section h2 {
  font-size: 22px !important;
  color: var(--gold) !important;
}
body.sources-page .section h3 {
  font-size: 17px !important;
  color: #e0c46a !important;
}
body.sources-page .section p {
  font-size: 15px !important;
  color: #c8c1b5 !important;
  line-height: 2 !important;
}
body.sources-page .project-brief p {
  color: #d3ccc0 !important;
}

/* CHAPTER NAV TIMELINE (for index.html) */
.chapter-timeline {
  display: flex; justify-content: center; gap: 0; max-width: 900px; margin: 0 auto 60px;
  flex-wrap: wrap;
}
.chapter-timeline.home-timeline {
  flex-wrap: nowrap;
  gap: 8px;
  max-width: 960px;
  position: relative;
  padding-top: 20px;
}
.chapter-timeline.home-timeline::before {
  content: '';
  position: absolute;
  left: 18px;
  right: 18px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.45), transparent);
}
.chapter-node {
  flex: 1; min-width: 180px; padding: 24px 16px;
  text-align: center; cursor: pointer; transition: all .3s;
  border: 1px solid var(--border); border-radius:0;
  background:
    linear-gradient(180deg, rgba(245,240,232,.025), transparent 38%),
    var(--bg-card);
  margin: 4px;
  font-family: var(--sans);
  text-decoration: none;
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.chapter-node::before {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(201,168,76,.7), transparent);
  opacity: .42;
}
.chapter-node:hover {
  border-color: rgba(201,168,76,.5); transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,.28);
  background:
    linear-gradient(180deg, rgba(201,168,76,.05), transparent 42%),
    var(--bg-card);
}
.chapter-node .ch-years {
  font-size: 13px; color: var(--red); font-weight: 700; letter-spacing: 2px; margin-bottom: 8px;
}
.chapter-node .ch-title {
  font-size: 15px; color: var(--cream); letter-spacing: 2px; margin-bottom: 6px;
}
.chapter-node .ch-question {
  font-size: 11px; color: var(--text-light); line-height: 1.6;
}

.project-brief {
  max-width: 740px;
  margin: 40px auto;
  padding: 30px 34px;
  background:
    linear-gradient(90deg, rgba(201,168,76,.055), transparent 28%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-left: 1px solid rgba(201,168,76,.32);
  border-top-color: rgba(201,168,76,.46);
  border-radius:0;
}
.project-brief h3 {
  font-size: 16px;
  color: var(--gold);
  letter-spacing: 3px;
  margin-bottom: 16px;
  font-family: var(--sans);
}
.project-brief p {
  font-size: 14px;
  line-height: 2;
  color: var(--text-light);
  margin-bottom: 12px;
  text-indent: 2em;
}
.project-brief p:last-child { margin-bottom: 0; }

/* CHAPTER PAGE */
.chapter-hero {
  padding: 80px 24px 40px; text-align: center;
  background: linear-gradient(180deg, #1a0a0a, var(--bg-body));
}
.chapter-hero .ch-number {
  font-size: 14px; color: var(--red); letter-spacing: 4px;
  font-family: var(--sans); margin-bottom: 8px;
}
.chapter-hero h1 {
  font-size: 32px; color: var(--cream); letter-spacing: 6px; margin-bottom: 8px;
}
.chapter-hero .ch-years {
  font-size: 18px; color: var(--gold); letter-spacing: 4px; margin-bottom: 20px;
}
.chapter-hero .core-question {
  font-size: 16px; color: var(--red); font-weight: 600;
  max-width: 600px; margin: 0 auto;
  padding: 12px 24px; border-bottom: 2px solid var(--red);
  font-family: var(--sans);
}

/* SECTIONS */
.section {
  max-width: 1100px; margin: 0 auto; padding: 56px 16px 40px;
}
body.home-page .section {
  padding-top: 26px;
}
.subsection {
  margin-bottom: 60px;
  scroll-margin-top: 88px;
}
.subsection-title {
  font-size: 22px; color: var(--cream); letter-spacing: 4px;
  max-width: 760px; margin: 0 auto 20px; padding-bottom: 8px;
  border-bottom: 1px solid rgba(178,34,34,.3);
  font-family: var(--sans);
  scroll-margin-top: 88px;
}
.subsection-title .sec-num {
  color: var(--red); font-weight: 700;
}

/* NARRATIVE TEXT */
.narrative {
  max-width: 760px;
  margin: 0 auto;
}
.narrative p {
  font-size: 16px; line-height: 2.22; color: var(--text);
  margin-bottom: 16px; text-indent: 2em;
}
.narrative p.no-indent { text-indent: 0; }
.note-anchor {
  --anchor-accent: var(--gold);
  --anchor-soft: rgba(201,168,76,.08);
  color: var(--text);
  font-weight: 600;
  background: var(--anchor-soft);
  border-bottom: 1px solid color-mix(in srgb, var(--anchor-accent) 34%, transparent);
  padding: 1px 3px;
  border-radius:0;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  transition: background .18s ease, border-color .18s ease, color .18s ease;
}
.note-anchor[data-note-type="background"] {
  --anchor-accent: #8fb8c1;
  --anchor-soft: rgba(143,184,193,.11);
}
.note-anchor[data-note-type="source"] {
  --anchor-accent: #d08a63;
  --anchor-soft: rgba(208,138,99,.12);
}
.note-anchor[data-note-type="space"] {
  --anchor-accent: #8fbf8a;
  --anchor-soft: rgba(143,191,138,.12);
}
.note-anchor[data-note-type="deep"] {
  --anchor-accent: var(--gold);
  --anchor-soft: rgba(201,168,76,.13);
}
.note-anchor.is-linked-active {
  color: var(--cream);
  background: color-mix(in srgb, var(--anchor-accent) 25%, transparent);
  border-bottom-color: color-mix(in srgb, var(--anchor-accent) 72%, transparent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--anchor-accent) 12%, transparent);
}

/* MICRO HISTORY NOTES */
.micro-note {
  position: relative;
  margin: 28px 0;
  padding: 18px 20px;
  background: #151510;
  border: 1px solid rgba(201,168,76,.38);
  border-left: 1px solid rgba(201,168,76,.42);
  border-top-color: rgba(201,168,76,.5);
  border-radius:0;
  overflow: visible;
}
.micro-note:not(.is-collapsible)::after {
  content: '';
  position: absolute;
  top: 9px;
  right: 12px;
  width: 18px;
  height: 1px;
  background: rgba(201,168,76,.55);
  transform: rotate(-4deg);
  opacity: .62;
  pointer-events: none;
}
.micro-note.marginal-note {
  width: 230px;
  margin: 4px 0 20px;
  padding: 14px 16px;
  background: #141414;
  border-color: rgba(201,168,76,.28);
  border-left-width: 1px;
}
.micro-note.context-card {
  width: 240px;
  margin: 6px 0 22px;
  padding: 15px 16px;
  background:
    linear-gradient(135deg, rgba(50,76,89,.22), rgba(10,10,10,.08)),
    #141716;
  border-color: rgba(114,154,164,.36);
  border-left-color: #729aa4;
}
.micro-note.context-card .micro-label {
  color: #9dc0c8;
}
.micro-note.context-card h3 {
  font-size: 16px;
}
.micro-note.inline-note {
  position: relative;
  width: auto;
  max-width: 680px;
  margin: 18px auto 22px;
}
.micro-note.deep-dive {
  position: relative;
  width: 250px;
  margin: 8px 0 24px;
  padding: 20px 20px 22px;
  background:
    linear-gradient(135deg, rgba(201,168,76,.14), rgba(178,34,34,.06) 42%, rgba(10,10,10,.16)),
    #151510;
  border-color: rgba(201,168,76,.55);
  box-shadow: 0 10px 30px rgba(0,0,0,.32), inset 0 0 0 1px rgba(245,240,232,.03);
}
.micro-note.deep-dive::before {
  content: '微观史 · DEEP DIVE';
  display: inline-block;
  margin-bottom: 10px;
  padding: 3px 9px;
  background: rgba(201,168,76,.12);
  border: 1px solid rgba(201,168,76,.45);
  border-radius:0;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: 1.5px;
}
.micro-note.deep-dive .micro-label {
  display: none;
}
.micro-note .micro-label {
  font-size: 12px;
  color: var(--gold);
  font-family: var(--sans);
  letter-spacing: 2px;
  margin-bottom: 6px;
}
.micro-note h3 {
  font-size: 17px;
  color: var(--cream);
  font-family: var(--sans);
  letter-spacing: 1px;
  margin-bottom: 8px;
}
.micro-note p {
  font-size: 13px;
  line-height: 2;
  color: var(--text-light);
  margin-bottom: 8px;
  text-indent: 0;
}
.micro-note p:last-child { margin-bottom: 0; }
.micro-note.is-collapsible {
  --note-accent: var(--gold);
  --note-accent-soft: rgba(201,168,76,.12);
  --note-border: rgba(201,168,76,.38);
  padding: 0;
  border-left-color: var(--note-accent);
  border-color: var(--note-border);
  background:
    linear-gradient(135deg, var(--note-accent-soft), rgba(10,10,10,.08)),
    #141414;
  overflow: hidden;
}
.micro-note.is-collapsible.is-collapsed {
  background: rgba(13,13,13,.72);
  border-color: rgba(245,240,232,.09);
  border-left-color: var(--note-accent);
  box-shadow: none;
}
.micro-note.is-collapsible {
  width: auto;
  max-width: 680px;
  margin: 16px auto 20px;
}
.micro-note.is-collapsible.is-collapsed {
  display: block;
}
.micro-note.is-collapsible.is-expanded {
  display: block;
  width: auto;
  max-width: 680px;
  margin: 18px auto 24px;
}
.micro-note.is-collapsible.deep-dive::before {
  display: none;
}
.micro-note-toggle {
  width: 100%;
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 10px;
  align-items: center;
  font-family: var(--sans);
}
.micro-note.is-collapsed .micro-note-toggle {
  padding: 10px 12px;
}
.micro-note-toggle:hover {
  background: rgba(245,240,232,.035);
}
.micro-note.is-collapsed .micro-note-toggle:hover {
  background: var(--note-accent-soft);
}
.micro-note-type {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border: 1px solid var(--note-border);
  border-radius:0;
  color: var(--note-accent);
  background: var(--note-accent-soft);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.micro-note.is-collapsed .micro-note-type {
  padding: 1px 6px;
  font-size: 9px;
  opacity: .86;
  margin-bottom: 4px;
}
.micro-note-title {
  display: block;
  color: var(--cream);
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: 1px;
}
.micro-note.is-collapsed .micro-note-title {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  letter-spacing: .5px;
}
.micro-note-chevron {
  grid-row: 1 / span 2;
  grid-column: 2;
  align-self: center;
  color: var(--note-accent);
  font-size: 15px;
  line-height: 1;
  transform: rotate(0deg);
  transition: transform .18s ease;
}
.micro-note.is-collapsed .micro-note-chevron {
  opacity: .75;
  font-size: 13px;
}
.micro-note.is-expanded .micro-note-chevron {
  transform: rotate(90deg);
}
.micro-note.is-expanded {
  box-shadow: 0 10px 30px rgba(0,0,0,.24), inset 0 0 0 1px rgba(245,240,232,.025);
}
.micro-note-content {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(245,240,232,.055);
}
.micro-note.is-expanded .micro-note-content {
  overflow: auto;
}
.micro-note-content[hidden] {
  display: none;
}
.micro-note[data-note-type="background"] {
  --note-accent: #8fb8c1;
  --note-accent-soft: rgba(114,154,164,.14);
  --note-border: rgba(114,154,164,.38);
}
.micro-note[data-note-type="source"] {
  --note-accent: #d08a63;
  --note-accent-soft: rgba(208,138,99,.13);
  --note-border: rgba(208,138,99,.36);
}
.micro-note[data-note-type="space"] {
  --note-accent: #8fbf8a;
  --note-accent-soft: rgba(143,191,138,.13);
  --note-border: rgba(143,191,138,.36);
}
.micro-note[data-note-type="deep"] {
  --note-accent: var(--gold);
  --note-accent-soft: rgba(201,168,76,.14);
  --note-border: rgba(201,168,76,.48);
}
.micro-note[data-note-type="analysis"] {
  --note-accent: #c79bd5;
  --note-accent-soft: rgba(199,155,213,.12);
  --note-border: rgba(199,155,213,.34);
}
.cost-list {
  margin: 10px 0 10px;
  padding-left: 18px;
  color: var(--text-light);
  font-family: var(--sans);
}
.cost-list li {
  font-size: 12px;
  line-height: 1.8;
  margin-bottom: 6px;
}
.cost-list b {
  color: var(--cream);
  font-weight: 700;
}
.narrative::after {
  content: '';
  display: block;
  clear: both;
}

@media (min-width: 769px) and (max-width: 1399px) {
  .micro-note.marginal-note,
  .micro-note.context-card,
  .micro-note.deep-dive {
    width: auto;
    max-width: 760px;
    margin: 24px auto;
  }
}

@media (min-width: 1400px) {
  .narrative {
    position: relative;
  }

  .micro-note.note-left,
  .micro-note.note-right {
    position: absolute;
    z-index: 2;
    float: none;
    clear: none;
    margin-top: 0;
    margin-bottom: 0;
  }

  .micro-note.note-left {
    left: -326px;
    margin-left: 0;
    margin-right: 0;
  }

  .micro-note.note-right {
    right: -326px;
    margin-left: 0;
    margin-right: 0;
  }
}

@media (min-width: 1000px) {
  .narrative {
    position: relative;
    max-width: 700px;
  }

  .subsection-title {
    max-width: 700px;
  }

  .component-container,
  .footnotes {
    max-width: 700px;
  }

  .micro-note.is-collapsible,
  .micro-note.is-collapsible.note-left,
  .micro-note.is-collapsible.note-right,
  .micro-note.is-collapsible.inline-note {
    position: absolute !important;
    left: auto !important;
    right: -296px !important;
    top: 0;
    z-index: 2;
    width: 260px;
    max-width: 260px;
    margin: 0;
    float: none;
    clear: none;
  }

  .micro-note.is-collapsible.is-expanded {
    width: 280px;
    max-width: 280px;
    overflow: hidden;
    margin: 0;
  }

  .micro-note.is-collapsible.is-expanded .micro-note-content {
    overflow-y: auto;
  }
}

.gloss-term {
  color: var(--cream);
  border-bottom: 1px dotted var(--gold);
  cursor: help;
  position: relative;
}
.gloss-term:hover::after,
.gloss-term:focus::after {
  content: attr(data-tip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 120;
  width: max-content;
  max-width: 280px;
  padding: 10px 12px;
  background: #151510;
  border: 1px solid var(--gold);
  border-radius:0;
  color: var(--text);
  font-family: var(--sans);
  font-size: 12px;
  line-height: 1.7;
  box-shadow: 0 8px 18px rgba(0,0,0,.45);
  text-indent: 0;
}

/* DIARY QUOTE */
blockquote.diary-quote {
  margin: 24px 0; padding: 16px 20px;
  background:
    linear-gradient(90deg, rgba(178,34,34,.08), rgba(178,34,34,.025) 44%, transparent),
    #111;
  border-left: 1px solid rgba(178,34,34,.55);
  border-top: 1px solid rgba(201,168,76,.12);
  border-bottom: 1px solid rgba(201,168,76,.08);
  font-size: 14px; line-height: 2; color: var(--text);
  font-style: normal;
}
blockquote.diary-quote p {
  text-indent: 0;
}
blockquote.diary-quote cite {
  display: block; margin-top: 8px; font-size: 12px;
  color: var(--text-light); text-align: right; font-style: normal;
  letter-spacing: 1px;
}

/* COMPONENT CONTAINERS */
.component-container {
  position: relative;
  max-width: 860px; margin: 40px auto; padding: 24px;
  background:
    linear-gradient(180deg, rgba(245,240,232,.025), transparent 30%),
    var(--bg-card);
  border: 1px solid var(--border);
  border-top-color: rgba(201,168,76,.38);
  border-radius:0;
}
.component-container::before,
.component-container::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.component-container::before {
  left: 12px;
  bottom: 10px;
  width: 18px;
  height: 18px;
  border-left: 1px solid rgba(201,168,76,.28);
  border-bottom: 1px solid rgba(201,168,76,.22);
}
.component-container::after {
  top: 11px;
  right: 14px;
  width: 38px;
  height: 1px;
  background: linear-gradient(90deg, rgba(178,34,34,.56), rgba(201,168,76,.38), transparent);
  opacity: .7;
}
.component-title {
  font-size: 14px; color: var(--gold); letter-spacing: 2px;
  margin-bottom: 16px; font-family: var(--sans);
}
.component-title::before {
  content: ''; display: inline-block; width: 8px; height: 8px;
  background: var(--red); border-radius:0; margin-right: 8px;
  vertical-align: middle;
}
.component-note {
  font-size: 12px; color: var(--text-light); line-height: 1.8;
  margin: -4px 0 14px; font-family: var(--sans);
}
.component-note-centered {
  text-align: center;
}

/* ARCHIVAL IMAGES */
.archive-figure {
  max-width: 860px;
  margin: 0 auto 32px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius:0;
  overflow: hidden;
}
.archive-figure img {
  display: block;
  width: 100%;
  height: auto;
  border-radius:0;
}
.archive-figure.diary-facsimile img {
  width: calc(100% + 8px);
  max-width: none;
  transform: translateY(-5px);
  transform-origin: top right;
}
.archive-figure figcaption {
  margin-top: 12px;
  color: var(--text-light);
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.9;
  text-align: left;
}

/* MAP */
#map,
#map-2,
#map-3,
#map-gz {
  width: 100%;
  height: 400px;
  min-height: 400px;
  border-radius:0;
  z-index: 1;
  background: #151510;
  overflow: hidden;
}
.route-map-compact {
  height: 280px !important;
  min-height: 280px !important;
}
.route-map-expanded {
  height: 460px !important;
  min-height: 460px !important;
}
.leaflet-container,
.leaflet-pane,
.leaflet-map-pane {
  width: 100%;
}
.leaflet-tile {
  max-width: none !important;
}
.leaflet-popup-content { font-family: var(--sans); font-size: 13px; }
.origin-map-pin {
  position: relative;
  width: 22px;
  height: 22px;
  border-radius:0;
  border: 2px solid rgba(245,240,232,.94);
  background: var(--red);
  box-shadow:
    0 0 0 7px rgba(178,34,34,.18),
    0 0 0 1px rgba(0,0,0,.5),
    0 10px 24px rgba(0,0,0,.4);
}
.origin-map-pin.start {
  background: var(--gold);
  box-shadow:
    0 0 0 7px rgba(201,168,76,.2),
    0 0 0 1px rgba(0,0,0,.5),
    0 10px 24px rgba(0,0,0,.4);
}
.origin-map-label {
  margin-top: -4px;
  padding: 8px 11px 9px;
  border-radius:0;
  border: 1px solid rgba(245,240,232,.18);
  background: rgba(10,10,10,.92);
  color: #fffaf2;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 1px;
  box-shadow: 0 12px 28px rgba(0,0,0,.34);
  white-space: nowrap;
}
.origin-map-label span {
  color: #111 !important;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}
.leaflet-tooltip.origin-map-label {
  background: rgba(255,255,255,.96);
  color: #111 !important;
  border-color: rgba(17,17,17,.24);
}
.route-map-pin {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius:0;
  border: 2px solid rgba(255,250,242,.98);
  background: var(--red);
  box-shadow:
    0 0 0 7px rgba(178,34,34,.2),
    0 0 0 1px rgba(0,0,0,.5),
    0 10px 24px rgba(0,0,0,.4);
}
.route-map-pin.hub {
  background: var(--gold);
  box-shadow:
    0 0 0 7px rgba(201,168,76,.22),
    0 0 0 1px rgba(0,0,0,.5),
    0 10px 24px rgba(0,0,0,.4);
}
.route-map-label {
  padding: 7px 10px 8px;
  border-radius:0;
  border: 1px solid rgba(178,34,34,.68);
  background: rgba(10,10,10,.94);
  color: #fffdf8;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 1px;
  box-shadow: 0 12px 28px rgba(0,0,0,.34);
}
.route-map-label.hub {
  border-color: rgba(201,168,76,.72);
}
.origin-map-label.start {
  border-color: rgba(201,168,76,.62);
}
.origin-map-label.end {
  border-color: rgba(178,34,34,.62);
}

/* NETWORK */
#network-graph {
  height: 580px;
  border-radius:0;
  background: #0d0d0d;
  border: 1px solid rgba(201,168,76,.16);
  transition: border-color .18s ease, box-shadow .18s ease;
}
#network-graph.is-network-hovering {
  border-color: rgba(201,168,76,.48);
  box-shadow: 0 0 0 1px rgba(201,168,76,.14), 0 16px 36px rgba(0,0,0,.34);
}
.vis-tooltip {
  position: absolute;
  visibility: hidden;
  padding: 8px 11px !important;
  max-width: 260px;
  white-space: normal !important;
  font-family: var(--sans) !important;
  font-size: 12px !important;
  line-height: 1.7 !important;
  color: var(--cream) !important;
  background: rgba(18,17,15,.96) !important;
  border: 1px solid rgba(201,168,76,.58) !important;
  border-radius:0;
  box-shadow: 0 12px 28px rgba(0,0,0,.45) !important;
  z-index: 1000 !important;
  pointer-events: none !important;
}

/* LETTERS */
.chat-container {
  max-width: 500px; margin: 0 auto;
  padding: 20px; background: #12100b; border: 1px solid #403624;
  border-radius:0; box-shadow: inset 0 0 0 1px rgba(201,168,76,.08);
}
.chat-bubble {
  margin-bottom: 14px; max-width: 100%; padding: 16px 18px;
  border-radius:0; font-size: 14px; line-height: 2;
  position: relative;
  color: #2c2116;
  background:
    linear-gradient(90deg, rgba(112,79,35,.08) 1px, transparent 1px) 0 0 / 2.15em 100%,
    linear-gradient(0deg, rgba(255,255,255,.1), rgba(112,79,35,.04)),
    #e7d6b5;
  border: 1px solid #b99658;
  box-shadow: 0 3px 10px rgba(0,0,0,.25);
}
.chat-bubble.from-other {
  margin-right: 24px;
}
.chat-bubble.from-self {
  margin-left: 24px;
}
.chat-bubble .chat-name {
  font-size: 12px; color: #6a1f16; margin-bottom: 6px;
  font-family: var(--letter); letter-spacing: 1px; font-weight: 400;
}
.chat-bubble .letter-text {
  font-family: var(--letter);
  font-size: 21px;
  line-height: 2;
  letter-spacing: 1px;
  font-weight: 400;
  text-align: left;
}
.chat-bubble.letter-vertical {
  min-height: 290px;
}
.chat-bubble.letter-vertical .letter-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  width: 100%;
  height: min(360px, 52vh);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 6px 2px;
  line-height: 2.15;
  letter-spacing: .12em;
  text-align: start;
}
.chat-bubble .chat-date {
  font-size: 11px; color: #6f624f; text-align: right; margin-top: 8px;
  font-family: var(--letter);
  letter-spacing: .08em;
}
.secondary-component {
  max-width: 680px;
  margin: 18px auto 24px;
  border: 1px solid rgba(245,240,232,.12);
  border-left: 1px solid rgba(201,168,76,.32);
  border-top-color: rgba(201,168,76,.38);
  border-radius:0;
  background: rgba(16,16,16,.84);
  overflow: hidden;
}
.secondary-component summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  padding: 14px 16px;
  font-family: var(--sans);
}
.secondary-component summary::-webkit-details-marker {
  display: none;
}
.secondary-component summary::after {
  content: '›';
  margin-left: auto;
  color: var(--gold);
  font-size: 18px;
  transition: transform .18s ease;
}
.secondary-component[open] summary::after {
  transform: rotate(90deg);
}
.secondary-kicker {
  display: inline-flex;
  width: fit-content;
  padding: 2px 8px;
  border: 1px solid rgba(201,168,76,.34);
  border-radius:0;
  color: var(--gold);
  background: rgba(201,168,76,.1);
  font-size: 10px;
  line-height: 1.45;
  letter-spacing: 1.5px;
}
.secondary-title {
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
  letter-spacing: .5px;
}
.secondary-body {
  padding: 0 16px 16px;
  border-top: 1px solid rgba(245,240,232,.055);
}
.letter-secondary .chat-container {
  margin-top: 16px;
}
.secondary-note {
  margin-top: 12px;
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.8;
}
.route-map-secondary {
  max-width: 760px;
}
.route-map-compact {
  opacity: .94;
}

/* TIMELINE (for 商团事变) */
.event-intro {
  margin-bottom: 26px;
  padding: 18px 20px;
  border: 1px solid rgba(201,168,76,.28);
  border-left: 1px solid rgba(201,168,76,.42);
  border-top-color: rgba(201,168,76,.46);
  border-radius:0;
  background:
    linear-gradient(180deg, rgba(201,168,76,.07), transparent 70%),
    rgba(18,17,15,.96);
}
.event-intro h3 {
  margin-bottom: 8px;
  color: var(--cream);
  font-size: 17px;
  letter-spacing: 2px;
  font-family: var(--sans);
}
.event-intro p {
  color: var(--text);
  font-size: 14px;
  line-height: 2;
  text-indent: 2em;
}
.event-timeline {
  position: relative; padding-left: 20px;
  border-left: 1px solid var(--border);
}
.event-timeline.event-staged {
  padding-left: 0;
  border-left: 0;
}
.event-stage {
  margin-bottom: 30px;
  padding: 22px 22px 4px;
  border: 1px solid rgba(245,240,232,.1);
  border-top-color: rgba(201,168,76,.35);
  border-radius:0;
  background: rgba(13,13,13,.72);
}
.event-stage-label {
  display: inline-flex;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: 1px solid rgba(201,168,76,.32);
  border-radius:0;
  color: var(--gold);
  background: rgba(201,168,76,.08);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 2px;
}
.event-stage h3 {
  margin-bottom: 16px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 1.5px;
}
.event-item {
  position: relative; margin-bottom: 32px; padding-left: 20px;
}
.event-item.highlight {
  border-left: 1px solid rgba(178,34,34,.62); padding-left: 18px; margin-left: 0;
}
.event-item.secondary {
  margin-bottom: 20px;
  opacity: .78;
}
.event-item.secondary .event-date {
  color: rgba(201,168,76,.78);
  font-size: 12px;
}
.event-item.secondary .event-desc {
  font-size: 13px;
  color: var(--text-light);
}
.event-collapsible {
  cursor: pointer;
}
.event-collapsible summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.event-collapsible summary::-webkit-details-marker {
  display: none;
}
.event-collapsible summary::after {
  content: '›';
  color: rgba(201,168,76,.72);
  font-size: 15px;
  line-height: 1;
  transition: transform .18s ease;
}
.event-collapsible[open] summary::after {
  transform: rotate(90deg);
}
.event-collapsible .event-desc {
  margin-top: 8px;
}
.event-item .event-date {
  font-size: 13px; color: var(--gold); font-weight: 700;
  letter-spacing: 2px; font-family: var(--sans);
}
.event-item .event-desc {
  font-size: 14px; color: var(--text); margin-top: 4px; line-height: 1.8;
}
.event-item blockquote {
  margin: 8px 0 0; padding: 8px 12px;
  background: rgba(178,34,34,.06); border-left: 2px solid var(--gold);
  font-size: 12px; color: var(--text-light); line-height: 1.8;
}
.event-source {
  margin-top: 10px;
}
.event-source summary {
  display: inline-flex;
  cursor: pointer;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 1px;
  border-bottom: 1px solid rgba(201,168,76,.38);
}
.event-source summary::-webkit-details-marker {
  display: none;
}
.event-source summary::after {
  content: '›';
  margin-left: 6px;
  transition: transform .18s ease;
}
.event-source[open] summary::after {
  transform: rotate(90deg);
}
.event-why {
  padding: 18px 20px;
  border: 1px solid rgba(178,34,34,.28);
  border-left: 1px solid rgba(178,34,34,.5);
  border-top-color: rgba(178,34,34,.28);
  border-radius:0;
  background: rgba(178,34,34,.06);
}
.event-why h3 {
  margin-bottom: 10px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 16px;
  letter-spacing: 2px;
}
.event-why p {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.9;
  text-indent: 0;
}
.event-why p::before {
  content: '•';
  margin-right: 8px;
  color: var(--gold);
}

/* KEYWORD SEARCH */
.search-box {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.search-input-wrap {
  position: relative;
  flex: 1;
}
.keyword-presets {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px;
  margin: 0 0 18px; padding: 14px;
  background: #0d0d0d; border: 1px solid var(--border); border-radius:0;
}
.keyword-presets:empty {
  display: none;
}
.keyword-chip {
  padding: 7px 10px; border: 1px solid rgba(201,166,74,.18); border-radius:0;
  background: rgba(255,255,255,.025); color: var(--text-light); cursor: pointer;
  font-family: var(--sans); transition: all .2s;
  font-size: 14px;
  letter-spacing: 1px;
}
.keyword-chip:hover, .keyword-chip.active {
  color: var(--cream); background: rgba(201,168,76,.12);
  border-color: rgba(201,166,74,.65);
  box-shadow: inset 0 -1px 0 var(--gold);
}
.search-box input {
  width: 100%; padding: 8px 38px 8px 12px; border: 1px solid var(--border);
  background: #0d0d0d; color: var(--text); border-radius:0;
  font-family: var(--sans); font-size: 14px;
}
.search-box input::placeholder { color: var(--text-light); }
.search-box #search-clear {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 1px solid rgba(201,166,74,.28);
  border-radius:0;
  background: rgba(255,255,255,.04);
  color: var(--text-light);
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0;
  opacity: .58;
  cursor: default;
}
.search-box #search-clear.has-value {
  opacity: 1;
  cursor: pointer;
}
.search-box #search-clear.has-value:hover {
  color: var(--cream);
  border-color: rgba(201,166,74,.6);
}
.search-box button {
  padding: 8px 16px; background: var(--dark-red); color: var(--cream);
  border: none; border-radius:0; cursor: pointer;
  font-family: var(--sans); font-size: 13px; letter-spacing: 1px;
  transition: background .3s;
}
.search-box button:hover { background: var(--red); }

.inline-diary-link {
  max-width: 860px;
  margin: 18px auto 30px;
  padding: 12px 16px;
  border-left: 1px solid rgba(201, 166, 74, .45);
  border-top: 1px solid rgba(201, 166, 74, .18);
  background: rgba(201, 166, 74, .08);
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.9;
}

.inline-diary-link a {
  color: var(--gold);
  margin: 0 4px;
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 166, 74, .45);
}

.diary-search-panel,
.diary-fulltext {
  max-width: 920px;
  margin-left: auto;
  margin-right: auto;
}

.diary-search-panel {
  margin-bottom: 34px;
}

.diary-fulltext {
  color: var(--text);
}

.diary-source-note {
  margin: 0 0 22px;
  color: var(--text-light);
  font-size: 13px;
  line-height: 2;
}

.diary-volume {
  margin-bottom: 44px;
}

.diary-volume-title {
  margin: 0 0 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  color: var(--gold);
  font-size: 19px;
  letter-spacing: 3px;
}

.diary-volume-fold {
  margin-bottom: 16px;
  border: 1px solid rgba(201,166,74,.28);
  border-radius:0;
  background: rgba(255,255,255,.025);
}

.diary-volume-summary,
.diary-month-summary,
.diary-day-summary {
  list-style: none;
  cursor: pointer;
}

.diary-volume-summary::-webkit-details-marker,
.diary-month-summary::-webkit-details-marker,
.diary-day-summary::-webkit-details-marker {
  display: none;
}

.diary-volume-summary {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  position: relative;
}

.diary-volume-summary::after,
.diary-month-summary::after,
.diary-day-summary::after {
  content: '›';
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gold);
  transition: transform .18s ease;
}

.diary-volume-fold[open] > .diary-volume-summary::after,
.diary-month-fold[open] > .diary-month-summary::after,
.diary-day-fold[open] > .diary-day-summary::after {
  transform: translateY(-50%) rotate(90deg);
}

.diary-volume-summary-title {
  color: var(--gold);
  font-size: 19px;
  letter-spacing: 3px;
}

.diary-volume-summary-note {
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.8;
}

.diary-volume-body {
  padding: 0 18px 18px;
}

.diary-preface {
  margin-top: 12px;
}

.diary-month-fold {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius:0;
  background: rgba(0,0,0,.18);
}

.diary-month-summary {
  position: relative;
  padding: 14px 18px;
  color: var(--cream);
  font-size: 15px;
  letter-spacing: 2px;
}

.diary-month-body {
  padding: 0 12px 12px;
}

.diary-day-fold {
  margin-top: 10px;
  border: 1px solid rgba(255,255,255,.08);
  border-radius:0;
  background: rgba(255,255,255,.02);
}

.diary-day-summary {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 42px 12px 14px;
  color: var(--gold);
  font-size: 13px;
  line-height: 1.8;
}

.diary-day-label {
  display: inline-block;
}

.diary-day-hint {
  display: inline-block;
  border: 1px solid rgba(201, 166, 74, .24);
  border-radius:0;
  padding: 1px 8px;
  background: rgba(201, 166, 74, .06);
  color: var(--text-light);
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 1px;
}

.diary-day-body {
  padding: 0 12px 12px;
}

.diary-return-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.diary-return-button {
  border: 1px solid rgba(201, 166, 74, .28);
  border-radius:0;
  padding: 5px 11px;
  background: rgba(201, 166, 74, .06);
  color: var(--text-light);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background .18s ease;
}

.diary-return-button:hover,
.diary-return-button:focus-visible {
  border-color: rgba(201, 166, 74, .56);
  background: rgba(201, 166, 74, .12);
  color: var(--cream);
}

.diary-return-volume {
  margin-top: 12px;
  padding-top: 2px;
}

.diary-back-top {
  position: fixed;
  right: 28px;
  bottom: 26px;
  z-index: 40;
  border: 1px solid rgba(201, 166, 74, .42);
  border-radius:0;
  padding: 10px 14px;
  background: rgba(10, 10, 10, .88);
  color: var(--cream);
  font-size: 13px;
  letter-spacing: 1px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(0, 0, 0, .26);
  transition: opacity .18s ease, transform .18s ease, border-color .18s ease, background .18s ease;
}

.diary-back-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.diary-back-top:hover,
.diary-back-top:focus-visible {
  border-color: rgba(201, 166, 74, .72);
  background: rgba(28, 23, 15, .94);
}

.diary-day-fold .diary-entry {
  margin-bottom: 0;
}

.diary-day-fold .diary-entry-date {
  display: block;
}

.diary-entry {
  margin-bottom: 14px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--border);
  border-radius:0;
}

.diary-entry-date {
  margin-bottom: 8px;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 1px;
}

.diary-entry p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 2.05;
  text-indent: 2em;
}

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

.diary-note {
  color: var(--text-light) !important;
  font-size: 12px !important;
}

.diary-align-right {
  text-align: right;
  text-indent: 0 !important;
}

.diary-mark {
  border-bottom: 1px solid rgba(201, 166, 74, .45);
}

.diary-end-note {
  padding: 22px;
  background: rgba(178, 34, 34, .06);
  border: 1px solid rgba(178, 34, 34, .2);
  border-radius:0;
  color: var(--cream);
  font-size: 14px;
  line-height: 2;
  text-align: center;
}
.search-results { margin-top: 16px; }
.search-result-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px; margin-bottom: 8px; background: #0d0d0d;
  border: 1px solid var(--border); border-radius:0;
  cursor: pointer;
  font-family: inherit;
}
.search-result-item:hover { border-color: rgba(201,166,74,.55); }
.search-result-item .sr-date {
  font-size: 12px; color: var(--gold); font-family: var(--sans);
}
.search-result-item .sr-context {
  font-size: 13px; color: var(--text); margin-top: 4px; line-height: 1.8;
}
.search-result-item .sr-context mark {
  background: rgba(201,166,74,.28);
  color: #fffaf0;
  padding: 1px 4px;
  border-radius:0;
  box-shadow: inset 0 -1px 0 rgba(201,166,74,.85);
}
.diary-entry-focus {
  border-color: rgba(201,166,74,.8);
  box-shadow: 0 0 0 2px rgba(201,166,74,.12);
}

/* CHAPTER NAV (bottom prev/next) */
.chapter-nav {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 900px; margin: 40px auto; padding: 0 24px;
}
.chapter-nav a {
  font-size: 14px; color: var(--text-light); letter-spacing: 2px;
  padding: 8px 16px; border: 1px solid var(--border); border-radius:0;
  transition: all .3s; font-family: var(--sans);
}
.chapter-nav-label {
  font-size: 16px;
  font-weight: 700;
  color: var(--cream);
}
.chapter-nav-years {
  margin-left: 8px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1px;
}
.chapter-nav a:hover { border-color: var(--red); color: var(--gold); }
.chapter-nav a:hover .chapter-nav-label {
  color: var(--gold);
}

/* FOOTER */
footer {
  background: var(--darker); border-top: 1px solid var(--border);
  text-align: center; padding: 40px 24px;
}

footer .footer-text {
  font-size: 12px; color: var(--text-light); letter-spacing: 2px; line-height: 2;
}
.source-footer {
  max-width: 900px;
  margin: 0 auto;
}
.source-footer .source-heading {
  text-align: left;
  margin-bottom: 8px;
}
.source-footer .source-list {
  text-align: center;
  letter-spacing: 1px;
}
.source-footer .source-list div {
  line-height: 2;
}
.source-footer .project-note {
  margin-top: 12px;
  text-align: center;
}
footer .dedication {
  color: var(--red); font-size: 14px; margin-top: 12px; letter-spacing: 4px;
}

/* EVENT COMPARISON TABLE */
.event-table { width: 100%; border-collapse: collapse; font-family: var(--sans); }
.event-table th {
  font-size: 12px; color: var(--gold); letter-spacing: 1px;
  padding: 8px 10px; text-align: left;
  border-bottom: 1px solid var(--border);
}
.event-table td {
  font-size: 13px; color: var(--text); line-height: 1.8;
  padding: 10px; border-bottom: 1px solid rgba(51,51,51,.4);
  vertical-align: top;
}
.event-table tr:hover td { background: rgba(178,34,34,.04); }
.event-table .td-year { color: var(--gold); font-weight: 600; white-space: nowrap; width: 70px; }
.event-table .td-event { color: var(--text-light); width: 45%; }
.event-table .td-self { color: var(--cream); font-weight: 500; width: 45%; }

/* THOUGHT ANALYSIS */
.thought-analysis { margin: 40px 0; }
.thought-item {
  margin-bottom: 20px; padding: 16px 20px;
  background: var(--bg-card); border-left: 1px solid rgba(201,168,76,.42);
  border-top: 1px solid rgba(201,168,76,.22);
  border-radius:0;
}
.thought-item .thought-label {
  font-size: 13px; color: var(--gold); font-weight: 600;
  margin-bottom: 6px; font-family: var(--sans); letter-spacing: 1px;
}
.thought-item .thought-text {
  font-size: 14px; line-height: 2; color: var(--text);
}

/* SECTION DIVIDER */
.section-divider {
  text-align: center; margin: 48px 0 36px; position: relative;
}
.section-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.section-divider span {
  position: relative; background: var(--bg-body); padding: 0 16px;
  font-size: 14px; color: var(--gold); letter-spacing: 3px;
  font-family: var(--sans);
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hero h1 { font-size: 28px; letter-spacing: 6px; }
  .chapter-hero h1 { font-size: 24px; }
  .chapter-timeline { flex-direction: column; align-items: center; }
  .chapter-node { min-width: 260px; }
  .subsection-title { font-size: 18px; }
  nav .links a { font-size: 11px; padding: 3px 6px; }
  nav .links a small,
  nav .links a .nav-years {
    display: none !important;
  }
  #map,
  #map-2,
  #map-3,
  #map-gz {
    height: 300px;
    min-height: 300px;
  }
  .route-map-compact {
    height: 300px !important;
    min-height: 300px !important;
  }
  #network-graph { height: 350px; }
  .section { padding: 40px 16px 30px; }
  .narrative { max-width: none; }
  .narrative p { font-size: 15px; }
  .chapter-timeline.home-timeline {
    flex-wrap: wrap;
  }
  .project-brief {
    padding: 24px 22px;
  }
  body.home-page .hero {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 10px;
    padding: 76px 18px 34px;
  }
  .hero-portrait {
    width: min(60vw, 300px);
    min-width: 0;
    justify-self: auto;
    align-self: center;
    margin: 4px auto 0;
    transform: none;
  }
  .hero-portrait::before,
  .hero-portrait::after {
    display: none;
  }
  body.home-page .hero-content {
    padding: 6px 0 0;
    transform: none;
  }
  body.home-page .hero-content::before {
    display: none;
  }
  body.home-page .hero .subtitle {
    font-size: 14px;
    letter-spacing: 2px;
    margin-bottom: 14px;
  }
  body.home-page .hero .subtitle span {
    letter-spacing: 2px;
  }
  body.home-page .hero h1 {
    font-size: 58px;
    letter-spacing: 7px;
    margin-bottom: 12px;
    padding-bottom: 12px;
  }
  .hero-summary {
    font-size: 14px;
    line-height: 2;
  }
  .hero-question {
    font-size: 18px;
    line-height: 1.85;
    letter-spacing: 0;
  }
  body.home-page .hero-question {
    font-size: 18px;
    line-height: 1.8;
    max-width: 520px;
  }
  .home-panel {
    min-height: auto;
    padding: 46px 18px;
  }
  .home-panel::before {
    width: 132px;
    height: 190px;
    right: -18px;
    opacity: .1;
  }
  .home-panel:nth-child(even)::before {
    left: -22px;
  }
  .home-kicker {
    font-size: 18px;
    margin-bottom: 14px;
  }
  .home-kicker::before {
    width: 24px;
    height: 24px;
    flex-basis: 24px;
  }
  .home-panel h2 {
    font-size: 31px;
    font-weight: 800;
    line-height: 1.38;
    letter-spacing: 2px;
  }
  .home-panel-inner > p:not(.home-kicker) {
    font-size: 17px;
    line-height: 2;
  }
  .about-page-main {
    padding: 54px 18px 36px;
  }
  .about-hero {
    margin-bottom: 34px;
    text-align: center;
  }
  .about-hero h1 {
    font-size: 28px;
    letter-spacing: 4px;
  }
  .about-hero p {
    font-size: 15px;
    line-height: 2;
  }
  .about-overview {
    margin-bottom: 34px;
  }
  .about-credit,
  .about-citation {
    display: block;
    padding: 20px 0;
  }
  .about-item-body {
    margin-top: 10px;
  }
  .about-essay article {
    display: block;
    padding: 26px 0;
  }
  .about-essay h2 {
    margin-bottom: 12px;
  }
  .about-essay p {
    font-size: 14px;
    line-height: 2;
  }
  .micro-note.marginal-note,
  .micro-note.context-card,
  .micro-note.deep-dive {
    float: none;
    width: auto;
    margin: 24px 0;
    padding: 16px 18px;
    background: #151510;
    border-color: rgba(201,168,76,.4);
  }
  .micro-note.deep-dive {
    margin: 30px 0;
    padding: 20px 18px 22px;
  }
  .micro-note.is-collapsible {
    padding: 0;
    border-left-color: var(--note-accent);
    border-color: var(--note-border);
    background:
      linear-gradient(135deg, var(--note-accent-soft), rgba(10,10,10,.08)),
      #141414;
  }
  .micro-note.is-collapsible.is-collapsed {
    background: rgba(13,13,13,.72);
    border-color: rgba(245,240,232,.09);
    border-left-color: var(--note-accent);
  }
  .diary-back-top {
    right: 16px;
    bottom: 16px;
  }
}
@media (max-width: 480px) {
  nav .links a { font-size: 10px; padding: 2px 4px; }
  .hero h1 { font-size: 22px; }
  body.home-page .hero h1 { font-size: 48px; }
  .chat-bubble { max-width: 90%; }
}
.fn { font-size: 0.7em; vertical-align: super; color: var(--gold); text-decoration: none; cursor: pointer; margin: 0 1px; }
.footnotes { max-width: 800px; margin: 48px auto 0; padding: 24px 0 0; border-top: 1px solid var(--border); }
.footnotes h3 { font-size: 14px; color: var(--gold); letter-spacing: 2px; margin-bottom: 16px; font-family: var(--sans); }
.footnotes ol { padding-left: 20px; }
.footnotes li { font-size: 12px; color: var(--text-light); line-height: 1.8; margin-bottom: 6px; }
.footnotes li::marker { color: var(--gold); }
.src-warn { font-size: 0.75em; vertical-align: super; color: var(--red); cursor: help; margin: 0 2px; font-family: var(--sans); font-weight: 600; position: relative; }
.src-warn { font-size: 0.75em; vertical-align: super; color: var(--red); cursor: help; margin: 0 2px; font-family: var(--sans); font-weight: 600; position: relative; }
.src-warn:hover::after, .src-warn:focus::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1a1a1a; color: var(--cream); font-size: 12px; font-weight: 400; line-height: 1.6; padding: 8px 12px; border-radius:0; border: 1px solid var(--red); white-space: normal; width: max-content; max-width: 280px; z-index: 100; pointer-events: none; box-shadow: 0 4px 12px rgba(0,0,0,.6); }
.src-warn.show-tip::after { content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: #1a1a1a; color: var(--cream); font-size: 12px; font-weight: 400; line-height: 1.6; padding: 8px 12px; border-radius:0; border: 1px solid var(--red); white-space: normal; width: max-content; max-width: 280px; z-index: 100; box-shadow: 0 4px 12px rgba(0,0,0,.6); }
