/* ==========================================================================
   map.css —— 地图图层样式
   --------------------------------------------------------------------------
   · 自绘引擎（js/map-engine.js）画 SVG，外观全靠 CSS 类；
   · 实景引擎（js/map-amap.js）画 HTML 覆盖物，几何定位（.am-*）来自本文件，
     观感由 JS 内联样式给；#map-stage 作用域的规则负责标注密度控制。
   漏掉任一半，那一半就按浏览器默认样式画（自绘：无描边/巨字；实景：标记堆在原点）。
   规则按"只留地图图层"从旧样式表抽出（按逗号拆分分组选择器，去掉旧页面排版）。
   字号一律按 --u（地图单位/屏幕像素）换算，见 js/map-engine.js。
   ========================================================================== */

/* ============================ 1 全局容器 ============================ */
#map-stage { position: absolute; inset: 0; }
/* 注意：这里必须是 absolute，不能是 fixed —— fixed 会让地图以视口为基准铺满整页，
   把门户的目录卡片与页脚全盖住（旧叙事页用 fixed 是因为那边地图本来就是全屏背景）。 */
#map-stage svg { display: block; width: 100%; height: 100%; }
/* 地图 SVG 内的标注：字号随相机缩放换算，保证任何级别都可读 */
.map-node { transition: opacity 0.5s ease; }
.map-node-dot { fill: var(--cream); stroke: #0c1218; stroke-width: calc(1.5 * var(--u, 0.3) * 1px); }
.map-node-dot.river { fill: #8fc4d8; }
.map-node-dot.area { fill: #c8a064; }
.map-node-dot.place { fill: rgba(244, 239, 230, 0.5);
  stroke: rgba(8, 12, 16, 0.8);
  stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.map-node-halo { fill: none; stroke: rgba(143, 196, 216, 0.45); stroke-width: calc(1.1 * var(--u, 0.3) * 1px); }
.map-node-label { font-family: var(--font-body);
  font-size: calc(13 * var(--u, 0.3) * 1px);
  font-weight: 600;
  fill: var(--cream);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.92);
  stroke-width: calc(3.2 * var(--u, 0.3) * 1px);
  letter-spacing: 0.02em; }
.map-node-label.minor { font-size: calc(11 * var(--u, 0.3) * 1px); fill: rgba(244, 239, 230, 0.74); }
.map-node-label.battle { fill: #ffd9a8; }
.map-node-note { font-family: var(--font-body);
  font-size: calc(9 * var(--u, 0.3) * 1px);
  fill: rgba(244, 239, 230, 0.5);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.88);
  stroke-width: calc(2.4 * var(--u, 0.3) * 1px); }
.map-river-label { font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #7fc0da;
  letter-spacing: 0.22em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.6 * var(--u, 0.3) * 1px); }
.map-ridge-label { font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: rgba(200, 145, 112, 0.95);
  letter-spacing: 0.18em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.7);
  stroke-width: calc(2.4 * var(--u, 0.3) * 1px); }
.map-area-label { font-family: var(--font-body);
  font-size: calc(10 * var(--u, 0.3) * 1px);
  fill: rgba(210, 175, 115, 0.85);
  letter-spacing: 0.24em; }
.map-province-label { font-family: var(--font-title);
  font-size: calc(34 * var(--u, 0.3) * 1px);
  font-weight: 700;
  fill: rgba(244, 239, 230, 0.14);
  letter-spacing: 0.42em; }
/* 沿线地名标注：只在近景出现，宽视野下让位于叙事节点 */
.map-node-label.place { font-size: calc(10.5 * var(--u, 0.3) * 1px);
  font-weight: 500;
  fill: rgba(244, 239, 230, 0.66); }
svg:not(.is-tight) .map-node-label.place { display: none; }
/* 近景（相机可视高度较小）时收敛标注，只保留主要地名与当前关注点的注记 */
svg.is-tight .map-node-label.minor { display: none; }
svg.is-tight .map-node:not(.is-focus) .map-node-note { display: none; }
/* 山名反向处理：只在近景显示。远景下它与叙事节点注记抢地方，
   而第一章另有专门的自然地理范围标注承担"大别山"这个名称。 */
svg:not(.is-tight) .map-ridge-label { display: none; }
.map-battle-disc { fill: var(--red-bright); opacity: 0.92; }
.map-battle-star { fill: #ffe9c9; }
.map-battle-ring { fill: none;
  stroke: #ff8a5c;
  stroke-width: calc(1.3 * var(--u, 0.3) * 1px);
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center; }
.map-node.is-focus .map-battle-ring { animation: ringPulse 1.9s ease-out infinite; }
.map-node.is-focus .map-node-dot, .map-node.is-focus .map-battle-disc { fill: var(--gold); }
.map-node.is-focus .map-node-label { fill: #ffe1b0; font-weight: 700; }
/* ==================== 3b 专题图层（按章切换的底图） ==================== */
/* 省域面：第一章"范围归属"（三省用不同色调区分，便于一眼看出归属） */
.provinceShape.area { fill: rgba(232, 181, 99, 0.055);
  stroke: rgba(232, 181, 99, 0.3);
  stroke-width: 1.1;
  stroke-dasharray: 5 3; }
.provinceShape[data-name="河南省"] { fill: rgba(232, 181, 99, 0.085); }
.provinceShape[data-name="湖北省"] { fill: rgba(106, 163, 154, 0.10); }
.provinceShape[data-name="安徽省"] { fill: rgba(118, 152, 205, 0.095); }
.provinceShape[data-name="山东省"] { fill: rgba(198, 138, 158, 0.075); }
/* 自然地理范围：用醒目的亮色虚线勾边来定义"山脉范围"，
   填色保持中性，避免与省域面撞色 */
.physio.area { fill: rgba(158, 156, 126, 0.10);
  stroke: rgba(206, 224, 150, 0.78);
  stroke-width: 1.5;
  stroke-dasharray: 8 4; }
/* 自然地理范围与主峰 */
.physio-label { font-family: var(--font-title);
  font-size: calc(15 * var(--u, 0.3) * 1px);
  fill: rgba(190, 220, 170, 0.8);
  letter-spacing: 0.3em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.8);
  stroke-width: calc(3 * var(--u, 0.3) * 1px); }
.physio-peak { fill: rgba(190, 220, 170, 0.85); stroke: rgba(8, 12, 16, 0.7); stroke-width: 0.3; }
.physio-peak-label { font-family: var(--font-body);
  font-size: calc(10 * var(--u, 0.3) * 1px);
  fill: rgba(205, 230, 185, 0.9);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.6 * var(--u, 0.3) * 1px); }
/* 鄂豫皖苏区核心范围 */
.su.area { fill: rgba(193, 39, 45, 0.22);
  stroke: rgba(255, 120, 90, 0.8);
  stroke-width: 1.3; }
/* 三年游击区：用暖金虚线区分于红色实线的苏区核心区，
   两者叠在一起时也能一眼分开 */
.su.area.guerrilla { fill: rgba(232, 181, 99, 0.07);
  stroke: rgba(232, 181, 99, 0.62);
  stroke-width: 1.2;
  stroke-dasharray: 7 4; }
.su-label { font-family: var(--font-title);
  font-size: calc(15 * var(--u, 0.3) * 1px);
  fill: rgba(255, 170, 145, 0.88);
  letter-spacing: 0.26em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(3 * var(--u, 0.3) * 1px); }
/* 国家级大别山革命老区全域 */
.lao.area { fill: rgba(232, 181, 99, 0.12);
  stroke: rgba(232, 181, 99, 0.6);
  stroke-width: 1.4;
  stroke-dasharray: 10 5; }
.lao-label { font-family: var(--font-title);
  font-size: calc(15 * var(--u, 0.3) * 1px);
  fill: rgba(245, 214, 155, 0.9);
  letter-spacing: 0.26em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(3 * var(--u, 0.3) * 1px); }
/* 关隘：菱形 */
.pass-glyph { fill: #d8c9a0; stroke: #0c1218; stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.pass-label { font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #e6dcc0;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px); }
.pass-sub { font-family: var(--font-body);
  font-size: calc(8.5 * var(--u, 0.3) * 1px);
  fill: rgba(230, 220, 192, 0.6);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.2 * var(--u, 0.3) * 1px); }
/* 历代兵事地点 */
.ancient-glyph { fill: #9fb3c8; stroke: #0c1218; stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.ancient-label { font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #cfe0ec;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px); }
.ancient-sub { font-family: var(--font-body);
  font-size: calc(8.5 * var(--u, 0.3) * 1px);
  fill: rgba(207, 224, 236, 0.6);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.2 * var(--u, 0.3) * 1px); }
/* 早期起义地点：红星标记 */
.uprisings-glyph { fill: #ff5a2b; stroke: #ffe0c2; stroke-width: calc(0.8 * var(--u, 0.3) * 1px); }
.uprisings-label { font-family: var(--font-body);
  font-size: calc(12 * var(--u, 0.3) * 1px);
  font-weight: 600;
  fill: #ffd9a8;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(3 * var(--u, 0.3) * 1px); }
.uprisings-sub { font-family: var(--font-body);
  font-size: calc(9 * var(--u, 0.3) * 1px);
  fill: rgba(255, 217, 168, 0.7);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.4 * var(--u, 0.3) * 1px); }
/* 当代红色景点 */
.site-glyph { fill: #e8b563; stroke: #0c1218; stroke-width: calc(0.9 * var(--u, 0.3) * 1px); }
.site-label { font-family: var(--font-body);
  font-size: calc(11 * var(--u, 0.3) * 1px);
  fill: #f0dcb4;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px); }
.site-sub { font-family: var(--font-body);
  font-size: calc(8.5 * var(--u, 0.3) * 1px);
  fill: rgba(240, 220, 180, 0.55);
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.85);
  stroke-width: calc(2.2 * var(--u, 0.3) * 1px); }
/* 当代红色景点数量多（20 余处），宽视野下只显示金点、不显示名称，
   拉近后逐点显示；这是专题地图控制注记密度的常规做法 */
svg:not(.is-tight) .site-label.in-modern, svg:not(.is-tight) .site-sub.in-modern { display: none; }
/* 专题路线（长征 / 抗日 / 突围） */
.march.line { fill: none; stroke-width: 1.15; stroke-linecap: round; }
.march.halo { fill: none; stroke-width: 2.6; opacity: 0.14; stroke-linecap: round; }
.march-stop { opacity: 0.9; }
.march-arrow { opacity: 0.95; }
.tone-red .march-line, .march.line.tone-red { stroke: #ff5a2b; }
.march.halo.tone-red { stroke: #ff6a3d; }
.march-stop.tone-red { fill: #ffd0b0; }
.march-arrow.tone-red { fill: #ff5a2b; }
.march.line.tone-gray { stroke: #9fb3c8; }
.march.halo.tone-gray { stroke: #9fb3c8; }
.march-stop.tone-gray { fill: #cfe0ec; }
.march-arrow.tone-gray { fill: #9fb3c8; }
.march.line.tone-gold { stroke: #e8b563; }
.march.halo.tone-gold { stroke: #e8b563; }
.march-stop.tone-gold { fill: #f5d69b; }
.march-arrow.tone-gold { fill: #e8b563; }
/* 出图指示：路线走出图幅时标出去向 */
.march-exitarrow { fill: rgba(255, 170, 130, 0.9); }
.march-exit { font-family: var(--font-body);
  font-size: calc(10.5 * var(--u, 0.3) * 1px);
  fill: #ffcfae;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, 0.9);
  stroke-width: calc(2.8 * var(--u, 0.3) * 1px); }
/* ================== 3c 高德实景底图模式（map-amap.js） ==================
   高德覆盖物用自有 HTML 承载，因此这里定义点、标注、副标的样式。
   与自绘模式不同：实景底图上标注用固定屏幕字号（px），不随缩放缩放，
   这是真实地图的常规做法。
   近景收敛沿用同一判据：容器带 is-tight 类时，由下列 descendant 规则控制显隐。 */

/* 覆盖物容器：0 尺寸锚点盒，圆点居中于锚点，标注绝对定位在其周围 */
.am-marker { position: relative; width: 0; height: 0; overflow: visible; }
.am-labelbox { position: relative; width: 0; height: 0; overflow: visible; }
.am-dot { position: absolute;
  left: 0; top: 0;
  width: 9px; height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--cream);
  border: 1.5px solid rgba(8, 12, 16, 0.9);
  box-sizing: border-box; }
.am-dot.am-battle { width: 15px; height: 15px;
  margin: -7.5px 0 0 -7.5px;
  background: var(--red-bright);
  border-color: #ffe9c9;
  box-shadow: 0 0 0 3px rgba(255, 90, 43, 0.28); }
.am-dot.am-riverdot { background: #8fc4d8; }
.am-dot.am-areadot { background: #c8a064; }
.am-dot.am-citydot { width: 8px; height: 8px; margin: -4px 0 0 -4px; }
.am-dot.am-placedot { width: 5px; height: 5px; margin: -2.5px 0 0 -2.5px; background: rgba(244, 239, 230, 0.6); border-width: 1px; }
.am-dot.am-pass { border-radius: 1px; transform: rotate(45deg); background: var(--pass, #d8c9a0); }
.am-dot.am-ancient { background: #9fb3c8; }
.am-dot.am-uprising { background: var(--red-bright); border-color: #ffe0c2; box-shadow: 0 0 0 3px rgba(255, 90, 43, 0.25); }
.am-dot.am-site { background: var(--gold); border-color: rgba(8, 12, 16, 0.85); }
.am-dot.am-peak { width: 0; height: 0;
  margin: -6px 0 0 -6px;
  border-radius: 0;
  background: none;
  border: none;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 11px solid rgba(206, 224, 150, 0.95); }
/* 标注文字 */
.am-lbl, .am-sub { position: absolute;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.2;
  color: var(--cream);
  text-shadow: 0 1px 2px #000, 0 0 4px #000, 0 0 8px rgba(0, 0, 0, 0.9);
  pointer-events: none; }
.am-sub { font-size: 10px; color: rgba(244, 239, 230, 0.62); }
.am-lbl-top { left: 0; bottom: 8px; transform: translateX(-50%); }
.am-lbl-bottom { left: 0; top: 8px; transform: translateX(-50%); }
.am-lbl-left { right: 8px; top: 0; transform: translateY(-50%); }
.am-lbl-right { left: 8px; top: 0; transform: translateY(-50%); }
.am-sub.am-lbl-top { bottom: -20px; }
.am-sub.am-lbl-bottom { top: 22px; }
.am-sub.am-lbl-left { top: 14px; }
.am-sub.am-lbl-right { top: 14px; }
/* 节点与景点的强调样式 */
.am-nodelbl-battle { color: #ffd9a8; font-weight: 600; }
.am-nodelbl-minor { font-size: 11px; color: rgba(244, 239, 230, 0.74); font-weight: 500; }
.am-nodelbl-place { font-size: 10.5px; color: rgba(244, 239, 230, 0.66); font-weight: 500; }
.am-peaklbl { font-size: 10px; color: rgba(205, 230, 185, 0.95); }
.am-passlbl { font-size: 11px; color: #e6dcc0; }
.am-ancientlbl { font-size: 11px; color: #cfe0ec; }
.am-uplbl { font-size: 12px; color: #ffd9a8; font-weight: 600; }
.am-sitelbl { font-size: 11px; color: #f0dcb4; }
/* 面名与线名 */
.am-label { font-family: var(--font-title); font-size: 15px; color: rgba(244, 239, 230, 0.9); letter-spacing: 0.2em; text-shadow: 0 1px 3px #000, 0 0 6px #000; pointer-events: none; white-space: nowrap; }
.am-province { font-size: 22px; color: rgba(244, 239, 230, 0.35); letter-spacing: 0.4em; font-weight: 700; }
.am-ridge { font-size: 11px; color: rgba(200, 145, 112, 0.95); letter-spacing: 0.18em; }
.am-river { font-size: 11px; color: #7fc0da; letter-spacing: 0.2em; }
.am-area { font-size: 10px; color: rgba(210, 175, 115, 0.9); letter-spacing: 0.22em; }
.am-physio { font-size: 15px; color: rgba(206, 224, 150, 0.85); letter-spacing: 0.3em; }
.am-su { font-size: 15px; color: rgba(255, 170, 145, 0.9); letter-spacing: 0.24em; }
.am-lao { font-size: 15px; color: rgba(245, 214, 155, 0.9); letter-spacing: 0.24em; }
.am-exit { font-size: 11px; color: #ffcfae; letter-spacing: 0.02em; }
/* 关注点脉冲 */
.am-marker .is-focus { color: #ffe1b0; }
.am-marker.is-focus .am-dot { background: var(--gold);
  animation: amPulse 1.9s ease-out infinite; }
/* 近景 / 远景收敛（与自绘引擎同一套语义） */
#map-stage:not(.is-tight) .in-modern { display: none; }
#map-stage:not(.is-tight) .am-nodelbl-place { display: none; }
#map-stage.is-tight .am-nodelbl-minor { display: none; }
#map-stage.is-tight .am-ridge { display: none; }
#map-stage.is-tight .am-sub:not(.is-focus) { display: none; }
/* 底图切换按钮已移入导航栏（见 #map-toggle），此处不再需要 hud-toggle */

/* 天地图没有暗色底图，与页面深色基调不协。这里用 CSS 滤镜调整底图瓦片：
   只作用于 http(s) 来源的瓦片图与 canvas，
   本作品的专题覆盖物是 data-URI SVG 图标，不受影响、颜色不会被反转。

   强度由 --basemap-filter 控制（config.js 的 baseMapFilter 可覆盖）：
   压得越狠越融进深色页面，但真实地物的细节（路网、水系、地名）也越糊。
   默认值刻意保留了较高的对比度与饱和度，让"这是真实地图"看得出来。 */
#map-stage.tdt-dark img[src^="http"] { filter: var(--basemap-filter,
    invert(1) hue-rotate(180deg) brightness(1.04) contrast(1.34) saturate(1.18)); }
#map-stage.tdt-dark canvas { filter: var(--basemap-filter,
    invert(1) hue-rotate(180deg) brightness(1.04) contrast(1.34) saturate(1.18)); }
.route-line { display: flex;
  gap: 0.9rem;
  padding: 0.85rem 0;
  border-bottom: 1px dashed rgba(232, 181, 99, 0.18); }
.route-line-name { flex: none;
  width: 5.2rem;
  font-family: var(--font-title);
  font-size: 0.95rem;
  color: var(--gold);
  letter-spacing: 0.08em; }
.route-line-text { font-size: 0.94rem;
  color: rgba(244, 239, 230, 0.8); }
[data-c34id].is-c34-active .uprisings-glyph, [data-c34id].is-c34-active .site-glyph { stroke: #fff; stroke-width: 1.1; }
/* 三大起义的强调圈（黄麻／商南／六霍）：外虚内实，宽视野下也能一眼分出来 */
.uprisings-ring { fill: none; stroke: var(--gold); stroke-width: 0.75; opacity: 0.9;
  stroke-dasharray: 1.7 1.3; }
.uprisings-ring-inner { fill: none; stroke: var(--gold); stroke-width: 0.35; opacity: 0.55; }
/* 标注避让：被隐藏的标注用透明度收起（不用 display，避免影响布局测量） */
.uprisings-label, .uprisings-sub, .site-label, .site-sub { transition: opacity .12s linear; }
/* 关联/外围条目在自绘引擎里用空心圆区分 */
.g-c34rel .uprisings-glyph { fill: none !important; stroke: var(--gray); stroke-width: 1; }
.rel-c34 .am-dot { background: none !important; border: 2px solid var(--gray) !important; }
/* ------------------------------------------------- 大别山行政范围标注（新图层）
   必须像其他标注一样按 --u 换算字号：漏掉这条规则时，文字会退回 SVG 默认的
   16 用户单位，在 viewBox 缩放下变成约 50px 的巨字（第三章截图里那个问题）。 */
.admin-label { font-family: var(--font-title);
  font-size: calc(14 * var(--u, .3) * 1px);
  fill: rgba(178, 216, 240, .92);
  letter-spacing: .18em;
  paint-order: stroke;
  stroke: rgba(8, 12, 16, .85);
  stroke-width: calc(3 * var(--u, .3) * 1px); }
/* 兜底：任何没被上面具体类命中的 SVG 文字都不许退回默认 16 用户单位。
   用 :where() 把优先级压到 0，保证不会盖掉 .map-node-label 这类既有规则。 */
:where(#dabie-svg) text { font-size: calc(11 * var(--u, .3) * 1px); }
/* 大别山行政范围（范围归属）面：自绘引擎按类上色，缺这条规则整层面就看不见
   （高德底图走 map-style.js 的 JS 样式，所以那边一直正常）。 */
.admin.area { fill: rgba(140, 205, 240, .07);
  stroke: rgba(140, 205, 240, .62);
  stroke-width: calc(1.15 * var(--u, .3) * 1px); }

/* 尊重"减少动效"偏好：战斗光环不再脉动 */
@media (prefers-reduced-motion: reduce) {
  .map-node.is-focus .map-battle-ring { animation: none; opacity: .7; }
}
