/* =========================
   夜之城互动地图
   ========================= */

.map-panel {
  margin-top: 48px;
  overflow: hidden;
  border: 1px solid var(--border);
  background:
    linear-gradient(
      145deg,
      rgba(23, 35, 48, 0.9),
      rgba(10, 17, 24, 0.98)
    );
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.36);
}

.map-toolbar {
  min-height: 74px;
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--border);
  background: rgba(7, 11, 16, 0.96);
}

.map-toolbar-label,
.map-status {
  margin: 0;
  font-family: monospace;
}

.map-toolbar-label {
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.map-status {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.map-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.map-tool-button {
  padding: 8px 11px;
  border: 1px solid rgba(0, 217, 255, 0.35);
  color: var(--blue);
  background: rgba(0, 217, 255, 0.04);
  font: inherit;
  font-family: monospace;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.map-tool-button:hover,
.map-tool-button.is-active {
  color: #071015;
  border-color: var(--yellow);
  background: var(--yellow);
}

.map-scroll {
  overflow: auto;
  background: #1d1d29;
  scrollbar-color: var(--blue) #081018;
}

.map-stage {
  position: relative;
  width: 100%;
  max-width: 1325px;
  margin: 0 auto;
  line-height: 0;
  isolation: isolate;
}

.map-image {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.map-hotspot-layer {
  position: absolute;
  z-index: 2;
  inset: 0;
  pointer-events: none;
}

.map-hotspot {
  position: absolute;
  width: 30px;
  height: 30px;
  padding: 0;
  transform: translate(-50%, -50%);
  border: 1px solid transparent;
  border-radius: 50%;
  color: transparent;
  background: transparent;
  cursor: pointer;
  pointer-events: auto;
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  outline: none;
  border-color: var(--yellow);
  background: rgba(252, 238, 9, 0.18);
  box-shadow:
    0 0 0 3px rgba(252, 238, 9, 0.14),
    0 0 18px rgba(252, 238, 9, 0.72);
}

body.map-debug .map-hotspot {
  border-color: rgba(0, 217, 255, 0.9);
  background: rgba(0, 217, 255, 0.14);
}

body.map-debug .map-hotspot::after {
  content: attr(data-debug-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 3px);
  min-width: 25px;
  padding: 2px 4px;
  transform: translateX(-50%);
  color: #071015;
  background: var(--yellow);
  font-family: monospace;
  font-size: 9px;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}

body.map-editing .map-stage {
  cursor: crosshair;
}

.map-editor-message {
  margin: 0;
  padding: 12px 18px;
  border-top: 1px solid rgba(57, 255, 136, 0.28);
  color: var(--green);
  background: rgba(57, 255, 136, 0.05);
  font-family: monospace;
  font-size: 12px;
}

.map-modal[hidden] {
  display: none;
}

.map-modal {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.map-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(0, 0, 0, 0.76);
  cursor: default;
  backdrop-filter: blur(5px);
}

.map-location-card {
  position: relative;
  z-index: 1;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid rgba(0, 217, 255, 0.62);
  border-left: 5px solid var(--yellow);
  background:
    linear-gradient(
      145deg,
      rgba(23, 35, 48, 0.99),
      rgba(7, 11, 16, 0.99)
    );
  box-shadow:
    0 28px 90px rgba(0, 0, 0, 0.65),
    0 0 40px rgba(0, 217, 255, 0.12);
}

.map-location-close {
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  color: #fff;
  background: rgba(7, 11, 16, 0.84);
  font-size: 25px;
  line-height: 1;
  cursor: pointer;
}

.map-location-close:hover {
  color: #071015;
  border-color: var(--yellow);
  background: var(--yellow);
}

.map-location-image-frame {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #070b10;
}

.map-location-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.map-location-content {
  padding: 24px;
}

.map-location-code,
.map-location-district,
.map-location-coordinate {
  font-family: monospace;
}

.map-location-code {
  margin: 0 0 9px;
  color: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.map-location-content h2 {
  margin: 0;
  font-size: clamp(28px, 6vw, 42px);
  line-height: 1.12;
}

.map-location-district {
  margin: 9px 0 0;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.map-location-description {
  margin: 20px 0 0;
  color: var(--muted);
  white-space: pre-line;
}

.map-location-coordinate {
  margin: 22px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--green);
  font-size: 11px;
}

body.map-modal-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .map-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .map-toolbar-actions {
    justify-content: flex-start;
  }

  .map-stage {
    width: 900px;
    max-width: none;
  }

  .map-hotspot {
    width: 34px;
    height: 34px;
  }

  .map-location-content {
    padding: 20px;
  }
}

/* =========================
   世界地图入口
   ========================= */

.world-map-entry {
  width: 172px;
  margin-top: 28px;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 12px 12px;
  border: 1px solid rgba(0, 217, 255, 0.42);
  color: var(--text);
  background:
    linear-gradient(
      145deg,
      rgba(23, 35, 48, 0.88),
      rgba(7, 11, 16, 0.96)
    );
  box-shadow:
    0 14px 34px rgba(0, 0, 0, 0.28),
    inset 0 0 22px rgba(0, 217, 255, 0.04);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.world-map-entry:hover,
.world-map-entry:focus-visible {
  outline: none;
  transform: translateY(-3px);
  border-color: var(--yellow);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.38),
    0 0 24px rgba(252, 238, 9, 0.16);
}

.world-map-entry-icon {
  width: 92px;
  height: 72px;
  display: grid;
  place-items: center;
  color: var(--blue);
}

.world-map-entry-icon svg {
  width: 72px;
  height: 72px;
  overflow: visible;
  fill: rgba(0, 217, 255, 0.05);
  stroke: currentColor;
  stroke-width: 2;
  filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.34));
}

.world-map-entry:hover .world-map-entry-icon,
.world-map-entry:focus-visible .world-map-entry-icon {
  color: var(--yellow);
}

.world-map-entry-label {
  color: var(--green);
  font-family: monospace;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  text-align: center;
}
