/* 地图选点弹窗（共享）—— 样式与 /zeri/longshui3d 选点窗一致，前缀 zm- 避免与宿主页面冲突 */

.zm-mask {
  --zm-ink: #1a2332;
  --zm-mute: #5c6b82;
  --zm-soft: #7a879b;
  --zm-line: #dbe3ee;
  --zm-bright: #2f7ce8;
  --zm-bright-deep: #1e5aa8;
  --zm-warn: #c0392b;

  position: fixed; inset: 0; z-index: 12000;
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(28, 42, 66, .52);
}
.zm-mask[hidden] { display: none; }

.zm-picker {
  width: min(620px, 100%);
  /* 与龙水3D 同口径用 100vh；勿用宿主 --app-h（户型页键盘时会冻住旧值，把搜索顶出屏） */
  max-height: calc(var(--zm-vv-h, 100vh) - 32px);
  display: flex; flex-direction: column;
  background: rgba(255, 255, 255, .97);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(30, 48, 80, .34);
  overflow: hidden;
  color: var(--zm-ink);
  font-family: inherit;
}
.zm-head {
  position: relative;
  padding: 16px 18px 10px;
  flex: 0 0 auto;
}
.zm-head b { font-size: 16px; letter-spacing: .5px; }
.zm-x {
  position: absolute; right: 12px; top: 12px;
  width: 30px; height: 30px;
  border: none; border-radius: 50%;
  background: rgba(44, 62, 93, .06);
  color: var(--zm-soft);
  font-size: 18px; line-height: 1; cursor: pointer;
  font-family: inherit;
}
.zm-x:hover { background: rgba(44, 62, 93, .12); }

/* 搜索区（含下拉）要压住地图里的浮层；勿被 flex 挤没 */
.zm-search-wrap { position: relative; z-index: 9; flex: 0 0 auto; }
.zm-search { display: flex; gap: 8px; padding: 0 18px 10px; }
.zm-search input {
  flex: 1; min-width: 0;
  border: 1.5px solid rgba(120, 150, 200, .42);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 14px; font-family: inherit;
  color: var(--zm-ink); background: #fff;
}
.zm-search input:focus {
  outline: none;
  border-color: var(--zm-bright);
  box-shadow: 0 0 0 3px rgba(47, 124, 232, .16);
}
.zm-go {
  padding: 10px 16px;
  font-size: 13.5px; font-weight: 600;
  color: #fff; border: none; border-radius: 14px;
  background: linear-gradient(90deg, #3fb9f9 0%, #5c8cf8 60%, #8d7cf9 100%);
  box-shadow: 0 5px 14px rgba(92, 140, 248, .32);
  white-space: nowrap;
  cursor: pointer;
  font-family: inherit;
}

.zm-list {
  position: absolute; left: 18px; right: 18px; top: calc(100% - 4px);
  z-index: 8;
  max-height: 232px; overflow: auto;
  margin: 0;
  border: 1px solid var(--zm-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(44, 62, 93, .18);
}
.zm-list[hidden] { display: none; }
.zm-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 12px;
  border: none; border-bottom: 1px solid rgba(44, 62, 93, .07);
  background: none; font-family: inherit; cursor: pointer;
}
.zm-item:last-child { border-bottom: none; }
.zm-item:hover, .zm-item.on { background: rgba(47, 124, 232, .09); }
.zm-item.on b { color: var(--zm-bright-deep); }
.zm-item b { font-size: 13.5px; font-weight: 600; color: var(--zm-ink); }
.zm-item span { display: block; margin-top: 2px; font-size: 11.5px; color: var(--zm-mute); }
.zm-empty { padding: 14px; text-align: center; font-size: 12.5px; color: var(--zm-mute); }
.zm-hist-tip {
  padding: 9px 14px 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
  color: var(--zm-bright-deep);
  background: linear-gradient(180deg, #f4f8ff, #ffffff);
  border-bottom: 1px dashed var(--zm-line);
}
.zm-item.zm-hist { display: flex; align-items: center; padding: 0; }
.zm-item.zm-hist .zm-item-main {
  flex: 1 1 auto; min-width: 0;
  display: block; text-align: left;
  padding: 9px 4px 9px 12px;
  border: none; background: none;
  font-family: inherit; cursor: pointer;
}
.zm-item.zm-hist .zm-del {
  flex: 0 0 auto;
  width: 28px; height: 28px; margin-right: 10px;
  border: none; border-radius: 9px;
  background: none; color: rgba(44, 62, 93, .42);
  font-size: 15px; line-height: 1; cursor: pointer;
  font-family: inherit;
}
.zm-item.zm-hist .zm-del:hover { background: rgba(226, 87, 74, .12); color: var(--zm-warn); }

.zm-map {
  position: relative;
  margin: 0 18px;
  height: min(400px, 52vh);
  border-radius: 18px;
  overflow: hidden;
  background: #dfe8ef;
  cursor: grab;
  touch-action: none;
  box-shadow: inset 0 0 0 1px rgba(44, 62, 93, .12);
}
.zm-map.dragging { cursor: grabbing; }

.zm-loading {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  background: rgba(244, 250, 255, .74);
  font-size: 13px; color: var(--zm-bright-deep);
  pointer-events: none;
}
.zm-loading[hidden] { display: none; }
.zm-spin {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid rgba(47, 124, 232, .22);
  border-top-color: var(--zm-bright);
  animation: zmSpin .8s linear infinite;
}
@keyframes zmSpin { to { transform: rotate(360deg); } }

.zm-tiles {
  position: absolute; inset: 0;
  transform-origin: 50% 50%;
  will-change: transform;
}
.zm-tile {
  position: absolute;
  width: 256px; height: 256px;
  user-select: none;
  pointer-events: none;
}
/* 指北针：针尖始终指向屏幕上的真北（跟着盘面一起转） */
.zm-compass {
  position: absolute; right: 12px; top: 12px; z-index: 5;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 2px 8px rgba(30, 58, 110, .2);
  pointer-events: none;
  transform-origin: 50% 50%;
  will-change: transform;
}
.zm-compass i {
  position: absolute; left: 50%; top: 5px;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-bottom: 13px solid #d8443c;
}
.zm-compass b {
  position: absolute; left: 0; right: 0; bottom: 7px;
  text-align: center;
  font-size: 10.5px; font-weight: 800; line-height: 1;
  color: #b83a33;
}
/* 中心十字：细长、中心留 12px 空档便于对准 */
.zm-cross { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.zm-cross::before,
.zm-cross::after {
  content: ""; position: absolute;
  filter: drop-shadow(0 0 2px rgba(0, 0, 0, .6));
}
.zm-cross::before {
  left: -46px; top: -.5px;
  width: 92px; height: 1px;
  background: linear-gradient(to right,
    #ff4d3d 0 40px, transparent 40px 52px, #ff4d3d 52px 92px);
}
.zm-cross::after {
  top: -46px; left: -.5px;
  width: 1px; height: 92px;
  background: linear-gradient(to bottom,
    #ff4d3d 0 40px, transparent 40px 52px, #ff4d3d 52px 92px);
}

.zm-zoom {
  position: absolute; right: 10px; bottom: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.zm-zoom button {
  width: 36px; height: 36px;
  border: none; border-radius: 11px;
  background: rgba(255, 255, 255, .94);
  color: var(--zm-ink); font-size: 19px; line-height: 1;
  cursor: pointer; font-family: inherit;
  touch-action: manipulation;
  box-shadow: 0 3px 10px rgba(30, 48, 80, .24);
}
.zm-zoom button:hover { background: #fff; }
.zm-zoom button:active { transform: scale(.94); }
#zmRotL, #zmRotR {
  background: rgba(232, 244, 255, .94);
  color: var(--zm-bright-deep);
  font-size: 18px;
}
#zmRotL:hover, #zmRotR:hover { background: #fff; }

/* 实时山向浮层：单行胶囊「坐山 180.5° · 丙山壬向」 */
.zm-hud {
  position: absolute; left: 50%; top: 12px;
  transform: translateX(-50%);
  z-index: 6;
  display: inline-flex; align-items: baseline; gap: 5px;
  max-width: calc(100% - 120px);
  padding: 5px 11px 6px;
  border-radius: 999px;
  background: rgba(16, 28, 44, .66);
  box-shadow: 0 2px 10px rgba(10, 22, 40, .3),
              inset 0 0 0 1px rgba(255, 255, 255, .12);
  color: #fff;
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden;
  font-variant-numeric: tabular-nums;
}
.zm-hud.is-idle { display: none; }
.zm-hud-k {
  font-size: 10px; font-weight: 700;
  letter-spacing: .12em;
  color: rgba(168, 202, 234, .85);
}
.zm-hud-deg {
  display: inline-flex; align-items: baseline;
  font-size: 14px; font-weight: 800; line-height: 1;
  letter-spacing: .2px;
  color: #6ee7c8;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .42);
}
.zm-hud-u { font-style: normal; margin-left: 1px; font-size: 10.5px; font-weight: 700; color: rgba(110, 231, 200, .78); }
.zm-hud-sep { align-self: center; width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 255, 255, .3); }
.zm-hud-shan {
  font-size: 12px; font-weight: 700; line-height: 1;
  color: #ffd08a;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .4);
  overflow: hidden; text-overflow: ellipsis;
}
.zm-hud-shan em { font-style: normal; font-weight: 700; color: #ffa94d; }

.zm-attrib {
  position: absolute; left: 8px; bottom: 8px;
  max-width: calc(100% - 104px);
  padding: 2px 7px;
  border-radius: 7px;
  background: rgba(20, 32, 48, .34);
  font-size: 10.5px; color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .55);
  pointer-events: none;
  white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}

.zm-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 12px 18px 16px;
  position: relative; z-index: 9;
}
.zm-read { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 auto; }
.zm-coord {
  font-size: 13px; font-weight: 600;
  color: var(--zm-bright-deep);
  font-variant-numeric: tabular-nums;
}
.zm-sit {
  display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap;
  font-size: 12.5px; font-weight: 600;
  color: var(--zm-ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.zm-sit b { font-size: 13.5px; color: var(--zm-bright); letter-spacing: .2px; }
.zm-sit em { font-style: normal; font-weight: 700; color: #c1701c; }
.zm-btns { display: flex; gap: 8px; flex: 0 0 auto; }
.zm-btn {
  padding: 10px 16px;
  font-size: 13.5px; font-weight: 600;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.zm-btn.ghost { background: rgba(44, 62, 93, .06); color: var(--zm-mute); }
.zm-btn.ghost:hover { background: rgba(44, 62, 93, .12); }
.zm-btn.primary {
  color: #fff;
  background: linear-gradient(90deg, #3fb9f9 0%, #5c8cf8 60%, #8d7cf9 100%);
  box-shadow: 0 5px 14px rgba(92, 140, 248, .32);
}

@media (max-width: 560px) {
  /* 与龙水3D .picker-mask / .picker 一致 */
  .zm-mask {
    padding: 10px;
    align-items: flex-end;
  }
  .zm-picker {
    border-radius: 20px;
    height: calc(var(--zm-vv-h, 100vh) - 20px);
    max-height: calc(var(--zm-vv-h, 100vh) - 20px);
  }
  @supports (height: 100dvh) {
    .zm-picker {
      height: calc(var(--zm-vv-h, 100dvh) - 20px);
      max-height: calc(var(--zm-vv-h, 100dvh) - 20px);
    }
  }
  .zm-map { flex: 1 1 auto; min-height: 0; height: auto; margin: 0 12px; }
  .zm-search { padding: 0 12px 10px; }
  .zm-foot { padding: 10px 12px 14px; flex-wrap: wrap; flex: 0 0 auto; }
  .zm-sit { font-size: 12px; }
}
