:root {
  --bg: #0f1419;
  --panel: rgba(18, 24, 32, 0.92);
  --panel-border: rgba(255, 255, 255, 0.1);
  --text: #eef2f6;
  --muted: #9aa7b5;
  --accent: #c4a574;
  --accent-soft: rgba(196, 165, 116, 0.18);
  --ok: #7dcea0;
  --err: #e07a7a;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  width: 100%;
  height: 100%;
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", "Songti SC", "Noto Serif SC", serif;
  color: var(--text);
  background: var(--bg);
}

#map-area {
  width: 100%;
  height: 100%;
  background: #E8E4DC;
}

.esri-attribution a { color: #111; }
.esri-attribution {
  background: transparent;
  font-size: 12px;
  font-family: sans-serif;
  color: #111;
}
.esri-attribution__powered-by { display: none; }

.copyright-url {
  position: absolute;
  bottom: 5px;
  right: 40px;
  padding: 0 4px;
  font-family: sans-serif;
  font-size: 12px;
  color: #111;
  text-decoration: none;
  z-index: 2;
  background: rgba(255, 255, 255, 0.55);
}
.copyright-url:hover { text-decoration: underline; }

.copyright-logo {
  position: absolute;
  bottom: 5px;
  right: 10px;
  width: 28px;
  height: 28px;
  z-index: 2;
  background: url("https://api.hkmapservice.gov.hk/mapapi/landsdlogo.jpg") center / 28px no-repeat;
}

/* 缩放控件右下：抬高以免压住版权与 logo */
.esri-ui-bottom-right {
  bottom: 42px !important;
  right: 12px !important;
}

.shell-panel {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 3;
  width: min(320px, calc(100vw - 32px));
  padding: 16px 16px 14px;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(10px);
  transition: transform 0.22s ease, opacity 0.18s ease;
}

.shell-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.shell-panel-brand {
  min-width: 0;
  flex: 1 1 auto;
}

.shell-panel-brand .brand-kicker {
  margin-bottom: 2px;
}

.shell-panel-brand h1 {
  margin-bottom: 0;
}

.shell-panel-toggle {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-top: 2px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.shell-panel-toggle:hover {
  border-color: rgba(196, 165, 116, 0.5);
  background: var(--accent-soft);
}

.shell-panel.is-collapsed {
  pointer-events: none;
  opacity: 0;
  transform: translateX(calc(-100% - 24px));
}

.shell-panel-expand {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 24, 32, 0.92);
  color: var(--text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.shell-panel-expand:hover {
  border-color: rgba(196, 165, 116, 0.5);
  background: rgba(196, 165, 116, 0.28);
}

.shell-panel-expand[hidden] {
  display: none !important;
}

.brand-kicker {
  margin: 0 0 4px;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.shell-panel h1 {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.shell-panel .lede {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.section-title {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.search-box {
  margin: 0 0 14px;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.search-label {
  display: block;
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.search-row input {
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
}

.search-row input::placeholder {
  color: rgba(154, 167, 181, 0.85);
}

.search-btn {
  margin: 0;
  padding: 0 12px;
  border: 1px solid rgba(196, 165, 116, 0.45);
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
}

.search-btn:hover {
  border-color: var(--accent);
}

.search-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.search-results {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.35);
}

.search-results li {
  margin: 0;
  padding: 0;
}

.search-results button {
  display: block;
  width: 100%;
  margin: 0;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: var(--text);
  text-align: left;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.35;
}

.search-results button:hover,
.search-results button.is-active {
  background: rgba(196, 165, 116, 0.14);
}

.search-results .result-name {
  display: block;
  color: var(--text);
}

.search-results .result-meta {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.search-empty {
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 12px;
}

.shell-panel-body > #zone-controls,
.shell-panel-body > #pam-controls,
.shell-panel-body > #swap-controls {
  display: none;
}

.layer-group {
  padding: 4px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.layer-group.is-section {
  padding: 6px 4px 8px;
  background: rgba(255, 255, 255, 0.045);
}

.layer-name-zh {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.layer-name-zh .layer-tag {
  flex-shrink: 0;
}

.layer-group-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 2px 6px;
}

.layer-group-head:not(:has(> .layer-toggle)) {
  grid-template-columns: minmax(0, 1fr) auto;
}

.layer-toggle {
  margin: 0;
  accent-color: var(--accent);
}

.layer-pick-btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
  font: inherit;
}

.layer-pick-btn:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.layer-pick-btn.is-pick {
  background: rgba(200, 70, 70, 0.28);
}

.layer-pick-btn:disabled {
  cursor: not-allowed;
}

.layer-fold-btn {
  display: grid;
  place-items: center;
  width: 22px;
  min-width: 22px;
  margin: 0;
  padding: 6px 2px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

.layer-fold-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.layer-chevron {
  width: 0;
  height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 5px solid var(--muted);
  transition: transform 0.15s ease;
}

.layer-group.is-open > .layer-group-head .layer-chevron {
  transform: rotate(90deg);
}

.layer-children {
  margin: 0 4px 4px 12px;
  padding: 4px 0 4px 8px;
  border-left: 1px solid rgba(255, 255, 255, 0.1);
}

.layer-children .zone-controls,
.layer-children .pam-controls,
.layer-children .swap-controls {
  margin: 0;
  padding: 2px 0 4px;
  background: transparent;
}

.layer-children .zone-controls-head {
  justify-content: flex-end;
  margin-bottom: 6px;
}

.layer-children .layer-group.is-nested {
  margin-top: 2px;
  padding: 0;
  background: transparent;
  border: none;
}

.layer-children .layer-group.is-nested.is-disabled {
  opacity: 0.55;
}

.layer-children .layer-group.is-nested.is-disabled .layer-pick-btn {
  cursor: not-allowed;
}

.layer-children .layer-group.is-nested > .layer-group-head {
  padding: 0 2px;
}

.layer-children .layer-group.is-nested > .layer-group-head .layer-fold-btn,
.layer-children .layer-group.is-nested > .layer-group-head .layer-pick-btn {
  padding: 4px 4px;
  font-size: 12px;
}

.layer-children .layer-group.is-nested > .layer-children {
  margin-left: 8px;
  padding-left: 6px;
}

.layer-charging-note {
  margin: 2px 4px 6px;
  padding: 0 2px;
}

.stt-rate-panel {
  margin: 0 0 4px;
  padding: 2px 2px 3px;
}

.stt-rate-unit {
  margin: 0 0 3px;
  font-size: 9px;
  line-height: 1.2;
  color: var(--muted);
}

.stt-rate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
  column-gap: 6px;
  row-gap: 1px;
  font-size: 10px;
  line-height: 1.25;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.stt-rate-name {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stt-rate-val {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  text-align: right;
}

.layer-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid transparent;
  font-size: 13px;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.layer-row.is-child {
  padding: 5px 8px;
  background: transparent;
  font-size: 12px;
}

.layer-row.is-grandchild {
  padding-left: 4px;
  font-size: 11px;
}

.layer-row.is-grandchild .layer-name-en {
  font-size: 9px;
}

.layer-row.has-icon,
.layer-group-head.has-icon {
  grid-template-columns: auto minmax(0, 1fr) 28px;
}

.layer-row-icon {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.layer-row.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.layer-name {
  display: flex;
  flex-direction: column;
  gap: 1px;
  color: var(--text);
  line-height: 1.25;
}

.layer-name-en {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
}
.layer-tag {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}

.pam-controls {
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.pam-controls.is-disabled {
  opacity: 0.45;
}

.pam-power-legend {
  display: grid;
  gap: 8px;
  margin: 2px 0 10px;
  padding: 0 0 10px;
  list-style: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.pam-power-legend-row {
  margin: 0;
}

.pam-power-legend-option {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
  cursor: default;
}

.pam-power-legend-option .layer-pick-btn {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  padding: 2px 4px;
  font-size: 11px;
  color: inherit;
  line-height: 1.45;
}

.pam-power-legend-option input {
  width: 13px;
  height: 13px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.pam-power-legend-option:has(input:disabled) {
  cursor: default;
}

.pam-power-legend-row img {
  display: block;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}

.pam-power-legend-row strong {
  color: var(--text);
  font-weight: 600;
}

.pam-power-legend-icon-black {
  filter: drop-shadow(0 0 1px rgba(255, 255, 255, 0.9));
}

.pam-opt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--text);
  cursor: pointer;
}

.pam-opt input {
  margin: 0;
  accent-color: var(--accent);
}

.pam-scale-note {
  margin: 4px 0 8px;
  padding: 6px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  color: #1a1a1a;
  background: #f5e6a3;
  border: 1px solid #c4a035;
}

.swap-controls {
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.pam-edit-controls {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.pam-edit-hint {
  margin: 4px 0 8px;
  font-size: 11px;
  line-height: 1.4;
  color: #c8d0da;
}

.pam-edit-tools {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pam-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset-btn-primary {
  background: rgba(196, 165, 116, 0.35);
  color: #f5efe4;
  border-color: rgba(196, 165, 116, 0.55);
}

.preset-btn-danger {
  color: #ffb4b4;
  border-color: rgba(220, 80, 80, 0.45);
}

.preset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pam-edit-form {
  padding: 8px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.pam-edit-mode-label {
  margin: 0 0 8px;
  font-size: 11px;
  color: #c8d0da;
}

.pam-edit-mode-label code {
  font-size: 10px;
  color: #f5e6a3;
}

.pam-edit-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
  font-size: 11px;
  color: var(--text);
}

.pam-edit-field input,
.pam-edit-field select {
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 12px;
}

.pam-edit-field select option {
  color: #111;
  background: #fff;
}

.pam-icon-picker {
  border: 0;
  padding: 0;
  margin: 0 0 8px;
}

.pam-icon-picker legend {
  padding: 0;
  margin: 0 0 6px;
  font-size: 11px;
  color: var(--text);
}

.pam-icon-picker-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pam-icon-option {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
  font-size: 11px;
  color: var(--text);
}

.pam-icon-option:has(input:checked) {
  border-color: rgba(196, 165, 116, 0.65);
  background: var(--accent-soft);
}

.pam-icon-option input {
  margin: 2px 0 0;
}

.pam-icon-option img {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: block;
  margin-top: 1px;
}

.pam-icon-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pam-icon-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.pam-icon-hint {
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
}

.zone-hint code {
  font-size: 10px;
  color: #c4a574;
}

.zone-controls {
  margin: 0 0 12px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.zone-controls-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.zone-controls-title {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.zone-presets {
  display: flex;
  gap: 4px;
}

.preset-btn {
  margin: 0;
  padding: 3px 7px;
  border: 1px solid var(--panel-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-size: 11px;
  font-family: inherit;
  cursor: pointer;
  line-height: 1.3;
}

.preset-btn:hover {
  border-color: rgba(196, 165, 116, 0.45);
  color: var(--accent);
}

.control-row {
  display: grid;
  grid-template-columns: 52px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--muted);
}

.control-row input[type="range"] {
  width: 100%;
}

.zone-category-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 220px;
  overflow: auto;
  margin-bottom: 6px;
  padding-right: 2px;
}

.zone-cat {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 2px 2px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text);
  cursor: default;
}

.zone-cat .layer-pick-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.zone-cat:hover .layer-pick-btn:not(.is-pick):not(:disabled) {
  background: rgba(255, 255, 255, 0.05);
}

.zone-cat.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.zone-cat input {
  margin: 0;
  accent-color: var(--accent);
}

.zone-cat .swatch {
  width: 12px;
  height: 12px;
  border-radius: 2px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: 0 0 auto;
}

.zone-cat .cat-key {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  min-width: 2.4em;
}

.zone-cat .cat-zh {
  color: var(--text);
}

.zone-hint {
  margin: 0;
  font-size: 10px;
  line-height: 1.35;
  color: var(--muted);
  opacity: 0.85;
}

.meta-foot {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--panel-border);
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.map-tools {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.map-tool-modes {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(12, 16, 22, 0.55);
  backdrop-filter: blur(10px);
}

.map-tool-btn {
  width: 52px;
  min-height: 52px;
  padding: 6px 4px 4px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(18, 24, 32, 0.92);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
  cursor: pointer;
  color: #e8eef5;
  backdrop-filter: blur(10px);
}

.map-tool-btn-action {
  width: 52px;
  margin-top: 2px;
  border-style: dashed;
  border-color: rgba(255, 255, 255, 0.2);
}

.map-tool-icon {
  width: 20px;
  height: 20px;
  display: block;
}

.map-tool-caption {
  font-size: 10px;
  line-height: 1.1;
  color: #c8d0da;
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.map-tool-btn img {
  display: block;
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(0.92);
}

.map-tool-btn:hover {
  border-color: rgba(196, 165, 116, 0.5);
}

.map-tool-btn.is-active {
  border-color: rgba(196, 165, 116, 0.7);
  background: rgba(196, 165, 116, 0.28);
}

.map-tool-btn.is-active .map-tool-caption {
  color: #f5efe4;
}

.measure-panel {
  width: min(220px, calc(100vw - 48px));
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(18, 24, 32, 0.94);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
  color: var(--text);
  font-family: "Avenir Next", "PingFang SC", sans-serif;
}

.measure-hint {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.measure-result {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--accent);
  line-height: 1.35;
}

.measure-list {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  max-height: 140px;
  overflow: auto;
}

.measure-list-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  font-size: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.measure-list-idx {
  color: var(--muted);
  flex: 0 0 auto;
}

.measure-list-dist {
  flex: 1 1 auto;
  color: var(--text);
}

.measure-list-del {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: #ffb4b4;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.measure-list-del:hover {
  background: rgba(220, 80, 80, 0.2);
}

.shell-panel {
  max-height: calc(100vh - 32px);
  overflow: auto;
}

/* PAM 弹窗内容 */
.esri-popup__main-container {
  font-family: "Avenir Next", "PingFang SC", "Noto Sans TC", sans-serif;
}

.pam-pop {
  min-width: 220px;
  max-width: 300px;
  color: #1c2430;
  line-height: 1.35;
}

.pam-pop-hero {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f7f1e6 0%, #efe4d2 100%);
  border: 1px solid rgba(160, 120, 60, 0.22);
}

.pam-pop-metric {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.pam-pop-metric-value {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: #6b4a1e;
  line-height: 1;
}

.pam-pop-metric-unit {
  font-size: 12px;
  color: #8a7048;
  font-weight: 600;
}

.pam-pop-metric-desc {
  margin: 6px 0 0;
  font-size: 12px;
  color: #5c5348;
}

.pam-pop-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  margin: 0 0 10px;
}

.pam-pop-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.pam-pop-label {
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #8b949e;
}

.pam-pop-value {
  font-size: 12px;
  color: #1c2430;
  font-weight: 600;
  word-break: break-word;
}

.pam-pop-mono {
  font-variant-numeric: tabular-nums;
  font-family: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  font-weight: 500;
  font-size: 11px;
  line-height: 1.45;
}

.pam-pop-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 400;
  color: #66707a;
}

.pam-pop-note {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #f4f6f8;
  font-size: 11px;
  color: #4a5560;
}

.pam-pop-foot {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 8px;
  border-top: 1px solid #e6eaee;
  font-size: 10px;
  color: #8b949e;
}

.pam-pop-foot a {
  color: #8a6230;
  text-decoration: none;
}

.pam-pop-foot a:hover {
  text-decoration: underline;
}
