/* ============================================
   信抵达之前 — Phase 2 交互增强样式
   ============================================ */

:root {
  --bg-page: #F7F5F0;
  --bg-card: #FFFFFF;
  --bg-paper: #EDE8DF;
  --ink: #2C2C2C;
  --ink-secondary: #6B6B6B;
  --ink-tertiary: #9B9B9B;
  --accent-blue: #4A6FA5;
  --accent-red: #B85C50;
  --accent-green: #6B8E6B;
  --shadow-sm: 0 1px 3px rgba(44,44,44,0.08);
  --shadow-md: 0 4px 16px rgba(44,44,44,0.10);
  --shadow-lg: 0 8px 32px rgba(44,44,44,0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --font-serif: Georgia, "Times New Roman", "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-serif-en: Georgia, "Times New Roman", serif;
  --font-mono: "Courier New", Courier, monospace;
  --font-ui: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max-width: 1100px;
  --transition: 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-serif);
  background: var(--bg-page);
  color: var(--ink);
  line-height: 1.8;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
  position: relative;
  background: linear-gradient(180deg, var(--bg-page) 0%, #F0EDE5 100%);
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-blue);
  border: 1px solid var(--accent-blue);
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 32px;
}

.hero-title {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--ink);
}

.hero-subtitle {
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 400;
  color: var(--ink-secondary);
  margin-bottom: 36px;
  font-family: var(--font-serif-en);
  font-style: italic;
}

.hero-lead {
  font-size: clamp(14px, 1.8vw, 17px);
  color: var(--ink-secondary);
  max-width: 680px;
  margin: 0 auto 48px;
  line-height: 2;
}

.hero-lead br { display: none; }
@media (min-width: 768px) { .hero-lead br { display: inline; } }

.hero-scroll {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--ink-tertiary);
  font-size: 13px;
  animation: bounce 2s infinite;
  cursor: pointer;
  outline: none;
}

.hero-scroll:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 4px;
  border-radius: 4px;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* Sections */
section { padding: 72px 0; }

.section-title {
  font-size: clamp(24px, 3vw, 32px);
  font-weight: 700;
  margin-bottom: 16px;
  text-align: center;
}

.section-desc {
  text-align: center;
  color: var(--ink-secondary);
  margin-bottom: 40px;
  font-size: 15px;
}

/* Intro */
.intro {
  background: var(--bg-card);
  border-top: 1px solid var(--bg-paper);
  border-bottom: 1px solid var(--bg-paper);
}

.intro-body {
  max-width: 720px;
  margin: 0 auto 40px;
}

.intro-body p {
  margin-bottom: 20px;
  color: var(--ink-secondary);
  font-size: 15px;
}

.intro-body strong {
  color: var(--ink);
  font-weight: 600;
}

.letter-route-diagram {
  max-width: 800px;
  margin: 0 auto;
  padding: 24px;
  background: var(--bg-page);
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-paper);
}

.letter-route-diagram img {
  width: 100%;
  height: auto;
  display: block;
}

/* Journey Timeline */
.journey-section {
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-card) 100%);
  border-bottom: 1px solid var(--bg-paper);
}

.journey-timeline {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}

.journey-timeline::-webkit-scrollbar { height: 4px; }
.journey-timeline::-webkit-scrollbar-track { background: transparent; }
.journey-timeline::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.journey-stage {
  flex: 0 0 160px;
  background: var(--bg-card);
  border: 1px solid var(--bg-paper);
  border-radius: var(--radius-md);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  scroll-snap-align: start;
  position: relative;
}

.journey-stage:hover {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-sm);
}

.journey-stage.active {
  border-color: var(--accent-blue);
  box-shadow: var(--shadow-md);
  background: linear-gradient(180deg, #fff 0%, #F7FAFF 100%);
}

.journey-stage::after {
  content: '';
  position: absolute;
  bottom: -9px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-top: 8px solid var(--accent-blue);
  opacity: 0;
  transition: opacity var(--transition);
}

.journey-stage.active::after { opacity: 1; }

.journey-stage-icon {
  width: 32px;
  height: 32px;
  margin: 0 auto 10px;
  color: var(--accent-blue);
}

.journey-stage-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.journey-stage-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}

.journey-stage-desc {
  font-size: 12px;
  color: var(--ink-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.journey-hint {
  text-align: center;
  font-size: 13px;
  color: var(--ink-tertiary);
  margin-top: 20px;
  min-height: 20px;
}

/* Graph */
.graph-section {
  background: var(--bg-card);
  border-bottom: 1px solid var(--bg-paper);
}

.graph-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.graph-svg-container {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 10;
  background: var(--bg-page);
  border-radius: var(--radius-md);
  border: 1px solid var(--bg-paper);
  overflow: hidden;
}

.graph-svg-container svg {
  width: 100%;
  height: 100%;
  display: block;
}

.graph-node {
  cursor: pointer;
  transition: opacity var(--transition);
}

.graph-node:hover {
  opacity: 0.85;
}

.graph-node text {
  font-family: var(--font-serif);
  font-size: 12px;
  pointer-events: none;
}

.graph-edge {
  stroke: var(--bg-paper);
  stroke-width: 1.5;
  transition: stroke var(--transition);
}

.graph-edge.highlight {
  stroke: var(--accent-blue);
  stroke-width: 2;
}

.graph-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.graph-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--ink-secondary);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.graph-fallback {
  text-align: center;
  padding: 40px;
  color: var(--ink-tertiary);
}

/* Motif Filter */
.motif-filter { padding-bottom: 24px; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 12px;
}

.filter-btn {
  font-family: var(--font-serif);
  font-size: 14px;
  padding: 8px 18px;
  border: 1px solid var(--bg-paper);
  border-radius: 24px;
  background: var(--bg-card);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  outline: none;
}

.filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.filter-btn.active {
  background: var(--accent-blue);
  color: #fff;
  border-color: var(--accent-blue);
}

.filter-hint {
  text-align: center;
  font-size: 12px;
  color: var(--ink-tertiary);
}

/* Works Grid */
.works-grid-section { padding-top: 24px; }

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

@media (max-width: 640px) {
  .works-grid { grid-template-columns: 1fr; }
}

.work-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  border: 1px solid transparent;
  position: relative;
  outline: none;
}

.work-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--bg-paper);
}

.work-card:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.work-card.priority-1 {
  border-left: 4px solid var(--accent-red);
}

.work-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 12px;
}

.work-card-title {
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  flex: 1;
}

.work-card-year {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-tertiary);
  white-space: nowrap;
  padding-top: 4px;
}

.work-card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.work-card-type,
.work-card-region {
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-paper);
  color: var(--ink-secondary);
}

.work-card-motifs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.motif-tag {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  font-family: var(--font-mono);
}

.work-card-lead {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.work-card-priority {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-red);
}

/* Empty / Error */
.works-empty,
.works-error {
  text-align: center;
  padding: 60px 24px;
  color: var(--ink-tertiary);
}

.works-error { color: var(--accent-red); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(44,44,44,0.45);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 300ms ease;
}

.modal-overlay.show { opacity: 1; }

.modal-panel {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  max-width: 640px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  box-shadow: var(--shadow-lg);
  transform: translateY(16px) scale(0.98);
  transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-overlay.show .modal-panel {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  font-size: 28px;
  line-height: 1;
  background: none;
  border: none;
  color: var(--ink-tertiary);
  cursor: pointer;
  z-index: 10;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
  outline: none;
}

.modal-close:hover {
  background: var(--bg-paper);
  color: var(--ink);
}

.modal-close:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.modal-body {
  padding: 40px;
}

@media (max-width: 640px) {
  .modal-panel { max-height: 92vh; border-radius: var(--radius-md); }
  .modal-body { padding: 28px 24px; }
}

.modal-header {
  margin-bottom: 24px;
}

.modal-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.modal-type,
.modal-year,
.modal-region {
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 3px 10px;
  border-radius: 4px;
  background: var(--bg-paper);
  color: var(--ink-secondary);
}

.modal-motifs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.modal-section {
  margin-bottom: 24px;
}

.modal-section-title {
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-tertiary);
  margin-bottom: 8px;
  font-family: var(--font-mono);
}

.modal-section p {
  font-size: 15px;
  color: var(--ink-secondary);
  line-height: 1.8;
}

.modal-relation {
  background: linear-gradient(135deg, #F7F5F0 0%, #EDE8DF 100%);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  border-left: 3px solid var(--accent-blue);
}

.modal-scene {
  background: #FAFAF8;
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  font-style: italic;
  color: var(--ink-secondary);
}

.modal-keywords {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.keyword-tag {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 14px;
  background: var(--bg-page);
  color: var(--ink-secondary);
  border: 1px solid var(--bg-paper);
}

/* Reading Routes */
.reading-routes {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-page) 100%);
  border-top: 1px solid var(--bg-paper);
}

.route-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.route-item {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--bg-paper);
  transition: var(--transition);
  cursor: pointer;
  outline: none;
}

.route-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--accent-blue);
}

.route-item:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

.route-item.active {
  border-color: var(--accent-blue);
  background: linear-gradient(180deg, #fff 0%, #F7FAFF 100%);
}

.route-number {
  font-family: var(--font-serif-en);
  font-size: 32px;
  font-weight: 600;
  color: var(--accent-blue);
  opacity: 0.4;
  margin-bottom: 8px;
  line-height: 1;
}

.route-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 8px;
}

.route-tagline {
  font-size: 13px;
  color: var(--ink-secondary);
  font-style: italic;
  margin-bottom: 12px;
  line-height: 1.6;
}

.route-desc {
  font-size: 14px;
  color: var(--ink-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.route-works {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.route-tag {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--bg-paper);
  color: var(--ink-secondary);
}

.route-active-info {
  text-align: center;
}

.route-reset-btn {
  font-family: var(--font-serif);
  font-size: 14px;
  padding: 10px 24px;
  border: 1px solid var(--bg-paper);
  border-radius: 24px;
  background: var(--bg-card);
  color: var(--accent-blue);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.route-reset-btn:hover {
  border-color: var(--accent-blue);
  background: var(--accent-blue);
  color: #fff;
}

.route-reset-btn:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Footer */
.site-footer {
  padding: 48px 24px;
  text-align: center;
  border-top: 1px solid var(--bg-paper);
}

.footer-note {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-bottom: 8px;
  line-height: 1.8;
}

.footer-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-family: var(--font-mono);
}

/* Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #aaa; }

/* Focus visible global */
:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* Status Filter */
.status-filter {
  padding: 24px 0 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--bg-paper);
}

.filter-subtitle {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  color: var(--ink-secondary);
}

/* Work status tag */
.work-status-tag {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.work-status-tag.verified {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.work-status-tag.partial {
  background: #fff3e0;
  color: #ef6c00;
  border: 1px solid #ffcc80;
}

.work-status-tag.placeholder {
  background: #f5f5f5;
  color: #757575;
  border: 1px solid #e0e0e0;
}

.work-status-tag.needs-review {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* Sources Section */
.sources-section {
  background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-card) 100%);
  border-top: 1px solid var(--bg-paper);
}

.sources-intro {
  max-width: 720px;
  margin: 0 auto 32px;
  text-align: center;
  color: var(--ink-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.sources-intro p {
  margin-bottom: 12px;
}

.sources-intro a {
  color: var(--accent-blue);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.sources-intro a:hover {
  border-bottom-color: var(--accent-blue);
}

.source-audit-stats {
  max-width: 640px;
  margin: 0 auto 32px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--bg-paper);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}

.stat-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent-blue);
  line-height: 1;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-family: var(--font-mono);
}

.source-audit-gaps {
  max-width: 720px;
  margin: 0 auto 32px;
}

.gaps-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--ink-secondary);
}

.gaps-list {
  background: var(--bg-card);
  border: 1px solid var(--bg-paper);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.gaps-list p {
  font-size: 13px;
  color: var(--ink-tertiary);
  margin-bottom: 8px;
}

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

.gaps-list li {
  font-size: 13px;
  color: var(--ink-secondary);
  padding: 4px 0;
  border-bottom: 1px solid var(--bg-paper);
}

.gaps-list li:last-child {
  border-bottom: none;
}

.sources-list {
  max-width: 800px;
  margin: 0 auto;
}

.source-item {
  background: var(--bg-card);
  border: 1px solid var(--bg-paper);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  transition: var(--transition);
}

.source-item:hover {
  border-color: var(--accent-blue);
}

.source-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 6px;
}

.source-title {
  font-size: 14px;
  font-weight: 600;
}

.source-status {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.source-status.verified {
  background: #e8f5e9;
  color: #2e7d32;
}

.source-status.partial {
  background: #fff3e0;
  color: #ef6c00;
}

.source-status.placeholder {
  background: #f5f5f5;
  color: #757575;
}

.source-status.needs-review {
  background: #ffebee;
  color: #c62828;
}

.source-meta {
  font-size: 12px;
  color: var(--ink-tertiary);
  font-family: var(--font-mono);
  margin-bottom: 6px;
}

.source-note {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.7;
}

/* Modal sources */
.modal-sources {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-source-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 8px 12px;
  background: var(--bg-page);
  border-radius: var(--radius-sm);
  border: 1px solid var(--bg-paper);
}

.modal-source-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.modal-source-status {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.modal-source-link {
  font-size: 12px;
  color: var(--accent-blue);
  text-decoration: none;
  margin-left: auto;
}

.modal-source-link:hover {
  text-decoration: underline;
}

.modal-verification-status {
  font-family: var(--font-mono);
}

/* Mobile graph fallback */
@media (max-width: 640px) {
  .graph-svg-container { aspect-ratio: 4 / 5; }
  .graph-node text { font-size: 10px; }
  .journey-stage { flex: 0 0 140px; padding: 16px 12px; }
  .route-list { grid-template-columns: 1fr; }
  .source-audit-stats { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================
   Phase 4A Additions — Dark Mode, Print, Mobile, Anchors
   ============================================ */

/* ---- Dark Mode ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-page: #1a1917;
    --bg-card: #242320;
    --bg-paper: #2e2c28;
    --ink: #e8e4dc;
    --ink-secondary: #b0aba3;
    --ink-tertiary: #8a8580;
    --accent-blue: #6a9fd5;
    --accent-red: #d4766a;
    --accent-green: #8ab48a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.35);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.45);
  }

  body { background: var(--bg-page); color: var(--ink); }

  .hero { background: linear-gradient(180deg, var(--bg-page) 0%, #201f1d 100%); }
  .intro { background: var(--bg-card); border-color: var(--bg-paper); }
  .letter-route-diagram { background: var(--bg-page); border-color: var(--bg-paper); }

  .journey-section { background: linear-gradient(180deg, var(--bg-page) 0%, var(--bg-card) 100%); }
  .journey-stage { background: var(--bg-card); border-color: var(--bg-paper); }
  .journey-stage.active { background: linear-gradient(180deg, var(--bg-card) 0%, #1e2735 100%); }

  .graph-section { background: var(--bg-card); }
  .graph-svg-container { background: var(--bg-page); border-color: var(--bg-paper); }

  .work-card { background: var(--bg-card); }
  .work-card-type, .work-card-region { background: var(--bg-paper); color: var(--ink-secondary); }

  .modal-panel { background: var(--bg-card); }
  .modal-relation { background: linear-gradient(135deg, #2a2824 0%, #1e1c18 100%); }
  .modal-scene { background: #2a2927; color: var(--ink-secondary); }
  .keyword-tag { background: var(--bg-page); border-color: var(--bg-paper); color: var(--ink-secondary); }

  .route-item { background: var(--bg-card); border-color: var(--bg-paper); }
  .route-item.active { background: linear-gradient(180deg, var(--bg-card) 0%, #1e2735 100%); }
  .route-tag { background: var(--bg-paper); color: var(--ink-secondary); }

  .stat-card { background: var(--bg-card); border-color: var(--bg-paper); }
  .gaps-list { background: var(--bg-card); border-color: var(--bg-paper); }
  .source-item { background: var(--bg-card); border-color: var(--bg-paper); }
  .source-item:hover { border-color: var(--accent-blue); }
  .modal-source-item { background: var(--bg-page); border-color: var(--bg-paper); }

  .work-status-tag.verified { background: #1b3a1c; color: #81c784; border-color: #2e7d32; }
  .work-status-tag.partial { background: #3e2723; color: #ffb74d; border-color: #ef6c00; }
  .work-status-tag.placeholder { background: #212121; color: #bdbdbd; border-color: #616161; }
  .work-status-tag.needs-review { background: #3e1c1c; color: #ef9a9a; border-color: #c62828; }

  .source-status.verified { background: #1b3a1c; color: #81c784; }
  .source-status.partial { background: #3e2723; color: #ffb74d; }
  .source-status.placeholder { background: #212121; color: #bdbdbd; }
  .source-status.needs-review { background: #3e1c1c; color: #ef9a9a; }
}

/* ---- Print Styles ---- */
@media print {
  .hero-scroll,
  .graph-wrapper,
  .graph-mobile-list,
  .journey-timeline,
  .filter-bar,
  .status-filter,
  .modal-overlay,
  .route-active-info,
  .graph-legend,
  .site-footer { display: none !important; }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  .hero { min-height: auto; padding: 24px 0; background: #fff !important; }
  .hero-badge { border-color: #666; color: #333; }
  .hero-title { color: #000; font-size: 28pt; }
  .hero-subtitle { color: #333; }
  .hero-lead { color: #333; max-width: 100%; }

  section { padding: 18px 0; }
  .section-title { color: #000; font-size: 16pt; }
  .section-desc { color: #333; }

  .intro { background: #fff; border: none; }
  .intro-body p { color: #333; }

  .work-card {
    break-inside: avoid;
    page-break-inside: avoid;
    background: #fff;
    border: 1px solid #ddd;
    box-shadow: none;
    margin-bottom: 12px;
  }

  .works-grid { grid-template-columns: 1fr 1fr; gap: 12px; }

  a { color: #000; text-decoration: underline; }
  a[href]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #666; word-break: break-all; }
  a[href^="#"]::after { content: none; }

  .sources-section { background: #fff; border: none; }
  .sources-intro { color: #333; }
  .stat-card { background: #fff; border: 1px solid #ddd; }
  .stat-number { color: #000; }
  .source-item { background: #fff; border: 1px solid #ddd; }

  .reading-routes { background: #fff; border: none; }
  .route-item { background: #fff; border: 1px solid #ddd; box-shadow: none; }

  .container { max-width: 100%; padding: 0 12px; }
}

/* ---- Mobile Vertical Timeline (max-width: 720px) ---- */
@media (max-width: 720px) {
  .journey-timeline {
    flex-direction: column;
    overflow-x: visible;
    gap: 0;
    padding-left: 20px;
    border-left: 2px solid var(--bg-paper);
    scroll-snap-type: none;
  }

  .journey-stage {
    flex: none;
    width: 100%;
    text-align: left;
    padding: 16px 20px;
    margin-bottom: 12px;
    border-radius: var(--radius-sm);
    position: relative;
  }

  .journey-stage::before {
    content: '';
    position: absolute;
    left: -26px;
    top: 24px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent-blue);
    border: 2px solid var(--bg-page);
  }

  .journey-stage::after { display: none; }

  .journey-stage.active::before {
    background: var(--accent-blue);
    box-shadow: 0 0 0 3px var(--accent-blue)30;
  }

  .journey-stage-icon {
    margin: 0 0 8px 0;
  }

  .journey-stage-desc {
    -webkit-line-clamp: unset;
    display: block;
  }
}

/* ---- Mobile Graph List View ---- */
.graph-mobile-list { display: none; }

.graph-mobile-heading {
  display: none;
  font-size: 18px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 16px;
  color: var(--ink);
}

@media (max-width: 720px) {
  .graph-mobile-heading { display: block; }
}

@media (max-width: 720px) {
  .graph-mobile-list {
    display: block;
    margin-top: 24px;
    padding: 20px;
    background: var(--bg-page);
    border-radius: var(--radius-md);
    border: 1px solid var(--bg-paper);
  }

  .graph-mobile-group {
    margin-bottom: 20px;
  }

  .graph-mobile-group-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--bg-paper);
  }

  .graph-mobile-works {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .graph-mobile-work {
    font-size: 14px;
    padding: 8px 12px;
    color: var(--ink-secondary);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: var(--transition);
  }

  .graph-mobile-work:hover {
    background: var(--bg-card);
    color: var(--ink);
  }

  /* Simplify SVG on mobile: hide work nodes and their edges */
  .graph-svg-container svg .graph-node[data-type="work"] { display: none; }
  .graph-svg-container svg .graph-edge-work { display: none; }
}

/* ---- Content Warning in Modal ---- */
.modal-content-warning {
  background: #fff8e1;
  border-left: 3px solid #ffb300;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: #8d6e63;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 20px;
}

@media (prefers-color-scheme: dark) {
  .modal-content-warning {
    background: #3d3118;
    border-left-color: #ffb300;
    color: #dcc090;
  }
}

/* ---- Modal Actions ---- */
.modal-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.modal-copy-link {
  font-family: var(--font-ui);
  font-size: 13px;
  padding: 8px 16px;
  border: 1px solid var(--bg-paper);
  border-radius: 20px;
  background: var(--bg-page);
  color: var(--ink-secondary);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}

.modal-copy-link:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

@media (prefers-color-scheme: dark) {
  .modal-copy-link { background: #2e2c28; border-color: #3a3834; }
}

/* ---- Work Card Anchor offset for fixed headers ---- */
.work-card {
  scroll-margin-top: 20px;
}
