:root {
  color-scheme: light;
  --color-primary: #1565C0;
  --color-primary-strong: #0D47A1;
  --color-primary-soft: #E3F2FD;
  --color-accent: #FF9800;
  --color-accent-strong: #EF6C00;
  --color-background: #F5F5F5;
  --color-surface: #FFFFFF;
  --color-text: #212121;
  --color-muted-text: #757575;
  --color-border: #E0E0E0;
  --color-focus: #1565C0;
  --color-danger: #D32F2F;
  --color-green: #4CAF50;
  --color-purple: #9C27B0;
  --font-body: "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-display: "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-pill: 999px;
  --space-unit: 0.25rem;
  --content-width: 30rem;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.05), 0 2px 8px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: #E8E8E8;
  color: var(--color-text);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
}

button,
input {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

/* ---------- 地图页外壳 ---------- */
.map-page {
  background: var(--color-background);
  color: var(--color-text);
  max-width: var(--content-width);
  margin: 0 auto;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.map-page main {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部筛选栏 ---------- */
.filter-bar {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0.45rem 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
  flex: none;
}

.filter-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-bottom {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.city-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
}

.city-btn::after {
  content: "▾";
  font-size: 0.7rem;
  color: var(--color-muted-text);
  margin-left: 0.15rem;
}

.seg {
  display: inline-flex;
  background: var(--color-background);
  border-radius: var(--radius-pill);
  padding: 0.15rem;
  flex: none;
}

.seg button {
  border: none;
  background: none;
  font-size: 0.85rem;
  color: var(--color-muted-text);
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-pill);
  cursor: pointer;
}

.seg button.is-active {
  background: var(--color-surface);
  color: var(--color-primary);
  font-weight: 700;
  box-shadow: var(--shadow-card);
}

.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search-input {
  width: 100%;
  border: none;
  background: var(--color-background);
  border-radius: var(--radius-pill);
  padding: 0.42rem 0.85rem;
  color: var(--color-text);
  font-size: 0.85rem;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-overflow: ellipsis;
}

.search-input::placeholder {
  color: var(--color-muted-text);
}

.search-suggest {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  z-index: 20;
  overflow: hidden;
  max-height: 16rem;
  overflow-y: auto;
}

.search-suggest-item {
  padding: 0.55rem 0.85rem;
  cursor: pointer;
}

.search-suggest-item:active {
  background: var(--color-primary-soft);
}

.search-suggest-item .s-main {
  min-width: 0;
}

.search-suggest-item .s-name {
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-suggest-item .s-sub {
  font-size: 0.75rem;
  color: var(--color-muted-text);
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-empty {
  padding: 0.8rem;
  text-align: center;
  color: var(--color-muted-text);
  font-size: 0.85rem;
}

.filter-btn {
  flex: none;
  border: none;
  background: none;
  color: var(--color-muted-text);
  font-size: 0.85rem;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
}

/* ---------- 地图区 ---------- */
.map-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #EDF0E8;
}

.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.map-zoom {
  position: absolute;
  right: 0.75rem;
  bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  z-index: 5;
}

.map-zoom button {
  width: 2.4rem;
  height: 2.4rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-card);
}

/* 小区气泡 */
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  border: none;
  background: var(--pin-color, var(--color-primary));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0.35rem 0.6rem 0.45rem;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  z-index: 2;
  text-align: center;
  min-width: 4.6rem;
}

.map-pin.is-active {
  --pin-color: #E53935;
  z-index: 3;
  box-shadow: 0 3px 10px rgba(229, 57, 53, 0.4);
}

.map-pin::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--pin-color, var(--color-primary));
  transform: translateX(-50%);
}

.pin-name {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}

.pin-meta {
  font-size: 0.72rem;
  opacity: 0.95;
  margin-top: 0.05rem;
  white-space: nowrap;
}

/* ---------- 底部房源 Sheet ---------- */
.list-sheet {
  flex: none;
  background: var(--color-surface);
  border-radius: 1rem 1rem 0 0;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.10);
  display: flex;
  flex-direction: column;
  max-height: 46%;
  overflow: hidden;
}

.sheet-handle {
  width: 2.4rem;
  height: 0.3rem;
  background: #E0E0E0;
  border-radius: var(--radius-pill);
  margin: 0.5rem auto 0;
  flex: none;
}

.sheet-head {
  padding: 0.5rem 1rem 0.6rem;
  border-bottom: 1px solid #EEEEEE;
  flex: none;
}

.sheet-title {
  font-size: 1.15rem;
  font-weight: 700;
}

.sheet-sub {
  font-size: 0.82rem;
  color: var(--color-muted-text);
  margin-top: 0.2rem;
}

.sheet-sub .sheet-count {
  color: var(--color-danger);
  font-weight: 600;
}

.sheet-list {
  overflow-y: auto;
  padding: 0.6rem 0.75rem 0.75rem;
}

/* 房源卡片 */
.listing-card {
  display: flex;
  gap: 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-card);
}

.listing-img {
  flex: none;
  width: 5.5rem;
  height: 4.6rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #cfd8dc, #90a4ae);
  position: relative;
}

.listing-img .vr-badge {
  position: absolute;
  left: 0.3rem;
  bottom: 0.3rem;
  font-size: 0.62rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  padding: 0.1rem 0.35rem;
  border-radius: var(--radius-sm);
}

.listing-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.listing-title {
  font-size: 0.98rem;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.listing-sub {
  font-size: 0.8rem;
  color: var(--color-muted-text);
  margin-top: 0.15rem;
}

.listing-tags {
  display: flex;
  gap: 0.3rem;
  margin-top: 0.25rem;
}

.listing-tag {
  font-size: 0.68rem;
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  padding: 0.08rem 0.4rem;
  border-radius: var(--radius-sm);
}

.listing-price {
  margin-top: auto;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-danger);
}

.listing-price span {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-muted-text);
  margin-left: 0.25rem;
}

.sheet-empty {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--color-muted-text);
  font-size: 0.9rem;
}

/* 录入按钮 */
.sheet-add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  width: 100%;
  padding: 0.7rem;
  border: 1px dashed var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary-strong);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

/* ---------- 高德地图容器与气泡 ---------- */
.map-error {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-muted-text);
  font-size: 0.9rem;
  background: #EDF0E8;
  z-index: 3;
  text-align: center;
  padding: 1rem;
}

.cm-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--color-primary);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.cm-dot.is-active {
  width: 14px;
  height: 14px;
  background: #E53935;
}

.cm-info {
  padding: 2px 6px;
  text-align: center;
}

.cm-info .n {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
}

.cm-info .d {
  font-size: 0.72rem;
  color: var(--color-muted-text);
}

/* ---------- 分层气泡（区 / 商圈） ---------- */
.lvl-bubble {
  text-align: center;
  padding: 6px 10px;
  border-radius: 10px;
  color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  position: relative;
}

.lvl-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  transform: translateX(-50%);
}

.lvl-district {
  background: rgba(21, 101, 192, 0.94);
}

.lvl-district::after {
  border-top: 7px solid rgba(21, 101, 192, 0.94);
}

.lvl-biz {
  background: rgba(239, 108, 0, 0.94);
  padding: 5px 9px;
}

.lvl-biz::after {
  border-top: 6px solid rgba(239, 108, 0, 0.94);
}

.lvl-name {
  font-weight: 700;
  white-space: nowrap;
  line-height: 1.2;
}

.lvl-district .lvl-name {
  font-size: 0.95rem;
}

.lvl-biz .lvl-name {
  font-size: 0.82rem;
}

.lvl-meta {
  font-size: 0.7rem;
  opacity: 0.95;
  margin-top: 1px;
  white-space: nowrap;
}

/* ---------- 小区名字气泡（zoom >= 16 显示） ---------- */
.cm-bubble {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 8px;
  background: #FFFFFF;
  color: #333333;
  border: 1px solid #C8E6C9;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  max-width: 9rem;
}

.cm-bubble::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #FFFFFF;
  transform: translateX(-50%);
}

.cm-bubble .cm-b-name {
  font-size: 11px;
  font-weight: 600;
  color: #2E7D32;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cm-bubble .cm-b-count {
  flex: none;
  font-size: 10px;
  line-height: 1;
  color: #FFFFFF;
  background: #4CAF50;
  border-radius: 8px;
  padding: 2px 5px;
}

.cm-bubble .cm-b-good {
  flex: none;
  font-size: 9px;
  line-height: 1;
  color: #BF5B00;
  border: 1px solid rgba(191, 91, 0, 0.55);
  border-radius: 4px;
  padding: 1px 3px;
  margin-left: 2px;
  opacity: 0.9;
}

.cm-bubble.is-active {
  border-color: #E53935;
  box-shadow: 0 2px 8px rgba(229, 57, 53, 0.5);
  z-index: 3;
}

.cm-bubble.is-active::after {
  border-top-color: #FFFFFF;
}

.cm-bubble.is-active .cm-b-name {
  color: #E53935;
}

.cm-bubble.is-active .cm-b-count {
  background: #E53935;
}

/* ---------- 录入房源列表项 ---------- */
.house-item.sold {
  opacity: 0.55;
  filter: grayscale(0.85);
}

.house-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-card);
}

.house-item .h-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}

.house-item .h-meta {
  font-size: 0.8rem;
  color: var(--color-muted-text);
  margin-top: 0.25rem;
}

.house-item .addr-btn {
  cursor: pointer;
  border: none;
  background: #2468f2;
  color: #fff;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.72rem;
  margin-left: 0.25rem;
}

.house-item .h-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-danger);
}

.house-item .h-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.house-item .h-top {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(239, 44, 44, 0.18);
}

.house-item .h-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
}

.house-item .h-good {
  padding: 0.45rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 700;
}

.house-item .h-price small {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-muted-text);
}

/* ---------- 录入弹窗 ---------- */
.add-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: flex-end;
  justify-content: center;
}

.add-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.add-panel {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: 86vh;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: addUp 0.22s ease;
}

@keyframes addUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.add-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
}

.add-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
}

.add-community {
  font-size: 0.78rem;
  color: var(--color-primary);
  margin-top: 0.15rem;
}

.add-close {
  flex: none;
  width: 2rem;
  height: 2rem;
  font-size: 1.5rem;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--color-muted-text);
  cursor: pointer;
}

.add-body {
  padding: 0.8rem 1rem 0.2rem;
  overflow-y: auto;
}

.fld-row {
  display: flex;
  gap: 0.6rem;
}

.fld-row .fld {
  flex: 1;
  min-width: 0;
}

.fld {
  display: block;
  margin-bottom: 0.75rem;
}

.fld > span {
  display: block;
  font-size: 0.8rem;
  color: var(--color-muted-text);
  margin-bottom: 0.3rem;
}

.fld input,
.fld select,
.fld textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  color: var(--color-text);
  background: var(--color-surface);
}

.fld textarea {
  resize: vertical;
  line-height: 1.4;
}

.fld input:focus,
.fld select:focus,
.fld textarea:focus {
  outline: none;
  border-color: var(--color-focus);
  box-shadow: 0 0 0 2px rgba(21, 101, 192, 0.12);
}

.add-foot {
  display: flex;
  gap: 0.6rem;
  padding: 0.8rem 1rem calc(0.8rem + env(safe-area-inset-bottom));
  border-top: 1px solid var(--color-border);
}

.btn-cancel {
  flex: 1;
  padding: 0.7rem;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-save {
  flex: 2;
  padding: 0.7rem;
  border: none;
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-save:active {
  background: var(--color-primary-strong);
}

/* ---------- 展位入口浮条（框架） ---------- */
.booth-bar {
  position: absolute;
  top: 0.6rem;
  left: 0.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  z-index: 6;
  width: 17rem;
  max-width: calc(100% - 1.2rem);
}

.booth-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-text);
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.booth-toggle-caret {
  font-size: 0.9rem;
  color: var(--color-muted-text);
}

.booth-cards {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  width: 100%;
}

.booth-card {
  flex: none;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: none;
  border-radius: var(--radius-md);
  padding: 0.55rem 0.6rem;
  cursor: pointer;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
  text-align: left;
}

.booth-price {
  background: linear-gradient(135deg, #43A047, #2E7D32);
}

.booth-policy {
  background: linear-gradient(135deg, #FF9800, #EF6C00);
}

.booth-icon {
  flex: none;
  width: 1.6rem;
  height: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
}

.booth-info {
  flex: 1;
  min-width: 0;
}

.booth-name {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
}

.booth-house {
  display: block;
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 0.12rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booth-desc {
  display: block;
  font-size: 0.68rem;
  opacity: 0.92;
  margin-top: 0.1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.booth-arrow {
  font-size: 1.1rem;
  opacity: 0.9;
}

/* ---------- 展位面板（框架） ---------- */
.booth-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  align-items: flex-end;
  justify-content: center;
}

.booth-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.booth-panel {
  position: relative;
  width: 100%;
  max-width: 32rem;
  max-height: 80vh;
  background: var(--color-surface);
  border-radius: 16px 16px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: addUp 0.22s ease;
}

.booth-panel-head {
  position: relative;
  padding: 0.9rem 1rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
}

.booth-panel-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.booth-panel-rule {
  font-size: 0.78rem;
  color: var(--color-muted-text);
  margin-top: 0.2rem;
}

.booth-close {
  position: absolute;
  right: 0.8rem;
  top: 0.6rem;
  border: none;
  background: none;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--color-muted-text);
  cursor: pointer;
}

.booth-panel-body {
  overflow-y: auto;
  padding: 0.6rem 0.75rem 0.75rem;
}

.booth-item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
  box-shadow: var(--shadow-card);
  cursor: pointer;
}

.booth-item-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
}

.booth-item-badges {
  margin-top: 0.3rem;
}

.booth-item-badges .badge {
  margin-right: 0.3rem;
}

.booth-item-meta {
  font-size: 0.8rem;
  color: var(--color-muted-text);
  margin-top: 0.25rem;
}

.booth-item-foot {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 0.4rem;
}

.booth-item-price {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-danger);
}

.booth-item-unit {
  font-size: 0.78rem;
  color: var(--color-muted-text);
}

/* ---------- 房源角标（框架） ---------- */
.h-badges {
  display: inline-flex;
  gap: 0.3rem;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.h-badges .badge {
  margin: 0;
}

.badge {
  display: inline-block;
  font-size: 0.62rem;
  line-height: 1;
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}

.badge-top {
  background: linear-gradient(135deg, #FFB300, #FF9800);
  color: #fff;
}

.badge-good {
  background: #E53935;
  color: #fff;
}

.badge-policy {
  background: #7B1FA2;
  color: #fff;
}

.badge-unit {
  background: #EEEEEE;
  color: #616161;
}

.badge-expire {
  background: #FF6D00;
  color: #fff;
}

/* ---------- 置顶按钮（框架 · 灰色未开通态） ---------- */
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.sheet-head-main {
  flex: 1;
  min-width: 0;
}

.top-btn {
  flex: none;
  border: 1px solid var(--color-accent);
  background: var(--color-surface);
  color: var(--color-accent-strong);
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.85rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.top-btn.is-disabled {
  border-color: var(--color-border);
  background: var(--color-background);
  color: #BDBDBD;
  cursor: pointer;
}

.top-btn.is-top {
  background: linear-gradient(135deg, #FFB300, #FF9800);
  color: #fff;
  border-color: transparent;
}

.top-btn.is-good {
  background: #E53935;
  color: #fff;
  border-color: transparent;
}

.top-btn.is-over {
  background: linear-gradient(135deg, #7B1FA2, #9C27B0);
  color: #fff;
  border-color: transparent;
}

/* ---------- 房源图片（卡片缩略图 + 录入上传） ---------- */
.house-item .h-imgs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  margin-bottom: 0.45rem;
  scrollbar-width: none;
}
.house-item .h-imgs::-webkit-scrollbar { display: none; }
.house-item .h-img {
  width: 4.6rem;
  height: 3.5rem;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex: none;
  background: var(--color-background);
}

.img-uploader {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-start;
}
.img-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.img-thumb {
  position: relative;
  width: 4.4rem;
  height: 4.4rem;
}
.img-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius-sm);
  display: block;
  background: var(--color-background);
}
.img-del {
  position: absolute;
  top: -0.4rem;
  right: -0.4rem;
  width: 1.35rem;
  height: 1.35rem;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 0.9rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-add {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 4.4rem;
  height: 4.4rem;
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-muted-text);
  font-size: 0.78rem;
  cursor: pointer;
}

.watermark {
  position: fixed;
  inset: -15%;
  z-index: 9999;
  pointer-events: none;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: 2.2rem 3.5rem;
  transform: rotate(-20deg);
  opacity: 0.05;
  overflow: hidden;
}

.watermark span {
  font-size: 0.8rem;
  color: #000;
  white-space: nowrap;
  letter-spacing: 1px;
}

/* ---------- 登录入口 / 登录弹窗 ---------- */
.login-btn {
  flex: none;
  border: 1px solid var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary-strong);
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.login-btn.is-logged {
  border-color: var(--color-primary-soft);
  background: var(--color-primary-soft);
}

.code-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.code-row input {
  flex: 1;
  min-width: 0;
  width: auto;
}

.code-btn {
  flex: none;
  border: 1px solid var(--color-primary);
  background: var(--color-surface);
  color: var(--color-primary-strong);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.7rem;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
}

.code-btn:disabled {
  border-color: var(--color-border);
  color: var(--color-muted-text);
  cursor: default;
}

.login-tip {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  color: var(--color-muted-text);
  word-break: break-all;
}

/* ---------- 互动 / 收藏 / 通知 ---------- */
.filter-top-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: none;
}

.tool-btn {
  position: relative;
  flex: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0.32rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}

.notif-dot {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.2rem;
  border-radius: 1rem;
  background: #E53935;
  color: #fff;
  font-size: 0.68rem;
  line-height: 1rem;
  text-align: center;
  font-weight: 700;
}

.comm-fav-btn {
  flex: none;
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-muted-text);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
}
.comm-fav-btn.on {
  color: #F9A825;
  border-color: #F9A825;
}

.h-interact {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
  padding-top: 0.45rem;
  border-top: 1px dashed var(--color-border);
}

.interact-btn {
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-muted-text);
  border-radius: var(--radius-pill);
  padding: 0.22rem 0.6rem;
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
}
.interact-btn.on {
  background: #FFF3E0;
  border-color: #F9A825;
  color: #E65100;
}
.interact-btn.h-sold {
  color: #E53935;
  border-color: #E53935;
}
.sold-tag {
  font-size: 0.72rem;
  color: #fff;
  background: #9E9E9E;
  border-radius: 4px;
  padding: 1px 7px;
  align-self: center;
}

/* 通知/收藏弹窗列表 */
.notif-list {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.2rem 0;
}
.notif-item {
  display: flex;
  gap: 0.6rem;
  padding: 0.65rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  align-items: flex-start;
}
.notif-item.unread {
  background: #F5F9FF;
}
.notif-icon {
  font-size: 1.1rem;
  flex: none;
}
.notif-body {
  flex: 1;
  min-width: 0;
}
.notif-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}
.notif-content {
  font-size: 0.8rem;
  color: var(--color-muted-text);
  margin-top: 0.1rem;
  word-break: break-all;
}
.notif-time {
  font-size: 0.7rem;
  color: #BDBDBD;
  margin-top: 0.15rem;
}

.fav-body {
  max-height: 60vh;
  overflow-y: auto;
  padding: 0.2rem 0;
}
.fav-sec {
  padding: 0.4rem 0;
}
.fav-sec-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-primary-strong);
  padding: 0.3rem 0.7rem;
}
.fav-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.7rem;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
}
.fav-row-main {
  flex: 1;
  min-width: 0;
}
.fav-row-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-text);
}
.fav-row-meta {
  font-size: 0.78rem;
  color: var(--color-muted-text);
  margin-top: 0.1rem;
}
.fav-row-price {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-danger);
  flex: none;
}
.fav-row.is-sold {
  opacity: 0.55;
  filter: grayscale(0.85);
}

.fav-row-sold {
  font-size: 0.72rem;
  color: #fff;
  background: #9E9E9E;
  border-radius: 4px;
  padding: 1px 6px;
  flex: none;
}
/* 广播条 */
.broadcast-bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  height: 32px;
  padding: 0 0.75rem;
  background: linear-gradient(90deg, #fff5e6, #ffe9c7);
  border-bottom: 1px solid #f3dfb8;
  overflow: hidden;
}
.broadcast-icon {
  font-size: 0.9rem;
  flex: none;
}
.broadcast-marquee {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}
.broadcast-track {
  display: inline-flex;
  gap: 3rem;
  animation: broadcast-scroll 16s linear infinite;
}
.broadcast-text {
  font-size: 0.82rem;
  color: #b36200;
  font-weight: 600;
  white-space: nowrap;
}
@keyframes broadcast-scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* 聊天浮窗 */
.chat-modal {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9990;
}
.chat-panel {
  width: 340px;
  height: 480px;
  max-height: calc(100vh - 32px);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.chat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--color-primary);
  color: #fff;
}
.chat-head-title { flex: 1; font-size: 0.95rem; font-weight: 600; }
.chat-back { background: transparent; border: none; color: #fff; font-size: 1.15rem; cursor: pointer; padding: 0 4px; }
.chat-close { background: transparent; border: none; color: #fff; font-size: 1.25rem; cursor: pointer; line-height: 1; }
.chat-body { flex: 1; overflow-y: auto; padding: 10px; background: #f5f6f8; }
.chat-empty { text-align: center; color: var(--color-muted-text); font-size: 0.82rem; padding: 40px 10px; line-height: 1.9; }
.conv-row { display: flex; align-items: center; gap: 8px; padding: 10px; background: #fff; border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.conv-main { flex: 1; min-width: 0; }
.conv-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.conv-name { font-size: 0.9rem; font-weight: 600; color: var(--color-text); }
.conv-unread { background: #f5222d; color: #fff; font-size: 0.7rem; border-radius: 10px; padding: 0 6px; line-height: 1.5; flex: none; }
.conv-title { font-size: 0.8rem; color: var(--color-primary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-last { font-size: 0.78rem; color: var(--color-muted-text); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.conv-time { font-size: 0.7rem; color: #b0b0b0; flex: none; }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 8px; }
.msg-row.mine { align-items: flex-end; }
.msg-bubble { max-width: 78%; padding: 8px 11px; border-radius: 10px; background: #fff; font-size: 0.86rem; color: var(--color-text); word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }
.msg-row.mine .msg-bubble { background: var(--color-primary-soft); }
.msg-time { font-size: 0.65rem; color: #bbb; margin-top: 2px; }
.chat-input-row { display: flex; gap: 8px; padding: 8px 10px; background: #fff; border-top: 1px solid var(--color-border); }
.chat-input { flex: 1; border: 1px solid #ddd; border-radius: 18px; padding: 7px 12px; font-size: 16px; outline: none; }
.chat-input:focus { border-color: var(--color-focus); }
.chat-send { border: none; background: var(--color-primary); color: #fff; border-radius: 18px; padding: 0 16px; font-size: 0.86rem; cursor: pointer; }

/* ---------- 移动端窄屏适配 ---------- */
@media (max-width: 440px) {
  /* 顶栏：工具按钮只留图标 */
  .tool-btn .tool-label { display: none; }
  .filter-top-tools { gap: 0.24rem; }
  .tool-btn { padding: 0.32rem 0.5rem; }
  .login-btn { padding: 0.32rem 0.55rem; }
  .city-btn { font-size: 0.88rem; }

  /* 展位：上下堆叠，每个占满整行，信息不再截断 */
  .booth-bar { flex-direction: column; gap: 0.4rem; }
  .booth-card { padding: 0.45rem 0.55rem; }

  /* 房源卡片：价格与管理按钮换行，按钮缩窄 */
  .house-item .h-foot { flex-wrap: wrap; gap: 0.35rem; }
  .house-item .h-price { flex: 1 1 auto; }
  .house-item .h-actions { flex-wrap: wrap; gap: 0.3rem; }
  .top-btn { padding: 0.28rem 0.6rem; font-size: 0.78rem; }
  .interact-btn { padding: 0.2rem 0.5rem; font-size: 0.74rem; }

  /* 输入框字号提到16px，避免 iOS 点开输入框自动放大导致文字变大/截断 */
  .search-input, .fld input, .fld select, .fld textarea { font-size: 16px; }
}

/* ---------- 小区页全屏态 + 折叠 ---------- */
.list-sheet.is-full {
  position: fixed;
  inset: 0;
  max-height: none;
  z-index: 70;
  border-radius: 0;
}
.list-sheet.is-full .sheet-list { flex: 1; }
.sheet-collapse {
  flex: none;
  display: none;
  align-items: center;
  gap: 0.2rem;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0.3rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}
.list-sheet.is-full .sheet-collapse { display: inline-flex; }
.house-item { cursor: pointer; }

/* ---------- 房源详情页 ---------- */
.house-detail {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--color-background);
  flex-direction: column;
}
.hd-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.8rem;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}
.hd-back {
  flex: none;
  border: none;
  background: var(--color-background);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.hd-head-main { flex: 1; min-width: 0; }
.hd-comm { font-size: 0.95rem; font-weight: 700; color: var(--color-text); }
.hd-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0.8rem 0.9rem 1rem;
}
.hd-imgs { display: flex; gap: 0.5rem; overflow-x: auto; margin-bottom: 0.7rem; scrollbar-width: none; }
.hd-imgs::-webkit-scrollbar { display: none; }
.hd-img { flex: none; width: 15rem; height: 10.5rem; object-fit: cover; border-radius: var(--radius-md); }
.hd-title { font-size: 1.05rem; font-weight: 700; line-height: 1.35; margin-bottom: 0.5rem; }
.hd-title .h-badges { margin-right: 0.3rem; }
.hd-price { font-size: 1.5rem; font-weight: 700; color: var(--color-danger); margin-bottom: 0.4rem; }
.hd-price small { font-size: 0.85rem; font-weight: 400; color: var(--color-muted-text); }
.hd-over { color: #7B1FA2; font-size: 0.85rem; font-weight: 600; margin-bottom: 0.5rem; }
.hd-rows { display: flex; flex-wrap: wrap; margin-bottom: 0.5rem; }
.hd-row { width: 50%; display: flex; gap: 0.3rem; font-size: 0.85rem; padding: 0.45rem 0; border-bottom: 1px dashed #EDEDED; box-sizing: border-box; }
.hd-row:nth-child(odd) { padding-right: 0.5rem; }
.hd-k { color: var(--color-muted-text); flex: none; }
.hd-v { color: var(--color-text); font-weight: 600; }
.hd-addr {
  display: flex; align-items: center; flex-wrap: wrap; gap: 0.4rem;
  background: var(--color-surface); border: 1px solid var(--color-border);
  border-radius: var(--radius-md); padding: 0.6rem 0.7rem; margin-top: 0.2rem; margin-bottom: 0.7rem;
  font-size: 0.9rem;
}
.hd-addr-label { color: var(--color-muted-text); }
.hd-addr-val { font-weight: 600; }
.hd-addr-mask { color: #FF6D00; font-weight: 600; }
.hd-reveal { border: none; background: #2468f2; color: #fff; border-radius: 6px; padding: 0.32rem 0.75rem; font-size: 0.8rem; cursor: pointer; }
.hd-note { font-size: 0.85rem; color: var(--color-muted-text); line-height: 1.55; white-space: pre-wrap; }
.hd-note-label { display: block; font-weight: 700; color: var(--color-text); margin-bottom: 0.2rem; }
.hd-foot {
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.6rem 0.8rem calc(0.7rem + env(safe-area-inset-bottom));
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
}
.hd-foot-row {
  display: flex;
  gap: 0.4rem;
}
.hd-btn {
  flex: 1;
  border: 1px solid var(--color-border);
  background: var(--color-background);
  color: var(--color-text);
  border-radius: var(--radius-pill);
  padding: 0.6rem 0.3rem;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
}
.hd-call { background: #2468f2; color: #fff; border-color: transparent; }

/* iOS 输入聚焦自动放大修复：Safari 会把字号 <16px 的输入框缩放，导致界面被截断 */
@supports (-webkit-touch-callout: none) {
  input, textarea, select { font-size: 16px !important; }
}


/* ---------- 图片大图浏览 ---------- */
.img-lightbox { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; }
.img-lb-mask { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.92); }
.img-lb-stage { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.img-lb-head { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(0.8rem + env(safe-area-inset-top)) 1rem 0.6rem; z-index: 3; }
.img-lb-count { color: #fff; font-size: 0.9rem; font-weight: 600; }
.img-lb-close { border: none; background: rgba(255, 255, 255, 0.16); color: #fff; width: 2rem; height: 2rem; border-radius: 50%; font-size: 1rem; cursor: pointer; }
.img-lb-pic { max-width: 100%; max-height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.img-lb-prev, .img-lb-next { position: absolute; top: 50%; transform: translateY(-50%); border: none; background: rgba(255, 255, 255, 0.14); color: #fff; width: 2.4rem; height: 3.2rem; border-radius: 8px; font-size: 1.8rem; cursor: pointer; z-index: 3; }
.img-lb-prev { left: 0.6rem; }
.img-lb-next { right: 0.6rem; }
.img-lb-tools { position: absolute; left: 0; right: 0; bottom: calc(1rem + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 0.6rem; z-index: 3; }
.img-lb-tip { color: #ddd; font-size: 0.78rem; }
.img-lb-save { border: none; background: #2468f2; color: #fff; border-radius: 20px; padding: 0.55rem 1.5rem; font-size: 0.9rem; font-weight: 600; cursor: pointer; }

/* ---------- 录入楼盘弹窗 ---------- */
.comm-pick-btn {
  width: 100%;
  padding: 0.7rem;
  border: 1px dashed var(--color-primary, #2468f2);
  background: rgba(36, 104, 242, 0.06);
  color: var(--color-primary, #2468f2);
  border-radius: var(--radius-md, 10px);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}
.comm-pick-btn:active { background: rgba(36, 104, 242, 0.14); }
.comm-tip {
  margin: 0.6rem 0 0;
  padding: 0.55rem 0.7rem;
  background: rgba(255, 193, 7, 0.14);
  color: #8a6d00;
  border-radius: 8px;
  font-size: 0.82rem;
  line-height: 1.5;
}
.comm-del-btn {
  flex-shrink: 0;
  border: 1px solid #d9534f;
  background: rgba(217, 83, 79, 0.08);
  color: #d9534f;
  border-radius: 14px;
  padding: 0.28rem 0.6rem;
  font-size: 0.78rem;
  cursor: pointer;
}
