@charset "UTF-8";

/*
 * 简洁业务工作台主题
 * 参考 D:\归档 中 RuoYi 工作台的清晰层级：浅色导航、浅色工作区、白色内容卡片。
 * 本文件只覆盖视觉与排版，不改变任何功能节点、字段、按钮 ID 或交互事件。
 */
:root {
  /* 侧栏随桌面宽度调整，但文字字号不跟随视口缩放。 */
  --sidebar-open-width: clamp(292px, 17vw, 320px);
  --sb: var(--sidebar-open-width);
  --green: #2563eb;
  --green2: #3b82f6;
  --ui-primary: #2563eb;
  --ui-primary-soft: #eff6ff;
  --ui-sidebar: #f7f9fc;
  --ui-sidebar-deep: #edf3f9;
  --ui-canvas: #f3f6fa;
  --ui-card: #ffffff;
  --ui-line: #e2e8f0;
  --ui-text: #1e293b;
  --ui-muted: #64748b;
  --ui-radius: 8px;
}

/* 左侧菜单：所有一级项目保持横向，城市更新编辑与固定项目共用同一规格。 */
#sidebar {
  width: var(--sidebar-open-width);
  transform: translateX(calc(var(--sb) - var(--sidebar-open-width)));
  background: var(--ui-sidebar);
  border-right: 1px solid #d9e2ec;
  box-shadow: 2px 0 12px rgba(71, 85, 105, .1);
}
.sb-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 78px;
  padding: 17px 18px;
  gap: 10px;
  overflow: hidden;
  background: var(--ui-sidebar-deep);
  border-bottom: 1px solid #d9e2ec;
}
.sb-head::after { display: none; }
.sb-logo { height: 36px; }
.sb-name {
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  color: #1f3a56;
  font-size: 20px;
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: 0;
}
.sb-name #platformAgency {
  display: block;
  width: max-content;
  max-width: none;
  overflow: visible;
  white-space: nowrap;
  word-break: keep-all;
  text-overflow: clip;
}
.sb-name small { display: block; margin-top: 4px; color: #708399; font-size: 11px; }
.sb-citymark { color: #7f9fbd; opacity: .16; }
.sb-citymark path, .sb-citymark polyline, .sb-citymark line { stroke: #7896b3; }
.sb-citymark .city-fill { fill: rgba(120, 150, 179, .12); stroke: #7896b3; }
.sb-search {
  min-height: 38px;
  margin: 14px 14px 10px;
  padding: 8px 11px;
  background: #fff;
  border: 1px solid #d9e2ec;
  border-radius: 6px;
}
.sb-search input { color: #24364a; }
.sb-search input::placeholder { color: #91a0b1; }
.sb-search .ic { color: #60778f; opacity: .9; }
.sb-menu {
  flex: 1 1 auto;
  min-height: 0;
  gap: 2px;
  padding: 6px 10px 14px;
  overflow-y: auto;
}
.sb-menu > .grp { flex: none; border: 0; }
.sb-menu .grp-h,
.sb-menu .grp-h.menu-action,
#cityUpdateFeatureHost > .grp-h {
  display: flex;
  flex-direction: row;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 7px 9px;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #34495f;
  font: 500 14px/1.25 "Microsoft YaHei", sans-serif;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
}
.sb-menu .grp-h > span,
#cityUpdateFeatureHost > .grp-h > span {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sb-menu .grp-h > .menu-icon,
#cityUpdateFeatureHost > .grp-h > .menu-icon,
.grp-h.menu-action > i {
  order: 0;
  display: grid;
  flex: 0 0 28px;
  place-items: center;
  width: 28px;
  height: 28px;
  margin: 0;
  color: var(--ui-primary);
  font-size: 14px;
  font-style: normal;
  line-height: 1;
  background: #eaf2ff;
  border: 0;
  border-radius: 5px;
  transform: none;
}
.sb-menu .grp-h > .menu-caret,
#cityUpdateFeatureHost > .grp-h > .menu-caret {
  flex: 0 0 auto;
  margin-left: auto;
  color: #74879a;
  font-size: 17px;
  line-height: 1;
}
.sb-menu .grp-h:hover,
.sb-menu .grp-h.menu-action:hover,
.sb-menu .grp.open > .grp-h,
body:has(#statPanel:not(.hidden)) #statMenuBtn {
  color: #1f5faa;
  background: #eaf2fb;
  box-shadow: none;
}
.sb-menu .grp.open > .grp-h,
body:has(#statPanel:not(.hidden)) #statMenuBtn {
  background: #dfeafa;
}
.sb-menu .grp.open > .grp-h > .menu-icon,
body:has(#statPanel:not(.hidden)) #statMenuBtn > .menu-icon {
  color: var(--ui-primary);
  background: #dbeafe;
  border: 0;
}
/* 菜单图标在默认、悬停和选中状态下始终保持统一蓝色。 */
#sidebar .sb-menu .grp-h > .menu-icon,
#sidebar .sb-menu .grp:hover > .grp-h > .menu-icon {
  color: var(--ui-primary) !important;
  background: #eaf2ff !important;
}
#sidebar .sb-menu .grp.open > .grp-h > .menu-icon,
body:has(#statPanel:not(.hidden)) #statMenuBtn > .menu-icon {
  color: var(--ui-primary) !important;
  background: #dbeafe !important;
}
.grp.open > .grp-h .menu-caret { transform: rotate(90deg); }
.grp-b {
  margin: 3px 0 8px 14px;
  padding: 5px 5px 6px 14px;
  border-left: 1px solid #cfdae6;
}
.chip, .dnode, .rpt-item, .reno-row, .lyr, .std-row,
.dw-row > label, .dw-f span, .dw-tip, .fund, .lc-cap, .lc-sep {
  color: #51667c;
}
.chip:hover, .dnode:hover, .rpt-item:hover, .reno-row[data-levels]:hover,
.chip.on, .dnode.on, .prob.on, .reno-row.on {
  color: #174f91;
  background: #e7f0fb;
  outline-color: #c6d8eb;
}
.dw-row, .dw-f { align-items: flex-start; flex-direction: column; gap: 4px; }
.dw-row > label, .dw-f span { min-width: 0; }
.dw-row select, .dw-f input, .dw-f select, #dwWkt {
  width: 100%;
  min-height: 32px;
  border-color: #cbd8e5;
  border-radius: 5px;
  background: #fff;
}
.dw-btns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.dw-b, .dw-add-indicator, .dw-facade-actions button {
  min-height: 32px;
  color: #334155;
  background: #fff;
  border: 1px solid #dbe3ec;
  border-radius: 5px;
}
.dw-submit { min-height: 36px; border-radius: 5px; background: var(--ui-primary); }
.dw-indicator-title b, .dw-facade-row > span { color: #34495f; }
.dw-indicator-title span, .dw-facade-actions span, .dw-indicator-head, .dw-facade-head { color: #71849a; }
.dw-indicator-section, .dw-facade-section { border-color: #d9e2ec; }

/* 底部账号区是侧栏最后一项，保持紧凑，退出操作清晰可见。 */
#platformFooter { order: 2; flex: none; padding: 5px 16px; color: #8292a4; border: 0; }
#sbUser {
  order: 3;
  flex: none;
  margin: 5px 10px 10px;
  padding: 11px;
  border: 1px solid #d5e0eb;
  border-radius: 7px;
  background: var(--ui-sidebar-deep);
}
.sb-user-avatar { width: 36px; height: 36px; color: #fff; background: var(--ui-primary); box-shadow: none; }
.sb-user-name, .sb-user-meta b { color: #263b51; }
.sb-user-meta { color: #71849a; }
.sb-user-logout {
  margin-top: 9px;
  color: #425b73;
  background: #fff;
  border: 1px solid #cbd8e5;
  border-radius: 5px;
}
.sb-user-logout:hover { color: #1f5faa; background: #eaf2fb; border-color: #a9c2df; }

/* 地图工具：弱化装饰色，用统一白底工具条提高辨识度。 */
.ctlbtn, #sidebarToggle, #depthBtn, #mapSearch, #rightRail, #opacityCtl, #legend {
  background: rgba(255, 255, 255, .96);
  border: 1px solid #d8e1ec;
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, .12);
}
#depthBtn, #sidebarToggle {
  top: 16px;
  width: 40px;
  height: 40px;
  color: #334155;
  background: #fff;
  border: 1px solid #d8e1ec;
  border-radius: 7px;
  box-shadow: 0 4px 14px rgba(15,23,42,.12);
}
#depthBtn:hover, #sidebarToggle:hover { color: var(--ui-primary); background: var(--ui-primary-soft); }
#mapSearch { top: 16px; border-radius: 7px; overflow: visible; }
#searchType { background: #f8fafc; border-radius: 7px 0 0 7px; }
#rightRail { top: 70px; right: 16px; padding: 4px; gap: 2px; overflow: visible; }
#rightRail button { width: 38px; height: 38px; border: 0; border-radius: 5px; color: #475569; }
#rightRail button:hover, #rightRail button.on { color: var(--ui-primary); background: var(--ui-primary-soft); }
#bottomBar { color: #64748b; background: rgba(255,255,255,.95); border-color: #dce4ed; }

/* 所有大面板共用一致的工作区外观。 */
#statPanel, #exportPanel, #panel, #analysisCtl, #digCtl, #measureCtl,
#questionnaireQrCtl, #nearbyDrawer, #thematicInfo, .asset-modal-card {
  color: var(--ui-text);
  background: var(--ui-canvas);
  border: 1px solid #d8e1eb;
  border-radius: var(--ui-radius);
  box-shadow: 0 12px 34px rgba(15, 23, 42, .18);
}
.sp-head, .ex-head, .panel-head, .asset-modal-head, .nb-head, .theme-info-head {
  min-height: 58px;
  padding: 13px 18px;
  background: #fff;
  border-bottom: 1px solid var(--ui-line);
  border-radius: var(--ui-radius) var(--ui-radius) 0 0;
}
.sp-title b, .ex-title b, .panel-title, .asset-modal-head h2, .nb-head b { color: var(--ui-text); }
.sp-title span, .ex-title span, .panel-sub, .sp-city-section-head span { color: var(--ui-muted); }
.sp-titlemark, .ex-mark { width: 32px; height: 32px; color: #fff; background: var(--ui-primary); border-radius: 6px; }

/* 统计报表：标题、页签、查询条件、数据区明确分层。 */
#statPanel { top: 56px; bottom: 42px; }
.sp-tabs {
  align-self: flex-start;
  width: auto;
  max-width: calc(100% - 32px);
  margin: 12px 16px 0;
  padding: 3px;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
  background: #e9eef5;
}
.sp-tab { min-height: 34px; padding: 6px 15px; border-radius: 4px; color: #64748b; }
.sp-tab.on { color: var(--ui-primary); background: #fff; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.sp-filters, .ex-toolbar {
  margin: 12px 16px 0;
  padding: 11px 13px;
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
}
.sp-filters input[type=date], .sp-filters select, .ex-field select,
.recognition-unit-selector select, .recognition-evidence-toolbar select {
  border-color: #cfd9e5;
  border-radius: 5px;
}
.sp-filters input:focus, .sp-filters select:focus, .ex-field select:focus { border-color: var(--ui-primary); }
.sp-tblwrap { padding: 14px 16px 16px; }
.sp-tbl, .tbl, .net-tbl, .manual-detail-table { color: var(--ui-text); }
.sp-tbl th, .tbl th, .net-tbl th, .manual-detail-table th, .building-basic-table th {
  color: #475569;
  background: #f1f5f9;
  border-color: var(--ui-line);
  font-weight: 600;
}
.sp-tbl td, .tbl td, .net-tbl td, .manual-detail-table td { border-color: #e6ebf1; }
.sp-tbl tbody tr:nth-child(even) { background: #fafbfd; }
.sp-tbl tbody tr:hover { background: #f0f6ff; }
.sp-city, .sp-project-overview-scroll { padding: 16px; }
.sp-city-intro, .sp-global-indicators, .sp-city-card, .sp-qn-overall,
.recognition-evidence-gallery, .recognition-category, .recognition-unit-selector {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  box-shadow: none;
}
.sp-city-grid, .sp-project-overview-grid { gap: 12px; }
.recognition-group { margin-top: 14px; }
.recognition-group-title { padding: 9px 11px; background: #f8fafc; border: 1px solid var(--ui-line); border-bottom: 0; }
.recognition-group-title span, .sp-source, .recognition-category-head span {
  color: #245cad;
  background: #eaf2ff;
}
.recognition-table-wrap { border-color: var(--ui-line); border-radius: 0 0 7px 7px; }
.recognition-total-row { color: #1e3a5f; background: #eef5ff !important; }

/* 楼栋详情：从长内容流改为清晰的标题、属性卡、成果卡三级层次。 */
#panel {
  top: 14px;
  right: 14px;
  bottom: 14px;
  width: min(420px, calc(100vw - 28px));
  overflow: hidden;
}
.panel-head { position: sticky; top: 0; z-index: 2; border-left: 0; }
.panel-head::before { content: ""; position: absolute; left: 0; top: 13px; bottom: 13px; width: 3px; background: var(--ui-primary); }
.panel-close { top: 13px; right: 13px; width: 30px; height: 30px; border-radius: 5px; }
.panel-close:hover { color: var(--ui-primary); background: var(--ui-primary-soft); }
.panel-pad { height: calc(100% - 58px); padding: 14px; overflow-y: auto; }
.kv { gap: 8px; }
.building-asset-kv > div {
  min-height: 42px;
  padding: 9px 10px;
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 6px;
}
.building-asset-source { margin: 10px 0 4px; padding: 9px 10px; background: #eef2f6; border-radius: 6px; }
.sec { margin: 18px 0 9px; padding-left: 9px; color: var(--ui-text); border-left: 3px solid var(--ui-primary); }
.model-card, .model-empty, .building-recognition-group, .manual-detail-group,
.field-report-source, .qn-overall, .qn-category {
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  box-shadow: none;
}
.model-card { padding: 10px; }
.model-preview-btn, .qn-export, .rpt-link {
  color: #245cad;
  background: var(--ui-primary-soft);
  border-color: #bcd2f4;
  border-radius: 5px;
}
.building-recognition-title, .manual-detail-title {
  min-height: 38px;
  padding: 0 11px;
  background: #f8fafc;
  border-bottom: 1px solid var(--ui-line);
}
.building-recognition-title b, .manual-detail-title b { color: var(--ui-text); }
.building-recognition-title span, .manual-detail-title span {
  color: #245cad;
  background: #eaf2ff;
}
.building-recognition-total, .manual-detail-total,
.manual-detail-table .manual-detail-total td { color: #1e3a5f; background: #eef5ff; }
.manual-detail-table td:not(:first-child) { color: #243b53; }

/* 城市更新编辑：内容完全保留，仅把控件排列为易扫描的表单。 */
#cityUpdateFeatureHost .grp-b { padding-top: 8px; }
#cityUpdateFeatureHost .dw-form {
  display: grid;
  gap: 7px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #d9e2ec;
}
#cityUpdateFeatureHost .dw-f { margin: 0; }
#cityUpdateFeatureHost .dw-tip { padding: 6px 0; line-height: 1.55; }
#cityUpdateFeatureHost .dw-msg { color: #2864a8; }

/* 成果导出：沿用与统计报表相同的查询区 + 数据区布局。 */
#exportPanel { --ex-primary: var(--ui-primary); --ex-border: var(--ui-line); --ex-hover: var(--ui-primary-soft); }
.ex-tablebar { padding: 11px 16px 0; }
#exTableWrap { margin: 10px 16px 14px; padding: 10px; border-color: var(--ui-line); border-radius: 6px; }
.ex-grid { gap: clamp(6px, .55vw, 12px); }
.ex-card { min-height: 42px; padding: 9px 11px; border-color: var(--ui-line); border-radius: 5px; background: #fff; }
.ex-card:hover, .ex-card.on { background: var(--ui-primary-soft); border-color: #94b8ed; }
#exExport { background: var(--ui-primary); border-radius: 5px; }

/* 保留原悬浮卡片外观，仅等比例减少外边距，让菜单功能页适度放大。 */
@media (min-width: 761px) {
  #statPanel:not(.hidden),
  #exportPanel:not(.hidden) {
    left: calc(var(--sb) + 12px);
    right: 12px;
    top: 30px;
    bottom: 28px;
    width: auto;
  }
}

@media (min-width: 1000px) {
  #mapSearch, body.collapsed #mapSearch {
    top: 16px;
    left: calc(var(--sb) + (100% - var(--sb)) / 2);
    width: min(440px, calc(100vw - var(--sb) - 220px));
    transform: translateX(-50%);
  }
  #sidebarToggle, #depthBtn { top: 16px; }
}

@media (max-width: 760px) {
  :root { --sidebar-open-width: min(292px, 86vw); }
  #sidebar { width: var(--sidebar-open-width); }
  #panel { top: 8px; right: 8px; bottom: 8px; width: calc(100vw - 16px); }
  .panel-pad { padding: 11px; }
  .building-asset-kv { grid-template-columns: 1fr 1fr; }
  .sp-filters, .ex-toolbar { margin-inline: 10px; }
  .sp-tblwrap { padding: 10px; }
}

/* 城市更新入口使用稳定的矢量楼宇图标，避免特殊字符在不同电脑上缺字。 */
.city-update-menu-icon svg {
  display: block;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/*
 * 统计工作台布局重构：参照归档项目的 toolbar + workspace 模式。
 * 一级视图放到左侧导航，筛选条与正文位于右侧，不再是从上到下堆叠。
 */
@media (min-width: 761px) {
  #statPanel:not(.hidden) {
    display: grid;
    grid-template-columns: 154px minmax(0, 1fr);
    grid-template-rows: 60px auto minmax(0, 1fr);
  }
  #statPanel .sp-head {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
  }
  #statPanel .sp-tabs {
    grid-column: 1;
    grid-row: 2 / 4;
    align-self: stretch;
    align-content: start;
    display: flex;
    flex-direction: column;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 17px 10px;
    gap: 5px;
    background: #f8fafc;
    border: 0;
    border-right: 1px solid var(--ui-line);
    border-radius: 0;
  }
  #statPanel .sp-tabs::before {
    content: "数据视图";
    display: block;
    padding: 0 9px 8px;
    color: #94a3b8;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .08em;
  }
  #statPanel .sp-tab {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    min-height: 39px;
    padding: 0 11px;
    color: #526177;
    text-align: left;
    border-radius: 5px;
  }
  #statPanel .sp-tab::before {
    content: "";
    flex: 0 0 6px;
    width: 6px;
    height: 6px;
    margin-right: 9px;
    border: 1px solid #9cacbf;
    border-radius: 50%;
  }
  #statPanel .sp-tab:hover:not(.on) { color: #1e293b; background: #edf2f7; }
  #statPanel .sp-tab.on {
    color: #1d4ed8;
    background: #eaf2ff;
    box-shadow: none;
    font-weight: 650;
  }
  #statPanel .sp-tab.on::before { background: var(--ui-primary); border-color: var(--ui-primary); }
  #statPanel .sp-filters {
    grid-column: 2;
    grid-row: 2;
    min-width: 0;
    margin: 12px 14px 0;
  }
  #statPanel .sp-tblwrap {
    grid-column: 2;
    grid-row: 3;
    min-width: 0;
    padding: 12px 14px 16px;
  }
}

/* 识别结果正文：摘要工具条、指标区、基础数据和识别表形成独立工作区。 */
#statPanel .sp-city {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
}
#statPanel .sp-city-intro {
  flex: none;
  min-height: 58px;
  margin: 0;
  padding: 10px 13px;
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
}
#statPanel .sp-city-intro b { font-size: 15px; }
#statPanel .sp-city-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}
#statPanel .sp-global-indicators,
#statPanel .sp-health-report,
#statPanel .sp-city-recognition,
#statPanel .sp-city-questionnaire {
  flex: none;
  margin: 0;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
}
#statPanel .sp-health-report,
#statPanel .sp-city-recognition,
#statPanel .sp-city-questionnaire {
  margin-top: 0;
  padding-top: 14px;
}
#statPanel .sp-health-summary { color: #475569; font-size: 12px; line-height: 1.7; }
#statPanel .sp-health-export { background: var(--ui-primary); }
#statPanel .sp-health-export:hover { background: #1d4ed8; }
#statPanel .sp-city-section-head {
  min-height: 37px;
  margin: -2px 0 10px;
  padding-bottom: 9px;
  border-bottom: 1px solid #edf1f5;
}
#statPanel .sp-city-section-head b { font-size: 14px; }
#statPanel .sp-city-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  min-width: 0;
  gap: 10px;
}
/* 项目全域指标固定5列：五个指标卡片始终同一行 */
#statPanel .sp-project-overview-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
#statPanel .sp-project-overview-scroll { overflow: visible; padding: 0; }
#statPanel .sp-city-card {
  min-width: 0;
  min-height: 138px;
  padding: 13px 14px;
  background: #fbfcfe;
  overflow: hidden;
}
#statPanel .sp-city-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  justify-items: start;
  gap: 6px;
  min-height: 46px;
  color: #475569;
  font-size: 12px;
}
#statPanel .sp-source {
  max-width: 100%;
  padding: 3px 7px;
  text-align: left;
  white-space: normal;
}
#statPanel .sp-city-card strong {
  margin: 5px 0 8px;
  color: #172033;
  font-size: clamp(21px, 2vw, 29px);
  white-space: normal;
}
#statPanel .sp-city-card p { min-height: 0; font-size: 10.5px; }
#statPanel .recognition-group {
  padding: 0;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
  overflow: hidden;
}
#statPanel .recognition-group-title {
  min-height: 43px;
  margin: 0;
  padding: 8px 11px;
  border: 0;
  border-bottom: 1px solid var(--ui-line);
  background: #f8fafc;
}
#statPanel .recognition-table-wrap { border: 0; border-radius: 0; }
#statPanel .building-basic-table { border: 1px solid var(--ui-line); border-radius: 7px; }

/* 右侧详情页也采用“摘要 + 内容分组”布局，不再只有换色和描边。 */
#panel .panel-pad > .kv:first-child,
#panel .building-asset-kv {
  padding: 10px;
  background: #f8fafc;
  border: 1px solid var(--ui-line);
  border-radius: 7px;
}
#panel .model-card-list { display: grid; grid-template-columns: 1fr; gap: 7px; }
#panel .building-recognition-group,
#panel .manual-detail-group { margin-top: 8px; }
#panel .qn-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

@media (max-width: 980px) and (min-width: 761px) {
  #statPanel:not(.hidden) { grid-template-columns: 126px minmax(0, 1fr); }
  #statPanel .sp-city-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 项目全域指标不降列：任何窗口宽度都保持5列一行 */
}

@media (max-width: 760px) {
  #statPanel:not(.hidden) { display: flex; flex-direction: column; }
  #statPanel .sp-tabs {
    display: flex;
    flex-direction: row;
    width: calc(100% - 20px);
    max-width: none;
    margin: 9px 10px 0;
    overflow-x: auto;
  }
  #statPanel .sp-tab { flex: 0 0 auto; }
  #statPanel .sp-tblwrap { padding: 9px 10px 12px; }
  #statPanel .sp-city-grid { grid-template-columns: 1fr; }
  /* 项目全域指标不降列：任何窗口宽度都保持5列一行 */
  #statPanel .sp-city-intro { align-items: flex-start; flex-direction: column; }
  #statPanel .sp-city-actions { justify-content: flex-start; }
}

/* 两个搜索属于不同作用域：菜单筛选与地图对象检索明确分组。 */
.sb-search-label {
  flex: none;
  padding-right: 9px;
  color: #c7d4e3;
  border-right: 1px solid rgba(255,255,255,.15);
  font-size: 11px;
  font-weight: 650;
}
#mapSearch {
  min-height: 42px;
  overflow: hidden;
}
.map-search-label {
  display: flex;
  align-items: center;
  align-self: stretch;
  flex: none;
  padding: 0 12px;
  color: #526177;
  background: #f8fafc;
  border-right: 1px solid #e2e8f0;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
#mapSearch #searchType {
  flex: none;
  min-width: 112px;
  border-right: 1px solid #e2e8f0;
  border-radius: 0;
}
#mapSearch #searchInput {
  flex: 1 1 auto;
  width: auto;
  min-width: 170px;
}
@media (min-width: 1000px) {
  #mapSearch, body.collapsed #mapSearch {
    width: min(520px, calc(100vw - var(--sb) - 220px));
  }
}

/*
 * 城市更新图标使用 CSS 兜底生成：即使浏览器缓存了旧版 JS 模板，
 * 入口前仍会显示与其他菜单相同尺寸的楼宇图标。
 */
#cityUpdateFeatureHost > .grp-h > .city-update-menu-icon { display: none !important; }
#cityUpdateFeatureHost > .grp-h::before {
  content: "";
  display: block;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  margin: 0;
  border-radius: 5px;
  background-color: #eaf2ff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V9l5-3v14M9 20V4l7 3v13M16 20v-8l4-2v10M2 20h20M12 8h1M12 11h1M12 14h1M6 11h1M6 14h1M18 14h1M18 17h1'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 17px 17px;
}
#cityUpdateFeatureHost.open > .grp-h::before {
  background-color: #dbeafe;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232563eb' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 20V9l5-3v14M9 20V4l7 3v13M16 20v-8l4-2v10M2 20h20M12 8h1M12 11h1M12 14h1M6 11h1M6 14h1M18 14h1M18 17h1'/%3E%3C/svg%3E");
}

@media (max-width: 760px) {
  .map-search-label { display: none; }
  #mapSearch #searchType { min-width: 102px; }
}

/* 恢复原版地图搜索位置与显示内容；菜单筛选节点保留给旧脚本，但不再显示。 */
.sb-search { display: none !important; }
#mapSearch,
body.collapsed #mapSearch {
  top: 14px;
  left: calc(var(--sb) + 66px);
  width: auto;
  min-height: 0;
  transform: none;
  overflow: visible;
  transition: left .25s, opacity .16s, visibility .16s;
}
body.collapsed #mapSearch { left: 114px; }
#mapSearch #searchType {
  min-width: 0;
  padding: 11px 10px;
  background: #f4f6f5;
  border: 0;
  border-radius: 7px 0 0 7px;
}
#mapSearch #searchInput {
  flex: none;
  width: 280px;
  min-width: 0;
  padding: 11px 12px;
}

@media (max-width: 760px) {
  #mapSearch #searchInput { width: min(210px, calc(100vw - 235px)); }
}

/* 管网图例的折叠箭头默认不出现；管网加载成功后再显示，清除管网时同步隐藏。 */
#legend { display: none !important; }
body.network-legend-ready #legend:not([hidden]) { display: block !important; }

/*
 * 独立菜单页面打开时进入专注显示：保留左侧菜单和页面原有尺寸，
 * 仅暂时隐藏三维地图主页的小组件；关闭页面后由 :has 状态自动恢复。
 */
body:has(#statPanel:not(.hidden)) :is(
  #mapSearch, #rightRail, #opacityCtl, #legend, #bottomBar,
  #sidebarToggle, #depthBtn, #panel
),
body:has(#exportPanel:not(.hidden)) :is(
  #mapSearch, #rightRail, #opacityCtl, #legend, #bottomBar,
  #sidebarToggle, #depthBtn, #panel
) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* JS 显式专注状态：强制隐藏，解决旧浏览器或缓存页面中 :has() 未及时生效。 */
body.menu-page-focus :is(
  #mapSearch, #rightRail, #opacityCtl, #legend, #bottomBar,
  #sidebarToggle, #depthBtn, #panel
) {
  display: none !important;
}

/* 独立民意问卷页与其它左侧菜单功能保持一致的选中状态和专注模式。 */
body:has(#questionnairePanel:not(.hidden)) #questionnaireMenuBtn {
  color: #1d4ed8;
  background: #dce9fb;
}
body:has(#questionnairePanel:not(.hidden)) #questionnaireMenuBtn > .menu-icon {
  color: #2563eb;
  background: #edf4ff;
}
body:has(#questionnairePanel:not(.hidden)) :is(
  #mapSearch, #rightRail, #opacityCtl, #legend, #bottomBar,
  #sidebarToggle, #depthBtn, #panel
) {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 南川建委专属紧凑字号；不影响江北城发及其它项目。 */
body[data-project="nanchuanjianwei"] :is(button, input, select, textarea) { font-size: 12px; }
body[data-project="nanchuanjianwei"] #sidebar { font-size: 12px; }
body[data-project="nanchuanjianwei"] #sidebar .grp-h { font-size: 13px; }
body[data-project="nanchuanjianwei"] :is(#statPanel, #exportPanel, #questionnairePanel) { font-size: 12px; }
body[data-project="nanchuanjianwei"] #statPanel .sp-title b,
body[data-project="nanchuanjianwei"] #exportPanel .ex-title b,
body[data-project="nanchuanjianwei"] #questionnairePanel .qn-panel-title b { font-size: 18px; }
body[data-project="nanchuanjianwei"] #statPanel .sp-city-intro b { font-size: 14px; }
body[data-project="nanchuanjianwei"] #statPanel .sp-city-card strong { font-size: 25px; }
body[data-project="nanchuanjianwei"] #statPanel :is(th, td),
body[data-project="nanchuanjianwei"] #exportPanel :is(th, td) { font-size: 11px; }

/*
 * 稳定字号：布局可以随窗口重排，文字不使用 vw 缩放。
 * 同时关闭移动端浏览器的自动文字放大，保证大小屏显示口径一致。
 */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.login-visual-copy h1 { font-size: 32px; }
#statPanel .sp-city-card strong { font-size: clamp(17px, 1.45vw, 22px); }
.sp-tbl.recognition-matrix th,
.sp-tbl.recognition-matrix td { font-size: 11px; }
.facade-metrics-table { font-size: 12px; }
