/* =========================================================
   深圳模型系统 · 浮层式三维沙盘
   版式参照 sunlight-3d 系统：全屏场景 + 顶部栏 + 悬浮侧栏 + 底部时间轴
   ========================================================= */

:root {
  /* 深色专业版：对齐 sunlight-3d-new.html 的深蓝玻璃面板 */
  --bg: #0a1220;
  --panel: rgba(15, 25, 45, .90);
  --panel-solid: #101a2c;
  --panel-2: rgba(255, 255, 255, .045);
  --input-bg: rgba(8, 16, 30, .72);
  --border: rgba(100, 180, 255, .20);
  --border-strong: rgba(100, 180, 255, .30);
  --text: #e8eefc;
  --text-2: #9fb6d4;
  --text-3: #6f8fb0;
  --primary: #4f9cf9;
  --primary-soft: rgba(79, 156, 249, .16);
  --accent: #e2a33c;
  --green: #4bb27f;
  --shadow: 0 10px 34px rgba(0, 0, 0, .45);
  --shadow-sm: 0 3px 12px rgba(0, 0, 0, .35);
  --radius: 12px;
  --left-w: 262px;
  --right-w: 304px;
  --top-h: 58px;
  --blur: saturate(140%) blur(14px);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0; width: 100%; height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  -webkit-font-smoothing: antialiased;
}

button, input { font-family: inherit; }
button { cursor: pointer; }

/* ---------- 全屏舞台 ---------- */
.stage {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, #0e1b2e 0%, #0a1424 55%, #070f1c 100%);
  overflow: hidden;
}
.view { position: absolute; inset: 0; }
.view.hidden { display: none; }
#view3d canvas { display: block; width: 100%; height: 100%; }

/* ---------- 顶部栏 ---------- */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  height: var(--top-h);
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .96) 0%, rgba(255, 255, 255, .74) 68%, rgba(255, 255, 255, 0) 100%);
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }

.brand { display: flex; align-items: center; gap: 10px; flex: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg, #1f6f4a, #34a06a);
  position: relative; flex: none;
  box-shadow: 0 3px 10px rgba(31, 111, 74, .28);
}
.brand-mark::before, .brand-mark::after {
  content: ''; position: absolute; background: var(--panel); border-radius: 1.5px;
}
.brand-mark::before { left: 7px; top: 8px; width: 7px; height: 7px; transform: rotate(45deg); }
.brand-mark::after  { left: 13px; top: 15px; width: 10px; height: 7px; }
.brand-title { font-size: 15px; font-weight: 700; letter-spacing: .4px; line-height: 1.15; }
.brand-sub { font-size: 10.5px; color: var(--text-3); letter-spacing: .3px; margin-top: 2px; }

.topbar-tabs {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 2px;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.vtab {
  border: none; background: transparent; color: var(--text-2);
  font-size: 12px; font-weight: 600; padding: 6px 15px; border-radius: 7px;
  transition: background .16s, color .16s;
}
.vtab:hover { background: var(--primary-soft); color: var(--primary); }
.vtab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(37, 99, 235, .3); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.weather-chip {
  font-size: 11px; color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 11px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.badge {
  font-size: 10.5px; padding: 3px 9px; border-radius: 20px;
  background: var(--primary-soft); color: var(--primary); font-weight: 600;
}
.badge.gray { background: var(--panel-2); color: var(--text-2); }

/* 云端同步状态（只有「云端项目」才显示） */
.cloud-tag {
  font-size: 10.5px; padding: 3px 9px; border-radius: 20px; font-weight: 600;
  white-space: nowrap; border: 1px solid transparent;
}
.cloud-tag.ok { background: rgba(46, 160, 100, .12); color: #1f8a55; border-color: rgba(46, 160, 100, .28); }
.cloud-tag.busy { background: rgba(230, 168, 40, .14); color: #a9741b; border-color: rgba(230, 168, 40, .3); }
.cloud-tag.err { background: rgba(214, 74, 60, .12); color: #c0392b; border-color: rgba(214, 74, 60, .3); cursor: help; }

/* ---------- 顶部提示条 ---------- */
.hint-line {
  position: absolute; top: calc(var(--top-h) - 4px); left: 50%; transform: translateX(-50%);
  z-index: 15;
  font-size: 11px; color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 20px; padding: 4px 14px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  white-space: nowrap; max-width: calc(100vw - 640px);
  overflow: hidden; text-overflow: ellipsis;
  pointer-events: none;
}

/* ---------- 悬浮侧栏 ---------- */
.dock {
  position: absolute; z-index: 12;
  top: calc(var(--top-h) + 14px); bottom: 44px;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: auto;
  overflow-y: auto; overflow-x: hidden;
}
.dock::-webkit-scrollbar { width: 5px; }
.dock::-webkit-scrollbar-thumb { background: rgba(188, 200, 216, .85); border-radius: 4px; }
.dock::-webkit-scrollbar-track { background: transparent; }
.dock > * { flex: none; }
.dock > .card-grow { flex: 1 1 auto; }
.dock-left { left: 12px; width: var(--left-w); }
.dock-right { right: 12px; width: var(--right-w); }

.card {
  pointer-events: auto;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .85);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
  flex: none;
  min-height: 0;
}
.card-grow { flex: 1 1 auto; display: flex; flex-direction: column; }

.card-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 9px 12px 7px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.card-title {
  font-size: 11px; font-weight: 700; color: var(--text-2);
  letter-spacing: .8px;
}
.card-meta { font-size: 10px; color: var(--text-3); font-weight: 500; }

.card-body { padding: 10px 12px 12px; min-height: 0; }
.card-grow > .card-body { overflow: hidden; }

/* 数据说明折叠卡 */
.card-note { flex: none; }
.card-note > summary { list-style: none; cursor: pointer; }
.card-note > summary::-webkit-details-marker { display: none; }
.card-note[open] > summary { border-bottom: 1px solid var(--border); }
.card-note > summary .card-meta::after { content: ' ▾'; }
.card-note .note { max-height: 168px; overflow-y: auto; }

/* ---------- 片区卡 ---------- */
.district-card {
  border: 1px solid var(--border-strong);
  border-radius: 9px; padding: 9px 10px;
  background: var(--panel-2);
  margin-bottom: 7px;
}
.district-card.active {
  border-color: var(--primary);
  background: linear-gradient(180deg, rgba(79,156,249,.18), rgba(79,156,249,.10));
  box-shadow: inset 0 0 0 1px rgba(79, 156, 249, .25);
}
.district-card .dc-name { font-weight: 700; font-size: 12.5px; display: flex; align-items: center; gap: 6px; }
.district-card .dc-meta { font-size: 10.5px; color: var(--text-2); margin-top: 4px; line-height: 1.55; }
.district-card .dc-tags { margin-top: 7px; display: flex; gap: 4px; flex-wrap: wrap; }
.tag {
  font-size: 9.5px; padding: 2px 6px; border-radius: 4px;
  background: rgba(120, 160, 210, .16); color: var(--text-2);
}
.district-card.active .tag { background: rgba(79, 156, 249, .22); color: #9ecbff; }

.dc-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--primary); flex: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .16);
}

.planned-block { margin-top: 9px; }
.planned-title { font-size: 10px; color: var(--text-3); margin-bottom: 5px; letter-spacing: .5px; }
.planned-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; color: var(--text-3); padding: 5px 2px;
  border-bottom: 1px dashed rgba(227, 233, 242, .9);
}
.planned-row:last-child { border-bottom: none; }
.planned-row .p-status { font-size: 9.5px; color: var(--text-3); background: #f1f4f9; padding: 1px 6px; border-radius: 4px; }

/* ---------- 图层开关 ---------- */
.layer-row {
  display: flex; align-items: center; gap: 8px;
  padding: 5px 3px; cursor: pointer; user-select: none;
  border-radius: 6px;
  transition: background .14s;
}
.layer-row:hover { background: rgba(79, 156, 249, .12); }
.layer-row input { display: none; }
.switch {
  width: 27px; height: 15px; border-radius: 9px; background: #d5dce8;
  position: relative; flex: none; transition: background .18s;
}
.switch::after {
  content: ''; position: absolute; left: 2px; top: 2px;
  width: 11px; height: 11px; border-radius: 50%; background: var(--input-bg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .18); transition: transform .18s;
}
.layer-row input:checked + .switch { background: var(--primary); }
.layer-row input:checked + .switch::after { transform: translateX(12px); }
.layer-name { flex: 1; font-size: 11.5px; color: var(--text); }
.layer-swatch { width: 7px; height: 7px; border-radius: 2px; flex: none; opacity: .9; }

/* ---------- 图例 ---------- */
.legend-static {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 6px;
  font-size: 10.5px; color: var(--text-2);
}
.legend-item { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; }
.legend-dot { width: 8px; height: 8px; border-radius: 2px; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text-2);
  border-radius: 7px; padding: 6px 9px; font-size: 11px; font-weight: 500;
  transition: all .15s; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: #1d54d0; color: #fff; }
.btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.wide { width: 100%; }
.btn-row { display: flex; gap: 6px; }
.btn-row .btn { flex: 1; min-width: 0; }

/* ---------- 微型滑块（昼夜） ---------- */
.mini-range {
  width: 100%; margin: 2px 0 0; height: 4px;
  accent-color: var(--primary); cursor: pointer;
}
.mini-ticks {
  display: flex; justify-content: space-between;
  font-size: 9px; color: var(--text-3); margin-top: 3px;
}

/* ---------- 右栏：当前片区 ---------- */
.si-main { font-size: 19px; font-weight: 700; letter-spacing: .4px; }
.si-sub { font-size: 10.5px; color: var(--text-2); margin-top: 4px; line-height: 1.5; }
.si-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.si-chip {
  font-size: 10px; color: var(--text-2);
  background: var(--panel-2);
  border: 1px solid rgba(226, 233, 242, .9);
  border-radius: 6px; padding: 3px 7px;
}
.si-chip b { color: var(--text); font-size: 11px; }
.si-grid {
  margin-top: 9px; padding-top: 8px;
  border-top: 1px dashed rgba(226, 233, 242, .95);
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px;
  font-size: 10.5px; color: var(--text-3);
}
.si-grid div { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.si-grid b { color: var(--text); font-size: 11px; font-weight: 600; }

/* ---------- 统计行 ---------- */
.stat-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px; color: var(--text-2);
  padding: 5px 0; border-bottom: 1px dashed rgba(226, 233, 242, .85);
}
.stat-row:last-child { border-bottom: none; }
.stat-row b { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---------- 详情 ---------- */
.card-detail { flex: none; }
#detailCard { overflow-y: auto; max-height: 190px; }
.detail-empty {
  text-align: center; padding: 18px 8px; color: var(--text-3); font-size: 11px; line-height: 1.9;
}
.detail-head { display: flex; align-items: flex-start; gap: 8px; }
.detail-dot { width: 10px; height: 10px; border-radius: 3px; margin-top: 4px; flex: none; }
.detail-name { font-size: 13px; font-weight: 700; line-height: 1.4; }
.detail-type { font-size: 10px; color: var(--text-2); margin-top: 3px; }

.kv { display: grid; grid-template-columns: 62px 1fr; gap: 6px 8px; margin-top: 10px; font-size: 10.5px; }
.kv .k { color: var(--text-3); }
.kv .v { color: var(--text); word-break: break-all; line-height: 1.5; }
.kv .v.accent { color: var(--primary); font-weight: 600; }
.v-real { color: var(--green); font-weight: 700; }

/* ---------- 地点列表 ---------- */
.filter-row { display: flex; gap: 4px; flex-wrap: wrap; }
.chip {
  font-size: 9.5px; padding: 3px 7px; border-radius: 20px;
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text-2);
  transition: all .14s;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

.poi-list {
  pointer-events: auto;
  overflow-y: auto; flex: 1 1 auto; min-height: 60px;
  padding: 4px 8px 8px;
}
.poi-list::-webkit-scrollbar, #detailCard::-webkit-scrollbar, .card-note .note::-webkit-scrollbar { width: 6px; }
.poi-list::-webkit-scrollbar-thumb, #detailCard::-webkit-scrollbar-thumb, .card-note .note::-webkit-scrollbar-thumb {
  background: rgba(190, 202, 218, .85); border-radius: 4px;
}
.poi-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 7px; border-radius: 6px; cursor: pointer;
  transition: background .14s;
}
.poi-item + .poi-item { border-top: 1px solid rgba(241, 244, 248, .95); }
.poi-item:hover { background: rgba(79, 156, 249, .12); }
.poi-item.selected { background: var(--primary-soft); }
.poi-item.selected .pi-name { color: var(--primary); font-weight: 600; }
.poi-item .pi-dot { width: 6px; height: 6px; border-radius: 2px; flex: none; }
.poi-item .pi-name { flex: 1; font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poi-item .pi-d { font-size: 9.5px; color: var(--text-3); flex: none; font-variant-numeric: tabular-nums; }

/* ---------- 底部时间条 ---------- */
.timebar {
  position: absolute; z-index: 16;
  left: 50%; transform: translateX(-50%);
  bottom: 44px;
  width: min(560px, calc(100vw - var(--left-w) - var(--right-w) - 80px));
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: var(--input-bg);
  border: 1px solid rgba(255, 255, 255, .9);
  border-radius: 14px;
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.tb-left { display: flex; align-items: center; gap: 8px; flex: none; }
.tb-sun {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; background: linear-gradient(135deg, #fff3d6, #ffe1a8);
  color: #b07507;
}
.tb-label { font-size: 9.5px; color: var(--text-3); letter-spacing: .3px; }
.tb-left b { font-size: 15px; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.tb-main { flex: 1; min-width: 0; }
#timeSlider {
  width: 100%; margin: 0; height: 5px;
  accent-color: var(--primary); cursor: pointer;
}
.tb-ticks {
  display: flex; justify-content: space-between;
  font-size: 8.5px; color: var(--text-3); margin-top: 4px;
}
.tb-play {
  flex: none; width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text-2);
  font-size: 10px; display: flex; align-items: center; justify-content: center;
}
.tb-play.playing { background: var(--primary); border-color: var(--primary); color: #fff; }
.tb-phase {
  flex: none; font-size: 10px; padding: 3px 9px; border-radius: 20px;
  background: rgba(120, 160, 210, .16); color: var(--text-2);
}

/* ---------- 底栏 ---------- */
.footer {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 10;
  height: 30px;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  font-size: 9.5px; color: #94a2b6;
  background: linear-gradient(0deg, rgba(255, 255, 255, .82), rgba(255, 255, 255, 0));
  pointer-events: none;
}
.footer .f-right { margin-left: auto; }

/* ---------- 地图视图提示 ---------- */
.map-notice {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: #eef3fa; z-index: 5; padding: 30px;
}
.map-notice.hidden { display: none; }
.map-notice-inner {
  max-width: 420px; background: var(--input-bg); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px; text-align: center; box-shadow: var(--shadow);
}
.map-notice h3 { margin: 0 0 10px; font-size: 15px; }
.map-notice p { margin: 0; font-size: 12px; color: var(--text-2); line-height: 1.8; }

/* ---------- 顶部小按钮 ---------- */
.top-btn {
  font-size: 11px; color: var(--text-2);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 5px 10px;
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  transition: all .15s;
}
.top-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.top-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 楼栋参数面板 ---------- */
.bld-panel {
  position: absolute; z-index: 18;
  left: calc(var(--left-w) + 24px); bottom: 96px;
  width: 272px;
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 14px;
  box-shadow: 0 14px 36px rgba(24, 43, 78, .18);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  display: none;
}
.bld-panel.show { display: block; animation: bpIn .18s ease-out; }
@keyframes bpIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
/* 精修面板内容较长：限高滚动，头部保持可见 */
.bld-panel { max-height: calc(100vh - 180px); overflow-y: auto; overscroll-behavior: contain; }
.bld-panel::-webkit-scrollbar { width: 6px; }
.bld-panel::-webkit-scrollbar-thumb { background: rgba(120, 150, 190, .35); border-radius: 3px; }

.bp-head {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 3;
  background: var(--panel);
  border-radius: 14px 14px 0 0;
}
.bp-title { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; color: var(--text-2); }
.bp-id { margin-left: auto; font-size: 9.5px; color: var(--text-3); }
.bp-close {
  border: none; background: transparent; font-size: 16px; line-height: 1;
  color: var(--text-3); padding: 0 2px;
}
.bp-close:hover { color: var(--text); }

.bp-body { padding: 10px 12px 12px; }
.bp-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.bp-row label { width: 50px; font-size: 10.5px; color: var(--text-3); flex: none; }
.bp-row input[type="text"], .bp-row input[type="number"] {
  flex: 1; min-width: 0;
  border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 5px 8px; font-size: 11.5px; color: var(--text); background: var(--input-bg); outline: none;
}
.bp-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.bp-unit { font-size: 10.5px; color: var(--text-3); flex: none; width: 14px; }
.bp-row-color { align-items: flex-start; }
.bp-colors { display: flex; gap: 5px; flex-wrap: wrap; flex: 1; }
.bp-color {
  width: 17px; height: 17px; border-radius: 5px;
  border: 2px solid transparent; cursor: pointer; flex: none;
  transition: transform .12s;
}
.bp-color:hover { transform: scale(1.12); }
.bp-color.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .18); }

.bp-summary {
  font-size: 10px; color: var(--text-3); line-height: 1.55;
  background: var(--panel-2);
  border-radius: 6px; padding: 6px 8px; margin: 2px 0 9px;
}
.bp-summary b { color: var(--text-2); }
.bp-actions { display: flex; gap: 6px; }
.bp-actions .btn { flex: 1; padding: 6px 4px; font-size: 10.5px; }
.btn.danger { color: #b91c1c; border-color: #f0c6c6; background: var(--input-bg); }
.btn.danger:hover { background: #fef2f2; border-color: #ef4444; color: #b91c1c; }

/* ---------- 后续片区折叠 ---------- */
.planned-fold { margin-top: 8px; }
.planned-fold > summary {
  list-style: none; cursor: pointer;
  font-size: 10px; color: var(--text-3); letter-spacing: .4px;
  display: flex; align-items: center; gap: 4px;
}
.planned-fold > summary::-webkit-details-marker { display: none; }
.planned-fold > summary::before { content: '▸'; font-size: 8px; }
.planned-fold[open] > summary::before { content: '▾'; }

/* ---------- 矮屏：收起次要卡片，保证主卡不被裁 ---------- */
@media (max-height: 940px) {
  .card-note { display: none !important; }
  .card-stat { display: none !important; }
  .dock-left .district-card .dc-meta { display: none; }
  /* 收紧左栏密度，保证矮屏下四张卡完整可见 */
  .dock-left .card-head { padding: 7px 10px 6px; }
  .dock-left .card-body { padding: 7px 10px 8px; }
  .dock-left .layer-row { padding: 3px 3px; }
  .dock-left .legend-static { gap: 4px 6px; font-size: 10px; }
  .dock-left .btn-row .btn { padding: 4px 5px; font-size: 10px; }
  .dock-left .district-card { padding: 7px 8px; margin-bottom: 5px; }
  .timebar { bottom: 38px; padding: 8px 12px; }
  .bld-panel { bottom: 88px; }
  .tool { width: 36px; height: 34px; border-radius: 9px; }
  .tool .ic { font-size: 13px; }
  .tool .lb { display: none; }
}
@media (max-width: 1340px) {
  .badge { display: none; }
}

/* ---------- 右侧竖排工具栏 ---------- */
/* 两列竖向工具条（对齐 sunlight-3d 的 side-toolbar：2 列、分组、可滚动） */
.side-tool {
  position: absolute; z-index: 16;
  right: calc(var(--right-w) + 12px); top: calc(var(--top-h) + 10px);
  bottom: 92px;
  display: grid; grid-template-columns: repeat(2, 40px);
  gap: 5px; align-content: start; justify-content: center;
  overflow-y: auto; overflow-x: hidden;
  padding: 4px 2px;
  scrollbar-width: thin; scrollbar-color: rgba(100,180,255,.3) transparent;
}
.side-tool::-webkit-scrollbar { width: 4px; }
.side-tool::-webkit-scrollbar-thumb { background: rgba(100,180,255,.25); border-radius: 3px; }
/* 分组用 display:contents 让按钮直接进两列网格，分组只做视觉分隔 */
.st-group { display: contents; }
.tool {
  width: 40px; height: 40px; border-radius: 10px; position: relative;
  background: rgba(14, 24, 42, .94); border: 1px solid rgba(100, 180, 255, .18);
  box-shadow: var(--shadow-sm);
  /* 38 个按钮如果都开 backdrop-filter，软件渲染会直接拖死渲染进程，这里用实心底 */
  backdrop-filter: none; -webkit-backdrop-filter: none;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  color: var(--text-2); transition: all .15s; flex: none;
}
.tool:hover { color: #cfe6ff; border-color: rgba(100, 180, 255, .55); background: rgba(30, 60, 100, .85); transform: translateX(-2px); }
.tool.active { background: linear-gradient(135deg, #3d8bf7, #2563d8); border-color: #5aa4ff; color: #fff; }
.tool-hi { background: linear-gradient(135deg, rgba(52, 152, 219, .9), rgba(41, 128, 185, .9)); color: #fff; }
.tool .ic { font-size: 14px; line-height: 1; }
.tool .lb { font-size: 8px; line-height: 1; opacity: .88; letter-spacing: -.2px; }

/* ---------- 楼栋列表抽屉 ---------- */
.drawer {
  position: absolute; z-index: 17;
  left: calc(var(--left-w) + 24px); top: calc(var(--top-h) + 14px);
  width: 320px; max-height: calc(100% - var(--top-h) - 108px);
  display: none; flex-direction: column;
  background: var(--panel); border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 14px; box-shadow: 0 14px 36px rgba(24, 43, 78, .18);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
}
.drawer.show { display: flex; animation: bpIn .18s ease-out; }
.dr-head { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-bottom: 1px solid var(--border); }
.dr-title { font-size: 11.5px; font-weight: 700; letter-spacing: .6px; color: var(--text-2); }
.dr-meta { margin-left: auto; font-size: 9.5px; color: var(--text-3); }
.dr-close { border: none; background: transparent; font-size: 16px; line-height: 1; color: var(--text-3); }
.dr-close:hover { color: var(--text); }
.dr-search { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.dr-search input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 7px;
  padding: 6px 9px; font-size: 11px; outline: none; color: var(--text);
}
.dr-search input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.dr-list { overflow-y: auto; flex: 1; min-height: 90px; padding: 4px 6px; }
.dr-list::-webkit-scrollbar { width: 6px; }
.dr-list::-webkit-scrollbar-thumb { background: rgba(190, 202, 218, .85); border-radius: 4px; }
.dr-item { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px; cursor: pointer; }
.dr-item:hover { background: rgba(79, 156, 249, .12); }
.dr-item.selected { background: var(--primary-soft); }
.dr-item .dn { flex: 1; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dr-item .dh { font-size: 10px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.dr-item .df { font-size: 9px; color: var(--text-3); width: 34px; text-align: right; }
.dr-tip { padding: 7px 12px; font-size: 9.5px; color: var(--text-3); border-top: 1px solid rgba(227, 233, 242, .8); }

/* ---------- 日照卡 ---------- */
.sun-row { display: flex; gap: 6px; margin-bottom: 5px; }
.sun-row > div {
  flex: 1; display: flex; justify-content: space-between; align-items: baseline;
  font-size: 10px; color: var(--text-3);
  background: var(--panel-2); border-radius: 5px; padding: 4px 6px;
}
.sun-row b { color: var(--text); font-size: 11px; font-variant-numeric: tabular-nums; }
.season-row { display: flex; gap: 4px; margin-top: 5px; }
.season {
  flex: 1; font-size: 9.5px; padding: 3px 0; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text-2);
  transition: all .14s;
}
.season:hover { border-color: var(--primary); color: var(--primary); }
.season.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.date-line, .scale-line { display: flex; align-items: center; gap: 6px; margin-top: 5px; font-size: 10px; color: var(--text-3); }
.date-line input[type="date"] {
  flex: 1; border: 1px solid var(--border-strong); border-radius: 6px;
  padding: 3px 6px; font-size: 10.5px; color: var(--text); outline: none;
}
.date-line input[type="date"]:focus { border-color: var(--primary); }
.scale-line input[type="range"] { flex: 1; height: 4px; accent-color: var(--primary); }
.scale-line b { font-size: 10px; color: var(--text); width: 26px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- 窄屏 ---------- */
@media (max-width: 1280px) {
  :root { --left-w: 240px; --right-w: 276px; }
  .hint-line { display: none; }
}
@media (max-width: 1080px) {
  .dock-right { display: none; }
  .side-tool { right: 12px; }
  .timebar { width: min(520px, calc(100vw - var(--left-w) - 56px)); }
  .topbar-tabs { position: static; transform: none; margin-left: 8px; }
}
@media (max-width: 820px) {
  .dock-left { display: none; }
  .side-tool { display: none; }
  .drawer { left: 12px; }
  .timebar { width: calc(100vw - 24px); }
  .topbar-tabs { display: none; }
}

/* ---------- 片区数据加载遮罩 ---------- */
.load-mask {
  position: absolute; inset: 0; z-index: 60;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10, 18, 32, .88);
  backdrop-filter: saturate(140%) blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .22s ease;
}
.load-mask.show { opacity: 1; pointer-events: auto; }

.load-box {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 30px 42px;
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 44px rgba(24, 43, 78, .16);
  min-width: 300px;
}
.load-spin {
  width: 34px; height: 34px; border-radius: 50%;
  border: 3px solid rgba(37, 99, 235, .16);
  border-top-color: var(--primary);
  animation: loadspin .85s linear infinite;
}
@keyframes loadspin { to { transform: rotate(360deg); } }
.load-title { font-size: 14px; font-weight: 700; letter-spacing: .2px; }
.load-sub { font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.6; }

/* ---------- 标注抽屉 ---------- */
.anno-new {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}
.anno-new input {
  width: 100%; height: 30px; padding: 0 9px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  font-size: 12px; outline: none; background: var(--input-bg); color: var(--text);
}
.anno-new input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.anno-new-row { display: flex; gap: 6px; }
.anno-new-row input { flex: 1; }
.anno-new-row .btn { white-space: nowrap; height: 30px; padding: 0 10px; font-size: 11.5px; }

.anno-item { padding: 9px 12px; border-bottom: 1px solid var(--border); }
.ai-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; font-size: 12px; }
.ai-del { border: 0; background: transparent; color: var(--text-3); font-size: 15px; line-height: 1; cursor: pointer; padding: 0 2px; }
.ai-del:hover { color: #d9534f; }
.ai-url { margin-top: 3px; font-size: 10.5px; word-break: break-all; color: var(--text-3); }
.ai-url a { color: var(--primary); text-decoration: none; }
.ai-row { display: flex; gap: 6px; margin-top: 6px; }
.mini {
  border: 1px solid var(--border-strong); background: var(--input-bg); border-radius: 6px;
  height: 24px; padding: 0 8px; font-size: 11px; color: var(--text-2); cursor: pointer;
}
.mini:hover { border-color: var(--primary); color: var(--primary); }

/* ---------- 楼栋精修面板 ---------- */
.bp-detail { padding: 12px; }
.bp-detail-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.bp-detail-head b { font-size: 12.5px; }
.bp-detail-head span { font-size: 10.5px; color: var(--text-3); }
.bp-detail-tools { display: flex; gap: 6px; margin: 8px 0; }
.bp-tool {
  flex: 1; height: 32px; border: 1px solid var(--border-strong); background: var(--input-bg);
  border-radius: 8px; font-size: 11.5px; color: var(--text-2); cursor: pointer;
}
.bp-tool:hover { border-color: var(--primary); color: var(--primary); }
.bp-tool.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.bp-detail-stat {
  font-size: 11px; color: var(--text-2); background: var(--panel-2);
  border: 1px solid var(--border); border-radius: 8px; padding: 7px 9px; margin-bottom: 8px;
}
.bp-detail-stat b { color: var(--primary); font-size: 12px; }
.bp-tip { font-size: 10.5px; color: var(--text-3); line-height: 1.7; margin-top: 8px; }

/* 精修：编号开关 / 分段列表 */
.bp-opt { display: flex; align-items: center; gap: 10px; margin: 2px 0 6px; }
.bp-opt-tip { font-size: 9.5px; color: var(--text-3); margin-left: auto; }
.bp-chk { display: flex; align-items: center; gap: 4px; font-size: 10.5px; color: var(--text-3); cursor: pointer; }
.bp-chk input { accent-color: var(--primary); width: 12px; height: 12px; }
.bp-sec {
  border-top: 1px solid var(--border); padding-top: 8px; margin-top: 8px;
}
.bp-sec-h { display: flex; align-items: baseline; gap: 4px; font-size: 11px; color: var(--text-2); margin-bottom: 5px; }
.bp-sec-h span { font-weight: 600; }
.bp-sec-h b { color: var(--primary); font-size: 12px; }
.bp-sec-h i { font-style: normal; font-size: 9.5px; color: var(--text-3); }
.bp-list { max-height: 148px; overflow: auto; }
.bp-list:empty { display: none; }
.bp-item {
  border: 1px solid var(--border); background: var(--panel-2); border-radius: 7px;
  padding: 4px 7px; margin-bottom: 4px; font-size: 10.5px; color: var(--text-2);
  cursor: pointer;
}
.bp-item.sel { border-color: var(--primary); background: rgba(79, 156, 249, .14); }
.bp-item-top { display: flex; align-items: center; justify-content: space-between; gap: 4px; }
.bp-item-top .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bp-item-top .x {
  flex: none; width: 16px; height: 16px; line-height: 14px; text-align: center;
  border-radius: 4px; color: var(--text-3); cursor: pointer;
}
.bp-item-top .x:hover { background: rgba(217, 83, 79, .18); color: #e2726d; }
.bp-vp-btns { display: flex; align-items: center; gap: 4px; flex: none; }
.bp-mini {
  border: 1px solid var(--border-strong); background: var(--input-bg); color: var(--text-2);
  border-radius: 5px; font-size: 9.5px; padding: 1px 5px; cursor: pointer; line-height: 1.5;
}
.bp-mini:hover { border-color: var(--primary); color: var(--primary); }
.bp-item-row { display: flex; align-items: center; gap: 5px; margin-top: 3px; }
.bp-item-row span { flex: none; font-size: 9.5px; color: var(--text-3); }
.bp-item-row input[type="range"] { flex: 1; min-width: 30px; height: 3px; }
.bp-item-row b { flex: none; width: 26px; text-align: right; font-size: 9.5px; color: var(--text-2); }
.bp-row-rail { margin-top: 4px; }
.bp-row-rail input[type="range"] { height: 3px; }
.bp-val { font-size: 10px; color: var(--text-2); flex: none; width: 28px; text-align: right; }
.bp-detail input[type="range"] { accent-color: var(--primary); }

/* ---------- 轻提示（精修绘制反馈） ---------- */
.toast {
  position: fixed; left: 50%; bottom: 128px; transform: translate(-50%, 10px);
  max-width: 62vw; padding: 7px 14px; border-radius: 999px;
  background: rgba(14, 24, 42, .94); border: 1px solid rgba(79, 156, 249, .45);
  color: var(--text); font-size: 11.5px; line-height: 1.5; text-align: center;
  opacity: 0; pointer-events: none; transition: opacity .16s ease, transform .16s ease;
  z-index: 90; box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 房源 ---------- */
.units-box { margin-top: 12px; border-top: 1px dashed var(--border); padding-top: 9px; }
.units-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--text-2); margin-bottom: 6px; }
.units-head b { color: var(--primary); font-size: 12.5px; }
.unit-item {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; padding: 5px 7px; border-radius: 7px;
  background: var(--panel-2); border: 1px solid var(--border); margin-bottom: 4px;
}
.unit-item .u-type { font-weight: 600; color: var(--text); }
.unit-item .u-meta { color: var(--text-3); flex: 1; }
.unit-item a { color: var(--primary); text-decoration: none; font-size: 10.5px; }
.unit-item .u-del { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 14px; line-height: 1; }
.unit-item .u-del:hover { color: #d9534f; }

/* ---------- 底图标记 ---------- */
.anno-sep {
  padding: 8px 12px; font-size: 11px; font-weight: 600; color: var(--text-2);
  background: var(--panel-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between;
}
.anno-sep span { color: var(--primary); }
.bgm-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px 12px; font-size: 11.5px; border-bottom: 1px solid var(--border);
}
.bgm-item .dot2 { width: 7px; height: 7px; border-radius: 50%; background: #e2923c; flex: none; }
.bgm-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bgm-item a { color: var(--primary); text-decoration: none; font-size: 10.5px; }

/* ---------- 基础设施绘制面板 ---------- */
.feat-panel {
  position: absolute; right: 78px; top: 50%; transform: translateY(-50%) translateX(10px);
  width: 208px; z-index: 45;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  opacity: 0; pointer-events: none; transition: .18s;
}
.feat-panel.show { opacity: 1; pointer-events: auto; transform: translateY(-50%); }
.fp-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px; font-size: 12px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.fp-close { border: 0; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; }
.fp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 10px 12px; }
.fp-item {
  display: flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 8px; border-radius: 8px;
  border: 1px solid var(--border-strong); background: var(--input-bg);
  font-size: 11.5px; color: var(--text-2); cursor: pointer;
}
.fp-item i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.fp-item b { margin-left: auto; color: var(--text-3); font-size: 10.5px; }
.fp-item:hover { border-color: var(--primary); color: var(--primary); }
.fp-item.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.fp-item.active b { color: rgba(255,255,255,.75); }
.fp-tip { padding: 0 12px 8px; font-size: 10.5px; color: var(--text-3); line-height: 1.6; }
.fp-actions { padding: 0 12px 12px; }
.fp-actions .mini { width: 100%; height: 26px; }

/* ---------- 顶栏按钮密度适配（按钮多了以后 1500px 以下会挤） ---------- */
@media (max-width: 1560px) {
  .weather-chip { display: none; }
  .topbar-right { gap: 5px; }
  .top-btn { padding: 0 9px; font-size: 11.5px; }
}
@media (max-width: 1360px) {
  .top-btn { padding: 0 7px; font-size: 11px; }
  .badge { display: none; }
  .badge.gray { display: inline-flex; }
}
@media (max-width: 1180px) {
  .brand-sub { display: none; }
  .top-btn { padding: 0 6px; font-size: 10.5px; }
}

/* ---------- 通用弹窗 ---------- */
.modal {
  position: absolute; inset: 0; z-index: 70;
  display: none; align-items: center; justify-content: center;
  background: rgba(18, 26, 38, .38); backdrop-filter: blur(3px);
}
.modal.show { display: flex; }
.modal-box {
  width: min(760px, calc(100vw - 60px));
  max-height: calc(100vh - 120px);
  display: flex; flex-direction: column;
  background: var(--panel-solid); border: 1px solid var(--border);
  border-radius: 16px; box-shadow: 0 20px 60px rgba(18, 26, 38, .28);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: 14px; font-weight: 700;
}
.modal-sub { font-size: 11px; color: var(--text-3); font-weight: 400; flex: 1; }
.modal-close { border: 0; background: transparent; color: var(--text-3); font-size: 18px; line-height: 1; }
.modal-body { padding: 12px 18px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 12px 18px; border-top: 1px solid var(--border); background: var(--panel-2);
}

/* 导入底图：预览 + 参数行 */
.bm-preview {
  position: relative; height: 148px; margin-bottom: 10px;
  border-radius: 8px; border: 1px solid var(--border); background: var(--panel-2);
  display: flex; align-items: center; justify-content: center; overflow: hidden;
}
.bm-preview img { max-width: 100%; max-height: 100%; display: block; }
.bm-preview #bmEmpty { font-size: 11px; color: var(--text-3); }
#baseMapModal .mset-row span:first-child { width: 62px; }

.price-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.price-table th {
  text-align: left; font-weight: 600; color: var(--text-2);
  padding: 7px 8px; border-bottom: 1px solid var(--border-strong);
  position: sticky; top: 0; background: var(--panel-solid);
}
.price-table td { padding: 7px 8px; border-bottom: 1px solid var(--border); }
.price-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.price-table tr:hover td { background: var(--primary-soft); }
.price-table .unit-price { color: #c2410c; font-weight: 700; }
.price-empty { padding: 26px; text-align: center; color: var(--text-3); font-size: 12px; line-height: 1.9; }

/* ---------- 楼栋抽屉：分组与批量 ---------- */
.dr-groups { display: flex; gap: 5px; padding: 0 12px 8px; flex-wrap: wrap; }
.dr-g {
  height: 24px; padding: 0 9px; border-radius: 7px;
  background: var(--input-bg); border: 1px solid var(--border-strong);
  font-size: 11px; color: var(--text-2); cursor: pointer;
}
.dr-g:hover { border-color: var(--primary); color: var(--primary); }
.dr-g.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.dr-bulk {
  display: flex; align-items: center; gap: 6px;
  padding: 0 12px 8px; font-size: 11px; color: var(--text-2);
}
.dr-bulk label { display: flex; align-items: center; gap: 4px; margin-right: auto; cursor: pointer; }
.dr-bulk input { accent-color: var(--primary); }
.dr-item .cb { margin-right: 2px; }

/* ---------- 楼栋列表：分组 / 行内开关 ---------- */
.dr-gbar { display: flex; align-items: center; gap: 6px; padding: 0 12px 8px; }
.dr-addg {
  flex: none; height: 22px; padding: 0 9px; border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(79, 156, 249, .5); background: rgba(79, 156, 249, .16);
  color: var(--primary); font-size: 10.5px;
}
.dr-addg:hover { background: rgba(79, 156, 249, .3); color: #fff; }
.dr-gtip { font-size: 9px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dr-foot { display: flex; gap: 6px; padding: 0 12px 8px; }
.dr-foot .mini { flex: 1; padding: 5px 4px; font-size: 10px; }
.dr-group { margin-bottom: 4px; }
.dr-gh {
  display: flex; align-items: center; gap: 4px; padding: 4px 6px;
  border-radius: 6px; cursor: pointer; background: var(--panel-2); border: 1px solid var(--border);
}
.dr-gh:hover { border-color: rgba(79, 156, 249, .55); }
.dr-gh.active { border-color: var(--primary); background: rgba(79, 156, 249, .14); }
.dr-gh .tg { width: 10px; font-size: 8px; color: var(--text-3); transition: transform .12s; }
.dr-gh.collapsed .tg { transform: rotate(-90deg); }
.dr-gh .gn {
  flex: 1; font-size: 10.5px; font-weight: 600; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dr-gh.active .gn { color: var(--primary); }
.dr-gh .gc { font-size: 9px; color: var(--text-3); }
.bp-fit { font-size: 10px; color: var(--text-3); margin-right: auto; font-style: normal; }
.bp-fit.bad { color: #ff8a65; }
.bp-sec-h .bp-xbtn { margin-left: auto; }
.bp-sec-h .bp-fit { font-size: 10px; color: var(--text-3); margin-left: 4px; font-style: normal; }
.bp-sec-h .bp-fit.bad { color: #ff8a65; }

/* 楼栋旋转 / 平移：一行里塞两个数字框 + 小按钮 */
.bp-row-xf { align-items: center; gap: 4px; }
.bp-row-xf input[type=number] { width: 56px; flex: 0 0 auto; }
.bp-row-xf .bp-unit { margin: 0 2px; }
.bp-xbtn {
  flex: 0 0 auto; padding: 3px 7px; font-size: 11px; line-height: 1.2;
  border: 1px solid var(--line); border-radius: 6px;
  background: var(--panel-2, rgba(255,255,255,.06)); color: var(--text-1);
  cursor: pointer; white-space: nowrap;
}
.bp-xbtn:hover { border-color: var(--primary); color: var(--primary); }

.dr-gh .gcb {
  flex: none; width: 12px; height: 12px; margin: 0 1px 0 0; cursor: pointer;
  accent-color: #2f7df6; border-radius: 3px;
}
.dr-gh .gcb:not(:checked) { opacity: .55; }
.dr-gh .gi, .dr-gh .gx { width: 14px; text-align: center; font-size: 11px; color: var(--text-3); border-radius: 3px; }
.dr-gh .gi:hover { color: var(--primary); background: rgba(79, 156, 249, .18); }
.dr-gh .gx:hover { color: #e2726d; background: rgba(217, 83, 79, .16); }
.dr-gc { padding: 2px 0 0 2px; }
.dr-gc.collapsed { display: none; }
.dr-item .di {
  flex: none; width: 15px; text-align: center; font-size: 10.5px; line-height: 15px;
  color: var(--text-3); border-radius: 3px; user-select: none;
}
.dr-item .di.on { color: var(--primary); }
.dr-item .di.start { color: #e0a34a; }
.dr-item .di.off { color: rgba(140, 155, 175, .42); }
.dr-item .di:hover { background: rgba(79, 156, 249, .2); color: #fff; }
.dr-item.hidden-in-list .dn { opacity: .45; text-decoration: line-through; }
.dr-more { padding: 4px 7px; font-size: 9.5px; color: var(--text-3); }

/* ---------- 楼栋资料弹窗 ---------- */
.modal-box.wide { width: min(880px, calc(100vw - 60px)); }
.asset-tabs {
  display: flex; gap: 4px; padding: 10px 18px 0; border-bottom: 1px solid var(--border);
}
.asset-tabs button {
  height: 32px; padding: 0 14px; border: 1px solid transparent; border-bottom: 0;
  border-radius: 9px 9px 0 0; background: transparent; color: var(--text-2);
  font-size: 12px; cursor: pointer;
}
.asset-tabs button:hover { color: var(--primary); }
.asset-tabs button.active {
  background: var(--panel-solid); border-color: var(--border);
  color: var(--primary); font-weight: 600; margin-bottom: -1px;
}

.fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.fp-card {
  border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--panel-2);
  position: relative;
}
.fp-card img { width: 100%; height: 110px; object-fit: cover; display: block; cursor: zoom-in; }
.fp-card .fp-meta { padding: 6px 8px; font-size: 10.5px; color: var(--text-2); }
.fp-card .fp-name { font-weight: 600; color: var(--text); font-size: 11.5px; }
.fp-card .fp-del {
  position: absolute; top: 5px; right: 5px; width: 20px; height: 20px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.45); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer;
}
.fp-card .fp-del:hover { background: #d9534f; }
.fp-add {
  border: 1px dashed var(--border-strong); border-radius: 10px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; min-height: 150px; cursor: pointer; color: var(--text-3); font-size: 11.5px;
  background: var(--panel-2);
}
.fp-add:hover { border-color: var(--primary); color: var(--primary); }
.fp-add b { font-size: 20px; font-weight: 400; }

.link-group { margin-bottom: 14px; }
.link-group h4 { margin: 0 0 7px; font-size: 12px; color: var(--text-2); }
.link-row {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 9px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--panel-2); margin-bottom: 6px; font-size: 11.5px;
}
.link-row .ln { font-weight: 600; }
.link-row .lu { flex: 1; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-row a { color: var(--primary); text-decoration: none; font-size: 11px; }

.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.info-field label { display: block; font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.info-field input {
  width: 100%; height: 32px; padding: 0 9px; border: 1px solid var(--border-strong);
  border-radius: 8px; font-size: 12px; outline: none;
}
.info-field input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }

.deal-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.deal-table th { text-align: left; font-size: 11px; color: var(--text-3); padding: 6px 8px; border-bottom: 1px solid var(--border-strong); }
.deal-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); }
.deal-table td.num { text-align: right; font-variant-numeric: tabular-nums; }

.asset-empty { padding: 20px; text-align: center; color: var(--text-3); font-size: 11.5px; line-height: 1.9; }
.img-viewer {
  position: fixed; inset: 0; z-index: 90; background: rgba(10,16,24,.9);
  display: none; align-items: center; justify-content: center; cursor: zoom-out;
}
.img-viewer.show { display: flex; }
.img-viewer img { max-width: 92vw; max-height: 92vh; box-shadow: 0 20px 60px rgba(0,0,0,.5); }

/* ---------- 顶栏：项目文件按钮 ---------- */
.top-btn-file {
  border-color: rgba(37, 99, 235, .45);
  color: var(--primary);
  font-weight: 600;
}
.top-btn-file:hover { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ---------- 楼栋名开关 ---------- */
.bp-row-switch { align-items: center; }
.bp-switch { display: flex; align-items: center; gap: 8px; margin-left: auto; cursor: pointer; }
/* .bp-row label 统一 50px，会把这个开关标签也压成 50px 导致文字溢出被裁 */
.bp-row .bp-switch { width: auto; flex: none; }
.bp-switch input { display: none; }
.bp-switch-txt { font-size: 11px; color: var(--text-3); min-width: 30px; text-align: right; white-space: nowrap; }
.bp-switch input:checked + .switch { background: var(--primary); }
.bp-switch input:checked + .switch::after { transform: translateX(12px); }
.bp-switch input:checked ~ .bp-switch-txt { color: var(--primary); }
.bp-switch.is-off { opacity: .55; }
/* 置灰但不代表「已打开」：没有楼栋名时开关还是灰的，别显示成蓝色开态 */
.bp-switch.is-off input:checked + .switch { background: #5b6675; }
/* 整行失效（例：这栋还没有楼栋名，「C端名称」那一项没法生效） */
.bp-row.is-off > label:first-child { opacity: .5; }
/* C 端开关行：标签窄一点、文字不换行不溢出 */
.bp-row.bp-cfg > label:first-child { width: 58px; font-size: 10px; letter-spacing: -.2px; }
.bp-row.bp-cfg .bp-switch { gap: 6px; }
.bp-row.bp-cfg .bp-switch-txt { min-width: 26px; font-size: 10px; }

.card-mini { flex: none; }
.card-mini .card-body { padding: 8px 12px; }
.layer-count { font-size: 10.5px; color: var(--text-3); }

/* ---------- 新建模型起始页 ---------- */
.start-screen {
  position: fixed; inset: 0; z-index: 65;
  display: none; align-items: center; justify-content: center;
  background: radial-gradient(120% 90% at 50% 30%, rgba(232, 238, 247, .55), rgba(210, 220, 234, .82));
  backdrop-filter: blur(3px) saturate(120%);
  padding: 24px;
}
.start-screen.show { display: flex; }
.ss-box {
  width: min(560px, 100%);
  background: var(--panel-solid);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(20, 34, 56, .22);
  padding: 26px 28px 22px;
  text-align: center;
}
.ss-kicker {
  font-size: 10.5px; letter-spacing: 2px; color: var(--primary);
  font-weight: 700; text-transform: uppercase;
}
.ss-box h2 { margin: 6px 0 8px; font-size: 21px; letter-spacing: .5px; }
.ss-sub { margin: 0 0 16px; font-size: 12px; line-height: 1.85; color: var(--text-3); }
.ss-actions { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ss-actions .btn { height: 34px; padding: 0 16px; font-size: 12.5px; }
.ss-actions .btn.primary { min-width: 118px; }
.ss-open { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--border); }
.ss-open-title { font-size: 11px; color: var(--text-3); }
.ss-districts {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 6px; margin-top: 9px;
}
.ss-districts button {
  padding: 9px 4px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--input-bg);
  font-size: 11.5px; color: var(--text); cursor: pointer; line-height: 1.45;
}
.ss-districts button:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.ss-districts button span { display: block; font-size: 10px; color: var(--text-3); margin-top: 2px; }
.ss-tip {
  margin-top: 16px; font-size: 10.5px; line-height: 1.75; color: var(--text-3);
  background: var(--panel-2); border: 1px solid var(--border);
  border-radius: 9px; padding: 8px 10px; text-align: left;
}

/* 片区卡：新建模型条目 */
.district-card.is-new {
  border-style: dashed; border-color: var(--primary);
  background: rgba(79, 156, 249, .10);
}
.district-card.is-new .dc-name { color: var(--primary); }

/* ---------- 对象清单 ---------- */
.obj-panel {
  position: absolute; z-index: 18;
  left: calc(var(--left-w) + 22px); top: calc(var(--top-h) + 12px);
  width: 258px; max-height: calc(100% - var(--top-h) - 140px);
  display: none; flex-direction: column;
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 13px; box-shadow: var(--shadow);
  backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  overflow: hidden;
}
.obj-panel.show { display: flex; }
.op-head {
  display: flex; align-items: center; gap: 8px; padding: 9px 12px;
  font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--border);
}
.op-meta { margin-left: auto; font-size: 10px; color: var(--text-3); font-weight: 400; }
.op-close { border: 0; background: transparent; color: var(--text-3); font-size: 16px; line-height: 1; }
.op-body { overflow-y: auto; padding: 4px 0 6px; flex: 1; }
.op-group-title {
  font-size: 10px; color: var(--primary); padding: 7px 12px 3px; letter-spacing: .4px;
}
.op-item {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px;
  font-size: 11.5px; color: var(--text-2); cursor: pointer;
  border-left: 2px solid transparent;
}
.op-item:hover { background: var(--primary-soft); color: var(--text); }
.op-item.active { background: var(--primary-soft); border-left-color: var(--primary); color: var(--primary); }
.op-item .nm { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.op-item .meta { font-size: 9.5px; color: var(--text-3); }
.op-item .del { color: #e06c75; font-size: 12px; padding: 0 2px; }
.op-item .del:hover { color: #ff4d4d; }
.op-empty { padding: 14px 12px; font-size: 11px; color: var(--text-3); text-align: center; }
.op-tip { padding: 7px 12px; font-size: 9.5px; color: var(--text-3); border-top: 1px solid var(--border); line-height: 1.6; }

/* ---------- 基础模型参数弹层 ---------- */
.mset-pop {
  position: absolute; z-index: 22;
  right: calc(var(--right-w) + 66px); top: calc(var(--top-h) + 60px);
  width: 246px; display: none; flex-direction: column; gap: 8px;
  padding: 12px; border-radius: 13px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--shadow); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
}
.mset-pop.show { display: flex; }
.mset-head { display: flex; align-items: center; font-size: 12px; font-weight: 600; }
.mset-close { margin-left: auto; border: 0; background: transparent; color: var(--text-3); font-size: 15px; line-height: 1; }
.mset-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--text-2); }
.mset-row span { width: 56px; flex: none; }
.mset-row input[type=range] { flex: 1; accent-color: var(--primary); min-width: 0; }
.mset-row b { width: 42px; text-align: right; color: var(--primary); font-size: 11px; }
.mset-row select {
  flex: 1; height: 24px; border-radius: 6px; font-size: 11px;
  background: var(--input-bg); border: 1px solid var(--border); color: var(--text); outline: none;
}
.mset-chk { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-2); cursor: pointer; }
.mset-chk input { accent-color: var(--primary); }
.mset-tip { font-size: 9.5px; color: var(--text-3); line-height: 1.6; }

/* ---------- 保存项目 / 项目库 ---------- */
.prj-box { width: min(680px, calc(100vw - 32px)); }
.prj-save { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.prj-save input {
  flex: 1 1 240px; min-width: 0; height: 34px; padding: 0 11px; font-size: 12.5px;
  background: var(--input-bg); border: 1px solid var(--border-strong); border-radius: 8px;
  color: var(--text); outline: none;
}
.prj-save input:focus { border-color: var(--primary); }
.prj-save .btn { height: 34px; padding: 0 16px; font-size: 12px; }
/* 保存按钮的下拉菜单：覆盖 / 保存到线上 / 另存为下载 */
.prj-save-wrap { position: relative; flex: 0 0 auto; }
.prj-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 6px); z-index: 40;
  width: 250px; padding: 6px; border-radius: 10px;
  background: var(--panel, #fff); border: 1px solid var(--border-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .28);
}
.prj-menu.show { display: block; }
.prj-mi {
  display: block; width: 100%; text-align: left; padding: 8px 10px;
  border: none; border-radius: 8px; background: none; color: var(--text); cursor: pointer;
}
.prj-mi:hover:not(:disabled) { background: var(--panel-2, rgba(0,0,0,.05)); }
.prj-mi:disabled { opacity: .45; cursor: default; }
.prj-mi b { display: block; font-size: 12.5px; font-weight: 600; }
.prj-mi .s { display: block; margin-top: 2px; font-size: 10.5px; color: var(--text-3); line-height: 1.5; }
.prj-mi + .prj-mi { border-top: 1px solid var(--border); border-radius: 0 0 8px 8px; }
.prj-toast {
  font-size: 11.5px; color: #3ecf8e; opacity: 0; transform: translateY(2px);
  transition: opacity .2s, transform .2s;
}
.prj-toast.show { opacity: 1; transform: none; }
.prj-tip { margin-top: 10px; font-size: 11px; line-height: 1.75; color: var(--text-3); }
.prj-sect {
  display: flex; align-items: center; gap: 8px; margin: 14px 0 8px;
  font-size: 10.5px; letter-spacing: 2px; color: var(--text-3);
}
.prj-sect::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.prj-list { display: flex; flex-direction: column; gap: 6px; max-height: min(44vh, 360px); overflow-y: auto; }
.prj-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--panel-2);
}
.prj-item.cur { border-color: var(--primary); background: rgba(79, 156, 249, .08); }
.prj-item-main { flex: 1; min-width: 0; }
.prj-item-name {
  font-size: 12.5px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.prj-tag {
  margin-left: 6px; padding: 0 4px; border: 1px solid var(--primary); border-radius: 4px;
  font-size: 9.5px; font-weight: 400; color: var(--primary); vertical-align: 1px;
}
.prj-item-meta { margin-top: 3px; font-size: 10.5px; color: var(--text-3); }
.prj-item-ops { display: flex; gap: 6px; flex: none; }
.prj-item-ops .mini.danger:hover { border-color: #d9534f; color: #e2726d; }
.prj-empty { padding: 26px 10px; text-align: center; font-size: 11.5px; line-height: 1.9; color: var(--text-3); }
.prj-hint { flex: 1; text-align: left; font-size: 10.5px; color: var(--text-3); }
@media (max-width: 640px) {
  .prj-item { flex-wrap: wrap; }
  .prj-item-ops { width: 100%; justify-content: flex-end; }
  .prj-hint { width: 100%; }
}

/* ===== 楼顶标注 / 底图标注（DOM 叠层：屏幕恒定大小） ===== */
.anno-layer {
  position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 6;
}
.anno-tag {
  position: absolute; left: 0; top: 0;
  display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, .96);
  border: 2px solid #7fb2e5; border-radius: 8px;
  padding: 3px 9px; font-size: 12.5px; line-height: 1.3;
  color: #243447; white-space: nowrap;
  box-shadow: 0 4px 14px rgba(15, 35, 60, .18);
  pointer-events: auto; cursor: pointer; user-select: none;
}
.anno-tag::after {
  content: ''; position: absolute; left: 50%; bottom: -7px; margin-left: -6px;
  border: 6px solid transparent; border-top-color: #7fb2e5;
}
.anno-tag.linked { border-color: #2fa36b; }
.anno-tag.linked::after { border-top-color: #2fa36b; }
.anno-tag.linked .anno-tag-text { color: #14724a; font-weight: 600; }
.anno-tag.bg { border-color: #e8a33d; }
.anno-tag.bg::after { border-top-color: #e8a33d; }
.anno-tag:hover { border-color: #2563eb; }
.anno-tag:hover::after { border-top-color: #2563eb; }
.anno-tag.bg:hover { border-color: #d98b1e; }
.anno-tag.bg:hover::after { border-top-color: #d98b1e; }
.anno-tag-del {
  display: none; position: absolute; right: -10px; top: -10px;
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: #e74c3c; color: #fff; font-size: 12px; line-height: 1;
  cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.anno-tag:hover .anno-tag-del { display: flex; }
.anno-tag-input {
  border: none; outline: none; font: inherit; color: inherit;
  width: 96px; background: transparent;
}

/* ===== 房源管理（楼栋 × 楼层 × 房号 矩阵） ===== */
.unit-modal-box { width: min(1180px, calc(100vw - 60px)); }

.unit-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--border);
  background: var(--panel-2); font-size: 11px; color: var(--text-2);
}
.ub-lab { color: var(--text-3); }
.ub-select {
  min-width: 180px; max-width: 260px; padding: 4px 8px; font-size: 11.5px;
  background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 7px; color: var(--text); outline: none;
}
.ub-num {
  width: 58px; padding: 4px 6px; font-size: 11.5px;
  background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 7px; color: var(--text); outline: none;
}
.ub-unit { color: var(--text-3); }
.ub-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ub-chk { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.ub-chk input { accent-color: var(--primary); }

.unit-legend { display: flex; align-items: center; gap: 4px; font-size: 10.5px; }
.unit-legend i {
  display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-right: 3px;
  vertical-align: -2px;
}
.unit-legend span { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); }
.unit-legend .lv1 i { background: #3f9d55; }
.unit-legend .lv2 i { background: #7cc88a; }
.unit-legend .lv3 i { background: #e8d98a; }
.unit-legend .lv4 i { background: #eda17c; }
.unit-legend .lv5 i { background: #e05a4f; }

.unit-gen {
  display: none; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 18px; border-bottom: 1px solid var(--border);
  background: rgba(79, 156, 249, .07); font-size: 11px; color: var(--text-2);
}
.unit-gen.show { display: flex; }
.unit-gen label { display: inline-flex; align-items: center; gap: 4px; }
.unit-gen input {
  width: 74px; padding: 4px 6px; font-size: 11.5px;
  background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 7px; color: var(--text); outline: none;
}
.unit-gen input:focus { border-color: var(--primary); }

.unit-body {
  display: flex; gap: 12px; padding: 12px 18px; min-height: 300px;
  overflow: hidden; align-items: stretch;
}
.unit-matrix-wrap {
  flex: 1; min-width: 0; overflow: auto; max-height: 56vh;
  border: 1px solid var(--border); border-radius: 10px; background: rgba(6, 12, 24, .55);
}
.unit-matrix { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 11.5px; }
.unit-matrix th, .unit-matrix td {
  padding: 6px 8px; text-align: center; min-width: 62px;
  border-right: 1px solid rgba(100, 180, 255, .10);
  border-bottom: 1px solid rgba(100, 180, 255, .10);
  white-space: nowrap;
}
.unit-matrix thead th {
  position: sticky; top: 0; z-index: 2;
  background: #16233a; color: var(--text-2); font-weight: 600;
}
.unit-matrix thead tr.area-row th { top: 29px; font-weight: 400; font-size: 10.5px; color: var(--text-3); }
.unit-matrix .floor-cell {
  position: sticky; left: 0; z-index: 1;
  background: #16233a; color: var(--text-2); font-weight: 500; min-width: 52px;
}
.unit-matrix thead .floor-cell { z-index: 3; }
.unit-matrix td.cell { cursor: pointer; color: #0f1724; font-weight: 600; }
.unit-matrix td.cell:hover { outline: 2px solid var(--primary); outline-offset: -2px; }
.unit-matrix td.lv1 { background: #3f9d55; color: #fff; }
.unit-matrix td.lv2 { background: #7cc88a; }
.unit-matrix td.lv3 { background: #e8d98a; }
.unit-matrix td.lv4 { background: #eda17c; }
.unit-matrix td.lv5 { background: #e05a4f; color: #fff; }
.unit-matrix td.sold { background: rgba(255, 255, 255, .08); color: var(--text-3); font-weight: 400; }
.unit-matrix td.empty { color: var(--text-3); cursor: pointer; }
.unit-matrix td.empty:hover { background: rgba(79, 156, 249, .14); }
.unit-matrix tr.faded { display: none; }

.unit-form {
  width: 244px; flex: none; display: flex; flex-direction: column; gap: 6px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel-2); overflow-y: auto; max-height: 56vh;
}
.uf-title { font-size: 11.5px; font-weight: 700; color: var(--text); margin-bottom: 2px; }
.uf-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-3); }
.uf-row > span { width: 46px; flex: none; }
.uf-row input, .uf-row select {
  flex: 1; min-width: 0; padding: 4px 7px; font-size: 11.5px;
  background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 7px; color: var(--text); outline: none;
}
.uf-row input:focus, .uf-row select:focus { border-color: var(--primary); }
.uf-btns { display: flex; gap: 6px; margin-top: 4px; }
.uf-btns .btn { flex: 1; padding: 5px 6px; }
.uf-tip { font-size: 10.5px; color: var(--text-3); line-height: 1.5; margin-top: 6px; }

/* 详情卡里的房源行（房号 / 楼层 / 状态） */
.unit-item .u-room { font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.unit-item .u-tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.unit-item .u-tag.sold { background: rgba(255, 255, 255, .10); color: var(--text-3); }
.unit-item .u-tag.onsale { background: rgba(75, 178, 127, .18); color: #63d39b; }
.unit-item .u-edit { border: 0; background: transparent; color: var(--primary); cursor: pointer; font-size: 10.5px; }

.unit-empty-hint, .unit-empty {
  padding: 10px 2px; font-size: 10.5px; color: var(--text-3); line-height: 1.6;
}
.unit-empty { padding: 40px 16px; text-align: center; font-size: 12px; }

.units-head > span { flex: 1; }
.units-head .mini { margin-left: 4px; }

.unit-matrix td.cell.sel { outline: 2px solid #fff; outline-offset: -2px; }

/* 矩阵撑满、表单按内容高度，避免中间空一块 */
.unit-form { align-self: flex-start; }
.unit-body { min-height: 0; }

.unit-unnum {
  padding: 9px 12px; font-size: 10.5px; color: var(--text-3);
  border-top: 1px dashed var(--border); line-height: 2;
}
.unit-unnum button {
  margin: 0 4px 2px 0; padding: 2px 7px; font-size: 10.5px; cursor: pointer;
  background: rgba(255, 255, 255, .06); border: 1px solid var(--border-strong);
  border-radius: 5px; color: var(--text-2);
}
.unit-unnum button:hover { border-color: var(--primary); color: var(--primary); }

/* 标注上的 🔗：关联 / 更换房源 */
.anno-tag-link {
  display: none; position: absolute; right: 14px; top: -10px;
  width: 18px; height: 18px; border-radius: 50%; border: none;
  background: #2fa36b; color: #fff; font-size: 10px; line-height: 1;
  cursor: pointer; padding: 0; align-items: center; justify-content: center;
}
.anno-tag:hover .anno-tag-link { display: flex; }
.anno-tag.linked .anno-tag-link { display: flex; right: -10px; }

/* ===== 关联房源（标注挂房源） ===== */
.ul-tip { font-size: 11px; color: var(--text-3); line-height: 1.7; margin-bottom: 8px; }
.ul-bldrow { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 11px; color: var(--text-3); }
.ul-bldrow select {
  flex: 1; min-width: 0; padding: 5px 8px; font-size: 11.5px;
  background: var(--input-bg); border: 1px solid var(--border-strong);
  border-radius: 7px; color: var(--text); outline: none;
}
.ul-list { display: flex; flex-direction: column; gap: 5px; max-height: 46vh; overflow-y: auto; }
.ul-item {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 7px 10px; border-radius: 8px; font-size: 11.5px;
  background: var(--panel-2); border: 1px solid var(--border);
}
.ul-item:hover { border-color: var(--primary); }
.ul-item.active { border-color: #2fa36b; background: rgba(47, 163, 107, .14); }
.ul-item .ul-room { min-width: 92px; color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.ul-item .ul-type { flex: 1; color: var(--text-2); }
.ul-item .ul-price { color: #f0b35e; font-weight: 700; font-variant-numeric: tabular-nums; }
.ul-item .ul-tag { font-size: 10px; padding: 1px 5px; border-radius: 4px; }
.ul-item .ul-tag.sold { background: rgba(255,255,255,.10); color: var(--text-3); }
.ul-item .ul-tag.onsale { background: rgba(75,178,127,.18); color: #63d39b; }
.ul-empty { padding: 26px 10px; text-align: center; color: var(--text-3); font-size: 11.5px; }

/* 标注列表里的房源关联 */
.anno-item.linked { border-color: rgba(47, 163, 107, .55); background: rgba(47, 163, 107, .07); }
.anno-item .ai-unit { color: #63d39b; font-size: 10.5px; }
.mini.on { background: rgba(47, 163, 107, .22); border-color: #2fa36b; color: #8ef0bb; }

/* ============================= 房源模式（选中楼栋后） ============================= */
.ubar {
  position: fixed; left: 50%; bottom: 86px; transform: translate(-50%, 8px);
  z-index: 60; display: none; align-items: center; gap: 8px;
  padding: 8px 12px; border-radius: 12px;
  background: rgba(14, 24, 40, .93);
  border: 1px solid rgba(100, 180, 255, .28);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .35);
  color: #dbe9f7; font-size: 12px; white-space: nowrap;
  max-width: calc(100vw - 24px); overflow-x: auto;
  backdrop-filter: blur(8px);
}
.ubar.show { display: flex; animation: ubarIn .16s ease-out; }
@keyframes ubarIn { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 8px); } }
.ubar-t { font-weight: 600; color: #fff; letter-spacing: .3px; }
.ubar-bld {
  color: #8fd0ff; font-weight: 600; max-width: 170px;
  overflow: hidden; text-overflow: ellipsis;
}
.ubar label { color: #9fb6cc; }
.ubar input {
  width: 158px; height: 26px; padding: 0 8px; border-radius: 7px;
  border: 1px solid rgba(100, 180, 255, .3); background: rgba(255, 255, 255, .06);
  color: #fff; font-size: 12px; outline: none;
}
.ubar input::placeholder { color: #7c93a9; }
.ubar input:focus { border-color: #4aa3ff; box-shadow: 0 0 0 2px rgba(74, 163, 255, .2); }
.ubar-tip { color: #8fa8bf; }
.ubar-count { color: #ffd479; font-variant-numeric: tabular-nums; }
.ubar-btn {
  height: 26px; padding: 0 10px; border-radius: 7px; cursor: pointer;
  border: 1px solid rgba(100, 180, 255, .35);
  background: rgba(74, 163, 255, .18); color: #dcecff; font-size: 12px;
  transition: background .15s, border-color .15s;
}
.ubar-btn:hover { background: rgba(74, 163, 255, .32); border-color: rgba(100, 180, 255, .6); }
.ubar-btn.ghost { background: transparent; color: #9fb6cc; }
.ubar-btn.ghost:hover { color: #fff; }

/* 轮廓上的房源标签 */
.unit-layer { position: absolute; inset: 0; pointer-events: none; overflow: hidden; z-index: 7; }
.unit-tag {
  position: absolute; left: 0; top: 0; pointer-events: auto;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 6px; border-radius: 6px; font-size: 10.5px; line-height: 16px;
  color: #fff; white-space: nowrap; cursor: grab; user-select: none;
  background: linear-gradient(135deg, #2f7ef5, #1450b4);
  border: 1px solid rgba(255, 255, 255, .45);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .32);
}
.unit-tag::after {
  content: ''; position: absolute; left: 50%; bottom: -4px; width: 6px; height: 6px;
  transform: translateX(-50%) rotate(45deg);
  background: inherit; border-right: 1px solid rgba(255, 255, 255, .45);
  border-bottom: 1px solid rgba(255, 255, 255, .45);
}
.unit-tag.sold { background: linear-gradient(135deg, #64748b, #3f4c5c); }
.unit-tag.dragging { cursor: grabbing; box-shadow: 0 8px 20px rgba(0, 0, 0, .45); }
.unit-tag-del {
  width: 13px; height: 13px; padding: 0; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .24); color: #fff; font-size: 10px; line-height: 1;
  cursor: pointer;
}
.unit-tag-del:hover { background: #e05252; }

/* 标注列表里的类型标签（底图 / 楼顶） */
.anno-item .ai-kind {
  font-size: 10px; color: var(--text-3); margin-left: 6px;
  padding: 0 5px; border: 1px solid var(--border); border-radius: 5px;
  line-height: 15px; white-space: nowrap;
}

/* 楼栋参数：所属分组选择 */
.bp-row-group select {
  flex: 1; min-width: 0; height: 27px; padding: 0 6px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 11.5px; color: var(--text); background: var(--input-bg);
  outline: none; cursor: pointer;
}
.bp-row-group select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
.bp-row-group select.empty { color: var(--text-3); }

/* 价格表：已配房源链接的格子 */
.unit-matrix td.cell { position: relative; }
.unit-matrix td.cell .u-link-dot {
  position: absolute; right: 1px; top: 1px;
  font-size: 8px; line-height: 1; font-style: normal;
  padding: 1px 2px; border-radius: 4px;
  background: rgba(37, 99, 235, .95); color: #fff;
  pointer-events: none;
}
.unit-matrix td.cell.haslink { box-shadow: inset 0 0 0 1.5px rgba(37, 99, 235, .65); }

/* 房源表单：链接操作行（按钮跟输入框左对齐，提示另起一行） */
.uf-linkrow {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin: -2px 0 8px; padding-left: 54px;
  font-size: 10px; color: var(--text-3);
}
.uf-linkrow .mini { height: 22px; padding: 0 8px; font-size: 10.5px; }
.uf-linkrow span { flex: 1 0 100%; line-height: 1.5; }

/* ===== 标注关联弹窗（房源 + 户型图 + 新房备案） ===== */
.ul-body { max-height: min(74vh, 720px); overflow-y: auto; }
.ul-sec { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); }
.ul-sec-h { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.ul-sec-h b { font-size: 11.5px; color: var(--text); }
.ul-sec-h span { font-size: 10px; color: var(--text-3); }
.ul-sec-h input {
  margin-left: auto; width: 190px; height: 26px; padding: 0 8px;
  border: 1px solid var(--border-strong); border-radius: 7px;
  font-size: 11px; color: var(--text); background: var(--input-bg); outline: none;
}
.ul-sec-h input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.12); }

.ul-fp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 8px; }
.ul-fp-card {
  position: relative; border: 2px solid transparent; border-radius: 8px; overflow: hidden;
  background: var(--input-bg); cursor: pointer; transition: border-color .12s, transform .12s;
}
.ul-fp-card:hover { transform: translateY(-1px); border-color: var(--border-strong); }
.ul-fp-card.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.16); }
.ul-fp-card img { display: block; width: 100%; height: 78px; object-fit: cover; background: #fff; }
.ul-fp-card .nm { padding: 4px 6px 1px; font-size: 10.5px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-fp-card .mt { padding: 0 6px 5px; font-size: 9.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-fp-card .ck {
  position: absolute; right: 4px; top: 4px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
  display: none;
}
.ul-fp-card.active .ck { display: block; }
.ul-fp-none {
  display: inline-flex; align-items: center; height: 26px; padding: 0 10px; margin-bottom: 8px;
  border: 1px solid var(--border-strong); border-radius: 7px; font-size: 10.5px;
  color: var(--text-2); background: var(--input-bg); cursor: pointer;
}
.ul-fp-none.active { border-color: var(--primary); color: var(--primary); }
.ul-empty2 { padding: 10px; font-size: 10.5px; color: var(--text-3); line-height: 1.7; }

.ul-nh-list { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow-y: auto; }
.ul-nh-item {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  border: 1px solid var(--border); border-radius: 8px; cursor: pointer;
  background: var(--input-bg);
}
.ul-nh-item:hover { border-color: var(--border-strong); }
.ul-nh-item.active { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,.14); }
.ul-nh-main { flex: 1; min-width: 0; }
.ul-nh-t { font-size: 11.5px; color: var(--text); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-nh-s { margin-top: 2px; font-size: 10px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ul-nh-p { flex: none; text-align: right; font-size: 10.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.ul-nh-p b { display: block; font-size: 12px; color: #c2410c; }

/* 标注列表：户型图 / 备案 关联摘要 */
.anno-item .ai-extra { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.anno-item .ai-extra span {
  font-size: 10px; color: var(--text-2); padding: 1px 6px;
  border: 1px solid var(--border); border-radius: 5px; background: var(--panel-2);
}

/* 楼栋参数：墙体风格下拉 */
.bp-row-style select {
  flex: 1; min-width: 0; height: 27px; padding: 0 6px;
  border: 1px solid var(--border-strong); border-radius: 6px;
  font-size: 11.5px; color: var(--text); background: var(--input-bg);
  outline: none; cursor: pointer;
}
.bp-row-style select:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37, 99, 235, .12); }
