/* ============================================================
 * 全球能源项目世界地图 —— 样式
 * 深色「指挥中心」风格
 * ============================================================ */
:root {
  --bg: #060b18;
  --bg-2: #0a1224;
  --panel: rgba(16, 26, 48, 0.72);
  --panel-solid: #101a30;
  --border: rgba(120, 160, 220, 0.16);
  --border-strong: rgba(120, 160, 220, 0.34);
  --txt: #e8eefb;
  --txt-dim: #93a4c4;
  --txt-faint: #7b8ca6; /* 辅助文字：对 --bg / #101a30 卡底对比度 ≥5:1（WCAG AA），勿调暗 */
  --accent: #21c7ff;
  --good: #2ee6a6;
  --warn: #ffb02e;
  --plan: #5f718f;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background:
    radial-gradient(1200px 700px at 72% -10%, rgba(33, 199, 255, 0.10), transparent 60%),
    radial-gradient(900px 600px at 8% 110%, rgba(46, 230, 166, 0.08), transparent 60%),
    var(--bg);
  color: var(--txt);
  font-family: "PingFang SC", "Microsoft YaHei", "HarmonyOS Sans SC", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  overflow: hidden;
}

/* ---------- 布局骨架 ---------- */
.app {
  height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 12px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(10, 18, 36, 0.95), rgba(10, 18, 36, 0.6));
  backdrop-filter: blur(8px);
  z-index: 20;
}
.brand { display: flex; align-items: center; gap: 13px; min-width: 0; }
.brand .logo {
  width: 38px; height: 38px; flex: none;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 20px;
  background: linear-gradient(135deg, rgba(33,199,255,0.25), rgba(46,230,166,0.18));
  border: 1px solid var(--border-strong);
  box-shadow: inset 0 0 18px rgba(33,199,255,0.18);
}
.brand h1 { font-size: 17px; margin: 0; font-weight: 700; letter-spacing: .5px; white-space: nowrap; }
.brand .sub { font-size: 11px; color: var(--txt-dim); margin-top: 2px; white-space: nowrap; letter-spacing: 1px; }

.kpis { display: flex; gap: 26px; margin-left: auto; }
.kpi { text-align: right; }
.kpi .num { font-size: 21px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.kpi .lab { font-size: 11px; color: var(--txt-dim); margin-top: 4px; }
.kpi .num.accent { color: var(--accent); }
.kpi .num.good { color: var(--good); }
.kpi .num.warn { color: var(--warn); }

/* 移动端：顶栏「关键数据」开关（桌面端隐藏，由 ≤820px 媒体查询点亮）*/
.kpi-toggle {
  display: none; align-items: center; gap: 5px; flex: none;
  padding: 7px 11px; font-size: 12px; font-weight: 600; color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border);
  border-radius: 18px; cursor: pointer; white-space: nowrap;
}
.kpi-toggle .kt-ico { font-size: 13px; line-height: 1; }
.kpi-toggle .kt-car { font-size: 10px; transition: transform .2s; }
.kpi-toggle:active { transform: scale(.97); }
.topbar.kpis-open .kpi-toggle { color: var(--txt); border-color: var(--border-strong); }
.topbar.kpis-open .kpi-toggle .kt-car { transform: rotate(180deg); }

.main {
  display: grid;
  grid-template-columns: 286px 1fr 330px;
  min-height: 0;
}

/* ---------- 通用面板 ---------- */
.side {
  background: var(--panel);
  backdrop-filter: blur(10px);
  overflow-y: auto;
  padding: 16px 14px 28px;
}
.side.left { border-right: 1px solid var(--border); }
.side.right { border-left: 1px solid var(--border); }

.block { margin-bottom: 22px; }
.block-title {
  font-size: 12px; letter-spacing: 1.5px; color: var(--txt-dim);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  margin: 0 0 11px;
}
.block-title::before {
  content: ""; width: 3px; height: 13px; border-radius: 2px;
  background: linear-gradient(var(--accent), var(--good));
}
.block-title .count { margin-left: auto; color: var(--txt-faint); font-size: 11px; letter-spacing: 0; }

/* ---------- 搜索 ---------- */
.search {
  position: relative; margin-bottom: 18px;
}
.search input {
  width: 100%; padding: 9px 12px 9px 32px;
  background: rgba(0,0,0,0.25); color: var(--txt);
  border: 1px solid var(--border); border-radius: 10px;
  font-size: 13px; outline: none; transition: border-color .15s;
}
.search input:focus { border-color: var(--accent); }
.search input::placeholder { color: var(--txt-faint); }
.search .ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--txt-faint); font-size: 13px; }

/* ---------- 分类筛选 chips ---------- */
.cat-list { display: flex; flex-direction: column; gap: 6px; }
.cat-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.02);
  transition: background .15s, border-color .15s, opacity .15s;
  user-select: none;
}
.cat-chip:hover { background: rgba(255,255,255,0.05); }
.cat-chip .dot { width: 10px; height: 10px; border-radius: 50%; flex: none; box-shadow: 0 0 8px currentColor; }
.cat-chip .nm { flex: 1; font-size: 13px; }
.cat-chip .ct { font-size: 12px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
.cat-chip.off { opacity: 0.38; }
.cat-chip.off .dot { box-shadow: none; }
/* 展开子分类：独立的带边框小按钮，和计数分开，让"开关显示 vs 展开子类"一眼可分（方案 B）*/
.cat-chip .caret {
  flex: none; display: grid; place-items: center;
  width: 26px; height: 26px; margin-left: 4px;
  font-size: 12px; color: var(--txt-dim);
  border: 1px solid var(--border); border-radius: 7px;
  background: rgba(255, 255, 255, 0.04);
  transition: transform .15s, color .15s, background .15s, border-color .15s;
}
.cat-chip .caret:hover { color: var(--accent); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.1); }
.cat-group.open .cat-chip .caret { transform: rotate(90deg); color: var(--accent); border-color: var(--accent); background: rgba(33, 199, 255, 0.14); }
.sub-list { display: none; flex-direction: column; gap: 2px; margin: 5px 0 3px 13px; padding-left: 11px; border-left: 1px dashed var(--border); }
.cat-group.open .sub-list { display: flex; }
.sub-chip { display: flex; align-items: center; gap: 7px; padding: 4px 8px; border-radius: 7px; cursor: pointer; font-size: 12px; color: var(--txt-dim); transition: background .15s; }
.sub-chip:hover { background: rgba(255,255,255,0.05); }
.sub-chip .sdot { width: 6px; height: 6px; border-radius: 50%; flex: none; opacity: 0.85; }
.sub-chip .snm { flex: 1; }
.sub-chip .sct { color: var(--txt-faint); font-variant-numeric: tabular-nums; font-size: 11px; }
.sub-chip.off { opacity: 0.4; }
.sub-chip.off .snm { text-decoration: line-through; }
/* 当前筛选下为 0 个项目的子类：弱化，让有内容的子类更突出（仍可点击）*/
.sub-chip.is-zero { opacity: 0.4; }
.sub-chip.is-zero .sdot { box-shadow: none; filter: grayscale(0.6); }

.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pill {
  padding: 5px 11px; border-radius: 20px; cursor: pointer; font-size: 12px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  color: var(--txt-dim); transition: all .15s; user-select: none;
}
.pill:hover { border-color: var(--border-strong); color: var(--txt); }
.pill.on { background: rgba(33,199,255,0.16); border-color: var(--accent); color: #cdeeff; }

/* 状态色 */
.pill.status.on[data-v="规划"] { background: rgba(95,113,143,0.25); border-color: #8090ad; color: #cdd6e6; }
.pill.status.on[data-v="在建"] { background: rgba(255,176,46,0.18); border-color: var(--warn); color: #ffe0a8; }
.pill.status.on[data-v="投运"] { background: rgba(46,230,166,0.16); border-color: var(--good); color: #b6f5df; }

/* ---------- 所属大区 → 国家树（可展开列出各区国家，点国家筛选地图） ---------- */
.region-tree { display: flex; flex-direction: column; gap: 5px; }
.region-group { border-radius: 9px; }
.region-group.has-sel { background: rgba(46,230,166,0.05); }
.region-row { display: flex; align-items: center; gap: 7px; }
.region-row .rg-pill { flex: none; }
.region-row .rg-meta { flex: 1; font-size: 10.5px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
/* 区域展开按钮：与品类「展开子类」按钮一致的带边框小方块，明显可点（方案 B）*/
.rg-caret {
  flex: none; display: grid; place-items: center; cursor: pointer; user-select: none;
  width: 26px; height: 26px; font-size: 12px; color: var(--txt-dim);
  border: 1px solid var(--border); border-radius: 7px; background: rgba(255, 255, 255, 0.04);
  transition: transform .15s, color .15s, background .15s, border-color .15s;
}
.rg-caret:hover { color: var(--accent); border-color: var(--border-strong); background: rgba(255, 255, 255, 0.1); }
.region-group.open .rg-caret { transform: rotate(90deg); color: var(--accent); border-color: var(--accent); background: rgba(33, 199, 255, 0.14); }
.country-list { display: none; flex-wrap: wrap; gap: 5px; margin: 6px 0 4px 4px; padding: 4px 0 4px 10px; border-left: 1px dashed var(--border); }
.region-group.open .country-list { display: flex; }
.country-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 8px; border-radius: 14px;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02); color: var(--txt-dim);
  font-size: 11.5px; cursor: pointer; user-select: none; transition: all .15s;
}
.country-chip:hover { border-color: var(--border-strong); color: var(--txt); }
.country-chip .cc { font-style: normal; font-size: 10px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
.country-chip.on { background: rgba(46,230,166,0.16); border-color: var(--good); color: #b6f5df; }
.country-chip.on .cc { color: #8de9c6; }
.country-empty { font-size: 11px; color: var(--txt-faint); padding: 2px 4px; }

/* ---------- 年份滑块 ---------- */
.year-wrap { padding: 0 2px; }
.year-val { display: flex; justify-content: space-between; font-size: 12px; color: var(--txt-dim); margin-bottom: 8px; }
.year-val b { color: var(--accent); font-size: 14px; font-variant-numeric: tabular-nums; }
input[type=range] {
  -webkit-appearance: none; width: 100%; height: 4px; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--good)); outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: #fff; border: 2px solid var(--accent); cursor: pointer;
  box-shadow: 0 0 10px rgba(33,199,255,0.7);
}

.btn-reset {
  width: 100%; padding: 9px; margin-top: 4px;
  background: rgba(255,255,255,0.04); color: var(--txt-dim);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  font-size: 13px; transition: all .15s;
}
.btn-reset:hover { color: var(--txt); border-color: var(--border-strong); }

/* ---------- 地图 ---------- */
.map-wrap { position: relative; min-width: 0; }
#map { width: 100%; height: 100%; }
.map-hint {
  position: absolute; left: 16px; bottom: 14px; z-index: 5;
  font-size: 11px; color: var(--txt-faint); pointer-events: none;
  letter-spacing: .5px;
}

/* ---------- 统计：分类条形 ---------- */
.bar-row { margin-bottom: 9px; }
.bar-head { display: flex; align-items: center; gap: 7px; font-size: 12px; margin-bottom: 4px; }
.bar-head .dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.bar-head .nm { flex: 1; color: var(--txt); }
.bar-head .vv { color: var(--txt-dim); font-variant-numeric: tabular-nums; }
.bar-track { height: 6px; border-radius: 4px; background: rgba(255,255,255,0.06); overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; transition: width .5s cubic-bezier(.2,.8,.2,1); }

/* 区域分布 */
.region-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.region-cell {
  padding: 9px 10px; border-radius: 10px; background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
}
.region-cell .rv { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; }
.region-cell .rl { font-size: 11px; color: var(--txt-dim); margin-top: 2px; }

/* 项目列表 */
.proj-list { display: flex; flex-direction: column; gap: 6px; }
.proj-item {
  padding: 9px 11px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--border); background: rgba(255,255,255,0.02);
  transition: all .15s; border-left: 3px solid transparent;
}
.proj-item:hover { background: rgba(255,255,255,0.06); transform: translateX(2px); }
.proj-item .pn { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.proj-item .pn .star { color: var(--warn); font-size: 11px; }
.proj-item .pm { font-size: 11px; color: var(--txt-dim); margin-top: 3px; display: flex; gap: 8px; }

/* ---------- 详情卡 ---------- */
.detail {
  position: absolute; left: 16px; top: 16px; width: 332px; z-index: 15;
  background: var(--panel-solid);
  border: 1px solid var(--border-strong); border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden; transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
  /* 桌面默认限高（窄屏会在下方 @media 用 dvh 覆盖）；放在基础规则里，确保 @media 的窄屏值能后置覆盖 */
  max-height: calc(100vh - 110px);
}
.detail.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.detail .d-top { padding: 14px 16px; position: relative; }
.detail .d-cat {
  display: inline-flex; align-items: center; gap: 6px; font-size: 11px;
  padding: 3px 9px; border-radius: 12px; margin-bottom: 9px; font-weight: 600;
  /* 顶部右侧排着 ☆ 收藏 / EN 语言切换 / 🔗 / ✕ 四个绝对定位按钮（最左到 ≈132px）；
     给品类胶囊留出右侧空间并允许换行，避免长「品类·子类」把按钮盖住 */
  max-width: calc(100% - 142px); box-sizing: border-box;
}
.detail .d-name { font-size: 17px; font-weight: 800; line-height: 1.3; }
.detail .d-en { font-size: 11px; color: var(--txt-faint); margin-top: 3px; }
.detail .d-close {
  position: absolute; right: 12px; top: 12px; width: 24px; height: 24px;
  border-radius: 7px; border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--txt-dim); cursor: pointer; font-size: 14px; line-height: 1;
  display: grid; place-items: center;
}
.detail .d-close:hover { color: #fff; border-color: var(--border-strong); }
.detail .d-share {
  position: absolute; right: 42px; top: 12px; height: 24px; padding: 0 8px;
  border-radius: 7px; border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--txt-dim); cursor: pointer; font-size: 12px; line-height: 1;
  display: grid; place-items: center;
}
.detail .d-share:hover { color: var(--accent); border-color: var(--border-strong); }
.detail .d-lang {
  position: absolute; right: 74px; top: 12px; height: 24px; padding: 0 8px;
  border-radius: 7px; border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--txt-dim); cursor: pointer; font-size: 11px; font-weight: 800; letter-spacing: .04em; line-height: 1;
  display: grid; place-items: center;
}
.detail .d-lang:hover { color: #fff; border-color: var(--border-strong); }
.detail .d-fav {
  position: absolute; right: 106px; top: 12px; width: 26px; height: 24px; padding: 0;
  border-radius: 7px; border: 1px solid var(--border); background: rgba(255,255,255,0.04);
  color: var(--txt-dim); cursor: pointer; font-size: 13px; line-height: 1;
  display: grid; place-items: center;
}
.detail .d-fav:hover { color: #ffd45f; border-color: rgba(255, 212, 95, 0.5); }
.detail .d-fav.on { color: #ffd45f; border-color: rgba(255, 212, 95, 0.55); background: rgba(255, 212, 95, 0.12); }
.detail .d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.detail .d-cell { background: var(--panel-solid); padding: 10px 14px; }
.detail .d-cell .k { font-size: 10px; color: var(--txt-faint); letter-spacing: .5px; }
.detail .d-cell .v { font-size: 13px; font-weight: 600; margin-top: 3px; }
.detail .d-desc { padding: 13px 16px; font-size: 12.5px; line-height: 1.65; color: var(--txt-dim); border-top: 1px solid var(--border); }

.tag-status { font-size: 11px; padding: 2px 8px; border-radius: 6px; font-weight: 600; }
.st-规划 { background: rgba(95,113,143,0.28); color: #cdd6e6; }
.st-在建 { background: rgba(255,176,46,0.2); color: #ffd596; }
.st-投运 { background: rgba(46,230,166,0.18); color: #9defcf; }

/* ---------- 滚动条 ---------- */
.side::-webkit-scrollbar { width: 8px; }
.side::-webkit-scrollbar-thumb { background: rgba(120,160,220,0.2); border-radius: 8px; }
.side::-webkit-scrollbar-track { background: transparent; }

.empty { color: var(--txt-faint); font-size: 12px; text-align: center; padding: 16px 0; }

/* ---------- 响应式 / 移动端抽屉 ---------- */
/* 浮动触发按钮：默认隐藏，窄屏由媒体查询点亮（修复此前 ≤820px 双栏 display:none 导致手机无法筛选/搜索）*/
.mobile-fab {
  display: none;
  position: fixed; bottom: 18px; z-index: 1850;
  padding: 11px 15px; font-size: 13px; font-weight: 700; letter-spacing: .3px;
  color: var(--txt); background: var(--panel-solid);
  border: 1px solid var(--border-strong); border-radius: 24px;
  box-shadow: var(--shadow); backdrop-filter: blur(8px); cursor: pointer;
}
.mobile-fab:active { transform: scale(.96); }
.fab-left  { left: 16px; }
.fab-right { right: 16px; }

/* 抽屉顶部「收起」条（仅抽屉模式显示）*/
.drawer-close {
  display: none; position: sticky; top: -16px; z-index: 6;
  margin: -16px -14px 12px; padding: 14px;
  text-align: center; font-size: 14px; font-weight: 700; color: var(--txt);
  background: rgba(10, 18, 36, 0.98); backdrop-filter: blur(8px);
  border: none; border-bottom: 1px solid var(--border); cursor: pointer;
}
.drawer-close:hover { color: var(--accent); }

/* 抽屉遮罩 */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 1900;
  background: rgba(4, 8, 18, 0.5); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

/* ≤1180px：右侧统计栏 → 右抽屉（📊 浮钮调出）*/
@media (max-width: 1180px) {
  .main { grid-template-columns: 250px 1fr; }
  .side.right {
    position: fixed; top: 0; bottom: 0; right: 0; z-index: 2000;
    width: 86%; max-width: 340px; transform: translateX(104%);
    background: rgba(10, 18, 36, 0.97);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1);
    box-shadow: var(--shadow); border-left: 1px solid var(--border-strong);
  }
  .side.right.open { transform: translateX(0); }
  .side.right .drawer-close { display: block; }
  .fab-right { display: block; }
  /* 📊 浮钮在右下 → 热力图例上移让位 */
  .heat-legend { bottom: 70px; }
}

/* ≤820px：左侧筛选栏 → 左抽屉（🔍 浮钮调出），地图全宽 */
@media (max-width: 820px) {
  .main { grid-template-columns: 1fr; }
  .side.left {
    position: fixed; top: 0; bottom: 0; left: 0; z-index: 2000;
    width: 86%; max-width: 340px; transform: translateX(-104%);
    background: rgba(10, 18, 36, 0.97);
    transition: transform .26s cubic-bezier(.2, .8, .2, 1);
    box-shadow: var(--shadow); border-right: 1px solid var(--border-strong);
  }
  .side.left.open { transform: translateX(0); }
  .side.left .drawer-close { display: block; }
  .fab-left { display: block; }

  /* 顶栏精简成一行：logo + 标题 + 📊 数据开关；英文副标隐藏、KPI 收起，最大化地图。
     点「📊 数据」后 4 个 KPI 在下方换成 2×2 全显示 */
  .topbar { flex-wrap: wrap; gap: 8px 12px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .brand { flex: 1 1 auto; min-width: 0; gap: 9px; }
  .brand .logo { width: 30px; height: 30px; font-size: 16px; }
  .brand > div { min-width: 0; }
  .brand h1 { font-size: 15px; overflow: hidden; text-overflow: ellipsis; }
  .brand .sub-en { display: none; }
  .brand .sub { font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .topbar .kpi-toggle { display: inline-flex; }
  .kpis { display: none; margin-left: 0; width: 100%; flex-wrap: wrap; gap: 10px 16px; }
  .topbar.kpis-open .kpis { display: flex; }
  .kpi { text-align: left; flex: 1 0 40%; }
  .kpi .num { font-size: 19px; }

  /* 触控目标放大到更接近 44px：品类行/展开按钮/子类/国家/年份滑块 */
  .cat-chip { padding: 11px 12px; }
  .cat-chip .caret { width: 34px; height: 34px; font-size: 13px; }
  .sub-chip { padding: 8px; min-height: 34px; }
  .country-chip { padding: 7px 11px; }
  .rg-caret { width: 34px; height: 34px; }
  /* 滑块拇指触控目标 ≥44px：透明边框扩大命中区（双滑块只有拇指接收事件），视觉圆点仍 ~20px */
  input[type=range]::-webkit-slider-thumb,
  .range-dual input[type=range]::-webkit-slider-thumb {
    width: 44px; height: 44px; border: 12px solid transparent;
    background-clip: padding-box; box-shadow: none;
  }
  .range-dual input[type=range]::-moz-range-thumb {
    width: 44px; height: 44px; border: 12px solid transparent;
    background-clip: padding-box; box-shadow: none;
  }
  .range-dual { height: 44px; }
  .range-dual input[type=range] { height: 44px; }
  .range-dual .rd-track, .range-dual .rd-fill { top: 20px; }

  /* 右上角工具栏折叠成「⋯」菜单，点开才展开 8 个按钮，避免竖排占满屏。
     用 .map-tools .tools-toggle 提高优先级，压过后文 .tools-toggle{display:none} 基础规则 */
  .map-tools .tools-toggle { display: grid; place-items: center; }
  .map-tools > :not(.tools-toggle) { display: none; }
  .map-tools.tools-open > :not(.tools-toggle) { display: flex; }
  .map-tools.tools-open .tools-toggle { color: var(--accent); border-color: var(--accent); }

  /* iPhone 安全区：底部浮动按钮上移让开 home 横条 / 浏览器底栏 */
  .mobile-fab { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
  /* 缩放控件改放地图左上角（见 app.js：窄屏 topleft），彻底避开底部 🔍/📊 浮钮；
     左上角的详情卡相应下移，避免开卡时挡住缩放 ＋/－ */
  .detail { top: 76px; }
  /* 窄屏：用动态视口高度（dvh）顶住底部浏览器栏，给底部 🔍/📊 浮钮留出余量，超长内容整卡可滑动 */
  .detail { max-height: calc(100dvh - 168px); }
  /* 🔍 浮钮在左下 → 热力分面条上移让位 */
  .heat-facets { bottom: 70px; }
}

/* ============================================================
 * Leaflet 瓦片地图适配
 * ============================================================ */
#map { background: #0a1020; }
.leaflet-container { background: #0a1020; font-family: inherit; outline: none; }
.leaflet-container a { color: var(--accent); }

/* 缩放控件 / 归属 暗色化 */
.leaflet-bar a, .leaflet-bar a:hover {
  background: var(--panel-solid); color: var(--txt);
  border-bottom-color: var(--border); width: 32px; height: 32px; line-height: 32px;
}
.leaflet-bar a:hover { background: #16233f; }
.leaflet-bar { border: 1px solid var(--border); box-shadow: var(--shadow); }
.leaflet-control-attribution {
  background: rgba(6, 11, 24, 0.66) !important; color: var(--txt-faint) !important;
  font-size: 10px; padding: 1px 6px; border-radius: 6px 0 0 0;
}
.leaflet-control-attribution a { color: var(--txt-dim) !important; }

/* 项目标记（divIcon） */
.mk { background: transparent; border: none; }
.mk .dot {
  display: block; border-radius: 50%; background: var(--c);
  border: 1.5px solid rgba(255, 255, 255, 0.78);
  box-shadow: 0 0 9px var(--c), 0 0 3px rgba(0, 0, 0, 0.7);
  position: relative; cursor: pointer;
}
.mk .dot.is-flag::after {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--c); animation: mkpulse 2.4s ease-out infinite;
}
@keyframes mkpulse { 0% { transform: scale(0.85); opacity: 0.85; } 100% { transform: scale(2.7); opacity: 0; } }
.mk .dot.is-new::before {
  content: ''; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px dashed rgba(255, 255, 255, 0.8);
}

/* 流动飞线 */
.flowline { pointer-events: none; animation: mkflow 0.9s linear infinite; }
@keyframes mkflow { to { stroke-dashoffset: -12; } }

/* 聚合气泡（按主导品类着色 + 计数） */
.mk-cluster { background: transparent; border: none; }
.mkc {
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(10, 18, 36, 0.88); border: 2px solid var(--c);
  box-shadow: 0 0 16px var(--c), 0 2px 10px rgba(0, 0, 0, 0.5), inset 0 0 14px rgba(255, 255, 255, 0.06);
  color: #eaf2ff; cursor: pointer; transition: transform 0.12s;
}
.mkc:hover { transform: scale(1.08); }
.mkc b { font-size: 13px; font-weight: 800; font-variant-numeric: tabular-nums; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6); }
.leaflet-cluster-spider-leg { stroke: rgba(120, 160, 220, 0.5); stroke-width: 1.2; }

/* 悬浮提示 */
.leaflet-tooltip.mk-tip {
  background: rgba(10, 18, 36, 0.96); border: 1px solid var(--border-strong);
  color: var(--txt); border-radius: 9px; box-shadow: var(--shadow);
  font-size: 12px; line-height: 1.7; padding: 7px 11px; white-space: nowrap;
}
.leaflet-tooltip.mk-tip::before { display: none; }

/* 地图工具：底图切换 + 复位 */
.map-tools { position: absolute; top: 14px; right: 14px; z-index: 1200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
/* ⋯ 工具开关：仅移动端可见（媒体查询点亮），桌面端隐藏。
   用青色描边 + 工具图标，避免深色按钮在深色地图上"隐身"找不到 */
.tools-toggle {
  display: none; width: 42px; height: 42px; flex: none;
  font-size: 19px; line-height: 1; color: #cdeeff;
  background: rgba(13, 22, 44, 0.94); border: 1px solid var(--accent);
  border-radius: 12px; cursor: pointer; backdrop-filter: blur(8px);
  box-shadow: 0 0 0 1px rgba(33, 199, 255, 0.25), var(--shadow);
}
.tools-toggle:active { transform: scale(.95); }
.basemap-switch { display: flex; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.basemap-switch .bm { padding: 7px 11px; font-size: 12px; color: var(--txt-dim); cursor: pointer; border-right: 1px solid var(--border); transition: all 0.15s; user-select: none; }
.basemap-switch .bm:last-child { border-right: none; }
.basemap-switch .bm:hover { color: var(--txt); background: rgba(255, 255, 255, 0.05); }
.basemap-switch .bm.on { background: rgba(33, 199, 255, 0.18); color: #cdeeff; }
.btn-home { padding: 7px 12px; font-size: 12px; color: var(--txt-dim); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; backdrop-filter: blur(8px); box-shadow: var(--shadow); }
.btn-home:hover { color: var(--txt); border-color: var(--border-strong); }
/* 🌐 3D 地球版入口（链接到 globe.html）：青绿渐变描边，从工具条里"跳"出来 */
.btn-globe3d { display: inline-block; padding: 7px 12px; font-size: 12px; font-weight: 600; color: #cdeeff; text-decoration: none; white-space: nowrap; cursor: pointer; border-radius: 10px; border: 1px solid var(--accent); background: linear-gradient(90deg, rgba(33,199,255,0.22), rgba(46,230,166,0.18)); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(33,199,255,0.25), var(--shadow); transition: all .15s; }
.btn-globe3d:hover { color: #fff; box-shadow: 0 0 0 1px rgba(33,199,255,0.5), 0 0 18px rgba(33,199,255,0.35), var(--shadow); }
/* 🎓 国际销售话术陪练入口（链接到 coach.html）：金绿渐变描边，从工具条里"跳"出来 */
.btn-coach { display: inline-block; padding: 7px 12px; font-size: 12px; font-weight: 600; color: #fdebc0; text-decoration: none; white-space: nowrap; cursor: pointer; border-radius: 10px; border: 1px solid var(--gold, #ffd45f); background: linear-gradient(90deg, rgba(255,212,95,0.22), rgba(46,230,166,0.16)); backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(255,212,95,0.22), var(--shadow); transition: all .15s; }
.btn-coach:hover { color: #fff; box-shadow: 0 0 0 1px rgba(255,212,95,0.5), 0 0 18px rgba(255,212,95,0.32), var(--shadow); }
.btn-heat { padding: 7px 12px; font-size: 12px; color: var(--txt-dim); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; backdrop-filter: blur(8px); box-shadow: var(--shadow); white-space: nowrap; }
.btn-heat:hover { color: var(--txt); border-color: var(--border-strong); }
.btn-heat.on { color: #fff; border-color: #ff7a18; background: linear-gradient(90deg, rgba(255,45,45,.30), rgba(255,122,24,.30)); box-shadow: 0 0 0 1px rgba(255,122,24,.45), var(--shadow); }

/* 🎨 国别染色按钮（与热力互斥的另一种宏观面视图） */
.btn-choro { padding: 7px 12px; font-size: 12px; color: var(--txt-dim); background: var(--panel); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; backdrop-filter: blur(8px); box-shadow: var(--shadow); white-space: nowrap; }
.btn-choro:hover { color: var(--txt); border-color: var(--border-strong); }
.btn-choro.on { color: #fff; border-color: #15c2c2; background: linear-gradient(90deg, rgba(21,194,194,.30), rgba(52,208,88,.26)); box-shadow: 0 0 0 1px rgba(21,194,194,.45), var(--shadow); }
/* 染色模式：右下署名让位给染色图例 */
body.choro-on .map-credit { display: none; }

/* 投资热力图图例（仅热力模式显示）；国别染色图例复用同壳（仅染色模式显示） */
.heat-legend { position: absolute; right: 14px; bottom: 14px; z-index: 1100; display: none; align-items: center; gap: 9px; padding: 7px 13px; background: rgba(6, 11, 24, 0.74); border: 1px solid var(--border); border-radius: 20px; backdrop-filter: blur(6px); box-shadow: var(--shadow); font-size: 11px; color: var(--txt-dim); }
body.heat-on .heat-legend { display: flex; }
body.heat-on .heat-legend.choro-legend { display: none; }
body.choro-on .heat-legend.choro-legend { display: flex; }
.heat-legend .hl-cap { color: var(--txt); font-weight: 600; }
.heat-legend .hl-bar { width: 124px; height: 9px; border-radius: 5px; background: linear-gradient(90deg, #0b1f4d, #1e63ff, #15c2c2, #34d058, #ffd000, #ff7a18, #ff2d2d); }
.heat-legend .hl-lo, .heat-legend .hl-hi { letter-spacing: .5px; }

/* 制作者署名（地图右下角小药丸；热力模式让位给热力图例）*/
.map-credit {
  position: absolute; right: 14px; bottom: 14px; z-index: 1150;
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 20px;
  background: rgba(6, 11, 24, 0.62); border: 1px solid var(--border);
  backdrop-filter: blur(6px); box-shadow: var(--shadow);
  font-size: 11px; letter-spacing: .5px; color: var(--txt-dim);
  pointer-events: none; user-select: none; white-space: nowrap;
}
.map-credit .mc-by { color: var(--txt-faint); }
body.heat-on .map-credit { display: none; }
@media (max-width: 920px) {
  /* 窄屏底部四角已被 缩放/筛选/统计 占用 → 署名移到地图上部居中（标题栏下方，左上缩放与右上⋯之间）*/
  .map-credit { right: auto; left: 50%; transform: translateX(-50%); top: 12px; bottom: auto; }
}

/* 🔥 热力分面（聚焦单一品类，仅热力模式显示）*/
.heat-facets { position: absolute; left: 14px; bottom: 14px; z-index: 1100; display: none; flex-wrap: wrap; gap: 5px; max-width: 60%; padding: 7px 9px; background: rgba(6, 11, 24, 0.78); border: 1px solid var(--border); border-radius: 12px; backdrop-filter: blur(6px); box-shadow: var(--shadow); }
body.heat-on .heat-facets { display: flex; }
.heat-facets .hf { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; font-size: 11px; color: var(--txt-dim); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; user-select: none; transition: all .15s; }
.heat-facets .hf .d { width: 8px; height: 8px; border-radius: 50%; }
.heat-facets .hf:hover { color: var(--txt); border-color: var(--border-strong); }
.heat-facets .hf.on { color: #fff; border-color: var(--accent); background: rgba(33, 199, 255, 0.18); }
@media (max-width: 920px) { .heat-facets { max-width: calc(100% - 28px); } }

/* 详情卡：英文模式下中文正文的提示 */
.d-zh-note { margin-top: 8px; font-size: 11px; color: var(--txt-faint); font-style: italic; }

/* ============================================================
 * 首屏加载态（地图瓦片就绪后淡出）
 * ============================================================ */
.app-loader {
  position: fixed; inset: 0; z-index: 5000;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background:
    radial-gradient(1200px 700px at 72% -10%, rgba(33, 199, 255, 0.12), transparent 60%),
    radial-gradient(900px 600px at 8% 110%, rgba(46, 230, 166, 0.10), transparent 60%),
    var(--bg);
  transition: opacity .45s ease;
}
.app-loader.hidden { opacity: 0; pointer-events: none; }
.app-loader .al-logo { font-size: 46px; filter: drop-shadow(0 0 18px rgba(33, 199, 255, 0.4)); }
.app-loader .al-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(120, 160, 220, 0.18); border-top-color: var(--accent);
  animation: alspin .8s linear infinite;
}
@keyframes alspin { to { transform: rotate(360deg); } }
.app-loader .al-text { text-align: center; font-size: 16px; font-weight: 700; color: var(--txt); letter-spacing: .5px; }
.app-loader .al-text span { display: block; margin-top: 5px; font-size: 12px; font-weight: 400; color: var(--txt-dim); letter-spacing: 1px; }

/* 近一年开关 */
.recent-toggle {
  width: 100%; padding: 10px; margin-bottom: 18px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all 0.15s;
  background: linear-gradient(135deg, rgba(255, 176, 46, 0.14), rgba(255, 95, 168, 0.12));
  color: #ffd596; border: 1px solid rgba(255, 176, 46, 0.35);
}
.recent-toggle:hover { border-color: var(--warn); }
.recent-toggle.on { background: linear-gradient(135deg, rgba(255, 176, 46, 0.32), rgba(255, 95, 168, 0.26)); color: #fff; border-color: var(--warn); box-shadow: 0 0 14px rgba(255, 176, 46, 0.3); }

/* ⭐ 我的关注（收藏夹）：开关 + 备份/恢复小按钮 */
.fav-row { display: flex; gap: 6px; margin: -10px 0 18px; }
.fav-toggle {
  flex: 1; min-width: 0; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px; border-radius: 10px; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s;
  background: rgba(255, 212, 95, 0.08); color: #ffe9b0; border: 1px solid rgba(255, 212, 95, 0.30);
}
.fav-toggle:hover { border-color: #ffd45f; }
.fav-toggle.on { background: linear-gradient(135deg, rgba(255, 212, 95, 0.30), rgba(255, 176, 46, 0.22)); color: #fff; border-color: #ffd45f; box-shadow: 0 0 14px rgba(255, 212, 95, 0.28); }
.fav-toggle .fc { font-size: 11px; font-weight: 800; padding: 1px 7px; border-radius: 10px; background: rgba(255, 212, 95, 0.18); color: #ffd45f; font-variant-numeric: tabular-nums; }
.fav-toggle.on .fc { background: rgba(0, 0, 0, 0.25); color: #ffe9b0; }
.fav-io {
  flex: none; width: 38px; border-radius: 10px; cursor: pointer; font-size: 14px;
  background: rgba(255, 255, 255, 0.04); color: var(--txt-dim); border: 1px solid var(--border); transition: all .15s;
}
.fav-io:hover { color: #ffd45f; border-color: rgba(255, 212, 95, 0.45); }

/* 🆕 标记 */
.proj-item .pn .newtag { font-size: 10px; margin-left: 5px; }
.d-new { display: inline-block; margin-left: 8px; font-size: 11px; padding: 3px 9px; border-radius: 20px; background: rgba(255, 176, 46, 0.2); color: #ffd596; font-weight: 600; vertical-align: middle; }

/* 浮层层级（盖住地图与控件） */
.detail { z-index: 1300; }
.map-hint {
  z-index: 1100; left: 50%; right: auto; bottom: 10px; transform: translateX(-50%);
  background: rgba(6, 11, 24, 0.62); padding: 5px 12px; border-radius: 20px;
  border: 1px solid var(--border); backdrop-filter: blur(6px); white-space: nowrap;
}
@media (max-width: 920px) { .map-hint { display: none; } }

/* 详情卡：整卡可上下滑动；标题栏吸顶常驻（关闭/分享按钮始终可点）。
   限高（max-height）定义在基础 .detail 规则与窄屏 @media 里——不要在这里再设 max-height，
   否则这条更靠后的全局规则会覆盖窄屏的 dvh 值，导致卡片在移动端超出可视区、底部内容被遮挡且无法滑动。 */
.detail { overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.detail .d-top { position: sticky; top: 0; z-index: 2; background: var(--panel-solid); }
.detail .d-desc { padding-bottom: 16px; }
.detail::-webkit-scrollbar { width: 7px; }
.detail::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, 0.28); border-radius: 6px; }
.detail::-webkit-scrollbar-track { background: transparent; }

/* 详情卡 · 最新进展高亮条 */
.detail .d-progress {
  flex: none; padding: 10px 16px; font-size: 12.5px; line-height: 1.6; color: #d8e8ff;
  background: linear-gradient(90deg, rgba(33, 199, 255, 0.18), rgba(46, 230, 166, 0.08));
  border-top: 1px solid var(--border); border-left: 3px solid var(--accent);
}
.detail .d-progress .dp-tag {
  display: inline-block; font-weight: 800; color: var(--accent);
  margin-right: 8px; font-size: 11px; letter-spacing: 0.3px; white-space: nowrap;
}

/* ============================================================
 * 交互增强：年份区间双手柄 / 预设 / 分享导出 / 品类图例 / 提示条
 * ============================================================ */

/* 年份区间：快捷预设 */
.year-presets { display: flex; gap: 6px; margin-bottom: 12px; }
.year-presets .yp {
  flex: 1; min-width: 0; padding: 6px 4px; font-size: 11px; white-space: nowrap;
  color: var(--txt-dim); background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer; transition: all .15s;
}
.year-presets .yp:hover { color: var(--txt); border-color: var(--border-strong); }
.year-presets .yp.on { background: rgba(33, 199, 255, 0.16); border-color: var(--accent); color: #cdeeff; }

/* 年份区间：双手柄滑块（两个 range 叠放，仅滑块可点）*/
.range-dual { position: relative; height: 26px; }
.range-dual .rd-track { position: absolute; top: 11px; left: 0; right: 0; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, 0.10); }
.range-dual .rd-fill { position: absolute; top: 11px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--good)); }
.range-dual input[type=range] {
  position: absolute; top: 0; left: 0; width: 100%; height: 26px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.range-dual input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: all; position: relative; z-index: 3;
  width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 2px solid var(--accent); cursor: pointer; box-shadow: 0 0 10px rgba(33, 199, 255, 0.7);
}
.range-dual input[type=range]::-moz-range-thumb {
  pointer-events: all; width: 16px; height: 16px; border-radius: 50%; background: #fff;
  border: 2px solid var(--accent); cursor: pointer;
}
.range-dual input[type=range]::-moz-range-track { background: none; border: none; }

/* 分享 / 导出按钮 */
.action-row { display: flex; gap: 8px; margin-top: 4px; margin-bottom: 8px; }
.btn-act {
  flex: 1; padding: 9px 6px; font-size: 12px; color: var(--txt-dim);
  background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border);
  border-radius: 10px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-act:hover { color: var(--txt); border-color: var(--border-strong); }

/* 品类色图例（地图左上，点击切换品类）*/
.cat-legend {
  position: absolute; top: 14px; left: 14px; z-index: 1100; max-width: 212px;
  display: flex; flex-wrap: wrap; gap: 5px 10px; padding: 9px 11px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  backdrop-filter: blur(8px); box-shadow: var(--shadow);
}
.cat-legend .cl-title { width: 100%; font-size: 10px; letter-spacing: .5px; color: var(--txt-faint); margin-bottom: 2px; }
.cat-legend .cl { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--txt-dim); cursor: pointer; user-select: none; transition: opacity .15s, color .15s; }
.cat-legend .cl .d { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.cat-legend .cl:hover { color: var(--txt); }
.cat-legend .cl.off { opacity: .38; text-decoration: line-through; }
@media (max-width: 920px) { .cat-legend { display: none; } }

/* 可点击的区域格（与左侧大区筛选双向联动）*/
.region-cell { cursor: pointer; transition: all .15s; }
.region-cell:hover { border-color: var(--border-strong); }
.region-cell.on { border-color: var(--accent); background: rgba(33, 199, 255, 0.12); }

/* 轻量提示条 */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%) translateY(12px);
  z-index: 3000; padding: 10px 18px; background: rgba(6, 11, 24, 0.94);
  border: 1px solid var(--border-strong); border-radius: 10px; color: var(--txt);
  font-size: 13px; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transition: all .25s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
 * 容量硬指标 / 加权口径 / 排序切换
 * ============================================================ */

/* 硬指标卡片网格（按当前筛选汇总解析自 cap 的结构化容量）*/
.cap-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.cap-chip {
  display: flex; align-items: center; gap: 8px; padding: 8px 9px;
  border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border);
}
.cap-chip .cc-ico { font-size: 16px; line-height: 1; flex: none; }
.cap-chip .cc-body { min-width: 0; }
.cap-chip .cc-v { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; font-size: 15px; font-weight: 700; color: var(--txt); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cap-chip .cc-n { white-space: nowrap; }
.cap-chip .cc-u { white-space: nowrap; font-size: 12px; font-weight: 600; color: var(--txt-dim); }
.cap-chip .cc-l { font-size: 11px; color: var(--txt-dim); margin-top: 1px; }
.cap-empty { grid-column: 1 / -1; font-size: 12px; color: var(--txt-faint); padding: 6px 2px; }

/* ⚖️ 加权口径按钮（沿用地图工具按钮风格）*/
.btn-weight {
  padding: 7px 12px; font-size: 12px; color: var(--txt-dim); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  backdrop-filter: blur(8px); box-shadow: var(--shadow); white-space: nowrap;
}
.btn-weight:hover { color: var(--txt); border-color: var(--border-strong); }
.btn-weight.on { color: #fff; border-color: var(--good); background: linear-gradient(90deg, rgba(46, 230, 166, 0.28), rgba(33, 199, 255, 0.22)); box-shadow: 0 0 0 1px rgba(46, 230, 166, 0.4), var(--shadow); }

/* ⚡ 飞线 / 🏢 企业榜 / 🆚 对比 / 📈 趋势 / 中·EN 按钮（沿用 map-tools 按钮风格）*/
.btn-flow, .btn-league, .btn-compare, .btn-trends, .btn-lang {
  padding: 7px 12px; font-size: 12px; color: var(--txt-dim); background: var(--panel);
  border: 1px solid var(--border); border-radius: 10px; cursor: pointer;
  backdrop-filter: blur(8px); box-shadow: var(--shadow); white-space: nowrap;
}
.btn-flow:hover, .btn-league:hover, .btn-compare:hover, .btn-trends:hover, .btn-lang:hover { color: var(--txt); border-color: var(--border-strong); }
.btn-flow.on { color: #fff; border-color: #21c7ff; background: linear-gradient(90deg, rgba(33,199,255,.28), rgba(46,230,166,.18)); box-shadow: 0 0 0 1px rgba(33,199,255,.42), var(--shadow); }
.btn-lang { font-weight: 800; letter-spacing: .04em; min-width: 34px; text-align: center; }
/* 顶栏语言切换：紧贴「数据」按钮右侧（桌面端贴近 KPI，移动端与「数据」并排）*/
.btn-lang-top { margin-left: auto; flex: none; padding: 8px 12px; border-radius: 18px; backdrop-filter: none; box-shadow: none; }

/* 🏢 企业 / 业主排行榜（复用 country-panel 弹层外壳）*/
.lg-list { display: flex; flex-direction: column; gap: 6px; }
.lg-row { display: flex; align-items: center; gap: 10px; padding: 7px 9px; border: 1px solid var(--border); border-radius: 9px; background: var(--panel); cursor: pointer; transition: all .15s; }
.lg-row:hover { border-color: var(--border-strong); background: rgba(255,255,255,.04); }
.lg-rank { width: 22px; text-align: center; font-weight: 800; color: var(--txt-faint); font-size: 13px; flex: none; }
.lg-main { flex: 1; min-width: 0; }
.lg-name { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }
.lg-track { height: 4px; border-radius: 3px; background: var(--border); margin-top: 5px; overflow: hidden; }
.lg-fill { height: 100%; background: linear-gradient(90deg, #21c7ff, #2ee6a6); border-radius: 3px; }
.lg-meta { text-align: right; flex: none; min-width: 56px; }
.lg-meta b { display: block; font-size: 13px; font-weight: 800; }
.lg-meta span { font-size: 10px; color: var(--txt-faint); }

/* 🎯 国际大客户 BD 看板 */
.bd-tier { display: flex; align-items: center; gap: 7px; margin: 13px 0 5px; font-size: 12px; color: var(--txt); }
.bd-tier:first-child { margin-top: 2px; }
.bd-tier b { font-weight: 800; }
.bd-tier-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--tc); box-shadow: 0 0 7px var(--tc); flex: none; }
.bd-tier-meta { color: var(--txt-faint); font-size: 10px; }
.bd-row { align-items: flex-start; }
.bd-row .lg-name { white-space: normal; overflow: visible; flex-wrap: wrap; }
.bd-fit { font-size: 9px; font-weight: 800; color: #0a0f1c; background: var(--fc); border-radius: 5px; padding: 1px 5px; flex: none; }
.bd-type { font-size: 10px; font-weight: 500; color: var(--txt-faint); }
.bd-line { font-size: 10.5px; color: #b9c4dc; margin-top: 3px; line-height: 1.4; }
.bd-line.bd-dim { color: var(--txt-faint); }

/* 客户子分类的梯队小标题（左栏 client 子分类按 BD 梯队分组）——做成醒目的分组分隔条 */
.sub-tier { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 800; letter-spacing: .4px; color: #dbe4f3; background: rgba(255,255,255,.055); border-left: 3px solid var(--tc, var(--border-strong)); border-radius: 5px; margin: 13px 0 5px -5px; padding: 5px 9px; }
.sub-tier:first-child { margin-top: 4px; }

/* TOP 排序切换（标题里的可点击 chip）*/
.sort-toggle { cursor: pointer; user-select: none; transition: color .15s; }
.sort-toggle:hover { color: var(--accent); }

/* 详情卡：投资额的美元折算说明 */
.detail .d-usd { color: #8fb0e0; font-size: 12px; }

/* ============================================================
 * 时间轴播放：播放按钮 / 年份大字 / 当年新项目高亮
 * ============================================================ */
.btn-play {
  width: 100%; margin-top: 10px; padding: 9px; border-radius: 10px; cursor: pointer;
  font-size: 13px; font-weight: 600; transition: all .15s;
  color: #cdeeff; background: rgba(33, 199, 255, 0.12); border: 1px solid rgba(33, 199, 255, 0.35);
}
.btn-play:hover { border-color: var(--accent); }
.btn-play.on { background: linear-gradient(135deg, rgba(33, 199, 255, 0.30), rgba(46, 230, 166, 0.24)); color: #fff; border-color: var(--accent); box-shadow: 0 0 14px rgba(33, 199, 255, 0.3); }

/* 播放时地图上的年份大字 */
.year-ticker {
  position: absolute; right: 26px; top: 50%; transform: translateY(-50%);
  z-index: 1100; display: none; pointer-events: none;
  font-size: 132px; font-weight: 800; line-height: 1; letter-spacing: 2px;
  font-variant-numeric: tabular-nums; color: rgba(205, 238, 255, 0.12);
  text-shadow: 0 0 46px rgba(33, 199, 255, 0.28);
}
.year-ticker.show { display: block; animation: tickerIn .4s ease-out; }
@keyframes tickerIn { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 920px) { .year-ticker { font-size: 64px; right: 14px; } }

/* 播放中"当年新增"项目的弹入高亮（覆盖旗舰脉冲，一次性）*/
.dot.is-year-new { animation: yearPop .85s cubic-bezier(.2,.9,.2,1); transform-origin: center; }
@keyframes yearPop {
  0% { transform: scale(2.4); filter: brightness(1.9) drop-shadow(0 0 8px currentColor); }
  55% { transform: scale(1); }
  100% { transform: scale(1); filter: none; }
}

/* ============================================================
 * 国别下钻面板（点详情卡的国家打开的能源组合仪表盘）
 * ============================================================ */
.d-country-link { color: var(--accent); cursor: pointer; border-bottom: 1px dashed rgba(33,199,255,0.5); }
.d-country-link:hover { color: #cdeeff; }

.country-backdrop {
  position: absolute; inset: 0; z-index: 2400; background: rgba(4, 8, 18, 0.55);
  backdrop-filter: blur(2px); opacity: 0; pointer-events: none; transition: opacity .2s;
}
.country-backdrop.show { opacity: 1; pointer-events: auto; }

.country-panel {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%);
  width: min(540px, 92%); max-height: 84vh; z-index: 2450;
  background: var(--panel-solid); border: 1px solid var(--border-strong);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; overflow: hidden;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.country-panel.show { opacity: 1; transform: translate(-50%, -50%); pointer-events: auto; }

.cp-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--border); flex: none; }
.cp-head .cp-name { flex: 1; font-size: 19px; font-weight: 800; }
.cp-close {
  width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--border);
  background: rgba(255,255,255,0.04); color: var(--txt-dim); font-size: 18px; line-height: 1; cursor: pointer;
}
.cp-close:hover { color: #fff; border-color: var(--border-strong); }

.cp-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--border); flex: none; }
.cp-kpi { background: var(--panel-solid); padding: 11px 6px; text-align: center; }
.cp-kpi .v { font-size: 16px; font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; }
.cp-kpi .l { font-size: 10px; color: var(--txt-dim); margin-top: 3px; }

.cp-body { padding: 14px 18px; overflow-y: auto; flex: 1 1 auto; }
.cp-body::-webkit-scrollbar { width: 7px; }
.cp-body::-webkit-scrollbar-thumb { background: rgba(120,160,220,0.28); border-radius: 6px; }
.cp-sec-title { font-size: 11px; color: var(--txt-faint); letter-spacing: .5px; margin: 14px 0 8px; }
.cp-sec-title:first-child { margin-top: 0; }

.cp-status { display: flex; gap: 8px; }
.cp-status .s { flex: 1; text-align: center; padding: 9px 6px; border-radius: 9px; background: rgba(255,255,255,0.03); border: 1px solid var(--border); }
.cp-status .s b { display: block; font-size: 17px; font-variant-numeric: tabular-nums; }
.cp-status .s span { font-size: 11px; color: var(--txt-dim); }

.cp-years { display: flex; align-items: flex-end; gap: 2px; height: 48px; }
.cp-years .yb { flex: 1; min-height: 2px; background: linear-gradient(180deg, var(--accent), rgba(33,199,255,0.18)); border-radius: 2px 2px 0 0; }
.cp-years-ax { display: flex; justify-content: space-between; font-size: 10px; color: var(--txt-faint); margin-top: 4px; }

.cp-proj { display: flex; flex-direction: column; gap: 6px; }
.cp-note { font-size: 10px; color: var(--txt-faint); margin-top: 12px; line-height: 1.5; }
@media (max-width: 920px) { .country-panel { width: 94%; } .cp-kpis { grid-template-columns: repeat(2, 1fr); } }

/* 国别下钻面板里的「⊕ 加入对比」按钮 */
.cp-add {
  flex: none; margin-right: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600;
  color: #cdeeff; background: rgba(33, 199, 255, 0.14); border: 1px solid rgba(33, 199, 255, 0.4);
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.cp-add:hover { background: rgba(33, 199, 255, 0.24); border-color: var(--accent); }
/* 国别下钻面板里的「📍 地图筛选」按钮：把当前国家设为地图筛选并飞到该国 */
.cp-filter {
  flex: none; margin-left: auto; margin-right: 6px; padding: 5px 11px; font-size: 12px; font-weight: 600;
  color: #b6f5df; background: rgba(46, 230, 166, 0.14); border: 1px solid rgba(46, 230, 166, 0.42);
  border-radius: 8px; cursor: pointer; white-space: nowrap;
}
.cp-filter:hover { background: rgba(46, 230, 166, 0.24); border-color: var(--good); }

/* ============================================================
 * 🆚 国别对比（复用 country-panel 外壳，加宽为多列并排）
 * ============================================================ */
.country-panel.wide { width: min(920px, 96%); }
.cmp-hint { font-size: 12px; color: #ffd596; background: rgba(255, 176, 46, 0.12); border: 1px solid rgba(255, 176, 46, 0.3); border-radius: 9px; padding: 9px 12px; margin-bottom: 12px; }
.cmp-grid { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.cmp-grid::-webkit-scrollbar { height: 8px; }
.cmp-grid::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, 0.28); border-radius: 6px; }
.cmp-col { flex: 0 0 232px; min-width: 0; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, 0.03); padding: 11px; }
.cmp-col-head { display: flex; align-items: center; gap: 6px; margin-bottom: 9px; }
.cmp-col-head .cc-name { flex: 1; font-size: 15px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-rm { flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.04); color: var(--txt-dim); font-size: 12px; line-height: 1; cursor: pointer; }
.cmp-rm:hover { color: #ff6f59; border-color: rgba(255, 111, 89, 0.5); }
.cmp-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 4px; }
.cmp-kpi { background: rgba(0, 0, 0, 0.22); border: 1px solid var(--border); border-radius: 8px; padding: 7px 8px; }
.cmp-kpi b { display: block; font-size: 14px; font-weight: 800; color: var(--txt); font-variant-numeric: tabular-nums; line-height: 1.2; }
.cmp-kpi span { font-size: 10px; color: var(--txt-dim); }
.cmp-sec { font-size: 10px; color: var(--txt-faint); letter-spacing: .4px; margin: 11px 0 6px; }
.cmp-cat { display: grid; grid-template-columns: 12px 1fr auto; align-items: center; gap: 5px; margin-bottom: 5px; font-size: 11.5px; }
.cmp-cat .dot { width: 8px; height: 8px; border-radius: 50%; }
.cmp-cat .cn { color: var(--txt-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-cat .cv { font-size: 11px; color: var(--txt); font-variant-numeric: tabular-nums; }
.cmp-cat .cmp-cbar { grid-column: 2 / -1; height: 3px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 1px; }
.cmp-cat .cmp-cbar i { display: block; height: 100%; border-radius: 2px; }
.cmp-top { display: flex; align-items: center; gap: 6px; padding: 5px 6px; border-radius: 7px; background: rgba(255, 255, 255, 0.02); border: 1px solid var(--border); cursor: pointer; margin-bottom: 5px; }
.cmp-top:hover { border-color: var(--border-strong); }
.cmp-top .r { flex: none; width: 14px; text-align: center; font-weight: 800; color: var(--txt-faint); font-size: 11px; }
.cmp-top .t { flex: 1; min-width: 0; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp-top .v { flex: none; font-size: 10.5px; color: var(--good); font-variant-numeric: tabular-nums; }
.cmp-empty { font-size: 11px; color: var(--txt-faint); padding: 4px 2px; }
.cmp-addtile { flex: 0 0 96px; align-self: stretch; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 1px dashed var(--border-strong); border-radius: 11px; background: rgba(255, 255, 255, 0.02); color: var(--txt-dim); font-size: 22px; cursor: pointer; }
.cmp-addtile span { font-size: 12px; }
.cmp-addtile:hover { color: var(--txt); border-color: var(--accent); background: rgba(33, 199, 255, 0.06); }
.cmp-picker { margin-top: 12px; border: 1px solid var(--border); border-radius: 11px; padding: 10px; background: rgba(0, 0, 0, 0.18); }
.cmp-picker input { width: 100%; padding: 8px 11px; margin-bottom: 9px; background: rgba(0, 0, 0, 0.3); color: var(--txt); border: 1px solid var(--border); border-radius: 9px; font-size: 13px; outline: none; }
.cmp-picker input:focus { border-color: var(--accent); }
.cmp-picklist { display: flex; flex-wrap: wrap; gap: 6px; max-height: 168px; overflow-y: auto; }
.cmp-picklist::-webkit-scrollbar { width: 7px; }
.cmp-picklist::-webkit-scrollbar-thumb { background: rgba(120, 160, 220, 0.28); border-radius: 6px; }
.cmp-pick { display: inline-flex; align-items: center; gap: 5px; padding: 5px 9px; font-size: 12px; color: var(--txt-dim); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 16px; cursor: pointer; }
.cmp-pick:hover { color: var(--txt); border-color: var(--accent); background: rgba(33, 199, 255, 0.1); }
.cmp-pick span { font-size: 10px; color: var(--txt-faint); font-variant-numeric: tabular-nums; }
@media (max-width: 920px) { .country-panel.wide { width: 96%; } .cmp-col { flex-basis: 78%; } }

/* ============================================================
 * 📖 导览 / 故事模式（剧本选择行 + 底部解说条）
 * ============================================================ */
.btn-story { padding: 7px 12px; font-size: 12px; font-weight: 600; color: #e8d8ff; background: linear-gradient(90deg, rgba(168, 85, 247, 0.20), rgba(33, 199, 255, 0.16)); border: 1px solid rgba(168, 85, 247, 0.55); border-radius: 10px; cursor: pointer; backdrop-filter: blur(8px); box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.22), var(--shadow); white-space: nowrap; }
.btn-story:hover { color: #fff; box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.5), 0 0 18px rgba(168, 85, 247, 0.3), var(--shadow); }

.story-row { display: flex; align-items: center; gap: 11px; padding: 11px 12px; margin-bottom: 8px; border: 1px solid var(--border); border-radius: 11px; background: rgba(255, 255, 255, 0.02); cursor: pointer; transition: all .15s; }
.story-row:hover { border-color: rgba(168, 85, 247, 0.55); background: rgba(168, 85, 247, 0.07); }
.story-row .sr-ico { font-size: 22px; flex: none; }
.story-row .sr-main { flex: 1; min-width: 0; }
.story-row .sr-t { font-size: 13.5px; font-weight: 700; }
.story-row .sr-d { font-size: 11px; color: var(--txt-dim); margin-top: 3px; line-height: 1.5; }
.story-row .sr-n { flex: none; font-size: 11px; color: var(--txt-faint); white-space: nowrap; }

.story-card {
  position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(10px);
  width: min(560px, 94%); z-index: 1400;
  background: var(--panel-solid); border: 1px solid rgba(168, 85, 247, 0.5); border-radius: var(--radius);
  box-shadow: 0 0 0 1px rgba(168, 85, 247, 0.18), var(--shadow);
  padding: 12px 16px 12px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s;
}
.story-card.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.story-card .sc-top { display: flex; align-items: center; gap: 9px; margin-bottom: 7px; }
.story-card .sc-badge { font-size: 11px; font-weight: 700; color: #e8d8ff; background: rgba(168, 85, 247, 0.16); border: 1px solid rgba(168, 85, 247, 0.4); padding: 2px 9px; border-radius: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.story-card .sc-step { margin-left: auto; font-size: 11px; color: var(--txt-faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.story-card .sc-x { flex: none; width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--border); background: rgba(255,255,255,0.04); color: var(--txt-dim); cursor: pointer; font-size: 14px; line-height: 1; display: grid; place-items: center; }
.story-card .sc-x:hover { color: #fff; border-color: var(--border-strong); }
.story-card .sc-t { font-size: 15px; font-weight: 800; margin-bottom: 5px; }
.story-card .sc-txt { font-size: 12.5px; line-height: 1.65; color: var(--txt-dim); }
.story-card .sc-nav { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.story-card .sc-btn { padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--txt-dim); background: rgba(255, 255, 255, 0.04); border: 1px solid var(--border); border-radius: 9px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.story-card .sc-btn:hover:not(:disabled) { color: var(--txt); border-color: var(--border-strong); }
.story-card .sc-btn:disabled { opacity: .35; cursor: default; }
.story-card .sc-btn.sc-next { color: #e8d8ff; border-color: rgba(168, 85, 247, 0.5); background: rgba(168, 85, 247, 0.13); }
.story-card .sc-btn.sc-next:hover { color: #fff; }
.story-card .sc-dots { flex: 1; display: flex; justify-content: center; gap: 5px; flex-wrap: wrap; }
.story-card .sc-dots i { width: 8px; height: 8px; border-radius: 50%; background: rgba(120, 160, 220, 0.3); cursor: pointer; transition: all .15s; }
.story-card .sc-dots i:hover { background: rgba(120, 160, 220, 0.6); }
.story-card .sc-dots i.on { background: #a855f7; box-shadow: 0 0 7px rgba(168, 85, 247, 0.7); }
/* 故事模式：底部提示条/署名让位给解说条 */
body.story-on .map-hint, body.story-on .map-credit { display: none; }
@media (max-width: 820px) {
  /* 窄屏：解说条上移让开底部 🔍/📊 浮钮 */
  .story-card { bottom: calc(74px + env(safe-area-inset-bottom, 0px)); }
}

/* ============================================================
 * 📈 趋势统计（年度投资/项目数 SVG + 大区×品类矩阵热格）
 * ============================================================ */
.tr-svg { display: block; width: 100%; height: auto; background: rgba(0, 0, 0, 0.18); border: 1px solid var(--border); border-radius: 11px; }
.tr-cap { font-weight: 400; letter-spacing: 0; color: var(--txt-faint); margin-left: 6px; }
.tr-matrix {
  display: grid; grid-template-columns: 64px repeat(var(--cols, 10), minmax(34px, 1fr));
  gap: 3px; overflow-x: auto; padding-bottom: 4px;
}
.tr-matrix .trm-corner { }
.tr-matrix .trm-h {
  display: flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 10px; color: var(--txt-dim); padding: 3px 1px; white-space: nowrap;
}
.tr-matrix .trm-h .d { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.tr-matrix .trm-r { display: flex; align-items: center; font-size: 11px; color: var(--txt-dim); white-space: nowrap; padding-right: 4px; }
.tr-matrix .trm-c {
  position: relative; display: grid; place-items: center; min-height: 30px;
  font-size: 11px; font-weight: 700; font-variant-numeric: tabular-nums; color: #eaf2ff;
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border); border-radius: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
}
.tr-matrix .trm-c.has { cursor: pointer; }
.tr-matrix .trm-c.has::before {
  content: ''; position: absolute; inset: 0; border-radius: 5px;
  background: var(--cbg); opacity: var(--ca, 0.3);
}
.tr-matrix .trm-c span, .tr-matrix .trm-c { z-index: 1; }
.tr-matrix .trm-c.has:hover { border-color: var(--border-strong); }

/* ============================================================
 * 无障碍：键盘焦点可见 + 降低动态偏好
 * ============================================================ */
/* 键盘聚焦时给清晰焦点环（鼠标点击不显示，靠 :focus-visible）*/
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 6px;
}
.cat-chip:focus-visible, .sub-chip:focus-visible, .pill:focus-visible,
.region-cell:focus-visible, .bar-row:focus-visible, .cl:focus-visible,
.hf:focus-visible, .lg-row:focus-visible { outline-offset: 1px; }
/* 鼠标点击不残留焦点环 */
:focus:not(:focus-visible) { outline: none; }

/* 尊重「减少动态效果」系统偏好：关停脉冲/飞线/旋转/年份大字等动画与长过渡 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .mk .dot.is-flag::after, .mk .dot.is-new::before, .flowline,
  .app-loader .al-spin, .year-ticker, .dot.is-year-new { animation: none !important; }
}
