/* SCI Risk Map P0 — 主样式
 * 布局: 左侧栏 340px + 右侧地图 (单视野原则)
 * 底图: CSS 去饱和 (天地图)
 */

/* ─── SCI.AI editorial 页头（自包含，不依赖主题） ─── */
.editorial-header {
  background: #fff; border-bottom: 1px solid #e0e0e0; flex-shrink: 0; z-index: 2000;
}
.editorial-header .eh-inner {
  max-width: 100%; margin: 0 auto; padding: 10px 24px; display: flex; align-items: center; gap: 24px; height: 52px;
}
.eh-brand { display: flex; align-items: baseline; gap: 8px; text-decoration: none; }
.eh-logo { font-size: 18px; font-weight: 700; color: #0a4a8c; letter-spacing: 1px; }
.eh-subtitle { font-size: 13px; color: #666; font-weight: 400; }
.eh-nav { display: flex; gap: 18px; font-size: 13px; }
.eh-nav-link { text-decoration: none; color: #555; padding: 4px 0; transition: color 0.15s; }
.eh-nav-link:hover { color: #0a4a8c; }
.eh-nav-link--active { color: #0a4a8c; font-weight: 600; border-bottom: 2px solid #0a4a8c; }
.eh-actions { margin-left: auto; }
.eh-lang-toggle {
  background: none; border: none; font-size: 12px; color: #888; cursor: pointer; padding: 4px 8px;
}
.eh-lang-toggle .active { color: #0a4a8c; font-weight: 600; }
.eh-lang-toggle .sep { margin: 0 4px; color: #ddd; }

/* ─── SCI.AI editorial 页脚 ─── */
.editorial-footer { background: #1a1a2e; color: #999; padding: 16px 24px; flex-shrink: 0; }
.editorial-footer .ef-inner {
  max-width: 100%; margin: 0 auto; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-size: 11px; line-height: 1.6;
}
.ef-brand { font-size: 14px; font-weight: 700; color: #fff; }
.ef-links { flex: 1; display: flex; gap: 8px; flex-wrap: wrap; }
.ef-sep { color: #444; }
.ef-copy { color: #666; }

/* ─── 主容器: 在主题 content 区域内工作 ─── */
/* C(2026-10-03): 地图全宽 breakout——突破主题 shell 容器（vw 定中法）,
 * 工具页用满窗口宽; <769 移动端不 breakout（本就近似全宽且 100vw 有滚动条风险） */
body.sci-risk-map-body { overflow-x: hidden; }  /* C 配套: 吃掉 100vw 滚动条差 */

@media (min-width: 769px) {
  .sci-risk-map-container {
    /* translateX 定中法（margin 版被 JNews 主题 reset 归零致容器右偏半屏, 2026-10-03
     * 生产实测; transform 抗 reset; width !important 反杀主题 width 覆盖） */
    width: calc(100vw - 32px) !important;
    max-width: calc(100vw - 32px) !important;
    position: relative !important;
    left: 50%;
    transform: translateX(-50%);
  }
}

.sci-risk-map-container {
  display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 560px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: #f5f6f7; border-radius: 8px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06); margin: 10px 0 20px;
}

/* ─── 主布局: 左右分栏，内部各自滚动 ─── */
.risk-map-main {
  display: flex; flex: 1; min-height: 0; overflow: hidden; /* 关键：子元素才能滚动 */
}

/* ─── 左侧栏: 可拖拽宽度（v0.12.6 用户需求）, 事件列表内部滚动 ─── */
.risk-map-sidebar {
  width: 340px; min-width: 260px; max-width: 620px;   /* 260=事件卡可读下限, 620=保地图可用 */
  background: #fff; border-right: 1px solid #e0e0e0;
  display: flex; flex-direction: column; overflow: hidden; /* 侧栏整体不滚动 */
  position: relative;   /* resizer 把手定位 */
}
/* 桌面拖拽把手: 右缘 6px 竖条, 仅 ≥769 显示（移动端抽屉无宽度概念） */
.sidebar-resizer {
  position: absolute; top: 0; right: -3px; width: 7px; height: 100%;
  cursor: col-resize; z-index: 30; touch-action: none;
}
.sidebar-resizer:hover, .sidebar-resizer.dragging {
  background: rgba(10, 74, 140, 0.28); border-radius: 3px;
}
@media (max-width: 768px) { .sidebar-resizer { display: none; } }

/* ─── 事件列表: flex-grow + 内部滚动 ─── */
.event-list {
  flex: 1; overflow-y: auto; overflow-x: hidden;
  -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
}

/* ─── 日历预警条 ─── */
.calendar-alert {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  border-bottom: 1px solid #ffcc80;
  padding: 8px 20px; display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: #e65100;
}
.calendar-alert .cal-label {
  background: #e65100; color: #fff; font-size: 11px; padding: 2px 8px;
  border-radius: 3px; font-weight: 600; white-space: nowrap;
}
/* F2 v0.16.0: 日历条数据驱动条目（JS initCalendarBar 渲染; .cal-fallback=兜底静态文案, 渲染成功时 JS 收起）
   cal-detail 必须 min-width:0——flex 子项 min-width:auto 会按 chip 内容宽顶穿容器（移动端横滚失效根因, 布局教训②） */
.calendar-alert .cal-detail { min-width: 0; }
.calendar-alert .cal-items {
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center; min-width: 0;
}
.cal-item {
  display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 11.5px; padding: 2px 9px; border-radius: 10px;
  border: 1px solid transparent;
}
.cal-item b { font-weight: 700; }
.cal-item[data-url] { cursor: pointer; }
.cal-item[data-url]:hover { text-decoration: underline; }
/* 30/60/90 分档: 色深浅区分紧迫度（≤30 红 / ≤60 橙 / >60 琥珀蓝; >90 天归 90+ 档不丢条目） */
.cal-tier-30 { background: #ffebee; color: #c62828; border-color: #ef9a9a; }
.cal-tier-60 { background: #fff3e0; color: #e65100; border-color: #ffcc80; }
.cal-tier-90 { background: #e3f2fd; color: #1565c0; border-color: #90caf9; }
/* codex-review[2]: 静态表超 120 天未复核的灰标提示（meta.stale → JS 追加 chip） */
.cal-stale { background: #f5f5f5; color: #9e9e9e; border-color: #bdbdbd; font-style: italic; }
/* 语言切换（P1-5, 部署期置于日历条; P2-7 统一发布时并入 editorial 语言开关） */
.cal-lang-switch {
  margin-left: auto; flex-shrink: 0; text-decoration: none;
  font-size: 11px; font-weight: 600; color: #0a4a8c;
  border: 1px solid #ffcc80; border-radius: 10px; padding: 1px 9px;
  background: rgba(255,255,255,0.6); white-space: nowrap;
}



/* 搜索框 */
.search-box { padding: 14px 16px 10px; border-bottom: 1px solid #eee; position: relative; }
.search-input {
  width: 100%; padding: 8px 30px 8px 12px; border: 1px solid #d0d0d0; border-radius: 6px;
  font-size: 13px; background: #fafafa; outline: none;
}
.search-input:focus { border-color: #0a4a8c; background: #fff; }
.search-clear {
  position: absolute; right: 24px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; border: none; border-radius: 50%;
  background: #d0d0d0; color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer; padding: 0; display: flex; align-items: center; justify-content: center;
}
.search-clear:hover { background: #999; }

/* 筛选器 */
.filters { padding: 12px 16px; border-bottom: 1px solid #eee; }
.filter-group { margin-bottom: 10px; }
.filter-label {
  font-size: 11px; font-weight: 600; color: #888; text-transform: uppercase;
  letter-spacing: 0.5px; margin-bottom: 5px;
}
.filter-pills { display: flex; flex-wrap: wrap; gap: 4px; }
/* E12: 类别 pills 桌面端改横滚单行（对齐移动端 P1-7 形态）——侧栏上半省 ~2 行 */
#rm-cat-pills { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 2px; scrollbar-width: thin; }
.pill {
  padding: 2px 7px; border-radius: 12px; font-size: 11px;
  border: 1px solid #d0d0d0; color: #555; cursor: pointer; background: #fafafa;
  transition: all 0.15s;
  white-space: nowrap; flex-shrink: 0;
}
.pill.active { background: #0a4a8c; color: #fff; border-color: #0a4a8c; }
.pill.disabled { opacity: 0.4; cursor: not-allowed; }

/* 类别色板 */
.pill.cat-trade { background: #fff3e0; border-color: #ffcc80; color: #e65100; }
.pill.cat-trade.active { background: #e65100; color: #fff; }
.pill.cat-geo { background: #e3f2fd; border-color: #90caf9; color: #1565c0; }
.pill.cat-geo.active { background: #1565c0; color: #fff; }
.pill.cat-natural { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }
.pill.cat-natural.active { background: #2e7d32; color: #fff; }
.pill.cat-port { background: #e0f7fa; border-color: #80deea; color: #00838f; }
.pill.cat-port.active { background: #00838f; color: #fff; }
.pill.cat-shock { background: #f3e5f5; border-color: #ce93d8; color: #6a1b9a; }
.pill.cat-shock.active { background: #6a1b9a; color: #fff; }
.pill.cat-cyber { background: #efebe9; border-color: #bcaaa4; color: #4e342e; }
.pill.cat-cyber.active { background: #4e342e; color: #fff; }
.pill.cat-gov { background: #e8eaf6; border-color: #9fa8da; color: #283593; }
.pill.cat-gov.active { background: #283593; color: #fff; }
.pill.cat-labor { background: #fce4ec; border-color: #f48fb1; color: #c62828; }
.pill.cat-labor.active { background: #c62828; color: #fff; }

/* 筛选组折叠（2026-10-03: 5 组筛选吃掉侧栏 92%, 列表仅剩 46px → 默认折叠次要组） */
.filter-label.fg-toggle { cursor: pointer; user-select: none; display: flex; align-items: center; }
.filter-label.fg-toggle::after {
  content: '▾'; margin-left: auto; color: #b0bec5; font-size: 10px; transition: transform 0.2s;
}
.filter-group.collapsed .filter-label.fg-toggle::after { transform: rotate(-90deg); }
.filter-group.collapsed .filter-pills,
.filter-group.collapsed .sv-pop { display: none; }

/* 保存视图（P1-8） */
.saved-views { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.sv-empty { font-size: 10.5px; color: #aaa; }
.sv-tab {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 4px; font-size: 11px;
  background: #eef3fa; border: 1px solid #c5d8ef; color: #0a4a8c;
  cursor: pointer; transition: all 0.15s;
}
.sv-tab:hover { background: #dde9f7; }
.sv-tab .sv-del {
  color: #99a8bd; font-size: 13px; line-height: 1; padding: 0 1px;
}
.sv-tab .sv-del:hover { color: #c62828; }
.sv-actions { display: flex; gap: 6px; }
.sv-name-input {
  flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid #d0d0d0;
  border-radius: 4px; font-size: 11px; background: #fafafa; outline: none;
}
.sv-name-input:focus { border-color: #0a4a8c; background: #fff; }
.sv-save-btn {
  padding: 4px 10px; border-radius: 4px; font-size: 11px; white-space: nowrap;
  border: 1px solid #0a4a8c; background: #0a4a8c; color: #fff; cursor: pointer;
}
.sv-save-btn:hover { background: #083a70; }

/* 排序控件 */
.sort-control { padding: 8px 16px; border-bottom: 1px solid #eee; display: flex; align-items: center; gap: 10px; }
.sort-toggle { display: flex; gap: 0; border-radius: 4px; overflow: hidden; border: 1px solid #d0d0d0; }
.sort-btn {
  padding: 4px 12px; font-size: 11px; border: none; background: #fafafa; color: #555; cursor: pointer;
}
.sort-btn.active { background: #0a4a8c; color: #fff; }
.sort-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 事件列表 */
.event-list-header {
  padding: 8px 16px; font-size: 11px; color: #888; border-bottom: 1px solid #f0f0f0;
  display: flex; justify-content: space-between; background: #fafafa;
}

.event-card {
  padding: 10px 16px; border-bottom: 1px solid #f5f5f5; cursor: pointer;
  transition: all 0.15s;
}
.event-card:hover { background: #f0f4fa; border-left: 3px solid #0a4a8c; }
.event-card.selected { background: #eef3fa; border-left: 3px solid #0a4a8c; }
.event-card.new-event { border-left: 3px solid #2196f3; }
/* E12: severity 色条（pre-attentive——选中/新事件态优先于 severity 色） */
.event-card.sev-high { border-left: 3px solid #d32f2f; }
.event-card.sev-high.selected, .event-card.sev-high:hover { border-left-color: #0a4a8c; }
.event-card.sev-high.new-event { border-left-color: #2196f3; }
.event-card.sev-medium { border-left: 3px solid #f9a825; }
.event-card.sev-medium.selected, .event-card.sev-medium:hover { border-left-color: #0a4a8c; }
.event-card.sev-medium.new-event { border-left-color: #2196f3; }
.event-card.sev-low { border-left: 3px solid #66bb6a; }
.event-card.sev-low.selected, .event-card.sev-low:hover { border-left-color: #0a4a8c; }
.event-card.sev-low.new-event { border-left-color: #2196f3; }
/* E12: 类别色点（meta 行首 pre-attentive 前置） */
.cat-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
/* E12: 影响链 chip 行（挂链事件一行式传导, 弹窗 mpi 的列表层缩小版） */
.event-impact {
  font-size: 10.5px; color: #5e35b1; background: #f3eefb;
  border-radius: 3px; padding: 2px 6px; margin: 2px 0 3px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.event-impact .ei-arrow { color: #b39ddb; margin: 0 3px; }
.event-meta { display: flex; gap: 6px; align-items: center; margin-bottom: 3px; flex-wrap: wrap; }
.event-date { font-size: 11px; color: #999; }
.event-title { font-size: 13px; font-weight: 500; color: #1a1a2e; line-height: 1.4; margin-bottom: 4px; }
.event-country { font-size: 11px; color: #666; }
.event-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.tag { font-size: 10px; padding: 1px 6px; border-radius: 3px; }
.loading { text-align: center; padding: 20px; color: #999; font-size: 13px; }

/* ─── 右侧: 地图区 ─── */
.risk-map-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ─── v0.12.0 桌面顶部筛选工具栏 ───
 * 用户需求: 5 组筛选 + 排序 + 保存视图上移地图区顶部(KPI 条上方), 侧栏整栏让位事件列表。
 * DOM 权威位在侧栏 slot, 桌面(≥769)由 JS reparent 进来; 移动端挂回抽屉原位, 形态不变。
 * 单行紧凑: 类别组 flex:1 内部横滚(E12 口径), 其余组固定收尾; 769-1280 隐组标签防溢出。 */
@media (min-width: 769px) {
  /* 注意不可加 overflow-x/mask: 弹出层(下拉菜单/sv-pop)是工具栏 absolute 子元素,
     overflow 或 mask-image 会把越界部分裁掉——2026-10-05 用户实测"下拉被地图遮住"即此因 */
  .rm-toolbar {
    display: flex; align-items: center;
    background: #fff; border-bottom: 1px solid #e0e0e0;
    padding: 7px 20px;
  }
  .rm-toolbar .filters {
    /* 1 1 auto + min-width:0: 允许被压缩 → 类别组吸收收缩, 胶囊内部横滚 */
    display: flex; align-items: center; flex: 1 1 auto; min-width: 0;
    padding: 0; border-bottom: none;
  }
  .rm-toolbar .filter-group {
    display: flex; align-items: center; gap: 6px;
    margin: 0; padding: 0 12px; border-left: 1px solid #eee;
    flex-shrink: 0;
  }
  .rm-toolbar .filter-group:first-child {
    padding-left: 0; border-left: none;
    flex: 1 1 140px; min-width: 140px;
  }
  .rm-toolbar .filter-group:first-child .filter-pills { flex: 1; min-width: 0; }
  /* 工具栏形态永远展开——抵消侧栏 collapsed 残留(saved-views 除外, 它是下拉) */
  .rm-toolbar .filter-group.collapsed .filter-pills { display: flex; }
  .rm-toolbar .filter-label { margin: 0; white-space: nowrap; flex-shrink: 0; }
  .rm-toolbar .filter-label.fg-toggle::after { content: none; }  /* 桌面无折叠交互 */
  .rm-toolbar .filter-pills { flex-wrap: nowrap; }
  .rm-toolbar .pill { padding: 2px 7px; }

  /* 低频单选组(时间窗/层级/严重度)= "组名 · 当前值"按钮 + 弹出菜单——按钮自带分区名
     (2026-10-05 用户反馈: 只显"全部"无法区分), 组 label 因此全区间隐 */
  .fd-value {
    display: none;   /* 仅工具栏上下文显示(下条覆盖), 移动端/侧栏回退形态不存在 */
  }
  .rm-toolbar .filter-group.droplist .filter-label { display: none; }
  .rm-toolbar .filter-group.droplist .fd-value {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 9px; border-radius: 12px; font-size: 11px; white-space: nowrap;
    border: 1px solid #d0d0d0; background: #fafafa;
    cursor: pointer; transition: all 0.15s; flex-shrink: 0;
  }
  .rm-toolbar .filter-group.droplist .fd-value:hover,
  .rm-toolbar .filter-group.droplist.open .fd-value { border-color: #0a4a8c; background: #fff; }
  .rm-toolbar .filter-group.droplist .fd-name { color: #888; }
  .rm-toolbar .filter-group.droplist.open .fd-name { color: #0a4a8c; }
  .rm-toolbar .filter-group.droplist .fd-cur { color: #0a4a8c; font-weight: 600; }
  .rm-toolbar .filter-group.droplist .fd-value::after { content: '▾'; font-size: 9px; color: #90a4ae; }
  /* 769-1200 窄带: 按钮只留组名(宽度预算), 当前值由菜单内 active 高亮表达 */
  @media (max-width: 1200px) {
    .rm-toolbar .filter-group.droplist .fd-cur { display: none; }
  }
  .rm-toolbar .filter-group.droplist .filter-pills {
    display: none;
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 2200;
    background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
    box-shadow: 0 6px 24px rgba(0,0,0,0.14); padding: 6px;
    flex-direction: column; align-items: stretch; gap: 2px;
  }
  .rm-toolbar .filter-group.droplist.open .filter-pills { display: flex; }
  .rm-toolbar .filter-group.droplist.open .filter-pills .pill { text-align: center; }
  .rm-toolbar .filter-group.droplist { position: relative; }
  /* droplist 组 label 纯标识——工具栏形态点击开合全走 fd-value 按钮(阻断 fg-toggle 的折叠语义) */
  .rm-toolbar .filter-group.droplist .filter-label.fg-toggle { pointer-events: none; }

  /* v0.12.4: 排序已挪 KPI 条(.sort-in-bar), 工具栏以严重度下拉收尾 */
}

/* KPI 汇总条 */
.summary-bar {
  background: #fff; border-bottom: 1px solid #e0e0e0;
  padding: 6px 20px; display: flex; gap: 20px; align-items: baseline; flex-wrap: wrap;
}
/* v0.12.2: KPI 一行化（用户需求）——"名称 数字"水平排列, 名称小字+数字大号 baseline 对齐 */
.stat { display: flex; align-items: baseline; gap: 5px; min-width: 0; }
.stat .num { font-size: 20px; font-weight: 700; color: #0a4a8c; line-height: 1.15; }
.stat .num.alert { color: #c62828; }
.stat .num.warn { color: #e65100; }
.stat .label { font-size: 11.5px; color: #888; white-space: nowrap; }
/* v0.12.4: 排序也挂 KPI 条右端(用户需求)——sort-in-bar 第 1 个(margin-left:auto 推右), 保存视图紧随 */
.sort-in-bar {
  margin-left: auto; align-self: center; flex-shrink: 0;
  padding: 0; border-bottom: none;
}
.sort-in-bar > .filter-label { display: none; }   /* 按钮自说明, 与工具栏口径一致 */
/* v0.12.3: 保存的视图桌面挂 KPI 条右端（用户需求: 与事件总数同行; 原方法论链接位）——
 * JS mount 挂 #rm-summary 时加 .sv-in-bar, 作用域不依赖父容器 */
.sv-in-bar { position: relative; align-self: center; flex-shrink: 0; }
.sv-in-bar .filter-label.fg-toggle {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px; border-radius: 12px; font-size: 11px;
  border: 1px solid #d0d0d0; background: #fafafa; color: #555;
  cursor: pointer; text-transform: none; letter-spacing: 0; margin: 0;
  white-space: nowrap; transition: all 0.15s;
}
.sv-in-bar .filter-label.fg-toggle::after { content: '▾'; font-size: 9px; color: #90a4ae; }
.sv-in-bar .filter-label.fg-toggle:hover { border-color: #0a4a8c; background: #fff; }
.sv-in-bar:not(.collapsed) .filter-label.fg-toggle { border-color: #0a4a8c; color: #0a4a8c; background: #fff; }
.sv-in-bar .sv-pop {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 2200;
  width: 260px; padding: 10px;
  background: #fff; border: 1px solid #e0e0e0; border-radius: 8px;
  box-shadow: 0 6px 24px rgba(0,0,0,0.14);
}
/* E12: KPI 5 数字的自适应收窄——挂链/今日在移动端与窄笔记本隐藏（P1-7 压缩口径延续, 总数+高严重度保底） */
@media (max-width: 900px) {
  .stat.kpi-chain, .stat.kpi-today { display: none; }
}
@media (max-width: 768px) {
  .stat .num { font-size: 17px; }
  .stat .label { font-size: 10.5px; }
}

/* 地图画布 */
.map-canvas { flex: 1; position: relative; min-height: 0; overflow: hidden; }
#rm-map .leaflet-tile { filter: grayscale(0.8) saturate(0.6); }

/* 如何读图 */
.how-to-read {
  position: absolute; top: 12px; right: 12px; z-index: 1000;  /* 2026-10-04 左上→右上（用户决策） */
  background: rgba(255,255,255,0.96); border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 12px 16px; max-width: 280px; box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.guide-title { font-size: 12px; font-weight: 700; color: #0a4a8c; margin-bottom: 6px; }
.guide-content { font-size: 11px; color: #555; line-height: 1.6; }
.legend { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.legend-item { display: flex; align-items: center; gap: 3px; font-size: 10px; color: #555; }
.legend-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.guide-dismiss { text-align: right; margin-top: 6px; }
.guide-dismiss a { font-size: 10px; color: #0a4a8c; text-decoration: none; cursor: pointer; }

/* 更新标注 */
.update-label {
  position: absolute; bottom: 12px; left: 12px; z-index: 1000;
  background: rgba(255,255,255,0.95); border: 1px solid #e0e0e0; border-radius: 6px;
  padding: 8px 12px; font-size: 11px; color: #666; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  line-height: 1.5;
}
.rhythm-badge {
  display: inline-block; background: #e65100; color: #fff;
  font-size: 10px; padding: 1px 6px; border-radius: 3px; margin-right: 4px;
}
/* E6: 源降级/更新暂停态 —— 琥珀警示（区别于正常橙红 #e65100; box-shadow 描边不扰动布局） */
.rhythm-badge.degraded { background: #b45309; box-shadow: 0 0 0 1px #92400e; }

/* 底图署名 */
.map-attrib {
  position: absolute; bottom: 0; right: 0; z-index: 1000;
  font-size: 10px; color: #888; background: rgba(255,255,255,0.85);
  padding: 3px 8px; border-top-left-radius: 4px;
}

/* ─── Leaflet 弹窗样式覆盖 ─── */
.leaflet-popup-content-wrapper {
  border-radius: 8px; box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}
.rm-popup { min-width: 300px; max-width: 380px; }
.rm-popup-wrapper .leaflet-popup-content { max-height: min(calc(100vh - 360px), 62vh); overflow-y: auto; }
/* 限高=视口相对（2026-10-04 修上半被裁: 62vh 在矮视口超过地图可用高, 弹窗顶越界被地图容器裁） */
.rm-popup-title { font-size: 14px; font-weight: 600; line-height: 1.4; margin-bottom: 6px; color: #1a1a2e; }
.rm-popup-summary { font-size: 12px; color: #555; line-height: 1.5; margin-bottom: 8px; }
.rm-popup-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 11px; }
.rm-popup-field .k { color: #999; }
.rm-popup-field .v { color: #333; font-weight: 500; }
.rm-popup-basis {
  margin-top: 8px; padding: 4px 8px; background: #f5f5f5; border-radius: 4px;
  font-size: 10px; color: #888;
}

/* ─── 弹窗信息重排（2026-10-04 用户视角审计） ─── */
.rm-popup-badges { display: flex; gap: 5px; margin-bottom: 6px; flex-wrap: wrap; }
.rm-badge { font-size: 10px; padding: 1px 8px; border-radius: 9px; font-weight: 600; }
.rm-badge-time { background: #eceff1; color: #607d8b; font-weight: 500; }
/* F2: 生效日倒计时徽章（琥珀底, 与事件卡 ⏳ tag 同色系） */
.rm-badge-eff { background: #fff8e1; color: #b45309; font-weight: 500; }
.rm-popup-factline {
  display: flex; align-items: center; gap: 10px; margin-top: 6px; padding-top: 6px;
  border-top: 1px solid #eceff1; font-size: 11.5px;
}
.rm-fact-country { color: #0a4a8c; cursor: pointer; font-weight: 600; }
.rm-fact-country:hover { text-decoration: underline; }
.rm-fact-source { color: #789; text-decoration: none; margin-left: auto; }
.rm-fact-source:hover { color: #0a4a8c; text-decoration: underline; }

/* ─── E14-C3: 事件核查清单（弹窗内建议核查项） ─── */
.rm-popup-checklist {
  margin-top: 6px; padding: 6px 8px; background: #e8f5e9;
  border-radius: 4px; border-left: 3px solid #2e7d32;
}
.rpc-title { font-size: 10px; font-weight: 600; color: #2e7d32; margin-bottom: 3px; }
.rpc-item { display: block; font-size: 10.5px; color: #37474f; padding: 1px 0; line-height: 1.4; }

/* ─── F1: 应对参考分组（弹窗核查项/应对项两级分组, 2026-10-06）─── */
.rpc-group-action {
  margin-top: 6px; padding: 6px 8px; background: #e3f2fd;
  border-radius: 4px; border-left: 3px solid #1565c0;
}
.rpc-title-action { color: #1565c0; }
.rpc-action-name { font-size: 10.5px; font-weight: 600; color: #283593; margin-bottom: 3px; line-height: 1.4; }
.rpc-action-step { color: #37474f; }
.rpc-action-meta { font-style: normal; color: #78909c; font-size: 9.5px; }
.rpc-disclaimer {
  display: block; font-size: 10px; font-style: italic; color: #90a4ae;
  border-top: 1px solid #bbdefb; margin-top: 4px; padding-top: 3px; line-height: 1.4;
}
/* F3: 执法案例行（弹窗应对组内, OFAC 官方处罚记录直录） */
.rpc-case-title { font-size: 10.5px; font-weight: 600; color: #455a64; margin-top: 5px; }
.rpc-case {
  display: block; font-size: 10.5px; color: #1565c0; text-decoration: none;
  line-height: 1.45; padding: 1px 0;
}
.rpc-case:hover { text-decoration: underline; }

/* ─── P2-0 影响链（弹窗内传导路径） ─── */
.rm-popup-impact {
  margin-top: 8px; padding: 8px; background: #fff8e1;
  border-left: 3px solid #e65100; border-radius: 4px;
}
.mpi-title { font-size: 10.5px; font-weight: 700; color: #bf360c; margin-bottom: 5px; }
.mpi-path { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; font-size: 10.5px; }
.mpi-node { padding: 2px 6px; border-radius: 3px; line-height: 1.4; }
.mpi-node i { font-style: normal; opacity: 0.7; font-size: 9.5px; }
.mpi-node.mat { background: #e3f2fd; color: #1565c0; }
.mpi-node.chk { background: #ffebee; color: #c62828; }
.mpi-node.prd { background: #f3e5f5; color: #6a1b9a; }
.mpi-node.ind { background: #e8f5e9; color: #2e7d32; }
.mpi-arrow { color: #b0bec5; font-size: 10px; }
.mpi-note { font-size: 10px; color: #8d6e63; margin-top: 5px; line-height: 1.5; }
.mpi-src { font-size: 9.5px; color: #a1887f; margin-top: 4px; }

/* ─── 分享按钮（2026-10-04 缩小: factline 行内小图标按钮） ─── */
.rps-btn {
  border: 1px solid #cfd8dc; background: #fff; color: #546e7a;
  border-radius: 6px; width: 26px; height: 22px; font-size: 12px; line-height: 1;
  cursor: pointer; padding: 0; flex-shrink: 0;
}
.rps-btn:hover { background: #eceff1; border-color: #90a4ae; }

/* ─── P2-B 相关分析（弹窗内） ─── */
.rm-popup-related {
  margin-top: 8px; padding: 8px; background: #f3effa;
  border-left: 3px solid #5e35b1; border-radius: 4px;
}
.rpr-title { font-size: 10.5px; font-weight: 700; color: #5e35b1; margin-bottom: 4px; }
.rpr-link {
  display: block; font-size: 11px; color: #4527a0; text-decoration: none;
  line-height: 1.5; margin-bottom: 2px;
}
.rpr-link:hover { text-decoration: underline; }

/* ─── P2-0b 材料档案卡 ─── */
.material-card {
  margin: 10px 12px 6px; background: linear-gradient(135deg, #f0f6ff, #e8f1ff);
  border: 1px solid #c5d8ef; border-left: 4px solid #0a4a8c;
  border-radius: 8px; padding: 10px 12px;
  animation: mc-in 0.25s ease;
}
@keyframes mc-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; } }
.mc-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.mc-badge { font-size: 14px; }
.mc-name { font-size: 14px; font-weight: 700; color: #0a4a8c; flex: 1; }
.mc-close { border: none; background: #d8e6f7; color: #0a4a8c; border-radius: 50%;
  width: 20px; height: 20px; line-height: 1; cursor: pointer; font-size: 13px; }
.mc-close:hover { background: #b7d0ee; }
.mc-en { font-size: 10.5px; color: #6b7f99; margin-bottom: 6px; }
/* E7: 档案卡证据分级徽标 */
.mc-ev { display: inline-block; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 3px; margin-right: 4px; vertical-align: 1px; }
.mc-ev.ev-deep { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.mc-ev.ev-official { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.mc-ev.ev-unverified { background: #f5f5f5; color: #999; border: 1px solid #ddd; }
/* E3: 咽喉点资产层开关控件（地图右下角; v0.12.5 垂直双按钮=复位世界视图+咽喉点, 默认开） */
.cp-toggle { margin-bottom: 42px !important; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.cp-toggle button {
  background: rgba(255,255,255,0.92); border: 1px solid #cfd8dc; border-radius: 4px;
  padding: 4px 10px; font-size: 11px; color: #455a64; cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.cp-toggle button.on { background: #0a4a8c; color: #fff; border-color: #0a4a8c; }
/* B2: 咽喉点弹窗月度分布微条图 */
.cp-timeline { display: inline-flex; align-items: flex-end; gap: 1px; height: 14px; margin-left: 4px; vertical-align: -2px; }
.cp-mbar { display: inline-block; width: 5px; background: #e65100; border-radius: 1px; min-height: 1px; }
/* E10: 口径卡（chip ⓘ 弹卡 + 如何读图汇总链接） */
.cc-info { font-style: normal; margin-left: 4px; opacity: 0.65; cursor: help; }
.pill:hover .cc-info { opacity: 1; }
.cc-overlay {
  position: fixed; inset: 0; background: rgba(10,20,35,0.45); z-index: 3200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.cc-card {
  background: #fff; border-radius: 10px; max-width: 460px; width: 100%;
  max-height: min(calc(100vh - 120px), 70vh); overflow-y: auto;
  padding: 14px 16px; box-shadow: 0 12px 48px rgba(0,0,0,0.3);
}
.cc-card .mc-name { font-size: 14px; font-weight: 600; }
.cc-row { display: flex; gap: 10px; font-size: 11.5px; margin: 6px 0; align-items: baseline; }
.cc-row .cc-k { color: #8a9bb0; white-space: nowrap; min-width: 4.5em; }
.cc-row .cc-v { color: #37474f; line-height: 1.55; word-break: break-word; }
.cc-row .cc-v ul { margin: 2px 0; padding-left: 16px; }
.cc-evid code {
  display: block; font-size: 10px; color: #5e35b1; background: #f3eefb;
  border-radius: 3px; padding: 1px 5px; margin: 2px 0; word-break: break-all;
}
.guide-cards { margin-top: 8px; font-size: 10.5px; }
.gcc-title { color: #0a4a8c; font-weight: 600; margin-bottom: 2px; }
.gcc-links a { color: #0a4a8c; cursor: pointer; text-decoration: underline; }
@media (max-width: 768px) {
  .cc-overlay { align-items: flex-end; padding: 0; }
  .cc-card { border-radius: 14px 14px 0 0; max-width: 100%; max-height: 72vh; padding-bottom: calc(12px + env(safe-area-inset-bottom, 0)); }
}
.mc-row { display: flex; gap: 8px; font-size: 11.5px; margin-bottom: 4px; align-items: baseline; }
.mc-row .k { color: #8a9bb0; white-space: nowrap; min-width: 3.5em; }
.mc-row .v { color: #1a2a3a; font-weight: 500; }
.mc-count {
  margin-top: 6px; padding: 5px 8px; background: rgba(255,255,255,0.75);
  border-radius: 6px; font-size: 11.5px; color: #33475b;
}
.mc-count b { color: #0a4a8c; font-size: 13px; }

/* ─── P2-6 国家面板（侧滑轻量预览） ─── */
.country-panel {
  position: absolute; top: 52px; right: -360px; width: 340px; max-width: 92%;
  bottom: 12px; z-index: 2400;
  background: #fff; border-radius: 12px; border: 1px solid #e0e0e0;
  box-shadow: -8px 0 32px rgba(0,0,0,0.14);
  padding: 14px 16px; overflow-y: auto;
  transition: right 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; flex-direction: column; gap: 8px;
}
.country-panel.open, .country-panel.np-filtering { right: 12px; }
.np-head { display: flex; align-items: center; gap: 8px; }
.np-flag { font-size: 24px; line-height: 1; }
.np-name { font-size: 16px; font-weight: 700; color: #1a1a2e; flex: 1; }
.np-close { border: none; background: #f0f0f0; color: #666; width: 24px; height: 24px;
  border-radius: 50%; cursor: pointer; font-size: 15px; line-height: 1; }
.np-close:hover { background: #ddd; }
.np-stats { display: flex; gap: 10px; }
.np-stat { flex: 1; background: #f5f8fc; border-radius: 8px; padding: 8px 6px; text-align: center; }
.np-stat b { display: block; font-size: 20px; color: #0a4a8c; line-height: 1.2; }
.np-stat.sev b { color: #c62828; }
.np-stat span { font-size: 10.5px; color: #789; }
.np-sec { font-size: 11px; font-weight: 600; color: #8a9bb0; text-transform: uppercase;
  letter-spacing: 0.5px; margin-top: 4px; }
.np-cat-row { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.np-cat-name { font-size: 11.5px; color: #33475b; width: 64px; flex-shrink: 0; }
.np-cat-bar { flex: 1; height: 8px; background: #eef2f7; border-radius: 4px; overflow: hidden; }
.np-cat-bar span { display: block; height: 100%; background: linear-gradient(90deg, #4a86c8, #0a4a8c); border-radius: 4px; }
.np-cat-num { font-size: 11px; color: #789; width: 26px; text-align: right; }
.np-top { display: flex; flex-direction: column; gap: 4px; }
.np-event { display: flex; gap: 8px; font-size: 11.5px; padding: 5px 8px; border-radius: 6px;
  cursor: pointer; align-items: baseline; }
.np-event:hover { background: #f0f6ff; }
.np-event-date { color: #99a8bd; white-space: nowrap; font-size: 10.5px; }
.np-event-title { color: #1a2a3a; line-height: 1.4; }
.np-filter-btn {
  margin-top: 6px; padding: 9px; border-radius: 8px; border: 1px solid #0a4a8c;
  background: #0a4a8c; color: #fff; font-size: 12.5px; cursor: pointer; font-weight: 600;
}
.np-filter-btn:hover { background: #083a70; }
.country-panel.np-filtering .np-filter-btn {
  background: #fff; color: #0a4a8c;   /* 激活态: 再点取消 */
}
.np-detail-link {
  display: block; text-align: center; margin-top: 8px; padding: 8px;
  font-size: 12px; color: #0a4a8c; text-decoration: none;
  border: 1px dashed #b7d0ee; border-radius: 8px;
}
.np-detail-link:hover { background: #eef3fa; }
.rm-popup-country-link {
  margin-top: 8px; padding: 6px 8px; background: #eef3fa; border-radius: 6px;
  font-size: 11.5px; color: #0a4a8c; font-weight: 600; cursor: pointer;
}
.rm-popup-country-link:hover { background: #dde9f7; }
.event-country.clickable { cursor: pointer; color: #0a4a8c; }
.event-country.clickable:hover { text-decoration: underline; }

/* 移动端: 国家面板 = 底部第二层 sheet（盖住抽屉） */
@media (max-width: 768px) {
  .country-panel.np-mobile {
    top: auto; right: 0; left: 0; bottom: -100vh; width: 100%; max-width: 100%;
    border-radius: 14px 14px 0 0; max-height: 72dvh; height: auto;
    transition: bottom 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    padding-bottom: calc(14px + env(safe-area-inset-bottom, 0));
  }
  .country-panel.np-mobile.open, .country-panel.np-mobile.np-filtering { right: 0; bottom: 0; }
}

/* ─── 抽屉把手（仅移动端显示） ─── */
.drawer-handle {
  display: none; /* 桌面隐藏 */
}

/* ─── drawer-body: 桌面也保持 flex 链（P1-7 引入包裹层, 原布局依赖 sidebar 直接
   flex 子项; 无此规则则 event-list 的 flex:1 失效 → 列表不可滚 2026-10-03 修复） ─── */
@media (min-width: 769px) {
  .drawer-body {
    display: flex; flex-direction: column; height: 100%; min-height: 0;
  }
}

/* ─── 响应式: P1-7 移动端适配（≤768px） ───
 * 形态: 地图全屏主体 + 底部抽屉（默认收起显最新 3 条）+ 底部 sheet 弹窗
 * 字号门槛: 核心 ≥12px / 辅助 ≥10px（roadmap v2.39 #11）
 */
@media (max-width: 768px) {
  /* 容器: 100dvh 抗移动地址栏 */
  .sci-risk-map-container {
    height: auto; min-height: calc(100dvh - 190px);
    border-radius: 0; margin: 0 0 8px;
  }
  .risk-map-main { flex-direction: column; }

  /* ── 地图全屏主体 ── */
  .risk-map-area { min-height: 55vh; order: 0; }
  .summary-bar { padding: 6px 12px; gap: 16px; }
  .stat .num { font-size: 18px; }
  /* KPI 压缩为 2 个数字: 事件总数 + 高热区域 */
  .summary-bar .stat:nth-of-type(3), .summary-bar .methodology-link { display: none; }

  /* 引导浮窗/更新标注缩小避让 */
  .how-to-read { max-width: 190px; padding: 8px 10px; top: 8px; right: 8px; }
  .update-label { bottom: 8px; left: 8px; font-size: 10px; padding: 5px 8px; }
  .calendar-alert { font-size: 11.5px; padding: 6px 12px; }
  /* F2: 日历条移动端单行横滚（条目多/长时不撑高头部; 先例=类别横滚筛选条）
     0.16.1 修复: cal-detail 收缩+溢出隐藏——否则 flex 子项 min-width:auto 按内容撑到 1103px,
     chip 越界被 body overflow 裁剪且容器 sw==cw 不出滚动条（390 视口实测 3/3 chip 不可达） */
  .calendar-alert .cal-detail { flex: 1 1 auto; min-width: 0; overflow: hidden; }
  .calendar-alert .cal-items { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .cal-item { flex-shrink: 0; font-size: 11px; }

  /* ── 底部抽屉 ── */
  .risk-map-sidebar {
    width: 100%; min-width: 0; max-width: 100%;
    height: 216px;               /* 收起: 把手 + 类别横滚 + 最新3条 */
    border-right: none; border-top: 1px solid #e0e0e0;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    order: 1; overflow: hidden;
    flex-shrink: 0;
  }
  .risk-map-sidebar.expanded { height: 72dvh; }

  .drawer-handle {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 16px 7px; cursor: pointer; user-select: none;
    background: #fafafa; border-bottom: 1px solid #eee;
    flex-shrink: 0; touch-action: none;
  }
  .handle-bar {
    position: absolute; left: 50%; top: 4px; transform: translateX(-50%);
    width: 36px; height: 4px; border-radius: 2px; background: #ccc;
  }
  .drawer-handle { position: relative; }
  .handle-title { font-size: 12px; font-weight: 600; color: #333; }
  .handle-count { font-size: 11px; color: #888; }
  .handle-chevron { margin-left: auto; font-size: 13px; color: #999; transition: transform 0.3s; }
  .risk-map-sidebar.expanded .handle-chevron { transform: rotate(180deg); }

  .drawer-body {
    display: flex; flex-direction: column; height: calc(100% - 38px);
    min-height: 0; overflow: hidden;
  }

  /* 类别筛选 → 顶部水平滚动条（收起时也可见） */
  .search-box { display: none; }          /* 搜索非移动首要操作, 展开后也不占空间 */
  .risk-map-sidebar.expanded .search-box { display: block; }
  .filters { padding: 8px 12px; border-bottom: 1px solid #f0f0f0; }
  .filter-group { margin-bottom: 6px; }
  .filter-group:first-child { margin-bottom: 0; }
  .filter-group:first-child .filter-label { display: none; }
  .filter-group:first-child .filter-pills {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: 2px;
  }
  .filter-group:first-child .filter-pills::-webkit-scrollbar { display: none; }
  .pill { white-space: nowrap; font-size: 11px; padding: 4px 11px; }
  /* 收起时只显类别行（时间/来源/严重度藏进展开态） */
  .risk-map-sidebar:not(.expanded) .filter-group:not(:first-child) { display: none; }
  .risk-map-sidebar:not(.expanded) .sort-control { display: none; }

  .sort-control { padding: 6px 12px; }
  .event-list-header { padding: 6px 12px; }
  .event-card { padding: 9px 12px; }
  .event-title { font-size: 12.5px; }
}

/* ─── 弹窗: 移动端 = 底部 sheet ─── */
@media (max-width: 768px) {
  .rm-popup-wrapper.leaflet-popup {
    position: fixed !important;
    bottom: 0 !important; left: 0 !important; top: auto !important; right: 0 !important;
    width: 100% !important; max-width: 100% !important;
    transform: none !important; margin: 0 !important;
    z-index: 2600;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .rm-popup-wrapper .leaflet-popup-content-wrapper {
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -6px 30px rgba(0,0,0,0.2);
    width: 100%;
  }
  .rm-popup-wrapper .leaflet-popup-content { width: auto !important; margin: 14px 16px; }
  .rm-popup-wrapper .leaflet-popup-tip-container { display: none !important; }
  .rm-popup-wrapper .leaflet-popup-close-button {
    right: 10px; top: 8px; font-size: 22px !important;
  }
  .rm-popup { min-width: 0; max-width: 100%; width: 100%; }
}
/* B2: FBX 运价 KPI 卡 */
.stat.kpi-freight .num { font-size: 20px; }
.stat.kpi-freight .num span { font-weight: 500; }

/* E14-C2: 档案卡"当前风险状态"段 */
.mc-status {
  margin: 4px 0; padding: 6px 8px; background: #e3f2fd;
  border-radius: 4px; border-left: 3px solid #1565c0;
}
.mcs-title { font-size: 10px; font-weight: 600; color: #1565c0; margin-bottom: 3px; }
.mc-status .mc-row { margin: 2px 0; }
.rpc-baseline { color: #1565c0; font-style: italic; border-top: 1px solid #c8e6c9; margin-top: 2px; padding-top: 2px; }
