/* ==========================================================================
   app.css —— 衡阳市入河排污口"一口一策"整治管理系统
   风格：政务办公 · 克制 · 信息密度优先 · 浅色主题
   ======================================================================== */

:root {
  /* ★ 2026-10-05：底色/线条/文字取值**对齐「饮用水水源巡查系统」**（用户要求三套系统底色一致）。
     巡查的调色板：--bg:#eef3f8  --card:#ffffff  --ink:#16283a  --sub:#5e7185  --line:#dfe8f0  --soft:#f2f7fa
     本系统本来就是浅色系，此处只是把这几档数值对齐（原值见行尾注释），视觉变化很小。
     注：--brand 仍保留本系统的蓝色 #0f5c8c（巡查为青绿 #0d7377）—— 那是品牌色不是底色，
         如需连品牌色也统一，改这一行即可。 */
  --ink:        #16283a;   /* 原 #16202b，= 巡查 --ink */
  --ink-2:      #5e7185;   /* 原 #46586b，= 巡查 --sub */
  --ink-3:      #7c8b9a;
  --line:       #dfe8f0;   /* 原 #dde4ea，= 巡查 --line */
  --line-2:     #c7d1da;
  --bg:         #eef3f8;   /* 原 #f2f5f7，= 巡查 --bg */
  --bg-2:       #ffffff;   /*           = 巡查 --card */
  --bg-3:       #f2f7fa;   /* 原 #f8fafb，= 巡查 --soft */
  --brand:      #0f5c8c;
  --brand-2:    #0a7bb5;
  --brand-soft: #e6f1f8;
  --ok:         #1a7f4b;
  --no:         #b3261e;
  --warn:       #b26a00;
  --radius:     8px;
  --radius-lg:  12px;
  --shadow:     0 2px 10px rgba(22, 32, 43, .07);
  --shadow-sm:  0 1px 3px rgba(22, 32, 43, .06);   /* 面板/卡片统一浅阴影（对齐资金管理系统） */
  --panel-line: #d8e0e8;                            /* 面板描边（对齐资金管理系统制式） */
  --sans: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", sans-serif;
  --mono: Consolas, "Courier New", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: var(--sans);
  font-size: 14px; line-height: 1.6; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 500; }
a { color: var(--brand-2); }
.muted { color: var(--ink-3); font-size: 13px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.ok { color: var(--ok); } .no { color: var(--no); }
code.mono { background: var(--bg-3); padding: 1px 5px; border-radius: 4px; border: 1px solid var(--line); }

/* ============================ 登录页 ============================ */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px;
  background:
    radial-gradient(1100px 520px at 12% -8%, #dceaf4 0%, transparent 60%),
    radial-gradient(900px 480px at 100% 108%, #e3eee6 0%, transparent 62%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 452px; background: var(--bg-2);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow); padding: 32px 30px 22px;
}
.login-brand { display: flex; gap: 15px; align-items: flex-start; margin-bottom: 26px; }
.brand-mark {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 11px;
  background: var(--brand-soft); color: var(--brand);
  display: flex; align-items: center; justify-content: center;
}
.login-brand h1 { font-size: 19px; line-height: 1.42; letter-spacing: .2px; }
.brand-sub { margin: 7px 0 0; font-size: 12.5px; color: var(--ink-3); }
.login-form { display: flex; flex-direction: column; gap: 15px; }
.login-foot {
  margin-top: 20px; padding-top: 15px; border-top: 1px solid var(--line);
}
.login-foot p { margin: 0; font-size: 12.5px; color: var(--ink-3); line-height: 1.65; }

/* ============================ 表单元素 ============================ */
.fld { display: flex; flex-direction: column; gap: 6px; }
.fld-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; }
.fld-label .req { color: var(--no); font-style: normal; }
.fld input, .fld select, .fld textarea {
  font-family: inherit; font-size: 14px; color: var(--ink);
  padding: 9px 11px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--bg-2); outline: none; transition: border-color .14s, box-shadow .14s;
  width: 100%;
}
.fld textarea { resize: vertical; min-height: 76px; line-height: 1.65; }
.fld input:focus, .fld select:focus, .fld textarea:focus {
  border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(10, 123, 181, .12);
}
.fld input:disabled, .fld select:disabled { background: var(--bg-3); color: var(--ink-3); cursor: not-allowed; }
.fld-hint { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.fld-row { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.form-error {
  font-size: 13px; color: var(--no); background: #fdf0ef;
  border: 1px solid #f3cfcc; border-radius: var(--radius); padding: 8px 11px;
}

/* ============================ 按钮 ============================ */
/* ★ 2026-10-07：按钮制式对齐「资金管理系统」——统一 height:32px / radius:6px / 13px 字。 */
.btn-primary, .btn-ghost, .btn-danger {
  font-family: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  height: 32px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 15px; border-radius: 6px; border: 1px solid transparent;
  transition: background .14s, border-color .14s, color .14s;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--brand-2); }
.btn-ghost { background: var(--bg-2); color: var(--ink-2); border-color: var(--line-2); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand-2); }
.btn-danger { background: var(--no); color: #fff; }
.btn-danger:hover { background: #951d16; }
.btn-sm { height: 26px; padding: 0 11px; font-size: 12.5px; }
.btn-block { width: 100%; height: auto; padding: 11px; font-size: 15px; letter-spacing: 3px; }
button:disabled { opacity: .45; cursor: not-allowed; }
.link {
  background: none; border: none; padding: 2px 5px; cursor: pointer;
  color: var(--brand-2); font-family: inherit; font-size: 13px; border-radius: 4px;
}
.link:hover { text-decoration: underline; }
.link-danger { color: var(--no); }

/* ============================ 顶栏 ============================ */
/* ★ 2026-10-07：顶栏改「资金管理系统」深蓝渐变白字风格
   （品牌色取自资金管理系统 style.css：--c-primary #1a4a7a → --c-primary-dark #123555）。
   原为浅色 var(--bg-2)，与巡查/资金系统顶栏观感不一，用户要求三套系统顶栏统一。
   ★ 仅改顶栏 .topbar 与其内部元素；筛选条 / 页面其余仍保持浅色不变。 */
.topbar {
  display: flex; align-items: center; gap: 18px; height: 54px; padding: 0 18px;
  background: linear-gradient(100deg, #1a4a7a 0%, #123555 100%);
  color: #fff; border-bottom: 1px solid #123555;
  box-shadow: 0 2px 10px rgba(18, 53, 85, .28);
  position: sticky; top: 0; z-index: 60;
}
.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tb-mark {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 50%; overflow: hidden;
  background: #fff; color: var(--brand);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}
.tb-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.tb-title { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.tb-title strong { font-size: 19px; font-weight: 600; white-space: nowrap; letter-spacing: 1px; color: #fff; }
.tb-user { font-size: 12px; color: rgba(255, 255, 255, .8); white-space: nowrap; }
.topbar-nav { display: flex; gap: 2px; margin-left: auto; }
.nav-btn {
  font-family: inherit; font-size: 13px; cursor: pointer; color: rgba(255, 255, 255, .85);
  height: 32px; display: inline-flex; align-items: center;
  background: none; border: none; padding: 0 13px; border-radius: 6px;
  border-bottom: 2px solid transparent;
  transition: background .15s ease, color .15s ease;
}
.nav-btn:hover { background: rgba(255, 255, 255, .16); color: #fff; }
.nav-btn.is-active { color: #fff; border-bottom-color: #fff; font-weight: 600; }
.topbar-right { display: flex; gap: 7px; }
.tb-btn {
  white-space: nowrap;
  font-family: inherit; font-size: 13px; cursor: pointer; color: #fff;
  height: 32px; display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .35);
  padding: 0 12px; border-radius: 6px;
  transition: background .15s ease, border-color .15s ease;
}
.tb-btn:hover { background: rgba(255, 255, 255, .26); border-color: rgba(255, 255, 255, .6); color: #fff; }

/* ============================ 筛选条 ============================ */
.filterbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 11px 18px; background: var(--bg-2); border-bottom: 1px solid var(--line);
  position: sticky; top: 54px; z-index: 55;
}
.ctl {
  font-family: inherit; font-size: 13px; color: var(--ink); padding: 6px 10px;
  border: 1px solid var(--line-2); border-radius: var(--radius); background: var(--bg-2);
  outline: none; max-width: 200px;
}
.ctl:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(10,123,181,.12); }
.ctl-search { min-width: 210px; flex: 1 1 210px; max-width: 380px; }
.ctl-sm { padding: 4px 8px; font-size: 12.5px; max-width: none; }
.filter-count { margin-left: auto; font-size: 13px; color: var(--ink-3); }

/* ============================ 视图容器 ============================ */
.views { position: relative; }
.view { display: none; }
.view.is-active { display: block; }

/* ---- 地图视图 ---- */
#viewMap.is-active { position: relative; }
.map-box { width: 100%; height: calc(100vh - 108px); min-height: 460px; background: #dfe6ea; }
.map-nokey {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(242,245,247,.95); padding: 24px; z-index: 20;
}
.nokey-card {
  max-width: 560px; background: var(--bg-2); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 24px 26px; box-shadow: var(--shadow);
}
.nokey-card h3 { font-size: 16px; margin-bottom: 10px; color: var(--warn); }
.nokey-card p { margin: 0 0 9px; font-size: 13.5px; color: var(--ink-2); line-height: 1.7; }

.legend {
  position: absolute; left: 14px; bottom: 22px; z-index: 30;
  background: rgba(255,255,255,.95); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
  font-size: 12.5px; min-width: 178px;
}
.lg-title { font-weight: 500; font-size: 13px; margin-bottom: 8px; color: var(--ink); }
.lg-row { display: flex; align-items: center; gap: 7px; padding: 2.5px 0; color: var(--ink-2); }
.lg-div { height: 1px; background: var(--line); margin: 9px 0; }
.lg-chk { display: flex; align-items: center; gap: 6px; color: var(--ink-2); cursor: pointer; }
.lg-tip { margin-top: 8px; color: var(--ink-3); font-size: 12px; }
.lg-tip b { color: var(--brand); font-weight: 500; }
.dot { width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.14); flex: 0 0 10px; }
.dot-a { background: #1d7a4c; } .dot-b { background: #b26a00; } .dot-c { background: #b3261e; }

/* ---- 地图控件 ---- */
.map-ctrl {
  position: absolute; right: 14px; top: 14px; z-index: 30;
  display: flex; flex-direction: column; gap: 5px;
}
.mc-btn {
  width: 34px; height: 34px; cursor: pointer;
  background: rgba(255,255,255,.95); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 17px; line-height: 1; font-weight: 500;
  box-shadow: 0 1px 5px rgba(22,32,43,.14);
  display: flex; align-items: center; justify-content: center;
}
.mc-btn:hover { background: #fff; border-color: var(--brand-2); color: var(--brand-2); }
.mc-btn:active { background: var(--brand-soft); }
#btnFitAll, #btnHome { font-size: 14px; }
#btnLocate { font-size: 16px; }
#btnLocate:disabled { opacity: .55; cursor: default; }
#btnLocate.is-locating { color: var(--brand-2); }

/* 底图源切换 */
.map-src {
  position: absolute; right: 14px; bottom: 14px; z-index: 32;
  display: flex; flex-direction: column; align-items: flex-end; gap: 4px;
}
.ms-btn {
  display: flex; align-items: center; gap: 5px; cursor: pointer;
  background: rgba(255,255,255,.94); color: var(--ink-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: inherit; font-size: 11.5px; padding: 4px 9px;
  box-shadow: 0 1px 5px rgba(22,32,43,.12);
}
.ms-btn:hover { border-color: var(--brand-2); color: var(--brand-2); }
.ms-menu {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 4px 16px rgba(22,32,43,.16); padding: 4px; min-width: 186px;
  order: -1;   /* 菜单在按钮上方弹出 */
}
.ms-item {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; text-align: left; cursor: pointer; background: none;
  border: none; border-radius: 5px; padding: 7px 9px;
  font-family: inherit; font-size: 12.5px; color: var(--ink-2);
}
.ms-item:hover { background: var(--bg-3); color: var(--brand-2); }
.ms-item.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 500; }
.ms-name { display: flex; align-items: center; gap: 5px; }
.ms-key {
  font-style: normal; font-size: 10.5px; color: var(--warn);
  background: #fdf3e6; border: 1px solid #f2ddb8; border-radius: 3px; padding: 0 4px;
}
.ms-ok { font-size: 11px; color: var(--ok); }
.ms-empty, .ms-hint {
  font-size: 11.5px; color: var(--ink-3); padding: 6px 9px; line-height: 1.55;
}
.ms-hint { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 7px; }

.map-attr {
  position: absolute; right: 14px; bottom: 48px; z-index: 31;
  font-size: 10.5px; color: #dbe3e9; text-shadow: 0 1px 3px rgba(0,0,0,.75);
  pointer-events: none; max-width: 300px; text-align: right;
}

/* ---- 详情面板 ---- */
.detail {
  position: absolute; right: 0; top: 0; bottom: 0; width: 452px; max-width: 92vw; z-index: 40;
  background: var(--bg-2); border-left: 1px solid var(--line);
  box-shadow: -3px 0 18px rgba(22,32,43,.11);
  display: flex; flex-direction: column;
}
.dt-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 15px 16px 11px;
  border-bottom: 1px solid var(--line);
}
.dt-code { font-family: var(--mono); font-size: 12px; color: var(--brand); margin-bottom: 3px; }
.dt-name { font-size: 16px; line-height: 1.5; }
.dt-close {
  margin-left: auto; flex: 0 0 30px; width: 30px; height: 30px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  color: var(--ink-2); display: flex; align-items: center; justify-content: center;
}
.dt-close:hover { background: var(--bg); }
.dt-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.bdg {
  display: inline-block; font-size: 11.5px; padding: 2px 8px; border-radius: 20px;
  background: var(--bg-3); color: var(--ink-2); white-space: nowrap;
}
.bdg-gray { background: #eef1f4; color: #5a6b7b; }
.bdg-red { background: #fdecec; color: var(--no); }
.bdg-green { background: #e7f4ec; color: var(--ok); }
.bdg-blue { background: var(--brand-soft); color: var(--brand); }
.dt-body { flex: 1; overflow-y: auto; padding: 4px 16px 16px; }
.dt-group { margin-top: 14px; }
.dt-gh {
  font-size: 12.5px; font-weight: 500; color: var(--brand);
  padding: 5px 0 6px; border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.dt-row { display: grid; grid-template-columns: 108px 1fr; gap: 10px; padding: 5px 0; font-size: 13.5px; }
.dt-row.dt-long { grid-template-columns: 1fr; gap: 2px; }
.dt-row.dt-long .dt-k { color: var(--ink-3); font-size: 12.5px; }
.dt-k { color: var(--ink-3); font-size: 12.5px; }
.dt-v { color: var(--ink); word-break: break-word; }
.dt-foot {
  padding: 11px 16px; border-top: 1px solid var(--line);
  display: flex; gap: 8px; justify-content: flex-end; background: var(--bg-3);
}

/* ============================ 表格 ============================ */
.list-wrap, .users-wrap, .stats-wrap { padding: 16px 18px 26px; }
/* 面板制式（对齐资金管理系统）：白底 + #d8e0e8 描边 + radius 8 + 浅阴影 */
.table-scroll {
  overflow-x: auto; background: var(--bg-2);
  border: 1px solid var(--panel-line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
/* 面板容器（分析报告等）：对齐资金管理系统制式 —— 白底 + #d8e0e8 + radius 8 + 浅蓝阴影 */
.panel {
  background: #fff; border: 1px solid #d8e0e8; border-radius: 8px;
  box-shadow: 0 1px 3px rgba(26, 74, 122, .08);
  padding: 16px 18px 26px;
}
/* 表头：浅蓝灰渐变 + sticky（滚动时表头常驻） */
.tbl th {
  position: sticky; top: 0; z-index: 2;
  text-align: left; font-weight: 600; font-size: 13px; color: #123355;
  background: linear-gradient(180deg, #f0f5fa 0%, #e9f0f7 100%);
  padding: 10px 12px; border-bottom: 1px solid var(--panel-line); white-space: nowrap;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr:hover { background: #f0f6fc; }
.tbl .num { color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }
.tbl .ell { max-width: 340px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .empty { text-align: center; color: var(--ink-3); padding: 34px 0; }
.tbl .ops { white-space: nowrap; }
.pager {
  display: flex; align-items: center; gap: 8px; justify-content: flex-end;
  margin-top: 13px; flex-wrap: wrap;
}
.pg-info { font-size: 13px; color: var(--ink-3); margin-right: auto; }

/* ============================ 统计 ============================ */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 13px; margin-bottom: 16px; }
.stat-card { background: var(--bg-2); border: 1px solid var(--panel-line); border-radius: var(--radius); padding: 15px 17px; box-shadow: var(--shadow-sm); }
.sc-l { font-size: 12.5px; color: var(--ink-3); }
.sc-v { font-size: 27px; font-weight: 500; color: var(--brand); line-height: 1.25; margin: 3px 0 1px; }
.sc-s { font-size: 12px; color: var(--ink-3); }
.sc-h { font-size: 13.5px; font-weight: 500; margin-bottom: 11px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.stat-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(330px, 1fr)); gap: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 1.05fr) 2fr 46px; gap: 9px; align-items: center; padding: 3px 0; }
.bar-l { font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-t { height: 8px; background: var(--bg-3); border-radius: 4px; overflow: hidden; }
.bar-t i { display: block; height: 100%; border-radius: 4px; }
.bar-n { font-size: 12.5px; color: var(--ink-3); text-align: right; font-variant-numeric: tabular-nums; }

/* ============================ 账号管理 ============================ */
.users-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 14px; }
.users-head h2 { font-size: 17px; }
.users-head .muted { margin: 4px 0 0; }
.users-head button { margin-left: auto; }

/* ============================ 模态 ============================ */
/* [hidden] 默认 display:none 会被下方 .modal{display:flex} 覆盖，
   故必须显式声明优先级更高的隐藏规则，否则弹窗一进页面就全部可见 */
[hidden] { display: none !important; }
.modal {
  position: fixed; inset: 0; z-index: 200; background: rgba(22,32,43,.42);
  display: flex; align-items: center; justify-content: center; padding: 22px;
}
.modal-card {
  width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto;
  background: var(--bg-2); border-radius: var(--radius-lg); box-shadow: 0 12px 40px rgba(0,0,0,.2);
  padding: 22px 24px;
}
.modal-card h2 { font-size: 17px; margin-bottom: 12px; }
.modal-sm { max-width: 400px; }
.modal-form { display: flex; flex-direction: column; gap: 13px; }
.modal-act { display: flex; gap: 9px; justify-content: flex-end; margin-top: 5px; }
.confirm-text { font-size: 14px; color: var(--ink-2); line-height: 1.75; margin: 0 0 4px; }

/* ============================ Toast ============================ */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 300; background: #1d2b38; color: #fff; font-size: 13.5px;
  padding: 10px 20px; border-radius: var(--radius); box-shadow: 0 6px 22px rgba(0,0,0,.22);
  max-width: 84vw; text-align: center;
}
.toast-ok { background: #14663e; }
.toast-err { background: #8f1e17; }
.toast-warn { background: #8a5400; }

/* ============================ 响应式 ============================ */
@media (max-width: 1000px) {
  /* 窄屏顶栏收紧为两行：第一行「徽标+标题 + 右侧按钮」，第二行「导航」。
     标题允许收缩并省略，避免把右侧按钮挤到第三行（375×667 实测 162px → ≤110px）。 */
  .topbar { height: auto; flex-wrap: wrap; padding: 8px 12px; gap: 8px; }
  .topbar-left { flex: 0 1 auto; min-width: 0; }
  .tb-title { overflow: hidden; }
  .tb-title strong { font-size: 16px; letter-spacing: 0; overflow: hidden; text-overflow: ellipsis; }
  .topbar-nav { margin-left: 0; order: 3; width: 100%; overflow-x: auto; gap: 0; }
  .nav-btn { padding: 5px 10px; font-size: 13px; }
  .topbar-right { margin-left: auto; }
  .filterbar { top: 0; position: static; }
  .map-box { height: calc(100vh - 190px); }
  .detail { width: 100%; }
  .stat-cols { grid-template-columns: 1fr; }
  .fld-row { grid-template-columns: 1fr; }
  .ctl-search { min-width: 0; }
}
@media (max-width: 600px) {
  .topbar { padding: 6px 10px; gap: 6px; }
  .tb-mark { width: 26px; height: 26px; flex-basis: 26px; }
  .tb-title strong { font-size: 15px; }
  .tb-user { font-size: 11px; }
  .tb-btn { padding: 0 9px; }
  .nav-btn { padding: 4px 9px; font-size: 13px; }
}

/* ============ 分析报告 ============ */
.rpt-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 9px 24px;
  padding: 11px 15px; margin-bottom: 14px;
  background: var(--bg-2); border: 1px solid var(--panel-line); border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  font-size: 13px; color: var(--ink-2);
}
.rpt-meta b { color: var(--brand); font-weight: 600; }
/* 生成时间靠右收尾，避免挤在统计项之间 */
.rpt-meta-time { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
/* ★ 2026-10-09 报告正文档式对齐「资金管理系统」的分析报告（用户要求"文字部分如这般显示"）：
   ① 居中定宽文档列（max-width 1000px）；② 标题带浅色底纹、居中；③ 「统计口径」行 +「数据来源」行，
   末行下加粗底线；④ 章节标题带左侧色条 + 浅色底纹；⑤ 正文首行缩进 2 字、两端对齐；⑥ 表格加「表 N」题注。 */
.rpt {
  font-size: 14px; line-height: 1.9; color: var(--ink-1);
  max-width: 1000px; margin: 0 auto; background: var(--bg-2);
  padding: 6px 20px 20px; border-radius: var(--radius);
}
.rpt-title {
  font-size: 20px; font-weight: 600; text-align: center; letter-spacing: 1px;
  color: var(--brand); background: var(--brand-soft);
  padding: 10px 14px; border-radius: var(--radius);
  margin: 4px 0 8px; line-height: 1.6;
}
.rpt-sub {
  text-align: center; font-size: 12.5px; color: var(--ink-3);
  margin: 0 0 3px;
}
/* 数据来源行：与统计口径行同为居中小字，底部用粗线与正文分隔（对齐参考版式） */
.rpt-src {
  text-align: center; font-size: 12px; color: var(--ink-3); line-height: 1.7;
  padding-bottom: 10px; margin: 0 0 14px; border-bottom: 2px solid var(--brand);
}
.rpt h2 {
  font-size: 15.5px; font-weight: 600; color: var(--brand);
  margin: 22px 0 10px; padding: 6px 10px; border-left: 4px solid var(--brand);
  background: var(--brand-soft); line-height: 1.5;
}
.rpt h3 { font-size: 14px; font-weight: 600; color: var(--ink-1); margin: 16px 0 8px; }
.rpt p { margin: 0 0 12px; text-align: justify; text-indent: 2em; }
/* 以下元素不属于"正文段落"，一律不缩进（否则表题、注释、提示会缩进得很怪） */
.rpt .rpt-cap, .rpt .rpt-note, .rpt .rpt-none, .rpt-sub, .rpt-src, .rpt-cap { text-indent: 0; }
/* 表题：表上方、左对齐、不缩进（对齐参考版式「表 1　…」） */
.rpt-cap { font-size: 13px; font-weight: 600; color: var(--ink-2); margin: 14px 0 6px; }
.rpt strong { color: var(--brand); font-weight: 600; }
.rpt-none {
  padding: 14px; text-align: center; color: var(--ink-3);
  background: var(--bg-2); border-radius: var(--radius); font-size: 13px;
}
.rpt-empty { padding: 40px 0; text-align: center; }
.rpt-tbl { margin: 10px 0 16px; }
.rpt-tbl th { background: linear-gradient(180deg, #f0f5fa 0%, #e9f0f7 100%); font-size: 13px; }
.rpt-note { font-size: 12.5px; color: var(--ink-3); margin: -4px 0 14px; text-align: left; }
.rpt-note strong { color: var(--ink-2); }
/* 「下步工作建议」：公文式（一）（二）…逐条列 —— 去掉 <ol> 默认数字编号，
   编号由 JS 生成的中文序号承担（2026-10-12） */
.rpt-advice { margin: 8px 0 14px; padding-left: 0; list-style: none; }
.rpt-advice li { margin-bottom: 10px; text-align: justify; text-indent: 0; line-height: 1.9; }
.rpt-adv-no { color: var(--brand); font-weight: 600; margin-right: 6px; }
/* 完成率单元格：百分比 + 进度条 */
.rate { font-weight: 600; font-size: 12.5px; margin-right: 6px; }
.rate.ok { color: #1d7a4c; }
.rate.warn { color: #b26a00; }
.rate.no { color: #b3261e; }
.rate-bar {
  display: inline-block; width: 56px; height: 6px; vertical-align: middle;
  background: var(--bg-3); border-radius: 3px; overflow: hidden;
}
.rate-bar i { display: block; height: 100%; border-radius: 3px; }
/* 整治完成状态 */
.und { color: var(--ink-3); }

/* ============ 分析报告：工具栏 / 图表 / 打印 ============ */
/* ★ 2026-10-09 报告页顶部改两行式（用户要求"优化排版布局及字体大小"）：
   第 1 行 标题+说明 ／ 右侧操作按钮；第 2 行 筛选条件（标签与下拉同行、下拉等宽）。
   字号统一上调：标签 11.5→12.5px、下拉 13→13.5px。 */
.rpt-head { margin-bottom: 14px; }
.rpt-head-top { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.rpt-head-title h2 { font-size: 17px; }
.rpt-head-title .muted { margin: 4px 0 0; font-size: 13px; }
.rpt-acts { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.rpt-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 22px;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.rpt-tool { display: inline-flex; align-items: center; gap: 7px; }
.rpt-tool > span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
/* 工具栏下拉：给基础样式，高度与 btn-sm 对齐（原先 .sel 无样式 → 原生约 19px，比按钮矮一截） */
.rpt-tool .sel {
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  height: 30px; padding: 0 9px;
  border: 1px solid var(--line-2); border-radius: var(--radius);
  background: var(--bg-2); outline: none;
}
.rpt-tool .sel:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(10, 123, 181, .12); }
/* 下拉等宽对齐：数据清单最长、县市区其次、年/月最短 */
#rptScope { min-width: 220px; }
#rptDistrict { min-width: 132px; }
/* 报告页只剩「年份」一个下拉（月份已去掉），给它更宽一点更从容 */
#rptYear { min-width: 118px; }
/* ⚠️ 下面三个「图表网格/卡片」规则**现在由统计分析页使用**（其 markup 为
   `<div class="rpt-charts stat-charts"><div class="rpt-chart"><h4>…`）——
   报告页 2026-10-09 去掉全部图表后，这两个类名已成历史遗留：删它们会把统计页的
   图表网格与卡片样式一并弄坏（本次改版差点踩到）。保留，勿随手删。 */
.rpt-charts {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(430px, 1fr));
  gap: 14px; margin: 4px 0 20px;
}
.rpt-chart {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px 8px;
}
.rpt-chart h4 {
  font-size: 13px; font-weight: 600; color: var(--ink-1);
  margin: 0 0 8px; padding-left: 7px; border-left: 3px solid var(--brand);
}
.chart-svg { display: block; width: 100%; }
.chart-empty { padding: 30px 0; text-align: center; color: var(--ink-3); font-size: 12.5px; }
.chart-tip {
  position: absolute; z-index: 9999; display: none; pointer-events: none;
  background: rgba(22,32,43,.94); color: #fff; font-size: 12px; line-height: 1.6;
  padding: 6px 9px; border-radius: 4px; white-space: nowrap;
}
/* 打印：仅显示打印容器，隐藏界面元素（参照资金管理系统） */
.print-only { display: none; }
@media print {
  @page { size: A4 portrait; margin: 16mm 14mm; }
  html, body { background: #fff; }
  .topbar, .topbar-nav, .nav-btn, .rpt-head, .rpt-filters, .rpt-acts, .rpt-tools, .rpt-charts, .rpt-meta,
  .view, .modal, .toast, .chart-tip, .map-ctrl, .map-src, .map-attr, .map-legend {
    display: none !important;
  }
  .print-only { display: block !important; }
  #rptPrint { padding: 0; }
  #rptPrint .rpt { font-size: 12pt; line-height: 1.9; color: #000; }
  #rptPrint .rpt { max-width: 100%; padding: 0; }
  #rptPrint .rpt-title {
    font-size: 18pt; text-align: center;
    background: #e8eef5 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #rptPrint .rpt-src { border-bottom: 1px solid #333; }
  #rptPrint .rpt h2 {
    font-size: 14pt; break-after: avoid;
    background: #e8eef5 !important; border-left: 4px solid #1a4a7a;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #rptPrint .rpt-cap { font-size: 10pt; break-after: avoid; }
  #rptPrint .rpt table { font-size: 9pt; break-inside: avoid; }
  #rptPrint .rpt-tbl th { background: #e8eef5 !important; }
  .table-scroll { overflow: visible !important; max-height: none !important; }
}

/* 统计页图表与汇总表 */
.stat-charts { margin-top: 16px; }
.stat-summary { margin-top: 18px; }
.stat-summary h3 { font-size: 14px; font-weight: 600; color: var(--ink-1); margin: 0 0 10px; }
.stat-summary .bar-t { display: block; width: 100%; }

/* 整治完成时限状态着色 */
.ov { color: #b3261e; font-weight: 600; }      /* 已逾期 */
.dl-soon { color: #b26a00; font-weight: 600; }   /* 临期 */
.dl-bad { color: #7a4bb3; }                      /* 时限格式异常 */
.dl-note { font-size: 12px; white-space: nowrap; }

/* 整治完成时限：年+月双下拉 */
.fld-ym { display: flex; gap: 6px; align-items: center; }
.fld-ym .sel { min-width: 84px; }

/* 筛选栏「整治时间」：年 + 月 双下拉（带内联小标签，避免多出两个无说明的下拉）。
   实测：新增这组控件后，1440px 宽度下筛选栏会从 1 行变 2 行，
   故同步把搜索框最小宽度与年月下拉宽度收紧，把多占的横向空间让回来。 */
/* .ctl-ym / .ctl-ym-label 已删除：2026-10-09 筛选栏「整治时间（年+月）」改为
   「整治完成时限」单下拉，这组"内联小标签 + 窄下拉"的样式不再有使用者。 */
/* 整治完成时限下拉：用 .ctl 默认 max-width:200px 即够（6 字标题约 81px + 内边距） */

/* 清单页工具条（「新增排污口」入口）：左侧口径说明，右侧按钮 */
.list-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 10px; flex-wrap: wrap;
}
.list-bar-note { font-size: 12.5px; color: var(--ink-3); line-height: 1.5; }

/* 删除确认弹窗里的"记录摘要"与行内删除链接 */
.del-target { background: var(--bg-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; margin-bottom: 12px; }
.del-name { font-weight: 600; margin-bottom: 3px; word-break: break-all; }
.del-meta { font-size: 12.5px; color: var(--ink-3); }
.link-danger { color: var(--no); }
.link-danger:hover { color: #951d16; }

/* 清单长文本列（详细地址 / 名称 / 责任主体）：内层截断 + 省略号，悬停由 title 显示全文。
   注意：本表为 auto 布局，td 上的 max-width 不生效，必须由内层元素限宽。 */
.tbl .cell-ell { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tbl .cell-addr { max-width: 196px; }   /* 详细地址：th 220px - 左右 padding 24px */
.tbl .cell-name { max-width: 340px; }   /* 名称：沿用 .ell 原本写的 340px，让表宽确定化 */
.tbl .cell-duty { max-width: 126px; }   /* 责任主体：th 150px - 左右 padding 24px */

/* ────────────────────────────────────────────────────────────────────────
   排口清单专用表格（13 列）：窄屏时**保持列宽 + 横向滚动**，而不是把窄列压扁。
   为什么需要：.tbl 是 auto 布局，容器不够宽时浏览器会优先压缩可收缩列 ——
   实测 1440px 下「区县」被压到 50px、「排口类型」压到 78px（长类型名又折行）、
   「操作」压到 50px（详情/删除折成两行）。加 min-width 后表格不再收缩，
   超出部分交给 .table-scroll 横向滚动，列宽与 1920px 下一致。
   ──────────────────────────────────────────────────────────────────────── */
/* 1648 = 固定列之和 1494（序号52+编码190+区县72+类型150+地址220+整治88+超标66+完成110+时限120+责任150+操作84）
   + 名称列约 346px（与改动前 1440 下名称列的实际可用宽度相当，避免名称被迫折行）。 */
.tbl-list { min-width: 1648px; }

/* ---------------- 统计分析页：多维度筛选栏 ---------------- */
.stat-filter {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 13px; margin-bottom: 14px;
}
.sf-item { display: inline-flex; align-items: center; gap: 6px; }
.sf-item > span { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; }
.sf-item .ctl { max-width: 190px; }
.sf-hint { font-size: 12.5px; color: var(--ink-3); margin-left: auto; line-height: 1.5; }
.sf-hint b { color: var(--ink); font-weight: 600; }
/* 有筛选生效时给提示加一层底色，明确"数字是筛选后的" */
.sf-hint-on { background: var(--brand-soft); color: var(--brand); padding: 3px 9px; border-radius: 11px; }
.sf-hint-on b { color: var(--brand); }

/* ---------------- 统计分析页：台账对比块 ---------------- */
.cmp-card { margin-bottom: 16px; }
.cmp-note { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 8px; }
.cmp-wrap { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 13px; }
.cmp-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; background: var(--bg-3); }
.cmp-t { font-weight: 600; font-size: 14px; color: var(--brand);
  padding-bottom: 7px; margin-bottom: 8px; border-bottom: 1px solid var(--line); }
.cmp-t-full { color: #9a5b00; }
.cmp-row { display: flex; align-items: baseline; gap: 8px; font-size: 13px; padding: 3px 0; }
.cmp-row > span { color: var(--ink-2); min-width: 78px; }
.cmp-row > b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-row > em { font-size: 11.5px; color: var(--ink-3); font-style: normal; }

/* ---------------- 整改照片 / 佐证资料（2026-10-09） ----------------
   编辑弹窗内可上传/删除，详情面板只读展示。照片用网格缩略图，资料用清单。 */
.att-section { margin: 6px 0 14px; }
.att-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin: 14px 0 8px; padding-bottom: 6px; border-bottom: 1px dashed var(--line);
}
.att-head > span { font-size: 13px; font-weight: 600; color: var(--ink); }
.att-empty { font-size: 12.5px; color: var(--ink-3); padding: 4px 0 2px; }
.att-photos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 9px;
}
.att-item { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.att-item > .link { align-self: flex-start; font-size: 12px; }
.att-thumb {
  width: 100%; height: 72px; object-fit: cover; display: block;
  border: 1px solid var(--line); border-radius: 6px; background: var(--bg-3);
}
.att-thumb-err {
  display: flex; align-items: center; justify-content: center; text-align: center;
  font-size: 11.5px; color: var(--ink-3);
}
.att-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.att-name { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-sub { font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
/* 资料清单：一行一项，名字在左、大小/上传人在右 */
.att-docs { display: flex; flex-direction: column; }
.att-docs .att-item {
  flex-direction: row; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.att-docs .att-item:last-child { border-bottom: none; }
.att-docs .att-meta { flex: 1 1 auto; flex-direction: row; align-items: baseline; gap: 8px; }
.att-link { font-size: 13px; color: var(--brand-2); text-decoration: none; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-link:hover { text-decoration: underline; }
.att-count { font-size: 12px; font-weight: 400; color: var(--ink-3); margin-left: 8px; }
/* 详情面板里的附件块（与弹窗共用 .att-photos/.att-docs） */
#dtBody .att-photos { margin: 8px 0 4px; grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
#dtBody .att-thumb { height: 62px; }

/* 附件适用范围说明：不适用的记录（湘江干流省厅下发台账）在编辑弹窗里给一行灰字解释，
   而不是把上传区整个藏掉让人以为功能丢了 */
.att-scope-note {
  font-size: 12.5px; color: var(--ink-3); line-height: 1.7;
  background: var(--bg-3); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 9px 12px;
}
