:root {
  --brand: #49cd33;
  --brand-dark: #36a825;
  --brand-light: #eefbea;
  --text: #1f2d1d;
  --text-sub: #6b7a68;
  --border: #e3e8e1;
  --bg: #f5f7f4;
  --panel: #ffffff;
  --danger: #e5484d;
  --shadow: 0 2px 12px rgba(31, 45, 29, 0.12);
}

* { box-sizing: border-box; }

html, body, #app {
  margin: 0;
  height: 100%;
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

#app { display: flex; flex-direction: column; height: 100%; }

/* —— 顶栏 —— */
.topbar {
  height: 50px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
  flex: 0 0 auto;
}
.topbar .breadcrumb { font-size: 14px; color: var(--text-sub); }
.topbar .breadcrumb b { color: var(--text); }
.topbar .role { margin-left: auto; font-size: 13px; color: var(--text-sub); }
.topbar .logo {
  width: 28px; height: 28px; border-radius: 6px;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.menu-toggle {
  width: 30px; height: 30px; border: 1px solid var(--border); background: #fff;
  border-radius: 6px; cursor: pointer; font-size: 16px; color: var(--text);
  display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.menu-toggle:hover { background: var(--brand-light); }
body.sidebar-collapsed .sidebar { display: none; }

/* —— 工具条 —— */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.toolbar .field { display: flex; align-items: center; gap: 6px; }
.toolbar label { font-size: 13px; color: var(--text-sub); }
.toolbar label.check-label { display: flex; align-items: center; gap: 5px; cursor: pointer; user-select: none; white-space: nowrap; }
.toolbar label.check-label input { margin: 0; }

select, input[type="text"] {
  height: 34px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}
select:focus, input[type="text"]:focus { border-color: var(--brand); }
input[type="text"] { min-width: 180px; }

.btn {
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}
.btn:hover { border-color: var(--brand); color: var(--brand-dark); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); }
.btn.primary.dirty { background: #e8890c; border-color: #d17a08; animation: dirty-pulse 1.6s ease-in-out infinite; }
@keyframes dirty-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(232,137,12,.45); } 50% { box-shadow: 0 0 0 6px rgba(232,137,12,0); } }
.btn.danger { color: var(--danger); border-color: #f3c2c4; }
.btn.blue { background: #2f7ad9; border-color: #2f7ad9; color: #fff; }
.btn.blue:hover { background: #2868ba; }
.btn.active { background: var(--brand-light); border-color: var(--brand); color: var(--brand-dark); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.toolbar .divider { width: 1px; height: 22px; background: var(--border); margin: 0 4px; }

/* —— 地图区域 —— */
.map-shell { position: relative; flex: 1 1 auto; overflow: hidden; }
#map { position: absolute; inset: 0; }

.map-zoom {
  position: absolute;
  left: 12px; top: 12px;
  display: flex; flex-direction: column;
  background: #fff; border-radius: 8px; box-shadow: var(--shadow);
  overflow: hidden; z-index: 20;
}
.map-zoom button {
  width: 34px; height: 34px; border: none; background: #fff;
  font-size: 18px; cursor: pointer; color: var(--text);
}
.map-zoom button + button { border-top: 1px solid var(--border); }
.map-zoom button:hover { color: var(--brand-dark); }

.alert-bar {
  position: absolute; top: 12px; left: 50%; transform: translateX(-50%);
  background: #fff7e6; color: #b7791f; border: 1px solid #f5d99b;
  border-radius: 8px; padding: 8px 16px; font-size: 13px; z-index: 20;
  display: none;
}
.alert-bar.show { display: block; }

/* —— 右侧浮动面板 —— */
.side-panel {
  position: absolute; top: 12px; right: 12px; bottom: 12px;
  width: 340px;
  background: var(--panel);
  border-radius: 12px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  z-index: 25;
  overflow: hidden;
}
.side-panel.hidden { display: none; }
.panel-header {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
}
.panel-tabs { display: flex; gap: 4px; }
.panel-tabs .tab {
  border: none; background: none; cursor: pointer;
  font-size: 13px; color: var(--text-sub); padding: 6px 10px; border-radius: 6px;
}
.panel-tabs .tab.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.panel-header h3 { margin: 0; font-size: 15px; }
.panel-header .meta { margin-left: 8px; font-size: 12px; color: var(--text-sub); }
.panel-header .close { margin-left: auto; border: none; background: none; cursor: pointer; font-size: 16px; color: var(--text-sub); }
.panel-body { flex: 1 1 auto; overflow-y: auto; padding: 14px 16px; }
.panel-footer { padding: 12px 16px; border-top: 1px solid var(--border); display: flex; gap: 8px; justify-content: flex-end; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
.dialog .field { display: flex; flex-direction: column; gap: 4px; }
.dialog .field.full { grid-column: 1 / -1; }
.dialog .field input, .dialog .field select { width: 100%; min-width: 0; }
.form-item { display: flex; flex-direction: column; gap: 4px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 12px; color: var(--text-sub); }
.form-item label.check-row { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.form-item label.check-row input { width: auto; margin: 0; }
.form-item input, .form-item select { width: 100%; min-width: 0; }
.form-item input[readonly] { background: #f5f6f5; color: var(--text-sub); cursor: not-allowed; }
.dialog .panel-tabs { margin-bottom: 12px; }
.dialog-pane[hidden] { display: none; }

/* 发包方：下拉 + 选择按钮 */
.owner-pick { display: flex; gap: 8px; align-items: center; }
.owner-pick select { flex: 1 1 auto; }
.owner-pick .btn { flex: 0 0 auto; white-space: nowrap; }
/* 发包方选择器里区划匹配行的底色 */
.grid tr.row-hit td { background: #f1f9f1; }

/* 合并编码选择列表 */
.code-options { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.code-option { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; }
.code-option:hover { border-color: var(--brand); }
.code-option input { width: auto; margin: 0; }
.code-option .code-main { font-size: 13px; font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.code-option .code-sub { font-size: 12px; color: var(--text-sub); margin-left: auto; }

/* 坐标点（界址点 + 中心点） */
.coords-box { border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: var(--bg); }
.coords-center { font-size: 12.5px; margin-bottom: 8px; }
.coords-center b { font-family: Consolas, monospace; }
.coords-center .coord-count { color: var(--text-sub); font-size: 12px; margin-left: 6px; }
.coords-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; max-height: 132px; overflow-y: auto; }
.coord-item { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.coord-no { flex: 0 0 38px; color: var(--text-sub); }
.coord-xy { font-family: Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.empty-tip { text-align: center; color: var(--text-sub); font-size: 13px; padding: 40px 0; }

/* 地块列表（快速定位） */
.parcel-list { display: flex; flex-direction: column; gap: 8px; }
.parcel-list .row {
  border: 1px solid var(--border); border-radius: 8px; padding: 10px;
  cursor: pointer; font-size: 13px;
}
.parcel-list .row:hover, .parcel-list .row.active { border-color: var(--brand); background: var(--brand-light); }
.parcel-list .row .code { color: var(--text-sub); font-size: 12px; }

/* 操作记录 */
.log-list { font-size: 12px; color: var(--text-sub); display: flex; flex-direction: column; gap: 8px; }
.log-list .log { border-left: 3px solid var(--brand); padding-left: 10px; }

/* 右键菜单 */
.context-menu {
  position: absolute; z-index: 30; background: #fff; border-radius: 8px;
  box-shadow: var(--shadow); min-width: 140px; padding: 6px; display: none;
}
.context-menu.show { display: block; }
.context-menu .item { padding: 8px 12px; font-size: 13px; border-radius: 6px; cursor: pointer; }
.context-menu .item:hover { background: var(--brand-light); color: var(--brand-dark); }

/* 工具条下拉（导入/导出矢量） */
.toolbar-drop { position: relative; display: inline-flex; }
.toolbar-drop .context-menu { left: 0; top: calc(100% + 4px); min-width: 210px; }

/* 底部提示 */
.bottom-hint {
  position: absolute; left: 12px; bottom: 12px; z-index: 20;
  background: rgba(255,255,255,0.9); border-radius: 8px;
  padding: 6px 12px; font-size: 12px; color: var(--text-sub);
}

/* 底部搜索结果坞 */
.result-dock {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 22;
  background: var(--panel); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: 38%; overflow: hidden;
}
.result-dock[hidden] { display: none; }
.dock-head { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.dock-title { font-weight: 600; font-size: 14px; }
.dock-meta { font-size: 12px; color: var(--text-sub); }
.dock-close { margin-left: auto; border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--text-sub); }
.dock-close:hover { color: var(--text); }
.dock-body { overflow: auto; padding: 10px 14px; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.dock-card { border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; cursor: pointer; }
.dock-card:hover, .dock-card.active { border-color: var(--brand); background: var(--brand-light); }
.dock-card .c1 { font-size: 13px; font-weight: 600; }
.dock-card .c2 { font-size: 12px; color: var(--text-sub); margin-top: 2px; }
.dock-card .c3 { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* 弹窗（合并目标 / 四至范围等） */
.dialog-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 40;
  display: none; align-items: center; justify-content: center;
}
.dialog-mask.show { display: flex; }
.dialog {
  width: 420px; background: #fff; border-radius: 12px; box-shadow: var(--shadow);
  overflow: hidden;
}
.dialog .d-header { padding: 14px 18px; font-weight: 600; border-bottom: 1px solid var(--border); }
.dialog .d-body { padding: 16px 18px; font-size: 13px; }
.dialog .d-footer { padding: 12px 18px; display: flex; gap: 8px; justify-content: flex-end; }
.dialog.wide { width: 560px; }
/* 超宽弹窗：承包方编辑的成员表（9 列）需要完整展示 */
.dialog.xwide { width: min(1180px, 96vw); }
.dialog .d-body.scroll { max-height: 60vh; overflow: auto; }
.import-summary { margin-bottom: 10px; line-height: 1.7; color: var(--text-main); }
.import-warn { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: #fff4e5; color: #b25b00; border: 1px solid #ffd9a8; line-height: 1.6; }
.import-ok { margin: 10px 0; padding: 10px 12px; border-radius: 8px; background: #ecf8ec; color: #2a7d2a; border: 1px solid #b7e6b7; line-height: 1.6; }
.dialog .form-grid { margin-top: 10px; }

/* 导入要素勾选清单 */
.import-feats { margin: 10px 0; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.import-feats-head { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--bg); font-size: 13px; }
.import-feats-head label { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.import-feats-head span { color: var(--text-sub); font-size: 12px; }
.import-feats-list { max-height: 180px; overflow-y: auto; }
.imp-row { display: flex; align-items: center; gap: 10px; padding: 7px 12px; border-top: 1px solid var(--border); font-size: 12px; cursor: pointer; }
.imp-row:hover { background: var(--brand-light); }
.imp-row .imp-code { flex: 0 0 150px; font-family: Consolas, monospace; color: var(--text); }
.imp-row .imp-name { flex: 1 1 auto; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.imp-row .imp-area { flex: 0 0 70px; text-align: right; color: var(--text-sub); }

/* OL 选中样式覆盖 */
.ol-selectable { user-select: none; }

@media (max-width: 900px) {
  .side-panel {
    width: auto;
    left: 12px; right: 12px; top: auto;
    bottom: 12px; height: 46%;
  }
  input[type="text"] { min-width: 120px; }
}

/* —— 后台布局：侧边导航 + 多视图 —— */
.body-wrap { display: flex; flex: 1 1 auto; overflow: hidden; }

.sidebar {
  width: 200px; flex: 0 0 auto; background: #fff;
  border-right: 1px solid var(--border); overflow-y: auto; padding: 8px 0;
}
.menu-group { padding: 14px 16px 6px; font-size: 12px; color: var(--text-sub); }
.menu-item {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 11px 16px; font-size: 14px; cursor: pointer; color: var(--text);
  border-right: 3px solid transparent;
}
.menu-item:hover { background: var(--brand-light); }
.menu-item.active { background: var(--brand-light); color: var(--brand-dark); border-right-color: var(--brand); font-weight: 600; }

/* 可折叠分组子菜单 */
.menu-parent .sub-menu { display: block; }
.menu-parent:not(.open) .sub-menu { display: none; }
.menu-item.parent { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.menu-item.parent .arrow { font-size: 11px; color: var(--text-sub); transition: transform .15s; }
.menu-parent:not(.open) .arrow { transform: rotate(-90deg); }
.menu-item.sub { padding-left: 34px; font-size: 13px; }
.menu-parent.active > .parent { background: var(--brand-light); color: var(--brand-dark); border-right-color: var(--brand); font-weight: 600; }

.main-area { flex: 1 1 auto; overflow: hidden; position: relative; }
.view { display: none; height: 100%; flex-direction: column; overflow: hidden; }
.view.active { display: flex; }

/* —— 业务页面通用 —— */
.page { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.page-filter {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border);
}
.page-filter .field { display: flex; align-items: center; gap: 6px; }
.page-filter label { font-size: 13px; color: var(--text-sub); }
.area-picker { position: relative; }
.area-picker-box { position: relative; display: flex; align-items: center; }
.area-picker-input { width: 210px; }
.area-picker-panel {
  display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 40;
  min-width: 280px; max-height: 360px; overflow: auto; padding: 6px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow);
}
.area-picker.open .area-picker-panel { display: block; }
.area-picker-opt { padding: 9px 12px; border-radius: 6px; font-size: 13px; cursor: pointer; white-space: nowrap; }
.area-picker-opt:hover { background: var(--bg); }
.area-picker-opt.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
/* 组级标记与地块数徽标 */
.area-picker-tag {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  background: var(--brand-light); color: var(--brand-dark); font-size: 11px; font-weight: 600; vertical-align: middle;
}
.area-picker-count {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 4px;
  background: var(--bg); color: var(--text-sub); font-size: 11px; vertical-align: middle;
}
/* 地图工具栏里的区域下拉：与其他工具控件对齐 */
.toolbar .area-picker .area-picker-input { width: 190px; }
.toolbar .area-picker label { font-size: 13px; color: var(--text-sub); }
.page-toolbar { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border); }
.table-wrap { flex: 1 1 auto; overflow: auto; background: #fff; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; white-space: nowrap; }
table.grid th { background: var(--bg); color: var(--text-sub); font-weight: 600; position: sticky; top: 0; z-index: 1; }
table.grid tr:hover td { background: #fafdf9; }

.tag { display: inline-block; padding: 2px 10px; border-radius: 10px; font-size: 12px; }
.tag.green { background: var(--brand-light); color: var(--brand-dark); }
.tag.gray { background: #f0f2f0; color: var(--text-sub); }
.tag.red { background: #fdecec; color: var(--danger); }
.tag.blue { background: #eaf3fc; color: #2b6cb0; }
.tag.orange { background: #fdf2e2; color: #b25b00; }
.tag.mini { padding: 0 6px; border-radius: 8px; font-size: 11px; line-height: 16px; margin-left: 4px; vertical-align: 1px; }
.grid tr.row-invalid td { color: var(--text-sub); background: #fafafa; }
.grid tr.row-disabled td { color: var(--text-sub); background: #f7f8fa; }

.link-btn { border: none; background: none; color: var(--brand-dark); cursor: pointer; font-size: 13px; padding: 2px 4px; }
.link-btn.danger { color: var(--danger); }
.link-btn + .link-btn { border-left: 1px solid var(--border); margin-left: 2px; }

.stat-cards { display: flex; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.stat-card { flex: 1; min-width: 140px; background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.stat-card .label { font-size: 12px; color: var(--text-sub); }
.stat-card .num { font-size: 22px; font-weight: 700; color: var(--brand-dark); margin-top: 4px; }

.sub-tabs { display: flex; gap: 4px; padding: 10px 16px 0; background: #fff; }
.sub-tabs .tab {
  border: none; background: none; cursor: pointer; font-size: 13px;
  color: var(--text-sub); padding: 8px 12px; border-radius: 6px 6px 0 0;
  border-bottom: 2px solid transparent;
}
.sub-tabs .tab.active { color: var(--brand-dark); font-weight: 600; border-bottom-color: var(--brand); }

.two-col { display: flex; height: 100%; overflow: hidden; }
.dept-pane { width: 260px; flex: 0 0 auto; border-right: 1px solid var(--border); overflow-y: auto; padding: 12px; }
.dept-body { flex: 1 1 auto; overflow: auto; }
.dept-tree { font-size: 13px; }
.dept-tree .node { padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.dept-tree .node:hover { background: var(--brand-light); }
.dept-tree .node.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.dept-tree .children { padding-left: 16px; }

/* 分户合户处理：左树 + 右内容 */
.fhhh-page { flex-direction: row; }
.fhhh-tree { width: 220px; flex: 0 0 auto; border-right: 1px solid var(--border); background: #fff; padding: 12px; overflow-y: auto; }
.tree-search input { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.tree-list { list-style: none; margin: 10px 0 0; padding: 0; }
.tree-node { padding: 8px 10px; cursor: pointer; border-radius: 6px; font-size: 13px; color: var(--text-main, #333); }
.tree-node:hover { background: var(--bg); }
.tree-node.active { color: var(--brand-dark); font-weight: 600; background: var(--brand-light); }
.fhhh-main { flex: 1 1 auto; display: flex; flex-direction: column; overflow: hidden; }
.fhhh-main .page-filter .filter-actions { margin-left: auto; gap: 8px; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--border); }
.pager-total { font-size: 13px; color: var(--text-sub); }
.pager-btns { display: flex; gap: 8px; align-items: center; }
.pager-cur { font-size: 13px; color: var(--text-sub); }
.transfer-blocks { display: flex; flex-direction: column; gap: 12px; }
.house-block { border: 1px solid var(--border); border-radius: 10px; padding: 12px; }
.house-block-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.house-block-meta { font-size: 13px; color: var(--text-sub); margin-bottom: 10px; }
.agreement-doc { line-height: 1.9; }
.agreement-title { text-align: center; font-size: 18px; margin: 0 0 12px; }
.agreement-meta { font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
.agreement-parties { margin: 12px 0; }
.agreement-party { border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 13px; }
.agreement-party-title { font-weight: 600; margin-bottom: 4px; }
.agreement-sign { margin-top: 18px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; font-size: 13px; }

.desc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 16px; }
.desc-grid .item { display: flex; flex-direction: column; gap: 3px; }
.desc-grid .item .k { font-size: 12px; color: var(--text-sub); }
.desc-grid .item .v { font-size: 13px; }

.member-table th, .member-table td { white-space: nowrap; }
/* 成员表输入框按填写内容自适应（宽度由 JS 按文字实测写入 style.width） */
#memTable .mem-row input {
  width: auto;
  min-width: 52px;
  max-width: 240px;
  box-sizing: border-box;
  text-align: left;
}
#memTable .mem-row select { max-width: 150px; }
/* 换户主后无法自动判断的成员关系：黄底提示人工确认 */
#memTable .mem-row.rel-todo select[data-m="relation"] { background: #fff7e6; border-color: #f0a94a; }
/* 小节标题后的说明文字 */
.section-hint { font-weight: 400; font-size: 12px; color: var(--text-sub); margin-left: 10px; }
/* 承包方列表里可点击的成员数量 */
.link-btn.num-link { font-weight: 600; text-decoration: underline dotted; text-underline-offset: 3px; }
.link-btn.num-link:hover { color: var(--brand); }
/* 家庭成员管理：户主标记 */
.rel-head-tag { display: inline-block; margin-right: 6px; padding: 0 6px; border-radius: 4px; background: rgba(54,168,37,.12); color: var(--brand-dark); font-size: 11px; line-height: 18px; vertical-align: 1px; }

/* 摸底表：预览 / 签名板 / 签字状态 */
.sv-preview { width: 100%; height: 62vh; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.sv-canvas { display: block; width: 100%; max-width: 760px; height: 260px; margin: 8px auto 0; border: 1px dashed var(--border); border-radius: 8px; background: #fff; cursor: crosshair; touch-action: none; }
.sv-canvas-bar { display: flex; align-items: center; gap: 12px; justify-content: center; margin-top: 10px; }
.sv-badge { display: inline-block; padding: 1px 8px; border-radius: 10px; font-size: 12px; line-height: 18px; }
.sv-badge.ok { background: rgba(54,168,37,.12); color: var(--brand-dark); }
.sv-badge.scan { background: rgba(52,120,246,.12); color: #2b62c9; }
.sv-badge.none { background: rgba(0,0,0,.06); color: var(--text-sub); }
.section-title { font-size: 14px; font-weight: 600; margin: 14px 0 8px; }

/* 驾驶舱 / 统计面板 */
.dash-grid { display: flex; gap: 12px; padding: 0 16px 16px; flex: 1 1 auto; overflow: auto; }
.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 0 16px 16px; flex: 1 1 auto; overflow: auto; }
.dash-panel {
  flex: 1 1 0; background: #fff; border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; overflow: auto; display: flex; flex-direction: column;
}
.dash-panel .table-wrap { background: transparent; }
.quick-links { display: flex; flex-wrap: wrap; gap: 10px; align-content: flex-start; }
.dash-map-layout { align-items: stretch; }
.dash-map-panel { flex: 2 1 0; min-width: 0; }
.dash-side { flex: 1 1 320px; display: flex; flex-direction: column; gap: 12px; overflow: auto; }
.dash-side .dash-panel { flex: 0 0 auto; }
.dash-map { flex: 1 1 auto; min-height: 340px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.bar-cell { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.bar { display: inline-block; height: 8px; border-radius: 4px; background: var(--brand); min-width: 2px; }
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 800px) { .dash-grid, .stats-grid { flex-direction: column; grid-template-columns: 1fr; } }

/* ===== 延包驾驶舱 · 深色科技大屏 ===== */
#view-dashboard { background: #071426; }
.screen {
  display: flex; flex-direction: column; height: 100%; overflow: hidden; color: #dbeafe;
  background: radial-gradient(1200px 700px at 50% -10%, #12325a 0%, #071426 60%);
}
.screen-top {
  position: relative;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 22px; border-bottom: 1px solid rgba(120,170,255,.18);
}
.screen-title {
  position: absolute; left: 50%; transform: translateX(-50%);
  font-size: 22px; font-weight: 700; letter-spacing: 2px; color: #eaf4ff;
  text-shadow: 0 0 14px rgba(80,160,255,.5); white-space: nowrap;
}
.screen-clock { margin-left: auto; font-size: 14px; color: #9fc4ef; font-variant-numeric: tabular-nums; white-space: nowrap; }
.screen-body {
  flex: 1 1 auto; position: relative; padding: 14px; overflow: hidden;
}
.screen-col {
  position: absolute; top: 14px; bottom: 14px; z-index: 5;
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
}
.screen-col.left { left: 14px; width: 300px; }
.screen-col.right { right: 14px; width: 320px; }
.screen-center {
  position: relative; border: 1px solid rgba(120,170,255,.25); border-radius: 12px;
  overflow: hidden; background: #0a1c33;
}
.screen-panel {
  background: linear-gradient(160deg, rgba(20,48,84,.72), rgba(12,30,54,.72));
  border: 1px solid rgba(120,170,255,.22); border-radius: 12px; padding: 14px;
}
.panel-title {
  font-size: 15px; font-weight: 600; color: #cfe6ff; margin-bottom: 12px;
  padding-left: 10px; border-left: 3px solid #3b82f6;
}
.base-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.base-item { background: rgba(10,28,51,.6); border-radius: 10px; padding: 14px 10px; text-align: center; }
.base-item.full { grid-column: 1 / -1; }
.b-num { font-size: 24px; font-weight: 700; color: #4fc3f7; }
.b-label { font-size: 12px; color: #9fc4ef; margin-top: 6px; }
.ring-row { display: flex; justify-content: space-around; }
.ring-disc {
  width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: conic-gradient(#38bdf8 calc(var(--p) * 1%), rgba(255,255,255,.1) 0); position: relative;
}
.ring-disc::before { content: ''; position: absolute; inset: 10px; border-radius: 50%; background: #0c2138; }
.ring-disc span { position: relative; font-weight: 700; color: #eaf4ff; }
.ring-label { text-align: center; font-size: 12px; color: #9fc4ef; margin-top: 6px; }
.prog { display: flex; align-items: center; gap: 10px; margin: 10px 0; }
.prog-label { width: 86px; font-size: 12px; color: #cfe6ff; }
.prog-track { flex: 1; height: 8px; background: rgba(255,255,255,.1); border-radius: 6px; overflow: hidden; }
.prog-bar { height: 100%; background: linear-gradient(90deg, #2563eb, #38bdf8); border-radius: 6px; }
.change-row { display: flex; justify-content: space-around; }
.change-item { text-align: center; }
.c-num { font-size: 22px; font-weight: 700; color: #4fc3f7; }
.c-label { font-size: 12px; color: #9fc4ef; margin-top: 4px; }
.feedback-total { margin-top: 12px; font-size: 13px; color: #cfe6ff; }
.feedback-total b { color: #4fc3f7; }
.screen-legend {
  position: absolute; left: 50%; transform: translateX(-50%); bottom: 12px; background: rgba(7,20,38,.7);
  border: 1px solid rgba(120,170,255,.25); border-radius: 8px; padding: 6px 12px; font-size: 12px; color: #cfe6ff;
}
.lg-dot {
  display: inline-block; width: 10px; height: 10px; border: 1px solid #2e7d32;
  background: rgba(46,125,50,.3); border-radius: 2px; margin-right: 6px;
}
.quick-links.dark { flex-direction: column; gap: 8px; }
.dark-btn { background: rgba(37,99,235,.18); color: #cfe6ff; border: 1px solid rgba(120,170,255,.3); }
.dark-btn:hover { background: rgba(37,99,235,.32); }
#dashMap { position: absolute; inset: 0; z-index: 0; min-height: 0; border: none; }
.map-toolbar {
  position: absolute; top: 14px; left: 50%; transform: translateX(-50%); z-index: 10;
  display: flex; align-items: center; gap: 8px;
  background: rgba(7,20,38,.72); border: 1px solid rgba(120,170,255,.25);
  border-radius: 8px; padding: 6px 10px; font-size: 12px; color: #cfe6ff;
}
.map-toolbar select {
  background: #0d2240; color: #e8f2ff; border: 1px solid rgba(120,170,255,.35);
  border-radius: 6px; padding: 4px 8px; font-size: 12px; max-width: 190px; outline: none;
}
.panel-toggle {
  position: absolute; top: 14px; right: 14px; z-index: 11;
  background: rgba(37,99,235,.22); color: #cfe6ff; border: 1px solid rgba(120,170,255,.35);
  border-radius: 8px; padding: 6px 14px; font-size: 12px; cursor: pointer;
}
.panel-toggle:hover { background: rgba(37,99,235,.38); }
.screen.panels-hidden .screen-col { display: none; }
/* 驾驶舱满屏：隐藏后台顶栏与侧边栏，驾驶舱覆盖整个视口 */
body.dash-fullscreen .topbar,
body.dash-fullscreen .sidebar { display: none; }
body.dash-fullscreen .body-wrap { height: 100%; }
body.dash-fullscreen #view-dashboard { position: fixed; inset: 0; z-index: 200; }
.fs-toggle {
  background: rgba(37,99,235,.22); color: #cfe6ff; border: 1px solid rgba(120,170,255,.35);
  border-radius: 8px; padding: 6px 14px; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.fs-toggle:hover { background: rgba(37,99,235,.38); }
@media (max-width: 1100px) {
  .screen-col.left { width: 240px; }
  .screen-col.right { width: 260px; }
}
@media (max-width: 800px) {
  .screen-body { overflow-y: auto; }
  #dashMap { position: relative; height: 320px; }
  .screen-col { position: static; width: 100%; margin-bottom: 14px; }
  .map-toolbar, .screen-legend, .panel-toggle { position: static; transform: none; margin: 8px 0; }
}


/* 列表分页条（万级数据按页渲染） */
.pager { display: flex; align-items: center; gap: 12px; padding: 12px 4px 6px; font-size: 13px; color: var(--text-sub); flex-wrap: wrap; }
.pager-info b { color: var(--text); }
.pager-btns { display: flex; align-items: center; gap: 6px; }
.pager-btns .btn { height: 30px; padding: 0 10px; font-size: 13px; }
.pager-btns .btn[disabled] { opacity: .45; cursor: not-allowed; }
.pager-jump { width: 56px; height: 30px; min-width: 0 !important; text-align: center; padding: 0 6px; }
.pager-size { height: 30px; }

/* 批量导入进度浮层 */
.import-progress {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; width: 320px;
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
  box-shadow: var(--shadow); padding: 12px 14px;
}
.import-progress .ip-label { font-size: 13px; margin-bottom: 8px; }
.import-progress .ip-bar { height: 8px; background: #eef2ef; border-radius: 4px; overflow: hidden; }
.import-progress .ip-bar i { display: block; height: 100%; background: var(--brand); transition: width .2s; }

/* 矢量数据按视野加载时的角标提示 */
.geo-banner {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 900;
  display: none;
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(17, 24, 39, 0.86);
  color: #e8f1ff;
  font-size: 12.5px;
  line-height: 1.6;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
  pointer-events: none;
}
.geo-banner b { color: #7fd4ff; font-weight: 600; }

/* ===== 登录页（2026-11-23） ===== */
.login-screen {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eef3ef 0%, #dfeae1 50%, #d3e2ef 100%);
}
.login-screen.hidden { display: none; }
body.login-mode #app { visibility: hidden; }
.login-card {
  width: 380px; max-width: calc(100vw - 32px);
  background: #fff; border-radius: 14px; padding: 34px 34px 26px;
  box-shadow: 0 16px 50px rgba(24, 54, 40, 0.18);
  text-align: center;
}
.login-logo {
  width: 56px; height: 56px; margin: 0 auto 12px;
  border-radius: 14px; background: var(--brand, #2f7d4f); color: #fff;
  font-size: 28px; font-weight: 700; line-height: 56px;
}
.login-title { font-size: 19px; margin: 0 0 4px; color: #223; }
.login-sub { font-size: 13px; color: #879; margin: 0 0 20px; }
.login-field { text-align: left; margin-bottom: 14px; }
.login-field label { display: block; font-size: 13px; color: #445; margin-bottom: 6px; }
.login-field input {
  width: 100%; box-sizing: border-box; height: 40px; padding: 0 12px;
  border: 1px solid #d4ddd5; border-radius: 7px; font-size: 14px; color: #223;
  background: #fbfdfb; outline: none;
}
.login-field input:focus { border-color: var(--brand, #2f7d4f); box-shadow: 0 0 0 3px rgba(47,125,79,.12); }
.login-captcha-row { display: flex; gap: 8px; }
.login-captcha-row input { flex: 1; min-width: 0; }
.login-captcha-row button {
  width: 120px; height: 40px; padding: 0; border: 1px solid #d4ddd5;
  border-radius: 7px; background: #fff; cursor: pointer; overflow: hidden; line-height: 0;
}
.login-captcha-row button:hover { border-color: var(--brand, #2f7d4f); }
.login-captcha-row button svg { width: 100%; height: 100%; }
.login-error { min-height: 18px; color: #c0392b; font-size: 12.5px; text-align: left; margin: 2px 0 6px; }
.login-submit {
  width: 100%; height: 42px; border: none; border-radius: 7px;
  background: var(--brand, #2f7d4f); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-submit:hover { filter: brightness(1.07); }
.login-submit:disabled { opacity: .6; cursor: wait; }
.login-foot { margin-top: 16px; font-size: 12px; color: #99a; }
.topbar .login-user { font-size: 12.5px; color: #556; margin-left: 10px; }
.topbar .login-logout {
  border: 1px solid #ccd6cd; background: #fff; color: #445; border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; margin-left: 8px;
}
.topbar .login-logout:hover { border-color: var(--brand, #2f7d4f); color: var(--brand, #2f7d4f); }

/* ===== 行政区域级联菜单（市/区县/乡镇/村/组 多列，2026-11-23） ===== */
.area-cascader { position: relative; }
.area-cascader .cascader { position: relative; }
.cascader-breadcrumb { cursor: pointer; background: #fff; color: var(--text, #24382b); }
/* 各页面行政区域选择框均可见，并在输入框中显示已选区域路径（2026-11-29 恢复） */
.field.area-cascader { display: flex; }
.page-filter .area-cascader .area-picker-input { width: 260px; }
.toolbar .area-cascader .area-picker-input { width: 230px; }
.cascader-breadcrumb::after {
  content: '▾'; float: right; color: #889; font-size: 12px; margin-left: 6px;
}
.cascader-panel {
  display: none; position: absolute; top: calc(100% + 4px); left: 0; z-index: 1200;
  min-width: 480px; max-width: 860px; background: #fff; border: 1px solid #dbe3da;
  border-radius: 10px; box-shadow: 0 10px 34px rgba(20, 50, 35, 0.16);
  overflow: hidden;
}
.area-cascader.open .cascader-panel,
.area-picker.open .cascader-panel { display: block; }
.cascader-toolbar {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-bottom: 1px solid #edf1ed; background: #f7faf7;
}
.cascader-all {
  border: 1px solid #d7e2d8; background: #fff; color: #345; border-radius: 6px;
  padding: 5px 12px; font-size: 12.5px; cursor: pointer; white-space: nowrap;
}
.cascader-all:hover { border-color: var(--brand, #2f7d4f); color: var(--brand, #2f7d4f); }
.cascader-search {
  flex: 1; min-width: 0; height: 30px; padding: 0 10px; border: 1px solid #d7e2d8;
  border-radius: 6px; font-size: 12.5px; outline: none; background: #fff;
}
.cascader-search:focus { border-color: var(--brand, #2f7d4f); }
.cascader-cols { display: flex; align-items: stretch; min-height: 240px; max-height: 340px; }
.cascader-col {
  width: 190px; max-height: 340px; overflow-y: auto; flex: 0 0 auto;
  border-right: 1px solid #eef1ee; padding: 6px 0;
}
.cascader-col:last-child { border-right: none; }
.cascader-item {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 8px 12px; font-size: 13px; color: #334; cursor: pointer; line-height: 1.4;
}
.cascader-item:hover { background: #f0f6f1; }
.cascader-item.active { background: #e7f1e9; color: var(--brand, #2f7d4f); font-weight: 600; }
.cascader-item.leaf:hover, .cascader-item.leaf.active { background: #e7f1e9; }
.cascader-arrow { color: #aab; font-size: 13px; }
.cascader-count {
  font-size: 11px; color: #678; background: #eef2ef; border-radius: 8px; padding: 1px 7px;
  white-space: nowrap;
}
.cascader-results { max-height: 300px; overflow-y: auto; padding: 6px 0; }
.cascader-results .cascader-item { padding-left: 14px; padding-right: 14px; }
.cascader-empty { padding: 18px; text-align: center; color: #99a; font-size: 12.5px; }
/* 面板自适应：屏幕窄时允许换行滚动 */
@media (max-width: 900px) {
  .cascader-cols { flex-wrap: wrap; }
  .cascader-col { width: 50%; }
}

/* —— 地块信息列表（下方表格） —— */
.list-table-wrap { padding: 8px 10px; overflow: auto; }
.list-table-title { font-size: 13px; font-weight: 600; color: #24402c; margin-bottom: 8px; }
.list-table-title .list-sel-count { font-weight: normal; color: #2f7d46; margin-left: 6px; }
.list-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.list-table th, .list-table td { border: 1px solid #e2eae4; padding: 5px 6px; text-align: left; white-space: nowrap; }
.list-table th { background: #f2f7f3; color: #3c5a46; font-weight: 600; }
.list-table td.li-code { font-family: Consolas, monospace; color: #556; }
.list-table td.li-ops { white-space: nowrap; }
.list-table .link-btn { border: none; background: transparent; color: #2563ab; cursor: pointer; padding: 0 4px; font-size: 12px; }
.list-table .link-btn:hover { text-decoration: underline; }
.list-table .li-input { border: 1px solid #d5e0d7; border-radius: 3px; padding: 2px 4px; font-size: 12px; width: 100%; box-sizing: border-box; }
.list-table .li-input:focus { border-color: #4a90d9; outline: none; }

/* —— 地块信息浮层（选中地块时弹出，截图样式表格） —— */
.parcel-dock .dock-refresh {
  margin-left: auto; border: none; background: none; cursor: pointer;
  font-size: 15px; color: var(--text-sub); padding: 0 4px;
}
.parcel-dock .dock-refresh:hover { color: var(--text); }
.parcel-dock .dock-close { margin-left: 0; }
.parcel-dock .parcel-dock-body { display: block; padding: 8px 14px 12px; overflow: auto; }
.parcel-dock .list-table { width: 100%; }
.parcel-dock .li-input { min-width: 70px; }

/* —— 承包方名称点击选择 / 字典下拉列 —— */
.list-table .li-cbf { color: #2563ab; font-size: 12px; }
.list-table .li-cbf:hover { text-decoration: underline; }
.list-table select.li-input { min-width: 110px; }
.list-table-wrap, .parcel-dock-body { overflow-x: auto; }

/* —— 选择变更的承包户弹窗 —— */
.cbf-pick-filter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.cbf-pick-filter input { border: 1px solid var(--border, #d5e0d7); border-radius: 4px; padding: 5px 8px; font-size: 13px; width: 150px; }

/* —— 拓扑检查结果行选择高亮 —— */
.topo-table tbody tr { cursor: pointer; }
.topo-table tbody tr:hover { background: #f0f7f0; }
.topo-table tbody tr.topo-row-selected { background: #d9edd9; box-shadow: inset 3px 0 0 #2e8b57; }
.topo-table th input[type=checkbox], .topo-table td input[type=checkbox] { width: 15px; height: 15px; cursor: pointer; margin: 0; }

/* —— 驾驶舱人员变更统计置于左侧列底部 —— */
.screen-col.left .change-panel { margin-top: auto; }

/* —— 拓扑检查结果滚动区：表头吸顶，结果多时可上下滑动选择 —— */
.topo-scroll { max-height: 52vh; overflow-y: auto; overscroll-behavior: contain; }
.topo-table thead th { position: sticky; top: 0; z-index: 2; background: #f5f8f5; }
.topo-table thead th:first-child { z-index: 3; }

/* —— 公示图制作 —— */
.pub-page { padding: 16px; display: flex; flex-direction: column; gap: 12px; height: 100%; box-sizing: border-box; }
.pub-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; background: #f5f8f5; border: 1px solid var(--border, #d5e0d7); border-radius: 8px; }
.pub-toolbar select { border: 1px solid var(--border, #d5e0d7); border-radius: 4px; padding: 5px 8px; min-width: 180px; }
.pub-meta { color: #456; font-size: 13px; margin-left: auto; }
.pub-body { flex: 1 1 auto; min-height: 320px; display: flex; flex-direction: column; gap: 8px; }
.pub-map-wrap { position: relative; flex: 1 1 auto; min-height: 300px; border: 1px solid var(--border, #d5e0d7); border-radius: 8px; overflow: hidden; }
.pub-map { width: 100%; height: 100%; min-height: 300px; }
.pub-hint { position: absolute; left: 10px; bottom: 10px; z-index: 5; background: rgba(255,255,255,.85); border-radius: 6px; padding: 5px 10px; font-size: 12px; color: #456; }
.pub-actions { display: flex; align-items: center; gap: 14px; }
.pub-tip { font-size: 12px; color: #678; }
.pub-preview { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 8px; border-top: 1px dashed var(--border, #d5e0d7); }
.pub-preview-item { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.pub-preview-title { font-weight: 600; font-size: 13px; }
.pub-preview-item canvas { max-width: 480px; max-height: 300px; border: 1px solid var(--border, #d5e0d7); border-radius: 6px; background: #fff; }
.pub-fields { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 8px 12px; background: #fff; border: 1px solid var(--border, #d5e0d7); border-radius: 8px; }
.pub-fields .field { display: flex; align-items: center; gap: 6px; }
.pub-fields label { font-size: 13px; color: var(--text-sub); white-space: nowrap; }
.pub-fields input[type=text] { border: 1px solid var(--border, #d5e0d7); border-radius: 4px; padding: 5px 8px; font-size: 13px; width: 190px; }
.pub-preview-item.a0 canvas { max-width: 760px; max-height: 560px; }
/* 公示图制作：不展示地图与地块；地图实例离屏保留，仅供生成 A0 时抓取卫星底图 */
.pub-note { padding: 12px 14px; background: #f7faf7; border: 1px solid var(--border, #d5e0d7); border-radius: 8px; font-size: 13px; line-height: 1.8; color: #456; }
