* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html, body, #map-wrap, #amap-container { width: 100%; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
body { background: #f3f5f8; color: #1e293b; }

/* Watermark */
#watermark-layer {
  position: absolute; inset: 0; pointer-events: none; z-index: 120;
  overflow: hidden; opacity: 0.14;
  background-repeat: repeat;
}
#watermark-layer.is-hidden { display: none; }

/* CDR-style Title Banner */
.title-banner {
  position: absolute; top: 62px; left: 50%; transform: translateX(-50%);
  z-index: 140; pointer-events: none; text-align: center;
}
body.is-live .title-banner { top: 16px; }
.title-banner h1 {
  font-size: 24px; font-weight: 800; color: #b91c1c; letter-spacing: 1px;
  text-shadow: 0 0 6px #fff, 0 0 12px #fff, 0 2px 4px rgba(255,255,255,.95);
  white-space: nowrap;
}

/* Top Bar */
.top-bar {
  position: absolute; top: 12px; left: 14px; right: 14px; z-index: 200;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
body.is-live .top-bar, body.is-live .filter-bar { display: none !important; }
.bar-left, .bar-right {
  display: flex; align-items: center; gap: 8px; pointer-events: auto; flex-wrap: wrap;
}
.search-box { position: relative; }
.search-box input {
  width: 220px; height: 36px; padding: 0 12px; border-radius: 10px;
  border: 1px solid rgba(15,23,42,.12); background: rgba(255,255,255,.96);
  box-shadow: 0 4px 14px rgba(15,23,42,.08); font-size: 13px; outline: none;
}
.search-box input:focus { border-color: #2563eb; }
.search-dropdown {
  position: absolute; top: 42px; left: 0; width: 300px; max-height: 320px; overflow-y: auto;
  background: #fff; border-radius: 12px; box-shadow: 0 12px 32px rgba(15,23,42,.16);
  border: 1px solid rgba(15,23,42,.08); padding: 6px;
}
.sd-item {
  padding: 8px 10px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px;
}
.sd-item:hover { background: #f1f5f9; }
.sd-tag { font-size: 11px; padding: 1px 6px; border-radius: 4px; background: #fee2e2; color: #b91c1c; flex-shrink: 0; }
.sd-tag.resale { background: #ccfbf1; color: #0f766e; }
.sd-tag.poi { background: #e0f2fe; color: #0369a1; }

.layer-pills {
  display: flex; gap: 6px; background: rgba(255,255,255,.94); padding: 4px; border-radius: 11px;
  box-shadow: 0 4px 14px rgba(15,23,42,.08); border: 1px solid rgba(15,23,42,.08);
}
.pill {
  border: 0; background: transparent; padding: 5px 10px; border-radius: 8px;
  font-size: 12.5px; font-weight: 600; color: #475569; cursor: pointer; transition: all .15s;
}
.pill b { font-weight: 700; opacity: .75; margin-left: 2px; }
.pill.active { background: #1e293b; color: #fff; }
.pill[data-layer="newHouse"].active { background: #dc2626; }
.pill[data-layer="resale"].active { background: #0f766e; }
.pill[data-layer="zones"].active { background: #d97706; }
.pill[data-layer="lands"].active { background: #16a34a; }

.action-btn {
  height: 36px; padding: 0 13px; border-radius: 10px; border: 1px solid rgba(15,23,42,.1);
  background: rgba(255,255,255,.96); color: #1e293b; font-size: 13px; font-weight: 600;
  cursor: pointer; box-shadow: 0 4px 14px rgba(15,23,42,.08); transition: all .15s;
}
.action-btn:hover { transform: translateY(-1px); background: #fff; }
.action-btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.action-btn.primary:hover { background: #1d4ed8; }
.action-btn.edit-toggle.is-on { background: #dc2626; color: #fff; border-color: #dc2626; }

/* Filter Bar */
.filter-bar {
  position: absolute; top: 56px; left: 14px; z-index: 195;
  background: rgba(255,255,255,.96); backdrop-filter: blur(8px);
  border-radius: 12px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(15,23,42,.12);
  border: 1px solid rgba(15,23,42,.08); display: flex; flex-direction: column; gap: 8px;
}
.filter-group { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.fg-label { font-size: 12px; color: #64748b; width: 34px; font-weight: 600; }
.f-chip {
  border: 1px solid #e2e8f0; background: #fff; color: #334155; font-size: 12px;
  padding: 3px 10px; border-radius: 999px; cursor: pointer;
}
.f-chip.active { background: #1e293b; color: #fff; border-color: #1e293b; }

/* Live Mode Minimal Controls */
.live-controls {
  position: absolute; top: 14px; right: 14px; z-index: 210;
  display: flex; gap: 6px; background: rgba(15,23,42,.72); backdrop-filter: blur(8px);
  padding: 5px; border-radius: 999px;
}
.live-pill {
  border: 0; background: transparent; color: rgba(255,255,255,.78); padding: 5px 11px;
  border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.live-pill.active { background: #fff; color: #0f172a; }
.live-pill.exit { background: rgba(239,68,68,.9); color: #fff; }

/* CDR-Style Building Marker Card */
.nh-card-wrap {
  position: relative; display: inline-flex; flex-direction: column; align-items: center;
  user-select: none; cursor: pointer; transition: transform .12s;
}
.nh-card-wrap:hover { transform: scale(1.06); z-index: 999; }
.nh-badge {
  font-size: 10px; font-weight: 800; line-height: 1; padding: 2px 5px; border-radius: 3px 3px 0 0;
  background: #15803d; color: #fff; letter-spacing: .5px; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.nh-badge.xianfang { background: #7c3aed; }
.nh-card {
  border-radius: 4px; overflow: hidden; box-shadow: 0 2px 6px rgba(15,23,42,.28);
  border: 1px solid rgba(255,255,255,.9); min-width: 72px; text-align: center;
}
.nh-name {
  background: #dc2626; color: #fff; font-size: 11.5px; font-weight: 800;
  padding: 2px 6px; line-height: 1.25; white-space: nowrap;
}
.nh-card.theme-blue .nh-name { background: #2563eb; }
.nh-card.theme-amber .nh-name { background: #d97706; }
.nh-price {
  background: #fef08a; color: #1e293b; font-size: 10.5px; font-weight: 700;
  padding: 1px 5px; line-height: 1.25; white-space: nowrap;
}
.nh-card.theme-blue .nh-price { background: #dbeafe; color: #1e3a8a; }
.nh-pin-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #dc2626;
  border: 1.5px solid #fff; box-shadow: 0 1px 3px rgba(0,0,0,.35); margin-top: 1px;
}
.nh-card.theme-blue + .nh-pin-dot { background: #2563eb; }

/* Green Land Marker */
.land-pin {
  display: inline-flex; flex-direction: column; align-items: center; cursor: pointer;
}
.land-circle {
  width: 24px; height: 24px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: #16a34a; border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0,0,0,.3);
  display: flex; align-items: center; justify-content: center;
}
.land-circle span { transform: rotate(45deg); color: #fff; font-size: 12px; font-weight: 800; }
.land-lbl {
  margin-top: 2px; font-size: 10px; font-weight: 700; color: #14532d;
  background: rgba(255,255,255,.9); padding: 0 4px; border-radius: 3px; white-space: nowrap;
}

/* Resale Community Pill */
.resale-pill {
  background: rgba(15,118,110,.92); color: #fff; border: 1px solid rgba(255,255,255,.85);
  border-radius: 999px; padding: 2px 8px; font-size: 11px; font-weight: 700;
  white-space: nowrap; box-shadow: 0 2px 6px rgba(15,23,42,.22); cursor: pointer;
}
.resale-pill small { opacity: .88; font-weight: 500; margin-left: 3px; }
.resale-pill:hover { background: #0d9488; transform: scale(1.06); }

/* Zone Label */
.zone-lbl {
  font-size: 14px; font-weight: 900; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,255,255,.78); box-shadow: 0 1px 4px rgba(0,0,0,.1); white-space: nowrap;
  pointer-events: none;
}

/* Edit Sidebar */
.edit-panel {
  position: absolute; top: 58px; left: 14px; bottom: 52px; width: 300px; z-index: 205;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border-radius: 14px; box-shadow: 0 12px 36px rgba(15,23,42,.18);
  border: 1px solid rgba(15,23,42,.08); display: flex; flex-direction: column;
}
.ep-head, .dd-head {
  padding: 12px 14px; border-bottom: 1px solid #e2e8f0;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 8px;
}
.ep-body, .dd-body { padding: 12px 14px; overflow-y: auto; flex: 1; }
.ep-section { margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed #e2e8f0; }
.ep-sec-title { font-size: 12px; font-weight: 700; color: #475569; margin-bottom: 8px; display: flex; justify-content: space-between; }
.switch-label { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: #1e293b; cursor: pointer; }
.ep-btns { display: flex; gap: 6px; margin-top: 8px; }
.mini-btn {
  flex: 1; padding: 6px 8px; border-radius: 8px; border: 1px solid #cbd5e1;
  background: #fff; font-size: 12px; font-weight: 600; cursor: pointer; color: #1e293b;
}
.mini-btn.primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.mini-btn.danger { color: #dc2626; border-color: #fecaca; }
.mini-btn.full { width: 100%; margin-top: 6px; }
.ep-hint { margin-top: 8px; padding: 6px 8px; border-radius: 8px; background: #eff6ff; color: #1d4ed8; font-size: 12px; }
.unplaced-list, .overlay-list { display: flex; flex-direction: column; gap: 6px; max-height: 150px; overflow-y: auto; }
.list-row {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 6px 8px; border-radius: 8px; background: #f8fafc; font-size: 12px;
}
.list-row button { border: 0; background: #e2e8f0; padding: 2px 7px; border-radius: 6px; font-size: 11px; cursor: pointer; }
.list-row button.del { background: #fee2e2; color: #b91c1c; }
.ep-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 8px; font-size: 12px; color: #475569; }
.ep-field input, .ep-field select, .ep-field textarea {
  padding: 6px 8px; border-radius: 8px; border: 1px solid #cbd5e1; font-size: 12.5px; width: 100%;
}

/* Detail Drawer */
.detail-drawer {
  position: absolute; top: 58px; right: 14px; bottom: 52px; width: 350px; z-index: 205;
  background: rgba(255,255,255,.98); backdrop-filter: blur(10px);
  border-radius: 14px; box-shadow: 0 12px 36px rgba(15,23,42,.18);
  border: 1px solid rgba(15,23,42,.08); display: flex; flex-direction: column;
}
.dd-tag {
  display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 999px;
  background: #fee2e2; color: #b91c1c; margin-bottom: 4px;
}
.dd-tag.resale { background: #ccfbf1; color: #0f766e; }
.dd-head h2 { font-size: 17px; font-weight: 800; color: #0f172a; }
.dd-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.icon-close { border: 0; background: #f1f5f9; width: 28px; height: 28px; border-radius: 8px; cursor: pointer; font-size: 14px; flex-shrink: 0; }

.dd-price-box {
  background: linear-gradient(135deg, #fef2f2, #fffbeb); border: 1px solid #fecaca;
  border-radius: 10px; padding: 10px 12px; margin-bottom: 12px;
}
.dd-price-main { font-size: 18px; font-weight: 800; color: #b91c1c; }
.dd-price-sub { font-size: 12px; color: #64748b; margin-top: 2px; }
.dd-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.dd-kv { background: #f8fafc; border-radius: 8px; padding: 7px 9px; }
.dd-kv span { display: block; font-size: 11px; color: #64748b; }
.dd-kv b { font-size: 12.5px; color: #0f172a; }
.dd-block { margin-bottom: 10px; font-size: 12.5px; line-height: 1.55; color: #334155; }
.dd-block strong { display: block; font-size: 12px; color: #64748b; margin-bottom: 2px; }
.dd-actions { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.deal-table { width: 100%; border-collapse: collapse; font-size: 11.5px; margin-top: 6px; }
.deal-table th, .deal-table td { padding: 5px 4px; border-bottom: 1px solid #e2e8f0; text-align: left; }
.deal-table th { color: #64748b; font-weight: 600; }

/* Legend */
.map-legend {
  position: absolute; bottom: 12px; left: 14px; right: 14px; z-index: 180;
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: rgba(255,255,255,.92); backdrop-filter: blur(8px);
  padding: 6px 14px; border-radius: 999px; width: fit-content; max-width: calc(100% - 28px);
  box-shadow: 0 4px 14px rgba(15,23,42,.08); font-size: 12px; color: #334155;
}
.leg-item { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; }
.leg-item .dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.dot.red { background: #dc2626; } .dot.blue { background: #2563eb; }
.dot.teal { background: #0f766e; } .dot.green { background: #16a34a; }
.leg-contact { margin-left: 6px; padding-left: 10px; border-left: 1px solid #cbd5e1; color: #b91c1c; font-weight: 700; }

/* Modal & Toast */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 300;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-card {
  width: 100%; max-width: 360px; background: #fff; border-radius: 14px; padding: 18px;
  box-shadow: 0 20px 50px rgba(15,23,42,.25);
}
.modal-card h3 { font-size: 16px; margin-bottom: 6px; }
.modal-desc { font-size: 12px; color: #64748b; margin-bottom: 12px; line-height: 1.5; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.form-err { color: #dc2626; font-size: 12px; margin-top: 4px; }
.toast {
  position: fixed; bottom: 64px; left: 50%; transform: translateX(-50%); z-index: 400;
  background: rgba(15,23,42,.88); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 13px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .top-bar { flex-direction: column; align-items: stretch; gap: 6px; top: 8px; left: 8px; right: 8px; }
  .search-box input { width: 100%; }
  .bar-left, .bar-right { justify-content: space-between; }
  .layer-pills { overflow-x: auto; max-width: 100%; }
  .title-banner { top: 106px; }
  .title-banner h1 { font-size: 16px; }
  .detail-drawer { top: auto; left: 8px; right: 8px; bottom: 8px; width: auto; max-height: 62vh; }
  .edit-panel { top: 100px; left: 8px; right: 8px; width: auto; }
  .map-legend { font-size: 11px; padding: 5px 10px; gap: 8px; }
}
EOF'