:root {
  --bg-obsidian: #080b0d;
  --bg-panel: #0a0e10;
  --bg-stage: #070a0c;
  --bg-elevated: #101619;
  --border-line: #171f24;
  --border-subtle: #1e282e;

  --gold-accent: #d4a359;
  --gold-dim: rgba(212, 163, 89, 0.38);
  --gold-bg: rgba(212, 163, 89, 0.08);
  --teal-accent: #4e9a8e;

  --text-bright: #eef2f4;
  --text-body: #a9b7bd;
  --text-muted: #63727a;
  --text-dim: #46545b;

  --font-serif: "Songti SC", "STSong", "Noto Serif SC", "Source Han Serif SC", "PMingLiU", Georgia, serif;
  --font-italic: Georgia, "Times New Roman", "Palatino Linotype", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Inter", sans-serif;
  --font-mono: "JetBrains Mono", "SF Mono", "Menlo", "Consolas", monospace;
}

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

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  background-color: var(--bg-obsidian);
  color: var(--text-bright);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

/* Language Toggle Visibility */
body[data-lang="zh"] .en-text { display: none !important; }
body[data-lang="en"] .zh-text { display: none !important; }
body[data-lang="bi"] .en-text { display: block; }
body[data-lang="bi"] span.en-inline { display: inline; margin-left: 4px; opacity: 0.85; }
body[data-lang="zh"] span.en-inline { display: none !important; }
body[data-lang="en"] span.zh-inline { display: none !important; }

/* ============================================================================
 * TOP ARCHITECTURAL HEADER BAR
 * ============================================================================ */
.atlas-header {
  height: 48px;
  width: 100%;
  background-color: var(--bg-obsidian);
  border-bottom: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 30;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-emblem {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-emblem::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(78, 154, 142, 0.55);
}

.emblem-core {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #d97757;
}

.emblem-dot {
  position: absolute;
  top: 3px;
  right: 4px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background-color: var(--teal-accent);
}

.brand-titles {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-zh {
  font-family: var(--font-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 1.5px;
  color: var(--text-bright);
}

.brand-en {
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: 2.5px;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-counter {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-muted);
  margin-right: 6px;
  display: flex;
  align-items: center;
  gap: 5px;
}

#topIndexNum {
  color: var(--text-body);
}

.header-btn-group {
  display: flex;
  gap: 4px;
}

.arch-btn {
  background-color: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 2px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.18s ease;
}

.arch-btn:hover {
  border-color: var(--gold-dim);
  color: var(--text-bright);
  background-color: rgba(255, 255, 255, 0.02);
}

.arch-btn.active {
  border-color: var(--gold-dim);
  color: var(--gold-accent);
  background-color: var(--gold-bg);
}

/* ============================================================================
 * 3-COLUMN ARCHITECTURAL WORKSPACE
 * ============================================================================ */
.atlas-main {
  height: calc(100vh - 48px);
  width: 100vw;
  display: grid;
  grid-template-columns: 230px 1fr 405px;
  overflow: hidden;
}

/* ============================================================================
 * LEFT CATALOG INDEX SIDEBAR
 * ============================================================================ */
.atlas-sidebar-left {
  background-color: var(--bg-obsidian);
  border-right: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.catalog-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 14px 0;
}

.catalog-scroll::-webkit-scrollbar {
  width: 3px;
}
.catalog-scroll::-webkit-scrollbar-thumb {
  background: #1d272c;
}

.catalog-group-header {
  padding: 16px 18px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: 6px;
}

.catalog-group-header:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 4px;
}

.group-dot-title {
  display: flex;
  align-items: center;
  gap: 7px;
}

.group-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background-color: var(--teal-accent);
}

.group-dot.quantum {
  background-color: var(--gold-accent);
}

.group-en-label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-dim);
}

.catalog-item {
  width: 100%;
  padding: 9px 18px;
  background: transparent;
  border: none;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.catalog-item:hover {
  background-color: rgba(255, 255, 255, 0.025);
}

.catalog-item.active {
  background-color: rgba(212, 163, 89, 0.05);
}

.cat-num {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-dim);
  padding-top: 2px;
  min-width: 18px;
}

.catalog-item.active .cat-num {
  color: var(--gold-accent);
  font-weight: 600;
}

.cat-names {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cat-zh {
  font-size: 13.5px;
  color: var(--text-body);
  font-weight: 400;
  transition: color 0.15s;
}

.catalog-item:hover .cat-zh,
.catalog-item.active .cat-zh {
  color: var(--text-bright);
  font-weight: 500;
}

.cat-en {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.7px;
  color: var(--text-dim);
  text-transform: uppercase;
}

.catalog-item.active .cat-en {
  color: #8c9ea6;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border-line);
  font-size: 11px;
  line-height: 1.55;
  color: var(--text-dim);
}

.footer-sub {
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.8;
}

/* ============================================================================
 * CENTER PURE 3D EXHIBITION STAGE & CALLOUT ANNOTATIONS
 * ============================================================================ */
.atlas-stage-center {
  position: relative;
  background: radial-gradient(circle at 50% 47%, #12181d 0%, #090c0e 58%, #060809 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.canvas-wrap {
  position: relative;
  flex: 1;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#atomCanvas {
  width: 100%;
  height: 100%;
  display: block;
  cursor: grab;
}

#atomCanvas:active {
  cursor: grabbing;
}

/* 3D Leader-Line SVG & Floating Callout Tags */
.callout-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.callout-labels-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 11;
}

.callout-tag {
  position: absolute;
  transform: translate(-50%, -50%);
  background-color: rgba(11, 15, 18, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.13);
  padding: 4px 10px;
  border-radius: 2px;
  font-size: 11.5px;
  color: var(--text-bright);
  white-space: nowrap;
  display: flex;
  align-items: baseline;
  gap: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.55);
  transition: opacity 0.2s ease;
}

.callout-tag .tag-en {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: #8899a2;
}

/* Bottom Stage Toolbar */
.stage-bottom-bar {
  height: 54px;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.stage-controls-left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.tool-btn-group {
  display: inline-flex;
  border: 1px solid var(--border-subtle);
  background-color: #0b0f12;
  border-radius: 2px;
}

.tool-btn {
  background: transparent;
  border: none;
  border-right: 1px solid var(--border-subtle);
  color: var(--text-body);
  padding: 7px 13px;
  font-size: 11.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.tool-btn:last-child {
  border-right: none;
}

.tool-btn:hover {
  color: var(--text-bright);
  background-color: rgba(255, 255, 255, 0.03);
}

.tool-btn.active {
  color: var(--gold-accent);
  background-color: var(--gold-bg);
}

.tool-ico {
  font-size: 12px;
  opacity: 0.9;
}

.scale-indicator {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.scale-title {
  font-size: 11px;
  color: var(--text-muted);
}

.scale-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.scale-bracket {
  width: 44px;
  height: 4px;
  border-left: 1px solid var(--text-muted);
  border-right: 1px solid var(--text-muted);
  border-bottom: 1px solid var(--text-muted);
}

.scale-val {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.stage-shortcuts-right {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-dim);
}

.kbd-box {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid #222d33;
  border-radius: 2px;
  color: var(--text-muted);
  background-color: #0c1013;
}

.kbd-txt {
  margin-right: 2px;
}

.kbd-dot {
  margin: 0 3px;
}

/* ============================================================================
 * RIGHT MUSEUM EDITORIAL MONOGRAPH PANEL
 * ============================================================================ */
.atlas-sidebar-right {
  background-color: var(--bg-panel);
  border-left: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
}

.monograph-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 26px 26px 20px;
  user-select: text;
}

.monograph-scroll::-webkit-scrollbar {
  width: 4px;
}
.monograph-scroll::-webkit-scrollbar-thumb {
  background: #1f2a30;
}

/* Top Index & Category Row */
.mono-top-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 10px;
}

.mono-index-num {
  font-family: var(--font-italic);
  font-size: 20px;
  color: var(--gold-accent);
}

.mono-index-total {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
  margin-left: 4px;
}

.mono-cat-right {
  font-size: 11.5px;
  color: var(--text-muted);
}

/* Huge Serif Specimen Title */
.mono-title-zh {
  font-family: var(--font-serif);
  font-size: 31px;
  font-weight: 400;
  color: var(--text-bright);
  letter-spacing: 1px;
  line-height: 1.22;
}

.mono-title-latin {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 14.5px;
  color: var(--text-muted);
  margin-top: 5px;
}

/* Em-Dash Taxonomy Line */
.mono-taxonomy-line {
  margin-top: 14px;
  font-size: 12px;
  color: var(--teal-accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Rectangular Metadata Tags */
.mono-tags-row {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.mono-tag-gold {
  padding: 4px 10px;
  font-size: 11.5px;
  border: 1px solid var(--gold-dim);
  color: var(--gold-accent);
  background-color: var(--gold-bg);
  border-radius: 2px;
}

.mono-tag-neutral {
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  background-color: rgba(255, 255, 255, 0.015);
  border-radius: 2px;
}

/* Poetic Pull-Quote with Teal Left Border */
.mono-pullquote {
  margin-top: 22px;
  padding-left: 13px;
  border-left: 2px solid var(--teal-accent);
}

.mono-pullquote-zh {
  font-family: var(--font-serif);
  font-size: 15.5px;
  color: #dce5e8;
  line-height: 1.5;
}

.mono-pullquote-en {
  font-family: var(--font-italic);
  font-style: italic;
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}

/* Editorial Prose Paragraphs */
.mono-prose {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.mono-prose p {
  font-size: 13.3px;
  line-height: 1.85;
  color: var(--text-body);
}

.mono-prose p.en-prose {
  font-size: 12.2px;
  line-height: 1.68;
  color: #7c8d96;
  margin-top: -6px;
}

.mono-prose strong {
  color: var(--text-bright);
  font-weight: 500;
}

/* Section Divider Header (如: 数据 DATA / 交互参数 CONTROLS) */
.mono-section-head {
  margin-top: 24px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mono-section-head span.sec-zh {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 1px;
}

.mono-section-head span.sec-en {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: 2px;
}

.mono-section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border-line);
}

/* Interactive Sub-Controls inside Monograph */
.interactive-subpanel {
  border: 1px solid var(--border-line);
  background-color: #080b0d;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.sub-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.sub-opt-btn {
  flex: 1;
  min-width: 72px;
  padding: 6px 9px;
  background-color: #0d1215;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  font-size: 11.5px;
  cursor: pointer;
  border-radius: 2px;
  text-align: center;
  transition: all 0.15s;
}

.sub-opt-btn:hover {
  border-color: var(--gold-dim);
  color: var(--text-bright);
}

.sub-opt-btn.active {
  border-color: var(--gold-accent);
  color: var(--gold-accent);
  background-color: var(--gold-bg);
}

/* Architectural 2x3 DATA Grid (Exact Match to Reference) */
.data-grid-2x3 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border-line);
  border-left: 1px solid var(--border-line);
}

.data-cell {
  padding: 12px 13px;
  border-right: 1px solid var(--border-line);
  border-bottom: 1px solid var(--border-line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.data-cell-label {
  font-size: 10.5px;
  color: var(--text-dim);
}

.data-cell-value {
  font-size: 13px;
  color: var(--text-bright);
  line-height: 1.45;
}

.data-cell-value span.muted {
  color: var(--text-muted);
  font-size: 12px;
}

/* Right Panel Bottom Status Bar */
.monograph-footer {
  height: 44px;
  padding: 0 24px;
  border-top: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-dim);
}

.mono-foot-left {
  display: flex;
  align-items: center;
  gap: 7px;
}

.mono-foot-left strong {
  font-family: var(--font-mono);
  color: var(--text-body);
  font-weight: 500;
  margin-left: 4px;
}

/* ============================================================================
 * MODALS (COMPARE TABLE & QUIZ)
 * ============================================================================ */
.atlas-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(4, 6, 8, 0.82);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 28px;
}

.atlas-modal-backdrop.open {
  display: flex;
}

.atlas-modal {
  width: 100%;
  max-width: 960px;
  max-height: 85vh;
  background-color: #0b0f12;
  border: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
}

.atlas-modal-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-sub {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 2px;
  color: var(--gold-accent);
}

.atlas-modal-head h3 {
  font-family: var(--font-serif);
  font-size: 19px;
  font-weight: 400;
  color: var(--text-bright);
  margin-top: 3px;
}

.atlas-modal-body {
  padding: 22px 24px;
  overflow-y: auto;
  user-select: text;
}

.atlas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.8px;
}

.atlas-table th,
.atlas-table td {
  border: 1px solid var(--border-line);
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

.atlas-table th {
  background-color: #0f1519;
  color: var(--gold-accent);
  font-weight: 500;
}

/* Quiz items */
.quiz-item {
  border: 1px solid var(--border-line);
  background-color: #080b0d;
  padding: 16px 18px;
  margin-bottom: 14px;
}

.quiz-q-title {
  font-size: 14px;
  color: var(--text-bright);
  margin-bottom: 10px;
  line-height: 1.5;
}

.quiz-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.quiz-choice {
  padding: 10px 12px;
  background-color: #0c1013;
  border: 1px solid var(--border-subtle);
  color: var(--text-body);
  text-align: left;
  font-size: 12.5px;
  cursor: pointer;
  border-radius: 2px;
}

.quiz-choice:hover {
  border-color: var(--gold-dim);
  color: var(--text-bright);
}

.quiz-choice.correct {
  border-color: var(--teal-accent);
  background-color: rgba(78, 154, 142, 0.14);
  color: #8ce0d2;
}

.quiz-choice.wrong {
  border-color: #c85a5a;
  background-color: rgba(200, 90, 90, 0.12);
  color: #f2a0a0;
}

.quiz-exp-box {
  margin-top: 10px;
  padding: 10px 12px;
  border-left: 2px solid var(--gold-accent);
  background-color: rgba(212, 163, 89, 0.05);
  font-size: 12.5px;
  color: var(--text-body);
  display: none;
}

@media (max-width: 1180px) {
  .atlas-main {
    grid-template-columns: 195px 1fr 350px;
  }
  .stage-shortcuts-right {
    display: none;
  }
}
