/* ═══════════════════════════════════════════════
   石上千秋 · 碑帖专题展 — 暗色博物馆视觉
   ═══════════════════════════════════════════════ */
:root {
  --bg: #0c0b09;
  --bg2: #14120e;
  --panel: rgba(255, 250, 240, 0.04);
  --panel-border: rgba(214, 178, 106, 0.18);
  --gold: #d6b26a;
  --gold-bright: #f0d59a;
  --ink: #e8e2d4;
  --ink-dim: #9a927f;
  --seal: #a83a2b;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  --sans: "MiSans", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: var(--bg); color: var(--ink); font-family: var(--sans); }

/* ── 加载遮罩 ── */
#loader {
  position: fixed; inset: 0; z-index: 200; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.6s; }
#loader.done { opacity: 0; pointer-events: none; }
.loader-inner { text-align: center; }
.loader-seal {
  width: 64px; height: 64px; margin: 0 auto 18px; display: flex;
  align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 34px; color: #fff;
  background: var(--seal); border-radius: 8px;
  animation: seal-pulse 1.6s ease-in-out infinite; }
@keyframes seal-pulse { 0%,100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.08); opacity: 1; } }
.loader-text { color: var(--ink-dim); font-size: 14px; letter-spacing: 2px; }

/* ── 幻灯片 ── */
#stage { position: relative; height: 100vh; width: 100vw; }
.slide {
  position: absolute; inset: 0; opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.55s ease, transform 0.55s ease;
  transform: translateY(18px); overflow: hidden; }
.slide.active { opacity: 1; visibility: visible; transform: translateY(0); z-index: 2; pointer-events: auto; }
.hall-content { height: 100%; display: flex; flex-direction: column; padding: 44px 64px 70px; position: relative; }

.hall-head { flex: 0 0 auto; margin-bottom: 16px; }
.hall-no { color: var(--gold); font-size: 13px; letter-spacing: 6px; margin-bottom: 6px; }
.hall-title { font-family: var(--serif); font-size: 32px; font-weight: 600; letter-spacing: 2px; }
.hall-desc { color: var(--ink-dim); font-size: 14px; margin-top: 8px; max-width: 760px; line-height: 1.7; }

.scrollable { flex: 1; overflow-y: auto; overflow-x: hidden; padding-right: 6px; min-height: 0; }
.scrollable::-webkit-scrollbar { width: 6px; }
.scrollable::-webkit-scrollbar-thumb { background: rgba(214,178,106,.25); border-radius: 3px; }
.gold { color: var(--gold-bright); }

/* ── 序厅 ── */
.ink-bg {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 55% 42% at 22% 28%, rgba(214,178,106,0.075), transparent 62%),
    radial-gradient(ellipse 46% 38% at 78% 68%, rgba(168,58,43,0.07), transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 110%, rgba(214,178,106,0.05), transparent 70%);
  animation: ink-drift 26s ease-in-out infinite alternate; }
@keyframes ink-drift { from { filter: hue-rotate(0deg) brightness(1); } to { filter: hue-rotate(-6deg) brightness(1.12); } }

.intro-content { align-items: center; justify-content: center; text-align: center; }
.intro-kicker { color: var(--gold); font-size: 14px; letter-spacing: 10px; margin-bottom: 20px; }
.intro-title {
  font-family: var(--serif); font-size: clamp(56px, 9vw, 110px); font-weight: 700;
  letter-spacing: 14px; background: linear-gradient(160deg, #f5e7c4, var(--gold) 55%, #8c6a2f);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.intro-sub { font-family: var(--serif); font-size: 20px; color: var(--ink-dim); letter-spacing: 12px; margin-top: 10px; }
.intro-quote { margin: 36px 0 8px; font-size: 17px; line-height: 2; color: var(--ink); }
.intro-stats { display: flex; gap: 52px; margin: 34px 0 10px; flex-wrap: wrap; justify-content: center; }
.stat { display: flex; flex-direction: column; align-items: center; min-width: 72px; }
.stat-num { font-family: var(--serif); font-size: 34px; color: var(--gold-bright); }
.stat-label { color: var(--ink-dim); font-size: 13px; margin-top: 4px; letter-spacing: 2px; }
.btn-enter {
  margin-top: 30px; padding: 13px 44px; font-size: 16px; letter-spacing: 4px; cursor: pointer;
  color: var(--gold-bright); background: transparent; border: 1px solid var(--gold);
  border-radius: 2px; transition: all .3s; font-family: var(--sans); }
.btn-enter:hover { background: rgba(214,178,106,.12); box-shadow: 0 0 24px rgba(214,178,106,.25); }
.intro-footnote { margin-top: 26px; color: #6f6857; font-size: 12px; letter-spacing: 1px; }

/* ── 时空长河 ── */
.timeline-chart {
  display: flex; align-items: flex-end; gap: 8px; height: 46vh; min-height: 240px;
  padding: 20px 10px 0; border-bottom: 1px solid rgba(214,178,106,.22); }
.tl-bar-wrap { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; cursor: pointer; min-width: 26px; }
.tl-bar {
  width: 70%; max-width: 52px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(240,213,154,.85), rgba(214,178,106,.28));
  transition: filter .25s, box-shadow .25s; position: relative; }
.tl-bar-wrap:hover .tl-bar { filter: brightness(1.35); box-shadow: 0 0 18px rgba(214,178,106,.45); }
.tl-count { font-size: 11px; color: var(--gold-bright); margin-bottom: 5px; opacity: 0; transition: opacity .25s; white-space: nowrap; }
.tl-bar-wrap:hover .tl-count { opacity: 1; }
.tl-label { margin-top: 9px; font-size: 13px; color: var(--ink-dim); font-family: var(--serif); white-space: nowrap; }
.tl-bar-wrap:hover .tl-label { color: var(--gold-bright); }
.tl-bar-wrap.tl-hot .tl-bar { background: linear-gradient(180deg, #f0d59a, rgba(168,58,43,.5)); }
.subcat-row { display: flex; gap: 12px; flex-wrap: wrap; margin: 26px 4px 8px; }
.subcat-pill {
  padding: 8px 18px; border: 1px solid var(--panel-border); border-radius: 20px;
  background: var(--panel); font-size: 13px; color: var(--ink); }
.subcat-pill b { color: var(--gold-bright); font-family: var(--serif); margin-left: 6px; }
.timeline-hint { color: #6f6857; font-size: 12px; margin: 14px 4px; letter-spacing: 1px; }

/* ── 释读书房 ── */
.reading-room { flex: 1; display: flex; gap: 28px; min-height: 0; }
.reading-left { flex: 0 0 340px; min-width: 0; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.reading-meta { font-size: 13px; color: var(--ink-dim); line-height: 1.8; }
.reading-meta b { color: var(--gold-bright); font-family: var(--serif); font-size: 16px; display: block; }
.reading-meta .ai-badge { display: inline-block; font-size: 10px; color: var(--gold); border: 1px solid var(--panel-border); border-radius: 8px; padding: 1px 8px; margin-left: 6px; vertical-align: 2px; }
.reading-img {
  flex: 1; min-height: 0; max-width: 100%; object-fit: contain; background: #070605;
  border: 1px solid var(--panel-border); border-radius: 4px; cursor: zoom-in; }
.reading-nav { display: flex; align-items: center; justify-content: space-between; }
.reading-pos { color: var(--ink-dim); font-size: 13px; }
.reading-right { display: flex; flex-direction: column; border: 1px solid var(--panel-border); background: var(--panel); border-radius: 4px; min-height: 0; }
.reading-toolbar { display: flex; gap: 10px; padding: 12px 16px; border-bottom: 1px solid rgba(214,178,106,.12); flex: 0 0 auto; }
.btn-toggle {
  padding: 6px 18px; font-size: 13px; cursor: pointer; border-radius: 2px;
  color: var(--ink-dim); background: transparent; border: 1px solid rgba(214,178,106,.28); font-family: var(--sans); }
.btn-toggle.active { color: #111; background: var(--gold); border-color: var(--gold); }
.reading-columns { flex: 1; padding: 22px; overflow: auto; min-height: 0; }
/* vertical-rl 中 flex column 沿 block 轴（右→左）排各列；列高受容器约束，超长自动折到左侧新列 */
.reading-columns.vertical-rl { writing-mode: vertical-rl; display: flex; flex-direction: column; gap: 4px; }
.read-col {
  font-family: var(--serif); font-size: 19px; line-height: 1.9; letter-spacing: 4px;
  color: var(--ink); padding: 6px 3px; border-right: 1px dashed rgba(214,178,106,.14);
  transition: color .25s, background .25s; cursor: default; }
.read-col.header { color: var(--gold-bright); font-size: 21px; }
.read-col:hover, .read-col.lit { color: #fff8e6; background: rgba(214,178,106,.14); text-shadow: 0 0 10px rgba(214,178,106,.5); }
.reading-baihua { font-size: 16px; line-height: 2.2; color: var(--ink); font-family: var(--sans); writing-mode: horizontal-tb; max-width: 720px; }
.reading-baihua .src { display: block; margin-top: 18px; color: var(--ink-dim); font-size: 13px; }

/* ── 档案库 ── */
.dynasty-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; flex: 0 0 auto; }
.chip {
  padding: 6px 16px; font-size: 13px; border-radius: 16px; cursor: pointer;
  color: var(--ink-dim); border: 1px solid rgba(214,178,106,.22); background: transparent; font-family: var(--sans); }
.chip.active { color: #111; background: var(--gold); border-color: var(--gold); font-weight: 600; }
.chip .cnt { font-size: 11px; opacity: .7; margin-left: 4px; }
.person-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; padding-bottom: 20px; }
.person-card {
  border: 1px solid var(--panel-border); background: var(--panel); border-radius: 6px;
  padding: 16px; cursor: pointer; transition: transform .25s, border-color .25s, box-shadow .25s; }
.person-card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.person-name { font-family: var(--serif); font-size: 20px; color: var(--gold-bright); }
.person-dyn { font-size: 12px; color: var(--seal); margin: 4px 0 8px; letter-spacing: 2px; }
.person-dyn .ai-tag { color: var(--gold); border: 1px solid var(--panel-border); border-radius: 8px; padding: 0 6px; font-size: 10px; margin-left: 6px; }
.person-summary { font-size: 12.5px; color: var(--ink-dim); line-height: 1.8; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.person-title-full { font-size: 12px; color: var(--ink); margin-bottom: 6px; }

/* ── 关系网络 ── */
.network-layout { flex: 1; display: flex; gap: 24px; min-height: 0; }
.network-list { flex: 0 0 300px; display: flex; flex-direction: column; gap: 8px; min-height: 0; padding-right: 4px; }
.net-item {
  padding: 11px 14px; border: 1px solid var(--panel-border); border-radius: 5px;
  background: var(--panel); cursor: pointer; transition: border-color .2s; font-size: 13px; }
.net-item:hover, .net-item.active { border-color: var(--gold); }
.net-item.active { background: rgba(214,178,106,.1); }
.net-item b { font-family: var(--serif); color: var(--ink); font-size: 14px; }
.net-item .net-sub { color: var(--ink-dim); font-size: 11.5px; margin-top: 3px; }
.net-item .net-cnt { color: var(--gold-bright); float: right; font-family: var(--serif); }
.network-canvas { flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; }
#network-svg { width: 100%; height: 100%; max-height: 70vh; }
.net-edge { stroke: rgba(214,178,106,.35); stroke-width: 1.2; }
.net-edge-label { fill: var(--ink-dim); font-size: 11px; font-family: var(--sans); }
.net-node { fill: #1d1a14; stroke: var(--gold); stroke-width: 1.4; }
.net-node.center { fill: var(--seal); stroke: var(--gold-bright); stroke-width: 2; }
.net-node-label { fill: var(--ink); font-size: 13px; font-family: var(--serif); text-anchor: middle; }
.net-node-label.center { fill: #fff; font-size: 17px; font-weight: 600; }

/* ── AI 解码站 ── */
.capability-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 6px; }
.cap-card { border: 1px solid var(--panel-border); background: var(--panel); border-radius: 8px; padding: 22px; }
.cap-icon { font-size: 26px; margin-bottom: 10px; }
.cap-name { font-family: var(--serif); font-size: 20px; color: var(--gold-bright); margin-bottom: 8px; }
.cap-desc { font-size: 13px; color: var(--ink-dim); line-height: 1.9; }
.cap-example { margin-top: 12px; padding-top: 12px; border-top: 1px dashed rgba(214,178,106,.2); font-size: 12.5px; color: var(--ink); line-height: 1.8; }
.cap-example .cap-src { color: var(--gold); font-size: 11.5px; display: block; margin-bottom: 4px; }
.finale-stats { display: flex; gap: 40px; flex-wrap: wrap; margin: 30px 0 22px; }
.finale-links { display: flex; gap: 14px; flex-wrap: wrap; }
.finale-note { margin-top: 22px; color: #6f6857; font-size: 12px; line-height: 1.8; max-width: 760px; }

/* ── 导航 ── */
.nav-arrow {
  position: fixed; top: 50%; transform: translateY(-50%); z-index: 50;
  width: 46px; height: 72px; font-size: 30px; color: var(--gold); cursor: pointer;
  background: rgba(12,11,9,.4); border: 1px solid var(--panel-border); border-radius: 4px;
  backdrop-filter: blur(4px); transition: all .25s; }
.nav-arrow:hover { background: rgba(214,178,106,.18); color: var(--gold-bright); }
.nav-prev { left: 14px; } .nav-next { right: 14px; }
.nav-arrow.hidden { opacity: 0; pointer-events: none; }
.dots { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); z-index: 50; display: flex; gap: 14px; }
.dot { cursor: pointer; text-align: center; color: var(--ink-dim); font-size: 11px; letter-spacing: 1px; transition: color .25s; background: none; border: none; font-family: var(--sans); padding: 4px; }
.dot::before { content: ""; display: block; width: 8px; height: 8px; margin: 0 auto 5px; border-radius: 50%; background: rgba(214,178,106,.3); transition: all .25s; }
.dot.active { color: var(--gold-bright); }
.dot.active::before { background: var(--gold); box-shadow: 0 0 10px rgba(214,178,106,.8); }

/* ── 抽屉 ── */
.drawer-overlay { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .3s; backdrop-filter: blur(2px); }
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: -520px; width: 500px; max-width: 92vw; height: 100vh; z-index: 95;
  background: #151310; border-left: 1px solid var(--gold); transition: right .38s ease;
  box-shadow: -16px 0 48px rgba(0,0,0,.6); }
.drawer.open { right: 0; }
.drawer-close { position: absolute; top: 14px; right: 16px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; background: var(--panel); color: var(--ink); border: 1px solid var(--panel-border); cursor: pointer; font-size: 14px; }
.drawer-body { height: 100%; overflow-y: auto; padding: 34px 30px; }
.dw-name { font-family: var(--serif); font-size: 30px; color: var(--gold-bright); }
.dw-title { color: var(--ink-dim); font-size: 13px; margin: 6px 0 16px; line-height: 1.7; }
.dw-section { margin-top: 22px; }
.dw-section h4 { color: var(--gold); font-size: 13px; letter-spacing: 3px; margin-bottom: 10px; border-left: 3px solid var(--gold); padding-left: 8px; }
.dw-kv { display: grid; grid-template-columns: 88px 1fr; gap: 6px 12px; font-size: 13px; }
.dw-kv .k { color: var(--ink-dim); }
.dw-career { display: flex; flex-direction: column; gap: 8px; }
.dw-career-item { border-left: 2px solid rgba(214,178,106,.4); padding: 4px 0 4px 12px; font-size: 13px; line-height: 1.7; }
.dw-career-item .tp { color: var(--gold-bright); font-family: var(--serif); }
.dw-rel { display: inline-block; margin: 0 8px 8px 0; padding: 4px 12px; border: 1px solid var(--panel-border); border-radius: 14px; font-size: 12px; background: var(--panel); }
.dw-rel .role { color: var(--gold); margin-right: 6px; }
.dw-text { font-size: 13.5px; line-height: 2; color: var(--ink); }

/* ── 通用按钮 ── */
.btn-ghost {
  display: inline-block; padding: 7px 18px; font-size: 13px; cursor: pointer; text-decoration: none;
  color: var(--gold); background: transparent; border: 1px solid rgba(214,178,106,.35);
  border-radius: 2px; transition: all .25s; font-family: var(--sans); }
.btn-ghost:hover { background: rgba(214,178,106,.12); color: var(--gold-bright); }

/* ── 移动端 ── */
@media (max-width: 768px) {
  .hall-content { padding: 24px 20px 64px; }
  .hall-title { font-size: 22px; }
  .hall-desc { font-size: 12.5px; }
  .intro-stats { gap: 22px; }
  .stat-num { font-size: 24px; }
  .timeline-chart { height: 34vh; min-height: 180px; gap: 3px; }
  .tl-label { font-size: 10px; }
  .reading-room { flex-direction: column; overflow-y: auto; }
  .reading-left { flex: 0 0 auto; }
  .reading-img { max-height: 260px; flex: 0 0 auto; width: 100%; }
  .reading-right { min-height: 320px; }
  .network-layout { flex-direction: column; overflow-y: auto; }
  .network-list { flex: 0 0 auto; max-height: 180px; }
  .nav-arrow { width: 34px; height: 52px; font-size: 22px; }
  .person-grid { grid-template-columns: 1fr 1fr; }
}
