/* ============================================================
   山河证言 · 2.5D 视觉层
   概念：把整座档案馆做成一间悬浮的「立体战史沙盘室」——
   板块是有厚度的石质展台，按钮是可按压的金属键，
   地图是微微倾斜的作战沙盘，时间轴是嵌进桌面的轨道。
   本文件只追加视觉，不改变任何结构与交互逻辑。
   ============================================================ */

/* ---------- 0. 深度设计变量 ---------- */
:root {
  --d25-top-light: rgba(255, 240, 205, 0.09);   /* 顶光高光 */
  --d25-edge-hi: rgba(240, 220, 170, 0.22);     /* 棱线高光 */
  --d25-side-1: #241b0f;                        /* 挤出层 1（最近） */
  --d25-side-2: #171006;                        /* 挤出层 2 */
  --d25-side-3: #0d0803;                        /* 挤出层 3（最远） */
  --d25-cast: rgba(0, 0, 0, 0.55);              /* 落影 */
  --d25-gold-dark: #6e5626;                     /* 金色按钮的底面 */
  --d25-red-dark: #4d120c;                      /* 红色按钮的底面 */
}

/* ---------- 1. 场景：等距网格地板 + 顶部聚光 ---------- */
body {
  background:
    radial-gradient(1200px 640px at 50% -12%, rgba(234, 210, 155, 0.055), transparent 62%),
    radial-gradient(900px 620px at 88% 112%, rgba(168, 58, 45, 0.05), transparent 60%),
    repeating-linear-gradient(30deg, transparent 0 46px, rgba(220, 200, 160, 0.016) 46px 47px),
    repeating-linear-gradient(-30deg, transparent 0 46px, rgba(220, 200, 160, 0.013) 46px 47px),
    #0c0a08;
}

/* ---------- 2. 三大板块：有厚度的悬浮展台 ---------- */
.map-panel,
.chronicle,
.time-deck {
  position: relative;
  border: 1px solid var(--d25-edge-hi);
  border-right-color: rgba(0, 0, 0, 0.45);
  border-bottom-color: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  background:
    linear-gradient(155deg, rgba(240, 220, 170, 0.045), transparent 38%),
    linear-gradient(180deg, #1b1712, #14110d 58%, #100d0a);
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 2px 0 var(--d25-side-1),
    0 5px 0 var(--d25-side-2),
    0 9px 0 var(--d25-side-3),
    0 28px 52px var(--d25-cast);
}

/* 展台侧面接缝处的一线反光，让厚度更真实 */
.map-panel::after,
.chronicle::after,
.time-deck::after {
  position: absolute;
  right: 10px;
  bottom: -6px;
  left: 10px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(240, 220, 170, 0.14), transparent);
  content: "";
  pointer-events: none;
}

/* ---------- 3. 顶栏：悬浮横梁 ---------- */
.topbar {
  border-bottom: 1px solid rgba(0, 0, 0, 0.55);
  background:
    linear-gradient(180deg, rgba(240, 220, 170, 0.05), transparent 45%),
    #161310;
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 2px 0 var(--d25-side-2),
    0 16px 34px rgba(0, 0, 0, 0.5);
}

.brand-seal {
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 205, 0.22),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.55),
    0 6px 14px rgba(0, 0, 0, 0.45);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.6);
}

.era-readout strong {
  text-shadow:
    0 1px 0 #000,
    0 2px 0 #241a0e,
    0 4px 10px rgba(0, 0, 0, 0.65);
}

/* ---------- 4. 立体按键系统（可按压） ---------- */
.tool-button,
.icon-action,
.play-action,
.secondary-action,
.event-photo-button,
.chapter-nav button,
.history-tab,
.text-link {
  transition: transform 140ms ease, box-shadow 140ms ease, background 160ms ease, color 160ms ease;
}

.tool-button,
.icon-action,
.secondary-action,
.event-photo-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.12),
    0 3px 0 #0a0705,
    0 8px 16px rgba(0, 0, 0, 0.4);
}

.tool-button:hover,
.icon-action:hover,
.secondary-action:hover,
.event-photo-button:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.16),
    0 5px 0 #0a0705,
    0 12px 22px rgba(0, 0, 0, 0.48);
}

.tool-button:active,
.icon-action:active,
.secondary-action:active,
.event-photo-button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.08),
    0 1px 0 #0a0705,
    0 3px 8px rgba(0, 0, 0, 0.42);
}

/* 金色主按钮：黄铜压键 */
.primary-action,
.enter-button {
  position: relative;
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.5),
    inset 0 -3px 0 rgba(90, 66, 28, 0.38),
    0 4px 0 var(--d25-gold-dark),
    0 12px 26px rgba(0, 0, 0, 0.5);
  text-shadow: 0 1px 0 rgba(255, 246, 220, 0.35);
  transition: transform 140ms ease, box-shadow 140ms ease, background 160ms ease;
}

.primary-action:hover,
.enter-button:hover {
  transform: translateY(-3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.55),
    inset 0 -3px 0 rgba(90, 66, 28, 0.38),
    0 7px 0 var(--d25-gold-dark),
    0 20px 38px rgba(0, 0, 0, 0.55);
}

.primary-action:active,
.enter-button:active {
  transform: translateY(3px);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 225, 0.4),
    inset 0 -2px 0 rgba(90, 66, 28, 0.3),
    0 1px 0 var(--d25-gold-dark),
    0 5px 12px rgba(0, 0, 0, 0.5);
}

/* 章节页签：激活时微微浮起 */
.chapter-nav button.active {
  transform: translateY(-1px);
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.7);
}

/* ---------- 5. 地图框：作战沙盘 ---------- */
.map-frame {
  border: 1px solid rgba(201, 167, 101, 0.34);
  border-radius: 5px;
  box-shadow:
    inset 0 2px 0 rgba(255, 238, 190, 0.06),
    inset 0 18px 40px rgba(0, 0, 0, 0.68),
    inset 0 0 70px rgba(0, 0, 0, 0.6),
    0 1px 0 rgba(255, 240, 200, 0.05),
    0 14px 30px rgba(0, 0, 0, 0.52);
}

/* 细指针设备下，沙盘随鼠标轻微倾斜（JS 写入 --tilt-x / --tilt-y） */
@media (pointer: fine) {
  .map-frame {
    transform: perspective(1600px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)) scale(1.014);
    transform-style: preserve-3d;
    transition: transform 260ms ease-out;
  }

  .map-frame.tilting {
    transition: transform 90ms ease-out;
  }
}

/* 悬浮于沙盘之上的器件：图例、印章、罗盘、缩放钮 */
.map-legend,
.map-stamp,
.map-compass,
.map-zoom-controls,
.map-tooltip {
  filter: drop-shadow(0 10px 14px rgba(0, 0, 0, 0.55));
}

.map-zoom-controls button {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.14),
    0 3px 0 #0a0705,
    0 8px 14px rgba(0, 0, 0, 0.5);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.map-zoom-controls button:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.18),
    0 5px 0 #0a0705,
    0 12px 20px rgba(0, 0, 0, 0.55);
}

.map-zoom-controls button:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.08),
    0 1px 0 #0a0705,
    0 3px 8px rgba(0, 0, 0, 0.5);
}

/* 沙盘上的统计数字：浅浮雕 */
.national-casualty > strong,
.verified-casualty > strong {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.8),
    0 2px 0 rgba(30, 20, 8, 0.7),
    0 5px 12px rgba(0, 0, 0, 0.6);
}

.map-statline {
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    inset 0 10px 22px rgba(0, 0, 0, 0.35),
    0 3px 0 var(--d25-side-2),
    0 10px 20px rgba(0, 0, 0, 0.4);
}

/* ---------- 6. 卡片：挤出式浮起 ---------- */
.lens-card,
.battle-entry,
.archive-entry,
.evidence-note,
.help-grid > div {
  border: 1px solid rgba(201, 167, 101, 0.2);
  border-bottom-color: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  background: linear-gradient(165deg, #1d1913, #14110c 70%);
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 3px 0 var(--d25-side-2),
    0 10px 20px rgba(0, 0, 0, 0.4);
  transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
}

.lens-card:hover,
.battle-entry:hover,
.archive-entry:hover {
  transform: translateY(-3px);
  border-color: rgba(234, 211, 155, 0.34);
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 6px 0 var(--d25-side-2),
    0 18px 32px rgba(0, 0, 0, 0.5);
}

/* 战线符号：小立方块 */
.lens-symbol {
  border-radius: 3px;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.2),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 2px 0 rgba(0, 0, 0, 0.5),
    0 5px 10px rgba(0, 0, 0, 0.4);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.65);
}

/* 同期战史整条按钮：金属拨杆 */
.phase-battle-strip {
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.12),
    0 3px 0 #0a0705,
    0 10px 20px rgba(0, 0, 0, 0.42);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.phase-battle-strip:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.16),
    0 5px 0 #0a0705,
    0 16px 30px rgba(0, 0, 0, 0.5);
}

.phase-battle-strip:active {
  transform: translateY(2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.08),
    0 1px 0 #0a0705,
    0 4px 10px rgba(0, 0, 0, 0.45);
}

/* ---------- 7. 时间轴：嵌入桌面的金属轨道 ---------- */
.time-deck {
  background:
    linear-gradient(180deg, rgba(240, 220, 170, 0.035), transparent 40%),
    #131009;
}

.timeline-track {
  border: 1px solid rgba(201, 167, 101, 0.2);
  border-top-color: rgba(0, 0, 0, 0.6);
  border-radius: 5px;
  background: linear-gradient(180deg, #0a0705, #1a1409 55%, #100c06);
  box-shadow:
    inset 0 3px 7px rgba(0, 0, 0, 0.75),
    inset 0 -1px 0 rgba(238, 214, 160, 0.1),
    0 1px 0 rgba(255, 240, 200, 0.05);
}

.timeline-track::before {
  top: 2px;
  right: 4px;
  left: 4px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(238, 214, 160, 0.16), transparent);
}

/* 进度条：凸起的金铜熔流 */
.timeline-fill {
  top: 1px;
  height: 5px;
  border-radius: 3px;
  background: linear-gradient(180deg, #e8c98c, #b69657 45%, #7d5c26);
  box-shadow:
    inset 0 1px 0 rgba(255, 246, 220, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(190, 133, 70, 0.35);
}

/* 轨道把手：一颗黄铜算珠 */
.timeline-head span {
  border-color: #f0dcae;
  background: radial-gradient(circle at 32% 28%, #f7e3b4, #c9a765 48%, #6d5326 90%);
  box-shadow:
    inset 0 -2px 3px rgba(0, 0, 0, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.6),
    0 0 14px rgba(233, 211, 155, 0.4);
}

.timeline-wrap.is-scrubbing .timeline-head span {
  box-shadow:
    inset 0 -2px 3px rgba(0, 0, 0, 0.4),
    0 5px 10px rgba(0, 0, 0, 0.65),
    0 0 0 5px rgba(201, 167, 101, 0.14),
    0 0 24px rgba(233, 211, 155, 0.55);
}

/* 事件标记：轨道上的铆钉 */
.timeline-event {
  border-radius: 50%;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.25),
    0 2px 3px rgba(0, 0, 0, 0.6);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.timeline-event:hover {
  transform: translateX(-50%) translateY(-2px);
}

.timeline-event.unlocked {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    0 2px 4px rgba(0, 0, 0, 0.6),
    0 0 8px rgba(245, 232, 227, 0.25);
}

.timeline-event.active {
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.4),
    0 3px 6px rgba(0, 0, 0, 0.65),
    0 0 0 4px rgba(212, 107, 84, 0.16),
    0 0 16px rgba(212, 107, 84, 0.5);
}

/* 年份大数字：石刻感 */
.year-lockup strong {
  text-shadow:
    0 1px 0 #000,
    0 2px 0 #241a0e,
    0 3px 0 #170f06,
    0 7px 14px rgba(0, 0, 0, 0.65);
}

/* 见证进度：凹槽 + 凸条 */
.progress {
  border-radius: 4px;
  background: #0a0705;
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.8),
    inset 0 -1px 0 rgba(238, 214, 160, 0.1);
}

.progress i {
  border-radius: 3px;
  background: linear-gradient(180deg, #d98a70, #a83a2d 55%, #6d1f14);
  box-shadow:
    inset 0 1px 0 rgba(255, 240, 220, 0.35),
    0 0 10px rgba(168, 58, 45, 0.45);
}

/* ---------- 8. 抽屉与弹窗：向前推出的厚板 ---------- */
.archive-drawer {
  box-shadow:
    inset 1px 0 0 rgba(240, 220, 170, 0.14),
    inset 0 1px 0 var(--d25-top-light),
    -8px 0 0 rgba(0, 0, 0, 0.35),
    -34px 0 80px rgba(0, 0, 0, 0.65);
}

.modal-card,
.event-media-card,
.martyr-profile-folio {
  border: 1px solid rgba(234, 211, 155, 0.3);
  border-bottom-color: rgba(0, 0, 0, 0.6);
  border-radius: 6px;
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 3px 0 var(--d25-side-1),
    0 8px 0 var(--d25-side-3),
    0 50px 110px rgba(0, 0, 0, 0.75);
}

.media-main,
.media-secondary,
.martyr-profile-portrait {
  border: 1px solid rgba(234, 211, 155, 0.2);
  border-radius: 4px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.6),
    inset 0 12px 28px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 240, 200, 0.06);
}

.close-button {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.14),
    0 2px 0 rgba(0, 0, 0, 0.55),
    0 6px 12px rgba(0, 0, 0, 0.4);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.close-button:hover {
  transform: translateY(-1px) rotate(90deg);
}

.close-button:active {
  transform: translateY(1px);
}

.toast {
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 3px 0 var(--d25-side-2),
    0 18px 40px rgba(0, 0, 0, 0.6);
}

/* ---------- 9. 英烈墙：逐张升起的立体相片 ---------- */
.martyr-card {
  border-radius: 4px;
  transition: transform 260ms ease, box-shadow 260ms ease, border-color 260ms ease;
}

.martyr-card:hover {
  transform: translateY(-7px);
  box-shadow:
    0 4px 0 rgba(0, 0, 0, 0.4),
    0 24px 44px rgba(0, 0, 0, 0.65),
    0 0 0 1px rgba(234, 211, 155, 0.3);
}

/* ---------- 10. 片头：2.5D 主视觉 ---------- */
.intro-screen {
  background:
    radial-gradient(1100px 600px at 50% -14%, rgba(234, 210, 155, 0.07), transparent 60%),
    linear-gradient(90deg, rgba(10, 9, 8, 0.84), rgba(10, 9, 8, 0.2) 40%, rgba(10, 9, 8, 0.86)),
    radial-gradient(ellipse at 58% 42%, rgba(158, 76, 36, 0.2), transparent 37%),
    radial-gradient(ellipse at 35% 74%, rgba(99, 110, 90, 0.16), transparent 39%),
    repeating-linear-gradient(30deg, transparent 0 52px, rgba(220, 200, 160, 0.014) 52px 53px),
    repeating-linear-gradient(-30deg, transparent 0 52px, rgba(220, 200, 160, 0.011) 52px 53px),
    #11100e;
}

/* 主标题：象牙与黄铜的双色挤出立体字 */
.intro-content h1 {
  transform-style: preserve-3d;
}

.intro-content h1 span:nth-child(1) {
  color: #f2e9d6;
  text-shadow:
    0 1px 0 #bcab8d,
    0 2px 0 #a5947a,
    0 3px 0 #8a7a62,
    0 4px 0 #6f614c,
    0 5px 0 #564a39,
    0 6px 0 #3f3527,
    0 7px 0 #292218,
    0 16px 34px rgba(0, 0, 0, 0.72);
}

.intro-content h1 span:nth-child(2) {
  color: #dcbc7a;
  text-shadow:
    0 1px 0 #b08b4e,
    0 2px 0 #97763f,
    0 3px 0 #7c6134,
    0 4px 0 #614c29,
    0 5px 0 #483920,
    0 6px 0 #322817,
    0 7px 0 #1f190e,
    0 16px 34px rgba(0, 0, 0, 0.75);
}

/* 鼠标视差：不同景深层（JS 写入 --px / --py） */
.intro-content {
  translate: calc(var(--px, 0) * 7px) calc(var(--py, 0) * 5px);
}

.intro-map-watermark {
  translate: calc(var(--px, 0) * -24px) calc(var(--py, 0) * -15px);
}

.intro-seal {
  translate: calc(var(--px, 0) * 13px) calc(var(--py, 0) * 10px);
}

.intro-vertical {
  translate: calc(var(--px, 0) * -9px) calc(var(--py, 0) * -7px);
}

.intro-screen::before {
  translate: calc(var(--px, 0) * -16px) calc(var(--py, 0) * -11px);
}

/* 印章：朱红钤印的厚度 */
.intro-seal {
  border-radius: 3px;
  box-shadow:
    inset 0 0 0 4px #11100e,
    inset 0 0 0 5px rgba(173, 62, 42, 0.34),
    inset 0 2px 0 rgba(255, 220, 190, 0.14),
    inset 0 -3px 0 rgba(0, 0, 0, 0.4),
    0 3px 0 rgba(0, 0, 0, 0.55),
    0 14px 30px rgba(0, 0, 0, 0.55);
  text-shadow: 0 2px 3px rgba(0, 0, 0, 0.7);
}

/* 片头警示条与帮助键：浅槽 */
.intro-warning {
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 220, 190, 0.06),
    inset 0 8px 18px rgba(0, 0, 0, 0.35),
    0 2px 0 rgba(0, 0, 0, 0.4);
}

.intro-help {
  border-radius: 4px;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.1),
    0 3px 0 #0a0705,
    0 8px 16px rgba(0, 0, 0, 0.4);
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.intro-help:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.14),
    0 5px 0 #0a0705,
    0 12px 22px rgba(0, 0, 0, 0.48);
}

/* ---------- 11. 结尾：纪念碑的立体基座 ---------- */
.monument-window {
  border-radius: 5px;
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    inset 0 0 60px rgba(0, 0, 0, 0.5),
    0 3px 0 var(--d25-side-1),
    0 8px 0 var(--d25-side-3),
    0 40px 90px rgba(0, 0, 0, 0.7);
}

.ending-final-title {
  text-shadow:
    0 1px 0 #6d1f14,
    0 2px 0 #5a190f,
    0 3px 0 #47130c,
    0 4px 0 #340d08,
    0 5px 0 #220803,
    0 12px 30px rgba(0, 0, 0, 0.8);
}

/* ---------- 12. 滚动条：黄铜滑块 ---------- */
::-webkit-scrollbar {
  width: 9px;
  height: 9px;
}

::-webkit-scrollbar-track {
  background: #0d0a07;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
}

::-webkit-scrollbar-thumb {
  border: 2px solid #0d0a07;
  border-radius: 6px;
  background: linear-gradient(180deg, #8a6f3e, #57431f);
  box-shadow: inset 0 1px 0 rgba(255, 240, 200, 0.25);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #a8874e, #6b5429);
}

/* ---------- 13. 性能与无障碍护栏 ---------- */
body.performance-lite .map-frame {
  transform: none !important;
}

body.performance-lite .map-panel,
body.performance-lite .chronicle,
body.performance-lite .time-deck {
  box-shadow:
    inset 0 1px 0 var(--d25-top-light),
    0 4px 0 var(--d25-side-2),
    0 14px 28px rgba(0, 0, 0, 0.45);
}

@media (prefers-reduced-motion: reduce) {
  .map-frame {
    transform: none !important;
  }

  .intro-content,
  .intro-map-watermark,
  .intro-seal,
  .intro-vertical,
  .intro-screen::before {
    translate: none !important;
  }

  .tool-button,
  .icon-action,
  .secondary-action,
  .event-photo-button,
  .primary-action,
  .enter-button,
  .phase-battle-strip,
  .lens-card,
  .battle-entry,
  .archive-entry,
  .martyr-card {
    transition: none !important;
  }
}

/* ============================================================
   第二版追加：立体地图 · 火焰蔓延 · 按键涟漪 · 质感提升
   ============================================================ */

/* ---------- 14. 立体沙盘：静态俯角 + 动态倾斜 ---------- */
@media (pointer: fine) {
  .map-frame {
    transform: perspective(1700px) rotateX(calc(2.4deg + var(--tilt-x, 0deg))) rotateY(var(--tilt-y, 0deg)) scale(1.02);
  }
}

/* 沙盘内圈：顶部投光、四周下沉 */
.map-frame {
  box-shadow:
    inset 0 2px 0 rgba(255, 238, 190, 0.07),
    inset 0 22px 46px rgba(0, 0, 0, 0.72),
    inset 0 -8px 24px rgba(0, 0, 0, 0.5),
    inset 12px 0 30px rgba(0, 0, 0, 0.35),
    inset -12px 0 30px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 240, 200, 0.05),
    0 16px 34px rgba(0, 0, 0, 0.55);
}

/* 沙盘顶光斜射（不拦截指针） */
.map-frame::after {
  position: absolute;
  inset: 0;
  z-index: 7;
  background: linear-gradient(118deg, rgba(255, 240, 205, 0.05), transparent 34%, rgba(0, 0, 0, 0.12) 88%);
  content: "";
  pointer-events: none;
}

/* 火星粒子画布 */
.d25-ember-canvas {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  mix-blend-mode: screen;
}

/* ---------- 15. 立体地形：省份浮雕 ---------- */
.province {
  filter:
    drop-shadow(0.9px 1.8px 1.1px rgba(0, 0, 0, 0.5))
    drop-shadow(-0.7px -0.9px 0.6px rgba(255, 232, 190, 0.13));
}

.province:hover {
  filter:
    brightness(1.14)
    drop-shadow(0 0 6px rgba(240, 210, 150, 0.28))
    drop-shadow(0.9px 1.8px 1.1px rgba(0, 0, 0, 0.5));
}

/* 沦陷区：熔岩边缘光 */
.province.occupied,
.province.affected {
  filter:
    drop-shadow(0 0 6px rgba(255, 86, 32, 0.32))
    drop-shadow(0.9px 1.8px 1.1px rgba(0, 0, 0, 0.5));
}

.base-area {
  filter: drop-shadow(0 0 6px rgba(220, 180, 90, 0.4));
}

body.is-scrubbing .province,
.map-frame.is-panning .province,
body.performance-lite .province,
body.performance-lite .base-area {
  filter: none !important;
}

/* ---------- 16. 火焰蔓延（覆盖原燃烧动画） ---------- */
@keyframes provinceBurnIn {
  0% {
    opacity: 0.4;
    stroke: #fff6d8;
    stroke-width: 2.6;
    filter: brightness(2.6) saturate(1.7) drop-shadow(0 0 22px rgba(255, 150, 46, 0.95));
  }
  35% {
    opacity: 1;
    stroke: #ff9a3c;
    stroke-width: 2;
    filter: brightness(1.8) saturate(1.5) drop-shadow(0 0 14px rgba(255, 110, 30, 0.8));
  }
  70% {
    opacity: 1;
    stroke: rgba(255, 120, 60, 0.5);
    stroke-width: 1.4;
    filter: brightness(1.15) drop-shadow(0 0 6px rgba(230, 70, 20, 0.4));
  }
  100% {
    opacity: 1;
    stroke: rgba(237, 207, 165, 0.16);
    stroke-width: 1;
    filter: none;
  }
}

/* 省界火线：扭动的火焰描边 */
@keyframes burnBoundary {
  0% {
    opacity: 0;
    stroke: #ffe9ad;
    stroke-width: 3;
    stroke-dashoffset: 380;
  }
  30% {
    opacity: 1;
    stroke: #ffab4d;
    stroke-width: 2.6;
  }
  60% {
    opacity: 0.95;
    stroke: #ff7a33;
    stroke-width: 2.2;
  }
  100% {
    opacity: 0.55;
    stroke: rgba(255, 150, 90, 0.6);
    stroke-width: 1.5;
    stroke-dashoffset: 0;
  }
}

.province-overlay.burning {
  filter: url(#d25-flame-wobble) drop-shadow(0 0 9px rgba(255, 120, 30, 0.85));
}

/* 焦土余烬：沦陷后缓慢阴燃 */
.province-burn.visible {
  opacity: 0.28;
  animation: flameSmolder 3.6s ease-in-out infinite alternate;
}

@keyframes flameSmolder {
  from { opacity: 0.2; }
  to { opacity: 0.33; }
}

body.performance-lite .province-burn.visible {
  animation: none;
  opacity: 0.26;
}

/* ---------- 17. 按键涟漪与回弹 ---------- */
.primary-action,
.secondary-action,
.tool-button,
.enter-button,
.icon-action,
.play-action,
.event-photo-button,
.phase-battle-strip,
.chapter-nav button,
.history-tab,
.map-zoom-controls button,
.close-button {
  position: relative;
  overflow: hidden;
}

.d25-ripple {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 244, 214, 0.5), rgba(255, 214, 140, 0.18) 45%, transparent 70%);
  mix-blend-mode: screen;
  opacity: 0.9;
  transform: scale(0);
  animation: d25Ripple 0.6s ease-out forwards;
  pointer-events: none;
}

@keyframes d25Ripple {
  to {
    opacity: 0;
    transform: scale(1);
  }
}

.primary-action:active,
.enter-button:active {
  transform: translateY(3px) scale(0.98);
}

.tool-button:active,
.icon-action:active,
.secondary-action:active,
.event-photo-button:active,
.phase-battle-strip:active,
.map-zoom-controls button:active {
  transform: translateY(2px) scale(0.985);
}

/* ---------- 18. 面板光泽与质感 ---------- */
.map-panel::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 6px;
  background: linear-gradient(115deg, rgba(255, 244, 214, 0.05), transparent 28%);
  content: "";
  pointer-events: none;
}

/* 事件卡标题微浮雕 */
.event-copy h2 {
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.75),
    0 3px 10px rgba(0, 0, 0, 0.5);
}

.event-category {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.16),
    0 2px 0 rgba(0, 0, 0, 0.5),
    0 6px 12px rgba(0, 0, 0, 0.4);
}

/* 图例与印章：珐琅徽章质感 */
.legend-swatch {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.25),
    0 1px 2px rgba(0, 0, 0, 0.55);
}

.map-stamp {
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 214, 0.14),
    inset 0 -2px 0 rgba(0, 0, 0, 0.4),
    0 3px 0 rgba(0, 0, 0, 0.5),
    0 16px 30px rgba(0, 0, 0, 0.55);
}

/* 减弱动效时：涟漪与余烬也一并关闭 */
@media (prefers-reduced-motion: reduce) {
  .d25-ripple,
  .d25-ember-canvas {
    display: none !important;
  }

  .province-burn.visible {
    animation: none !important;
  }

  .province-overlay.burning {
    filter: none !important;
  }
}

/* ============================================================
   第三版追加：真·沙盘俯角 + 木质沙盘边框 + 事件追踪镜头
   ============================================================ */

/* 沙盘加大俯角，呈现实体沙盘的透视感 */
@media (pointer: fine) {
  .map-frame {
    transform: perspective(1500px) rotateX(calc(5deg + var(--tilt-x, 0deg))) rotateY(var(--tilt-y, 0deg)) scale(1.038);
  }
}

@media (pointer: coarse) {
  .map-frame {
    transform: rotateX(0);
  }
}

/* 沙盘底衬：深色木台 */
.map-frame {
  background: #1d150c;
}

/* 木质沙盘边框（绘制在顶层光效上，位于地图之上、控件之下） */
.map-frame::after {
  background: linear-gradient(118deg, rgba(255, 240, 205, 0.06), transparent 32%, rgba(0, 0, 0, 0.14) 88%);
  box-shadow:
    inset 0 0 0 5px #2b1f11,
    inset 0 0 0 6px rgba(255, 222, 160, 0.18),
    inset 0 0 0 8px #171008,
    inset 0 0 26px 10px rgba(0, 0, 0, 0.5);
}

/* 追踪镜头启动时，沙盘灯光微微提亮，目光聚焦于战场 */
.map-frame.is-zoomed {
  box-shadow:
    inset 0 2px 0 rgba(255, 238, 190, 0.08),
    inset 0 22px 46px rgba(0, 0, 0, 0.66),
    inset 0 -8px 24px rgba(0, 0, 0, 0.46),
    inset 12px 0 30px rgba(0, 0, 0, 0.32),
    inset -12px 0 30px rgba(0, 0, 0, 0.32),
    0 1px 0 rgba(255, 240, 200, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.6),
    0 0 60px rgba(201, 167, 101, 0.07);
}
