/* 设计系统：逐字取自 电力市场平台_模板/index.html 的 <style> 块，
   保证新前端与模板外观完全一致。下方「新增」区是本项目补充的部分。 */

/* ===== 模板原有 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
    font-family: "Microsoft Yahei", system-ui, sans-serif;
    background-color: #f3f4f6;
    font-size: 14px;
}
/* 侧边栏 */
.sidebar-item {
    cursor: pointer;
    padding: 10px 20px;
    color: #4b5563;
    transition: all 0.15s;
    border-right: 3px solid transparent;
}
.sidebar-item:hover { background-color: #f3f4f6; }
.sidebar-item.active {
    background-color: #fff7e6;
    color: #f59e0b;
    border-right-color: #f59e0b;
}
.menu-title {
    padding: 8px 12px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 8px;
}
.submenu-item {
    cursor: pointer;
    padding: 8px 20px;
    color: #4b5563;
    transition: all 0.15s;
    border-right: 3px solid transparent;
}
.submenu-item:hover { background-color: #f3f4f6; }
/* 选中统一琥珀色，与 sidebar-item.active 一致（原来这里是蓝底白字） */
.submenu-item.active {
    background-color: #fff7e6;
    color: #f59e0b;
    border-right-color: #f59e0b;
}
.menu-group { border-top: 1px solid #e5e7eb; padding: 8px 0; }
/* 首组（市场数据）不加分隔线，与模板的 .py-2 首组一致 */
#sidebar .menu-group.first { border-top: none; }

/* 顶部标签栏 */
.tab-bar {
    display: flex;
    background: #e5e7eb;
    border-bottom: 1px solid #d1d5db;
    overflow-x: auto;
}
.tab-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    cursor: pointer;
    border-top: 2px solid transparent;
    white-space: nowrap;
    font-size: 14px;
}
.tab-item:hover { background: #dcdfe4; }
.tab-item.active {
    background: #fff;
    border-top-color: #3b82f6;
    color: #1e40af;
}
.tab-close {
    font-size: 16px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
}
.tab-close:hover { color: #ef4444; }

/* 通用 */
.tab-panel { display: none; }
.tab-panel.show { display: block; }
.stat-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.chart-card {
    background: #fff;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }

/* 地理/拓扑页面通用 */
.geo-page {
    height: calc(100vh - 130px);
    display: flex;
    flex-direction: column;
}
.geo-top-bar {
    background: #1e293b;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border-radius: 6px 6px 0 0;
}
.geo-row {
    flex: 1;
    display: grid;
    gap: 12px;
}
.geo-left {
    position: relative;
    background: #fff;
    border-radius: 0 0 6px 6px;
    overflow: hidden;
}
.geo-right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    overflow-y: auto;
}
.zoom-btn {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    flex-direction: column;
    z-index: 10;
}
.zoom-btn button {
    width: 28px;
    height: 28px;
    border: 1px solid #aaa;
    background: #fff;
    cursor: pointer;
}
.topo-legend {
    border: 1px solid #ddd;
    background: #f8fafc;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 13px;
}
.highlight-tag {
    display: inline-block;
    background: #fef3c7;
    color: #b45309;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 6px;
}

/* ===== 新增：本项目补充 ===== */

/* 登录页 */
.login-wrap {
    position: fixed; inset: 0;
    display: flex; align-items: center; justify-content: center;
    /* 登录页是大面积色块 —— 原来 #1e3a8a→#2563eb 是一片高饱和蓝，太冲。
       换成同色系的深调和：深靛 → 蓝 → 青，饱和度降下来，和图表配色同族。 */
    background: linear-gradient(150deg, #1B3A5C 0%, #2A6AA8 58%, #3E8E7E 100%);
    z-index: 9999;
}
.login-box {
    background: #fff; border-radius: 12px; padding: 36px 40px;
    width: 360px; box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-box h1 { font-size: 20px; font-weight: 700; color: #1f2937; margin-bottom: 4px; }
.login-box p.sub { font-size: 13px; color: #6b7280; margin-bottom: 22px; }
.login-box label { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.login-box input {
    width: 100%; padding: 9px 12px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 14px; margin-bottom: 16px; font-family: inherit;
}
.login-box input:focus { outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.login-box button {
    width: 100%; padding: 10px; background: #2563eb; color: #fff; border: none;
    border-radius: 6px; font-size: 15px; cursor: pointer; font-family: inherit;
}
.login-box button:hover { background: #1d4ed8; }
.login-box button:disabled { background: #93c5fd; cursor: not-allowed; }
.login-err { color: #dc2626; font-size: 13px; margin-bottom: 12px; min-height: 18px; }

/* 筛选条 */
.filter-bar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    background: #fff; border-radius: 10px; padding: 10px 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); margin-bottom: 16px;
}
.filter-bar label { font-size: 13px; color: #6b7280; }
.filter-bar select, .filter-bar input[type=date] {
    padding: 5px 10px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 13px; font-family: inherit; color: #1f2937; background: #fff;
}
.filter-bar select:focus, .filter-bar input:focus { outline: none; border-color: #2563eb; }

/* 分段选择器（日/周、24h/96点） */
.seg { display: inline-flex; border: 1px solid #d1d5db; border-radius: 6px; overflow: hidden; }
.seg button {
    padding: 5px 14px; background: #fff; border: none; cursor: pointer;
    font-size: 13px; color: #4b5563; font-family: inherit;
}
.seg button + button { border-left: 1px solid #d1d5db; }
.seg button.on { background: #2563eb; color: #fff; }

/* 明细表：紧凑 + 语义着色 + 合计行 */
.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
.dt thead th {
    background: #f3f4f6; color: #374151; font-weight: 600;
    padding: 7px 10px; border: 1px solid #e5e7eb; white-space: nowrap;
    position: sticky; top: 0; z-index: 1;
}
.dt tbody td { padding: 5px 10px; border: 1px solid #e5e7eb; }
.dt tbody tr:nth-child(even) { background: #fafafa; }
.dt tbody tr:hover { background: #eff6ff; }
.dt td.num { text-align: right; font-variant-numeric: tabular-nums; }
.dt tr.total td { font-weight: 700; background: #f3f4f6; color: #111827; }
.dt .pos { color: #b0606a; }
.dt .neg { color: #4f9d8a; }
.table-scroll { max-height: 420px; overflow: auto; }

/* 「公式」页的表单控件 */
.f-in {
    padding: 4px 6px; border: 1px solid #d1d5db; border-radius: 5px;
    font-size: 13px; background: #fff; color: #111827; box-sizing: border-box;
}
.f-in:focus { outline: none; border-color: #2563eb; }
.f-items tbody td { padding: 4px 8px; vertical-align: middle; }
.f-del {
    border: 1px solid #e5e7eb; background: #fff; color: #9ca3af;
    border-radius: 5px; width: 26px; height: 26px; cursor: pointer; font-size: 15px; line-height: 1;
}
.f-del:hover { color: #b0606a; border-color: #b0606a; }
[data-theme="dark"] .f-in { background: #111827; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .f-del { background: #111827; border-color: #334155; }

/* 图表占位（无数据时） */
.chart-empty {
    height: 100%; display: flex; align-items: center; justify-content: center;
    color: #94a3b8; font-size: 14px;
}

/* 待建设面板 */
.todo-panel {
    background: #fff; border-radius: 10px; padding: 60px 20px; text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); color: #6b7280;
}
.todo-panel h3 { font-size: 17px; color: #374151; margin-bottom: 6px; }
.todo-panel p { font-size: 13px; color: #9ca3af; }

/* 加载中 / 顶栏 */
.loading { padding: 40px; text-align: center; color: #9ca3af; font-size: 14px; }
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 16px; background: #fff; border-bottom: 1px solid #e5e7eb;
}
.topbar .who { font-size: 13px; color: #6b7280; }
.topbar .who b { color: #374151; }
.topbar button.logout {
    font-size: 13px; color: #6b7280; background: none; border: 1px solid #d1d5db;
    border-radius: 6px; padding: 4px 12px; cursor: pointer; font-family: inherit;
}
.topbar button.logout:hover { color: #dc2626; border-color: #fca5a5; }

/* ===== 更新状态（顶部横幅 + 状态页） ===== */
.update-alert {
    padding: 7px 16px; font-size: 13px; cursor: pointer;
    background: #fef2f2; color: #b91c1c; border-bottom: 1px solid #fecaca;
}
.update-alert.warn { background: #fffbeb; color: #92400e; border-bottom-color: #fde68a; }
.update-alert:hover { filter: brightness(0.98); }
[data-theme="dark"] .update-alert { background: #3f1d1d; color: #fca5a5; border-bottom-color: #7f1d1d; }
[data-theme="dark"] .update-alert.warn { background: #3a2e14; color: #fcd34d; border-bottom-color: #78350f; }

.us-toolbar { display: flex; align-items: center; justify-content: space-between;
    gap: 12px; margin-bottom: 10px; }
.us-sum { font-size: 13px; }
.us-ok { color: #15803d; }
.us-bad { color: #b91c1c; }
.us-warn { color: #b45309; }
.us-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px; margin-bottom: 16px; }
.us-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 12px 14px; }
.us-card h3 { font-size: 14px; color: #374151; margin-bottom: 8px;
    display: flex; align-items: center; gap: 8px; }
.us-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; font-weight: 600; }
.us-badge.ok { background: #dcfce7; color: #15803d; }
.us-badge.fail { background: #fee2e2; color: #b91c1c; }
.us-badge.skip { background: #f3f4f6; color: #6b7280; }
.us-kv { font-size: 12px; color: #4b5563; line-height: 1.9; }
.us-kv b { color: #111827; font-weight: 600; }
.us-steps { margin-top: 8px; font-size: 12px; color: #b91c1c; }
.us-steps li { margin-left: 16px; }
.us-stale { color: #b45309; font-weight: 600; }
[data-theme="dark"] .us-card { background: #111827; border-color: #1f2937; }
[data-theme="dark"] .us-card h3, [data-theme="dark"] .us-kv b { color: #e5e7eb; }
[data-theme="dark"] .us-kv { color: #9ca3af; }

/* ===== 矩阵热力表 ===== */
.mx-toolbar { display: flex; justify-content: flex-end; margin-bottom: 8px; }
.mx-toolbar .mx-dl {
    font-size: 13px; color: #374151; background: #fff; border: 1px solid #d1d5db;
    border-radius: 6px; padding: 4px 14px; cursor: pointer; font-family: inherit;
}
.mx-toolbar .mx-dl:hover { color: #2563eb; border-color: #93c5fd; }

/* 下钻图标题栏：左边标题、右边日期与曲线勾选 */
.drill-head {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 8px;
}
.drill-head h4 { margin: 0; font-size: 14px; font-weight: 600; color: #374151; }
.drill-head select {
    padding: 3px 8px; border: 1px solid #d1d5db; border-radius: 6px;
    font-size: 12px; font-family: inherit; color: #1f2937; background: #fff;
}
.drill-chks { display: flex; gap: 10px; flex-wrap: wrap; font-size: 12px; color: #4b5563; }
.drill-chks label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.drill-chks input { margin: 0; }
/* 「多日 · 选择日期」的勾选列表：日期多时可滚动 */
.drill-picks {
    display: flex; flex-wrap: wrap; gap: 10px; font-size: 12px; color: #4b5563;
    max-height: 58px; overflow-y: auto;
}
.drill-picks label { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.drill-picks input { margin: 0; }
/* 多块横向对比：不换行，放不下就整条横向滚动（用户要求）。
   不同 block.group 各占一行，避免行数不等时横向错位。 */
.mx-group {
    display: flex; gap: 12px; align-items: flex-start;
    flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px;
}
.mx-group + .mx-group { margin-top: 12px; }
.mx-block {
    background: #fff; border-radius: 10px; padding: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08); flex: 0 1 auto; max-width: 100%;
}
.mx-title { font-size: 13px; font-weight: 600; color: #374151; margin-bottom: 8px; text-align: center; }
.mx-unit { font-weight: 400; color: #9ca3af; font-size: 12px; }
.mx-scroll { overflow-x: auto; }
table.mx { border-collapse: collapse; font-size: 11px; }
table.mx th, table.mx td {
    border: 1px solid #e5e7eb; padding: 2px 5px; text-align: center; white-space: nowrap;
}
table.mx thead th { background: #f3f4f6; color: #374151; font-weight: 600; }
/* 附加表头行（如电价块的「日前申报电价」）：视觉上像一条汇总带，放在日期行上方 */
table.mx tr.mx-headrow th { background: #eef2f7; }
table.mx tr.mx-headrow td { font-weight: 700; }
/* 同排其它块补的等高空行：隐形，只为对齐 */
table.mx tr.mx-headpad th, table.mx tr.mx-headpad td {
    background: #fff; border-color: transparent;
}
table.mx tr.mx-wd th { font-size: 10px; color: #6b7280; font-weight: 400; padding: 1px 5px; }
/* ── 「块名进表头」那一版抬头（.mx-nih，只出清电量用）──
   名字横跨一行、**居中**；右侧「日前/实时」做成浅色小标签，醒目但轻。 */
table.mx tr.mx-namrow td.mx-namcell {
    background: #f3f4f6; color: #374151; font-weight: 600;
    text-align: center; padding: 2px 6px;
}
table.mx .mx-nmrt {
    float: right; font-weight: 400; font-size: 11px;
    background: #fff7e6; color: #b45309; border-radius: 3px; padding: 0 6px;
}
table.mx .mx-namrow td.mx-namcell .mx-unit { font-weight: 400; }
/* 抬头里的星期/日期：居中 + 加粗（原来太淡） */
.mx-block.mx-nih table.mx tr.mx-wd th { font-weight: 700; color: #1f2937; font-size: 11px; }
[data-theme="dark"] table.mx .mx-nmrt { background: #3b2f1a; color: #f0b95b; }
[data-theme="dark"] .mx-block.mx-nih table.mx tr.mx-wd th { color: #e5e7eb; }
/* 角上那格跨两行，写行维度名（时段/指标/城市），样式并入表头 */
table.mx .mx-corner { background: #f3f4f6; color: #374151; font-weight: 600; }
table.mx .mx-rowlab {
    background: #f9fafb; color: #4b5563; font-weight: 400;
    text-align: center; padding: 2px 6px; font-variant-numeric: tabular-nums;
}
table.mx td { font-variant-numeric: tabular-nums; color: #1f2937; }
/* 空值：浅灰底 + 破折号，且不参与色阶（后端已区分 null 与真实 0） */
table.mx td.mx-null { background: #fafafa !important; color: #d1d5db; }
/* 该列被关掉色阶：只留数值，不上底色 */
table.mx td.mx-muted { background: #fff !important; }
/* Excel 式「数据条」：单元格里一条按数值长短的蓝条，数字叠在上层 */
table.mx td.mx-bar { position: relative; background: #fff; padding: 2px 6px; text-align: right; }
table.mx td.mx-bar .mx-barfill {
  position: absolute; left: 0; top: 1px; bottom: 1px; background: #9CC3E8;
  border-radius: 2px; z-index: 0; pointer-events: none;
}
table.mx td.mx-bar .mx-barval { position: relative; z-index: 1; }
/* 负值（外购）：条从右边长，红色；正负方向一眼可分 */
table.mx td.mx-bar .mx-barfill.neg { left: auto; right: 0; background: #E8A0A0; }
table.mx td.mx-bar.mx-bar-neg .mx-barval { color: #b91c1c; }
[data-theme="dark"] table.mx td.mx-bar { background: #0f172a; }
[data-theme="dark"] table.mx td.mx-bar .mx-barfill { background: #2f5c8a; }
[data-theme="dark"] table.mx td.mx-bar .mx-barfill.neg { background: #8a3a3a; }
[data-theme="dark"] table.mx td.mx-bar.mx-bar-neg .mx-barval { color: #fca5a5; }
/* 省间交易：日前出清电量/电价 上下或左右并列 */
.pv-clear-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.pv-clear-grid.side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
@media (max-width: 1280px) { .pv-clear-grid.side { grid-template-columns: 1fr; } }
/* 二值状态格（机组运行/停机）：不写字，靠颜色，hover 看具体值 */
table.mx td.mx-bin { padding: 0; height: 14px; min-width: 9px; }
/* 分类格（分时时段 谷/平/峰/尖峰）：色底 + 白字。四档颜色本身够深，白字对比足 */
/* 分类格（分时时段 谷/平/峰/尖峰）：底面与字色都由 block.cat 的 {bg, ink} 内联给，
   这里只兜底 —— 淡底配深字、浓底配白字，不再一律白字（浅底上白字会糊） */
table.mx td.mx-cat { font-weight: 600; color: #3b3b3b; padding: 2px 4px; }

/* ---------- 分时电价页的规则卡 ---------- */
.tou-rule-line { font-size: 12.5px; color: #374151; padding: 5px 0; border-bottom: 1px dashed #e5e7eb; }
.tou-rule-line b { color: #111827; }
.tou-rule-note { font-size: 12px; color: #6b7280; margin-top: 8px; line-height: 1.6; }
.tou-policy { margin-top: 8px; font-size: 12px; }
.tou-policy summary { cursor: pointer; color: #2563eb; }
.tou-policy pre {
    white-space: pre-wrap; word-break: break-all; margin: 6px 0 0;
    background: #f9fafb; border: 1px solid #eef2f7; border-radius: 6px;
    padding: 8px; font-size: 11.5px; color: #4b5563; line-height: 1.7;
    font-family: 'Microsoft YaHei', sans-serif; max-height: 220px; overflow: auto;
}
[data-theme="dark"] .tou-rule-line { color: #cbd5e1; border-bottom-color: #1f2937; }
[data-theme="dark"] .tou-rule-line b { color: #f1f5f9; }
[data-theme="dark"] .tou-policy pre { background: #111827; border-color: #1f2937; color: #94a3b8; }

/* ---------- 交易日历页 ---------- */
.cal-mbtns { display: inline-flex; gap: 6px; }
.cal-mbtn {
    border: 1px solid #e5e7eb; background: #fff; color: #4b5563;
    border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer;
}
.cal-mbtn:hover { border-color: #93c5fd; color: #1d4ed8; }
.cal-mbtn.active { background: #2563eb; border-color: #2563eb; color: #fff; }

/* 时段甘特条：轴固定 09:00-17:00 */
.cal-gantt { position: relative; padding-bottom: 18px; }
.cal-grow { display: flex; align-items: center; margin-bottom: 6px; }
.cal-glab { width: 190px; flex: none; font-size: 12px; color: #374151; }
.cal-glab b { color: #111827; margin-left: 6px; font-variant-numeric: tabular-nums; }
.cal-gtrack { position: relative; flex: 1; height: 30px; background: #f6f8fa; border-radius: 4px; }
.cal-gbar, .cal-gseg {
    position: absolute; top: 0; height: 30px; border-radius: 4px;
    color: #fff; overflow: hidden; white-space: nowrap; padding: 0 8px;
    line-height: 30px; box-sizing: border-box; text-overflow: ellipsis;
}
.cal-gbar { background: #2f6fb0; font-size: 11px; }
.cal-gseg { background: #6b9ed0; font-size: 10px; border: 1px solid #fff; }
.cal-gcap { margin: 2px 0 6px 190px; font-size: 10.5px; color: #6b7280; line-height: 1.4; }
.cal-axis {
    display: flex; justify-content: space-between; margin-left: 190px;
    font-size: 10px; color: #9ca3af; border-top: 1px solid #eef2f7; padding-top: 2px;
}
.cal-rule { margin-top: 10px; font-size: 12px; color: #6b7280; }

/* 月历 */
table.cal { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.cal th {
    font-size: 11px; color: #6b7280; font-weight: 600; padding: 4px 6px;
    background: #f3f4f6; border: 1px solid #e5e7eb;
}
table.cal td.cal-cell {
    border: 1px solid #e5e7eb; vertical-align: top; padding: 4px 6px;
    height: 132px;
}
td.cal-empty { background: #fafafa; }
td.cal-weekend { background: #f7f9fb; }
td.cal-hol { background: #fff7f7; }
.cal-day { font-size: 13px; font-weight: 700; color: #111827; text-align: right; margin-bottom: 2px; }
td.cal-weekend .cal-day { color: #9ca3af; }
/* 日号上的标注：今天 / 月度交易都是**实心圆**、靠颜色区分（月度交易每月 1 天） */
.cal-dn { display: inline-block; box-sizing: border-box; min-width: 20px; height: 20px; line-height: 20px; text-align: center; border-radius: 50%; }
.cal-dn.cal-today { background: #f59e0b; color: #fff; }        /* 今天=琥珀实心 */
.cal-dn.cal-monthly { background: #2563eb; color: #fff; }      /* 月度交易=蓝实心 */
.cal-dn.cal-today.cal-monthly { background: #f59e0b; box-shadow: 0 0 0 2px #2563eb; }  /* 撞同一天：琥珀+蓝环 */
/* 交易日历·待办事项（按用户各存各的；与原计划分开，可勾选/删除） */
.cal-todos { margin-top: 4px; border-top: 1px dashed #e5e7eb; padding-top: 3px; }
.cal-todo { display: flex; align-items: center; gap: 3px; font-size: 11px; line-height: 1.35; color: #1f2937; }
.cal-todo-ck { cursor: pointer; flex: 0 0 auto; }
.cal-todo-tx { flex: 1 1 auto; word-break: break-all; }
.cal-todo.done .cal-todo-tx { text-decoration: line-through; color: #9ca3af; }
.cal-todo-del { cursor: pointer; color: #b0606a; flex: 0 0 auto; padding: 0 2px; opacity: .6; }
.cal-todo-del:hover { opacity: 1; }
.cal-todo-add { margin-top: 2px; font-size: 11px; color: #2563eb; background: none; border: 1px dashed #93c5fd; border-radius: 4px; padding: 0 4px; cursor: pointer; }
.cal-todo-add:hover { background: #eff6ff; }
.cal-todo-badge { display: inline-block; min-width: 15px; height: 15px; line-height: 15px; text-align: center; border-radius: 8px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; margin-right: 3px; vertical-align: middle; }
td.cal-today-cell { box-shadow: inset 0 0 0 2px #f59e0b; }
[data-theme="dark"] .cal-todos { border-color: #334155; }
[data-theme="dark"] .cal-todo { color: #cbd5e1; }
[data-theme="dark"] .cal-todo.done .cal-todo-tx { color: #64748b; }
[data-theme="dark"] .cal-todo-add { border-color: #1e3a8a; }
.cal-item { font-size: 11px; color: #374151; line-height: 1.4; margin-bottom: 2px; }
.cal-item-hol { color: #c0392b; font-weight: 600; }
[data-theme="dark"] .cal-mbtn { background: #111827; border-color: #334155; color: #cbd5e1; }
[data-theme="dark"] .cal-mbtn.active { background: #2563eb; border-color: #2563eb; color: #fff; }
[data-theme="dark"] .cal-glab { color: #cbd5e1; }
[data-theme="dark"] .cal-glab b { color: #f1f5f9; }
[data-theme="dark"] .cal-gtrack { background: #111827; }
[data-theme="dark"] table.cal th { background: #1f2937; color: #cbd5e1; border-color: #1f2937; }
[data-theme="dark"] table.cal td.cal-cell { border-color: #1f2937; }
[data-theme="dark"] td.cal-empty { background: #0b1220; }
[data-theme="dark"] td.cal-weekend { background: #0e1626; }
[data-theme="dark"] td.cal-hol { background: #1f1416; }
[data-theme="dark"] .cal-day { color: #e2e8f0; }
[data-theme="dark"] .cal-item { color: #cbd5e1; }

/* ---------- 政策知识库页 ---------- */
.pol-q {
    width: 420px; border: 1px solid #e5e7eb; border-radius: 6px;
    padding: 5px 10px; font-size: 13px; outline: none;
}
.pol-q:focus { border-color: #93c5fd; box-shadow: 0 0 0 2px rgba(147,197,253,.25); }
.pol-wrap { display: flex; gap: 12px; align-items: flex-start; }
.pol-side {
    width: 190px; flex: none; border: 1px solid #eef2f7; border-radius: 8px;
    background: #fff; padding: 6px 0; max-height: 74vh; overflow: auto;
}
.pol-sideh { font-size: 11px; color: #9ca3af; padding: 2px 10px 6px; }
.pol-cat {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 12px; color: #4b5563; padding: 4px 10px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pol-cat:hover { background: #f3f6fa; }
.pol-cat.active { background: #e8f1f8; color: #1d4ed8; font-weight: 600; }
.pol-cat b { color: #9ca3af; font-weight: 400; margin-left: 6px; }
.pol-list {
    width: 330px; flex: none; border: 1px solid #eef2f7; border-radius: 8px;
    background: #fff; max-height: 74vh; overflow: auto;
}
.pol-item { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; cursor: pointer; }
.pol-item:hover { background: #f8fafc; }
.pol-item.active { background: #e8f1f8; }
.pol-t { font-size: 13px; color: #111827; font-weight: 600; line-height: 1.4; }
.pol-m { font-size: 11px; color: #9ca3af; margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.pol-ext {
    background: #eef2f7; color: #4b5563; border-radius: 3px;
    padding: 0 4px; font-size: 10px; font-weight: 600;
}
.pol-bad { color: #c0392b; }
.pol-hit { color: #2563eb; }
.pol-snip { font-size: 11px; color: #6b7280; margin-top: 4px; line-height: 1.45; }
.pol-path { font-size: 10.5px; color: #cbd5e1; margin-top: 3px; word-break: break-all; }
.pol-empty { padding: 20px; text-align: center; color: #9ca3af; font-size: 12px; }
.pol-doc {
    flex: 1; min-width: 0; border: 1px solid #eef2f7; border-radius: 8px;
    background: #fff; padding: 14px 18px; max-height: 74vh; overflow: auto;
}
.pol-dt { font-size: 15px; font-weight: 700; color: #111827; line-height: 1.45; }
.pol-dm { font-size: 11.5px; color: #6b7280; margin-top: 4px; }
.pol-dp { font-size: 11px; color: #9ca3af; margin-top: 2px; word-break: break-all; }
.pol-dl {
    display: inline-block; font-size: 11.5px; color: #fff; background: #2f6fb0;
    border-radius: 4px; padding: 1px 9px; text-decoration: none;
}
.pol-dl:hover { background: #2563eb; }
.pol-dl2 { background: #6b7280; }
.pol-dl2:hover { background: #4b5563; }
.pol-nodl { font-size: 11px; color: #9ca3af; }
.pol-note {
    margin-top: 14px; font-size: 12.5px; color: #92400e; background: #fffbeb;
    border: 1px solid #fde68a; border-radius: 6px; padding: 10px 12px; line-height: 1.7;
}
.pol-pre {
    white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.85;
    color: #374151; margin-top: 12px;
    font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif;
}
.pol-pre mark, .pol-snip mark { background: #fde68a; color: #78350f; padding: 0 1px; }
[data-theme="dark"] .pol-q { background: #111827; border-color: #334155; color: #e2e8f0; }
[data-theme="dark"] .pol-side, [data-theme="dark"] .pol-list, [data-theme="dark"] .pol-doc {
    background: #0e1626; border-color: #1f2937;
}
[data-theme="dark"] .pol-cat { color: #cbd5e1; }
[data-theme="dark"] .pol-cat:hover { background: #16202f; }
[data-theme="dark"] .pol-cat.active { background: #1e3a5f; color: #93c5fd; }
[data-theme="dark"] .pol-item { border-bottom-color: #1f2937; }
[data-theme="dark"] .pol-item:hover { background: #16202f; }
[data-theme="dark"] .pol-item.active { background: #1e3a5f; }
[data-theme="dark"] .pol-t { color: #e2e8f0; }
[data-theme="dark"] .pol-dt { color: #f1f5f9; }
[data-theme="dark"] .pol-pre { color: #cbd5e1; }
[data-theme="dark"] .pol-ext { background: #1f2937; color: #cbd5e1; }
[data-theme="dark"] .pol-note { background: #2a2110; border-color: #57440f; color: #fcd34d; }
[data-theme="dark"] .pol-path { color: #475569; }
table.mx tfoot th { background: #f3f4f6; font-weight: 700; color: #111827; text-align: center; }
table.mx tfoot td { background: #f3f4f6; font-weight: 700; color: #111827; }
.mx-colhead.mx-clickable { cursor: pointer; }
.mx-colhead.mx-clickable:hover { background: #dbeafe; color: #1d4ed8; }

/* ---------- 月度报告页 ---------- */
.r-item { display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 8px 10px; border: 1px solid #e5e7eb; border-radius: 6px; margin-bottom: 6px;
  cursor: pointer; background: #fff; }
.r-item:hover { border-color: #93c5fd; }
.r-name { font-size: 12px; color: #1f2937; word-break: break-all; }
.r-dl { font-size: 12px; color: #2563eb; text-decoration: none; flex-shrink: 0; }
.r-dl:hover { text-decoration: underline; }

/* ---------- 信息披露 目录树/列表 ---------- */
.d-cat { font-size: 13px; font-weight: 600; color: #374151; padding: 7px 8px;
  border-radius: 5px; cursor: pointer; margin-top: 4px; }
.d-cat:hover { background: #f3f4f6; }
.d-cat.on { background: #eff6ff; color: #1d4ed8; }
.d-item { font-size: 12px; color: #4b5563; padding: 5px 8px 5px 20px; border-radius: 5px;
  cursor: pointer; line-height: 1.35; }
.d-item:hover { background: #f3f4f6; }
.d-item.on { background: #dbeafe; color: #1d4ed8; font-weight: 600; }
.d-row { cursor: pointer; }
.d-row:hover td { background: #eff6ff !important; }
.d-pg { border: 1px solid #e5e7eb; background: #fff; border-radius: 4px;
  padding: 2px 8px; font-size: 12px; color: #6b7280; cursor: pointer; }
.d-pg:hover { border-color: #93c5fd; }
.d-pg.on { background: #2563eb; border-color: #2563eb; color: #fff; }

/* ===== 浅色/深色主题 =====
   浅色就是上面原有那套（一个字没动）；深色是下面这一整块覆盖。
   需要换的只是「中性色」——各种图表的蓝/绿/琥珀/紫是数据色，两种主题都用同一套。 */
:root {
    --card: #ffffff; --line: #e5e7eb; --soft: #f8fafc; --page: #f3f4f6;
    --faint: #9ca3af; --dim: #6b7280; --ink: #374151; --tint: #e8f1f8;
}
[data-theme="dark"] {
    --card: #111827; --line: #1f2937; --soft: #0b1220; --page: #0f172a;
    --faint: #64748b; --dim: #94a3b8; --ink: #cbd5e1;
    color-scheme: dark;
}
[data-theme="dark"] body { background-color: #0f172a; color: #e2e8f0; }
[data-theme="dark"] aside { background: #111827 !important; border-color: #1f2937 !important; }
[data-theme="dark"] .menu-group { border-top-color: #1f2937; }
[data-theme="dark"] .menu-title { color: #cbd5e1; }
[data-theme="dark"] .sidebar-item { color: #94a3b8; }
[data-theme="dark"] .sidebar-item:hover { background-color: #1f2937; }
[data-theme="dark"] .sidebar-item.active { background-color: #3a2f12; color: #fbbf24; border-right-color: #fbbf24; }
[data-theme="dark"] .submenu-item { color: #94a3b8; }
[data-theme="dark"] .submenu-item:hover { background-color: #1f2937; }
[data-theme="dark"] .submenu-item.active { background-color: #17293f; color: #93c5fd; }
[data-theme="dark"] .topbar { background: #111827 !important; border-color: #1f2937 !important; color: #cbd5e1; }
[data-theme="dark"] .tab-bar { background: #111827; border-bottom-color: #1f2937; }
[data-theme="dark"] .tab-item { background: #1f2937; color: #cbd5e1; }
[data-theme="dark"] .tab-item.active { background: #0f172a; color: #93c5fd; }
[data-theme="dark"] .tab-item:hover { background: #334155; }
[data-theme="dark"] .stat-card, [data-theme="dark"] .chart-card {
    background: #111827; border-color: #1f2937; }
[data-theme="dark"] .filter-bar { background: #111827; border-color: #1f2937; }
[data-theme="dark"] .filter-bar label { color: #94a3b8; }
[data-theme="dark"] .filter-bar select, [data-theme="dark"] .filter-bar input[type=date] {
    background: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .seg { border-color: #334155; }
[data-theme="dark"] .seg button { background: #111827; color: #cbd5e1; }
[data-theme="dark"] .seg button + button { border-left-color: #334155; }
[data-theme="dark"] .seg button.on { background: #2563eb; color: #fff; }
[data-theme="dark"] .dt thead th { background: #1f2937; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .dt tbody td { border-color: #1f2937; color: #e2e8f0; }
[data-theme="dark"] .dt tbody tr:nth-child(even) { background: #0b1220; }
[data-theme="dark"] .dt tbody tr:hover { background: #1e293b; }
[data-theme="dark"] .dt tr.total td { background: #1f2937; color: #f1f5f9; }
[data-theme="dark"] .mx-title { color: #cbd5e1; }
[data-theme="dark"] table.mx th, [data-theme="dark"] table.mx td { border-color: #1f2937; }
[data-theme="dark"] table.mx thead th { background: #1f2937; color: #cbd5e1; }
[data-theme="dark"] table.mx .mx-corner { background: #1f2937; color: #cbd5e1; }
[data-theme="dark"] table.mx .mx-rowlab { background: #111827; color: #cbd5e1; }
[data-theme="dark"] table.mx td.mx-null { background: #0b1220 !important; color: #475569; }
[data-theme="dark"] table.mx td.mx-muted { background: #111827 !important; color: #cbd5e1; }
[data-theme="dark"] table.mx tfoot th, [data-theme="dark"] table.mx tfoot td { background: #1f2937; color: #e2e8f0; }
[data-theme="dark"] .mx-toolbar .mx-dl { background: #111827; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .chart-empty, [data-theme="dark"] .loading { color: #64748b; }
[data-theme="dark"] .drill-head h4, [data-theme="dark"] .chart-card h4 { color: #e2e8f0; }
[data-theme="dark"] .logout { background: #1f2937; color: #cbd5e1; border-color: #334155; }
[data-theme="dark"] .login-box { background: #111827; }
[data-theme="dark"] .login-box h1 { color: #e2e8f0; }
[data-theme="dark"] .login-box input { background: #0f172a; color: #e2e8f0; border-color: #334155; }
[data-theme="dark"] .d-cat { color: #cbd5e1; }
[data-theme="dark"] .d-cat:hover, [data-theme="dark"] .d-item:hover { background: #1f2937; }
[data-theme="dark"] .d-item { color: #94a3b8; }
[data-theme="dark"] .r-item { background: #111827; border-color: #1f2937; }
[data-theme="dark"] .r-name { color: #e2e8f0; }
/* Tailwind 工具类（页面 HTML 里用了不少 bg-white / text-gray-* ） */
[data-theme="dark"] .bg-white { background-color: #111827 !important; }
[data-theme="dark"] .bg-gray-100 { background-color: #1f2937 !important; }
[data-theme="dark"] .text-gray-800, [data-theme="dark"] .text-gray-700 { color: #e2e8f0 !important; }
[data-theme="dark"] .text-gray-600, [data-theme="dark"] .text-gray-500 { color: #94a3b8 !important; }
[data-theme="dark"] .text-gray-400 { color: #64748b !important; }
[data-theme="dark"] .border-gray-200, [data-theme="dark"] .border-gray-300 { border-color: #1f2937 !important; }
[data-theme="dark"] { --tint: #1e3a5f; }
