/* 沿用北京租赁住房地图的液态玻璃令牌，只做底图选择器布局。 */
:root {
  --fg: #101521;
  --fg2: #4a5468;
  --fg3: #7d8799;
  --accent: #0a84ff;
  --glass: rgba(255, 255, 255, .55);
  --glass-2: rgba(255, 255, 255, .72);
  --glass-3: rgba(255, 255, 255, .9);
  --stroke: rgba(255, 255, 255, .75);
  --stroke-2: rgba(16, 21, 33, .08);
  --tint: rgba(255, 255, 255, .35);
  --shadow: 0 18px 50px -12px rgba(16, 21, 33, .28), 0 2px 6px rgba(16, 21, 33, .06);
  --inner: inset 0 1px 0 rgba(255, 255, 255, .85), inset 0 -1px 0 rgba(255, 255, 255, .25);
  --r: 22px;
  --blur: 28px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}
html:not(.light) {
  --fg: #eef2f8;
  --fg2: #b3bccb;
  --fg3: #7f899c;
  --glass: rgba(22, 26, 36, .52);
  --glass-2: rgba(28, 33, 46, .7);
  --glass-3: rgba(34, 40, 54, .92);
  --stroke: rgba(255, 255, 255, .16);
  --stroke-2: rgba(255, 255, 255, .08);
  --tint: rgba(255, 255, 255, .05);
  --shadow: 0 22px 60px -14px rgba(0, 0, 0, .65), 0 2px 8px rgba(0, 0, 0, .35);
  --inner: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 -1px 0 rgba(255, 255, 255, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #0d1117; color: var(--fg); }
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
#app { position: fixed; inset: 0; }
#map { position: absolute; inset: 0; }
.glass {
  position: relative;
  color: var(--fg);
  background: linear-gradient(135deg, var(--tint), transparent 42%), var(--glass);
  backdrop-filter: blur(var(--blur)) saturate(190%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(190%);
  border: 1px solid var(--stroke);
  box-shadow: var(--shadow), var(--inner);
}
.glass::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(120% 70% at 50% -20%, rgba(255, 255, 255, .45), transparent 58%);
  mix-blend-mode: soft-light;
}
html:not(.light) .glass::before { opacity: .4; }
.glass > * { position: relative; }

.topbar {
  position: absolute;
  z-index: 20;
  top: 12px;
  left: 404px;
  right: 12px;
  min-height: 52px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 999px;
}
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 12px;
  color: #08111b;
  background: linear-gradient(135deg, #2ecc9a, #5d9cff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .65);
}
.brand-name { font-weight: 650; font-size: 15px; letter-spacing: .2px; }
.brand-sub { color: var(--fg3); font-size: 12px; margin-top: 1px; }
.top-meta { margin-left: auto; color: var(--fg2); font-size: 12px; padding-right: 8px; max-width: 46%; text-align: right; }

.panel {
  position: absolute;
  z-index: 18;
  top: 12px;
  left: 12px;
  bottom: 12px;
  width: 380px;
  border-radius: var(--r);
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 12px 12px 10px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 2px 4px 8px; }
.panel-head b { font-size: 15px; }
.panel-head span { color: var(--fg3); font-size: 12px; }
.chips { display: flex; gap: 6px; padding: 0 2px 8px; }
.chip {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--stroke-2);
  background: var(--glass-2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45);
}
.chip.on {
  background: linear-gradient(180deg, rgba(10, 132, 255, .32), rgba(10, 132, 255, .16));
  border-color: rgba(10, 132, 255, .55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 6px 16px -10px rgba(10, 132, 255, .9);
}
.bm-grid {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 2px;
  align-content: start;
}
.bm {
  border-radius: 14px;
  overflow: hidden;
  border: 2px solid transparent;
  background: var(--glass-2);
  text-align: left;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
  min-height: 44px;
}
.bm.on {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(10, 132, 255, .28), rgba(10, 132, 255, .12));
  box-shadow: 0 0 0 4px rgba(10, 132, 255, .16), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.bm.is-off { opacity: .72; }
.bm img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; background: #222; }
.bm-cap { display: flex; flex-direction: column; gap: 2px; padding: 7px 8px 8px; }
.bm-cap strong { font-size: 13px; font-weight: 650; line-height: 1.3; }
.bm-cap em { font-style: normal; color: var(--fg3); font-size: 11px; }

.opts {
  flex: none;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--stroke-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.opts label {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}
.opts label.is-disabled { opacity: .45; }
input[type=checkbox] {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(127, 137, 156, .55);
  background: var(--glass-2);
  display: inline-grid;
  place-items: center;
  margin: 0;
}
input[type=checkbox]:checked {
  background: linear-gradient(180deg, #5ec5ff, #2f9df0);
  border-color: transparent;
}
input[type=checkbox]:checked::after {
  content: "";
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: 0;
  border-left: 0;
  transform: translateY(-1px) rotate(45deg);
}
input[type=checkbox]:disabled { cursor: not-allowed; }
.note, .meta, .err {
  margin: 0;
  color: var(--fg2);
  font-size: 12px;
  line-height: 1.45;
}
.src { color: var(--fg2); font-size: 12px; }
.src summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: var(--accent); }
.src[open] { max-height: 28vh; overflow: auto; }
.err { color: #c4473a; min-height: 0; }
html:not(.light) .err { color: #ffb4a8; }
.meta a { color: var(--accent); }

.maplibregl-ctrl-group {
  background: var(--glass-2) !important;
  backdrop-filter: blur(18px) saturate(180%);
  border-radius: 14px !important;
  border: 1px solid var(--stroke) !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}
.maplibregl-ctrl-attrib {
  background: var(--glass-2) !important;
  border-radius: 999px !important;
  backdrop-filter: blur(10px);
  font-size: 11px;
}
.maplibregl-ctrl-scale {
  background: var(--glass-2) !important;
  border-color: var(--stroke-2) !important;
  color: var(--fg2) !important;
}

@media (max-width: 820px) {
  .topbar {
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    top: max(8px, env(safe-area-inset-top));
    min-height: 48px;
    border-radius: 18px;
  }
  .top-meta { display: none; }
  .panel {
    top: auto;
    left: max(8px, env(safe-area-inset-left));
    right: max(8px, env(safe-area-inset-right));
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-height: min(54dvh, 520px);
  }
  .maplibregl-ctrl-bottom-right { top: calc(64px + env(safe-area-inset-top)); bottom: auto !important; }
  .maplibregl-ctrl-bottom-left { top: calc(64px + env(safe-area-inset-top)); bottom: auto !important; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
