/* =========================================================
   tokens.css · 双皮肤 token 底座
   - 深色 = 汇报态（领导汇报、会场投屏）
   - 浅色 = 业务态（日常办公、表格表单、台账归档）
   - 切换通过 html[data-theme="dark|light"] 完成
   ========================================================= */

:root{
  /* 与主题无关的尺寸 / 圆角 */
  --r-sm:6px;  --r-md:8px;  --r-lg:12px;
  --top-h:64px;     --nav-h:42px;     --status-h:36px;
  --side-w:208px;   --side-gap:12px;
  --stage-pad-x:16px;

  /* 状态色（双主题共用，浅色略降饱和） */
  --ok:#37c98a;
  --warn:#ffb547;
  --high:#ff3d4f;
  --orange:#ff8a3d;
  --yellow:#ffd64a;
  --agri-green:#22c55e;
  --agri-green-2:#16a34a;
  --wheat-gold:#f6c761;
  --wheat-gold-2:#d4a843;
  --blue-lvl:#5aa7ff;
  --gray-lvl:#7a8aae;

  /* 任务 / 材料 / 支援的状态颜色（共用） */
  --st-pending:#7d8fa4;  --st-signed:#5aa7ff;  --st-decomposed:#a974ff;
  --st-dispatch:#3edaf4; --st-running:#22c55e; --st-wait:#ffb547;
  --st-done:#37c98a;     --st-overdue:#ff3d4f; --st-archived:#5b6da0;
}

/* =========================================================
   深色 · 汇报态（默认）
   ========================================================= */
:root[data-theme="dark"]{
  /* 兼容旧色板 */
  --bg-deep:#0a1124;  --bg-page:#0e1730;
  --bg-panel:#152244; --bg-panel-2:#1a2a52;
  --bg-card:#1e2f5f;  --bg-hover:#243a72;
  --bd-soft:#27396b;  --bd:#324b8a;  --bd-strong:#4a67b3;
  --tx-1:#eaf0ff; --tx-2:#b9c5e6; --tx-3:#8294c4; --tx-4:#5b6da0;

  --gov-blue:#2b6cff;     --gov-blue-2:#4a8bff;    --tech-cyan:#3edaf4;
  --ai-purple:#a974ff;    --ai-purple-soft:rgba(169,116,255,.14);

  /* 语义化背景 */
  --body-bg: radial-gradient(ellipse 1400px 800px at 50% -200px,#143a6f 0%,#0e1730 38%,#0a1124 100%);
  --top-bg:    linear-gradient(90deg,#0b1732 0%,#10264a 50%,#0b1732 100%);
  --nav-bg:    linear-gradient(90deg,#0a142a 0%,#0e1f3e 100%);
  --status-bg: linear-gradient(90deg,#0a132a 0%,#101e3d 100%);
  --panel-bg: linear-gradient(180deg,rgba(21,34,68,.92) 0%,rgba(14,23,48,.92) 100%);
  --card-bg: rgba(21,34,68,.72);
  --hover-bg: rgba(43,108,255,.10);
  --modal-bg: linear-gradient(180deg,#162547,#0d1932);
  --toast-bg: linear-gradient(180deg,rgba(30,47,95,.96),rgba(14,23,48,.96));

  /* 文本 */
  --text-main:var(--tx-1);
  --text-soft:var(--tx-2);
  --text-mute:var(--tx-3);
  --text-faint:var(--tx-4);

  /* 边框 / 分割线 */
  --border-soft:var(--bd-soft);
  --border:var(--bd);

  /* 表格 */
  --table-head-bg: rgba(43,108,255,.10);
  --table-row-hover: rgba(43,108,255,.08);
  --table-border: rgba(39,57,107,.5);

  /* 表单 / 附件 */
  --form-bg: rgba(15,30,60,.7);
  --form-border: var(--bd-soft);
  --form-label: var(--tx-3);
  --form-required: var(--orange);
  --form-focus: var(--tech-cyan);
  --upload-bg: rgba(15,30,60,.5);
  --upload-border: dashed 1px var(--bd-soft);
  --upload-hover: rgba(62,218,244,.10);

  /* 公文预览纸张（深色态下纸张本身仍保持白底以保证公文真实感） */
  --doc-paper-bg: #fbfbfb;
  --doc-paper-text: #1a2a52;
  --doc-paper-muted: #6b7280;
  --doc-paper-border: #d8e2f0;
  --doc-seal-red: #a40000;
  --doc-table-border: #c4c4c4;
  --doc-table-head-bg: #f1f1f1;
  --doc-pending-border: #d93b4f;
  --doc-pending-attach-text: #9a4b14;

  /* 阴影 */
  --shadow-soft: 0 6px 20px rgba(0,0,0,.45);
  --shadow-card: 0 0 14px rgba(62,218,244,.12);

  /* 地图变量 · 第九轮真实 GeoJSON 底图 */
  --map-bg: radial-gradient(ellipse at center,#102a55 0%,#08152d 100%);
  /* 菏泽其他区县（弱化） */
  --map-district-fill: rgba(28,52,103,.55);
  --map-district-stroke: rgba(74,103,179,.55);
  --map-district-muted-fill: rgba(20,38,80,.55);
  --map-district-muted-stroke: rgba(74,103,179,.42);
  /* 鄄城县（高亮） */
  --map-current-fill: rgba(43,108,255,.22);
  --map-current-stroke: rgba(62,218,244,.85);
  --map-current-glow: 0 0 14px rgba(62,218,244,.45);
  /* 第十九轮 P0-1：县界底板 + 强填充（深色态） */
  --map-county-plate-fill: rgba(10,25,55,.74);
  /* 第二十二轮 P0-3：boundary-strong / 县界检视模式专用强底板，
     饱和度更高、对比更强 —— 让县界在所有业务图层之上始终可辨 */
  --map-county-plate-fill-strong: rgba(14,39,92,.90);
  --map-county-fill-strong: rgba(30,108,210,.38);
  --map-county-stroke: #67e8f9;
  --map-county-shadow-stroke: rgba(1,7,20,.98);
  --map-county-border-highlight: rgba(255,255,255,.72);
  /* 第二十二轮 P0-2：fallback 县界（plate + outline）— 深色 */
  --map-fallback-county-plate: rgba(16,30,62,.62);
  --map-fallback-county-outline: rgba(103,232,249,.85);
  /* 第二十三轮 P0-1 + 第二十四轮 P0-2：双边界策略 —— 克制行政边界（深色）
     - silhouette-fill 降饱和度（.58 而非 .72），避免内部一整块发光蓝
     - silhouette-halo 新增，给县界一条暗色外环，替代旧的厚发光 */
  --map-county-silhouette-fill: rgba(30,86,154,.58);
  --map-county-silhouette-stroke: rgba(191,245,255,.95);
  --map-county-silhouette-halo: rgba(16,42,86,.82);
  --map-county-silhouette-top: rgba(191,245,255,.92);
  --map-county-real-fill: rgba(51,139,246,.12);
  --map-county-real-line: rgba(103,232,249,.68);
  --map-county-real-top: rgba(103,232,249,.68);
  /* 第二十四轮 P0-3：县域底图感（道路 + 河流，深色） */
  --map-guide-road: rgba(148,203,255,.35);
  --map-guide-river: rgba(56,189,248,.38);
  --map-guide-label: rgba(191,222,255,.68);
  /* 第二十四轮 P0-6：标签描边底色（让镇名 readable） */
  --map-label-stroke: rgba(5,14,32,.72);
  --map-bottom-bg: rgba(8,18,38,.86);
  --map-overlay-bg: rgba(8,18,38,.82);
  /* 标注 */
  --map-label-main: #eaf0ff;
  --map-label-soft: rgba(185,197,230,.75);
  --map-label-current: #ffffff;
  /* 业务点位 / 路线 */
  --map-point-stroke: rgba(255,255,255,.85);
  --map-route: rgba(62,218,244,.55);
  /* 信息层 */
  --map-tooltip-bg: rgba(8,18,38,.94);
  --map-tooltip-border: rgba(62,218,244,.45);
  --map-source-bg: rgba(8,18,38,.78);
  --map-source-text: rgba(185,197,230,.85);
  /* 第十六轮 P0-2：县界顶层实线主 + 虚线辅 —— 兜底强色，不再用透明度 */
  --map-county-border-solid: #ffffff;
  --map-county-border-dash: #67e8f9;
  /* 第二十轮 P0-1：置顶硬轮廓（深色） */
  --map-county-outline-top: #ffffff;
  --map-county-outline-glow: rgba(103,232,249,.95);
  /* 兼容旧变量（其它组件仍在使用） —— 第十五轮 P0-1：不能再覆盖 --map-county-stroke，
     否则会让三层县界强边界变量失效；改用 -legacy 后缀 */
  --map-county-fill: var(--map-current-fill);
  --map-county-stroke-legacy: var(--map-current-stroke);
  --map-town-fill: rgba(43,108,255,.10);
  --map-town-stroke: rgba(74,103,179,.55);
  --map-legend-bg: rgba(8,18,38,.86);
  --map-legend-border: var(--bd-soft);
  --map-header-fill: rgba(62,218,244,.60);
  --map-subheader-fill: rgba(130,148,196,.70);

  /* 第五轮新增：徽标蒙层 / 历史记录块 */
  --badge-overlay-bg: rgba(0,0,0,.50);
  --badge-overlay-text: #fff;
  --history-bg: rgba(8,18,38,.5);
}

/* =========================================================
   浅色 · 业务态
   ========================================================= */
:root[data-theme="light"]{
  /* 兼容旧色板（重映射到浅色） */
  --bg-deep:#f2f6fb;  --bg-page:#f7f9fc;
  --bg-panel:#ffffff; --bg-panel-2:#f8fbff;
  --bg-card:#ffffff;  --bg-hover:#eef5ff;
  --bd-soft:#dde6f2;  --bd:#c7d5e8;  --bd-strong:#a9c1df;
  --tx-1:#102033; --tx-2:#4f647d; --tx-3:#7e90a6; --tx-4:#9cacbf;

  --gov-blue:#2457d6;     --gov-blue-2:#4b82f1;    --tech-cyan:#1fa6d8;
  --ai-purple:#8459e6;    --ai-purple-soft:rgba(132,89,230,.10);

  /* 语义化背景 */
  --body-bg:#f3f6fb;
  --top-bg:    linear-gradient(90deg,#0f2f63 0%,#16457f 100%);    /* 顶栏保持深蓝政务感 */
  --nav-bg:    #ffffff;
  --status-bg: #f8fbff;
  --panel-bg:  #ffffff;
  --card-bg:   #ffffff;
  --hover-bg:  #eef5ff;
  --modal-bg:  #ffffff;
  --toast-bg:  #ffffff;

  /* 文本 */
  --text-main:var(--tx-1);
  --text-soft:var(--tx-2);
  --text-mute:var(--tx-3);
  --text-faint:var(--tx-4);

  /* 边框 */
  --border-soft:var(--bd-soft);
  --border:var(--bd);

  /* 表格 */
  --table-head-bg: #f1f5fb;
  --table-row-hover: #eef5ff;
  --table-border: #e3eaf3;

  /* 表单 / 附件 */
  --form-bg: #ffffff;
  --form-border: #d8e2f0;
  --form-label: #64748b;
  --form-required: #d93b4f;
  --form-focus: var(--gov-blue);
  --upload-bg: #f8fbff;
  --upload-border: dashed 1px #b5c6dc;
  --upload-hover: #edf4ff;

  /* 公文预览 */
  --doc-paper-bg: #ffffff;
  --doc-paper-text: #1a2a52;
  --doc-paper-muted: #6b7280;
  --doc-paper-border: #d8e2f0;

  --shadow-soft: 0 6px 18px rgba(31,55,98,.10);
  --shadow-card: 0 1px 4px rgba(31,55,98,.06);

  /* 地图变量 · 第九轮真实 GeoJSON 底图 */
  --map-bg: linear-gradient(180deg,#eef5ff 0%,#f8fbff 100%);
  /* 菏泽其他区县（弱化） */
  --map-district-fill: #eaf0f7;
  --map-district-stroke: #8fb3d9;
  --map-district-muted-fill: #f1f5fa;
  --map-district-muted-stroke: #bfd1e5;
  /* 鄄城县（高亮） */
  --map-current-fill: #cfe0f5;
  --map-current-stroke: #1d5fd1;
  --map-current-glow: 0 1px 3px rgba(29,95,209,.20);
  /* 第十九轮 P0-1：县界底板 + 强填充（浅色态） */
  --map-county-plate-fill: #f8fbff;
  /* 第二十二轮 P0-3：boundary-strong / 县界检视模式专用强底板（浅色） */
  --map-county-plate-fill-strong: #eef6ff;
  --map-county-fill-strong: #dbeafe;
  --map-county-stroke: #1d4ed8;
  --map-county-shadow-stroke: rgba(255,255,255,.98);
  --map-county-border-highlight: rgba(15,47,99,.38);
  /* 第二十二轮 P0-2：fallback 县界（plate + outline）— 浅色 */
  --map-fallback-county-plate: #eef4ff;
  --map-fallback-county-outline: #1d4ed8;
  /* 第二十三轮 P0-1 + 第二十四轮 P0-2：双边界策略（浅色）
     - 县域填充淡蓝、县界深蓝 2~2.5px、白色 halo 衬底，不使用明显发光 */
  --map-county-silhouette-fill: #dceeff;
  --map-county-silhouette-stroke: #1d4ed8;
  --map-county-silhouette-halo: rgba(255,255,255,.92);
  --map-county-silhouette-top: #1d4ed8;
  --map-county-real-fill: rgba(37,99,235,.06);
  --map-county-real-line: #2563eb;
  --map-county-real-top: rgba(37,99,235,.72);
  /* 第二十四轮 P0-3：县域底图感（道路 + 河流，浅色） */
  --map-guide-road: rgba(71,85,105,.28);
  --map-guide-river: rgba(14,165,233,.40);
  --map-guide-label: rgba(71,85,105,.65);
  /* 第二十四轮 P0-6：标签描边底色（浅色用白底，让镇名 readable） */
  --map-label-stroke: rgba(255,255,255,.86);
  --map-bottom-bg: rgba(255,255,255,.95);
  --map-overlay-bg: rgba(255,255,255,.92);
  /* 标注 */
  --map-label-main: #1f2a44;
  --map-label-soft: #64748b;
  --map-label-current: #0f2f63;
  /* 业务点位 / 路线 */
  --map-point-stroke: rgba(31,55,98,.30);
  --map-route: rgba(14,159,192,.65);
  /* 信息层 */
  --map-tooltip-bg: #ffffff;
  --map-tooltip-border: #c7d5e8;
  --map-source-bg: rgba(255,255,255,.92);
  --map-source-text: #4f647d;
  /* 第十八轮 P0-1：县界顶层（浅色）—— 终极兜底强色 */
  --map-county-border-solid: #020617;
  --map-county-border-dash: #1d4ed8;
  /* 第二十轮 P0-1：置顶硬轮廓（浅色） */
  --map-county-outline-top: #020617;
  --map-county-outline-glow: rgba(29,78,216,.42);
  /* 兼容旧变量 —— 第十五轮 P0-1：不再覆盖 --map-county-stroke，改用 -legacy 后缀 */
  --map-county-fill: var(--map-current-fill);
  --map-county-stroke-legacy: var(--map-current-stroke);
  --map-town-fill: #f7fbff;
  --map-town-stroke: #b7c8de;
  --map-legend-bg: rgba(255,255,255,.94);
  --map-legend-border: #d8e2f0;
  --map-header-fill: #1d5fd1;
  --map-subheader-fill: #64748b;

  /* 第五轮新增 · 浅色版 */
  --badge-overlay-bg: rgba(31,55,98,.08);
  --badge-overlay-text: #475569;
  --history-bg: #f6f9fd;
}

/* 默认主题为 dark —— 若 html 上没设置 data-theme，也按 dark 渲染 */
:root:not([data-theme]){
  --bg-deep:#0a1124;  --bg-page:#0e1730;
  --bg-panel:#152244; --bg-panel-2:#1a2a52;
  --bg-card:#1e2f5f;  --bg-hover:#243a72;
  --bd-soft:#27396b;  --bd:#324b8a;  --bd-strong:#4a67b3;
  --tx-1:#eaf0ff; --tx-2:#b9c5e6; --tx-3:#8294c4; --tx-4:#5b6da0;
  --gov-blue:#2b6cff; --gov-blue-2:#4a8bff; --tech-cyan:#3edaf4;
  --ai-purple:#a974ff;
}

*{margin:0; padding:0; box-sizing:border-box;}
html,body{
  background: var(--body-bg);
  color: var(--text-main);
  font-family:"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
  font-size:13px; line-height:1.55;
  min-width:1366px; min-height:900px; overflow-x:auto;
  transition: background .25s ease, color .25s ease;
}
button{font-family:inherit; cursor:pointer; border:none; outline:none; background:none; color:inherit;}
a{color:inherit; text-decoration:none;}
input,textarea,select{font-family:inherit;}

::-webkit-scrollbar{width:6px; height:6px;}
::-webkit-scrollbar-thumb{background:var(--bd); border-radius:3px;}
::-webkit-scrollbar-thumb:hover{background:var(--bd-strong);}
::-webkit-scrollbar-track{background:transparent;}
