:root {
  color-scheme: light;
  font-family: "HarmonyOS Sans SC", "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  --map-blue: #2d83b6;
  --map-deep: #203741;
  --map-muted: #617882;
  --map-line: rgba(38, 83, 102, 0.15);
}

* {
  box-sizing: border-box;
}

html,
body,
.map-shell,
.office-map {
  height: 100%;
  margin: 0;
  min-height: 100%;
  width: 100%;
}

html,
body {
  background: #e7eef0;
  overflow: hidden;
}

body.mode-interactive,
body.mode-interactive .map-shell,
body.mode-interactive .office-map {
  height: 100dvh;
}

.map-shell {
  isolation: isolate;
  overflow: hidden;
  position: relative;
}

.office-map {
  background:
    linear-gradient(rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.45)),
    repeating-linear-gradient(30deg, transparent 0 32px, rgba(57, 113, 135, 0.08) 32px 34px),
    #dbe7ea;
  z-index: 1;
}

.office-card {
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-left: 3px solid var(--map-blue);
  box-shadow: 0 8px 24px rgba(15, 49, 64, 0.13);
  color: var(--map-deep);
  display: grid;
  gap: 5px;
  left: 14px;
  max-width: min(330px, calc(100% - 28px));
  padding: 11px 13px;
  position: absolute;
  top: 14px;
  z-index: 500;
}

.office-card > span {
  color: var(--map-blue);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.office-card strong {
  font-size: 15px;
  font-weight: 650;
  line-height: 1.3;
}

.office-card address {
  color: var(--map-muted);
  font-size: 11px;
  font-style: normal;
  line-height: 1.55;
}

.office-card a {
  color: var(--map-blue);
  font-size: 12px;
  font-weight: 650;
  margin-top: 3px;
  text-decoration: none;
  width: fit-content;
}

.office-card a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.office-card a:focus-visible,
.map-fallback button:focus-visible,
.leaflet-control-zoom a:focus-visible,
.office-marker:focus-visible {
  outline: 3px solid rgba(45, 131, 182, 0.48);
  outline-offset: 3px;
}

.mode-preview .office-card address,
.mode-preview .full-only {
  display: none;
}

.map-fallback {
  align-items: center;
  background:
    linear-gradient(rgba(244, 248, 249, 0.94), rgba(244, 248, 249, 0.94)),
    repeating-linear-gradient(30deg, transparent 0 32px, rgba(57, 113, 135, 0.12) 32px 34px);
  color: var(--map-deep);
  display: flex;
  flex-direction: column;
  gap: 7px;
  inset: 0;
  justify-content: center;
  padding: 24px;
  position: absolute;
  text-align: center;
  transition: opacity 220ms ease, visibility 220ms ease;
  z-index: 700;
}

.map-fallback strong {
  font-size: 16px;
  line-height: 1.35;
}

.map-fallback p {
  color: var(--map-muted);
  font-size: 11px;
  line-height: 1.55;
  margin: 0;
  max-width: 430px;
}

.map-fallback > span:last-of-type {
  color: var(--map-muted);
  font-size: 11px;
}

.map-fallback button {
  background: var(--map-blue);
  border: 0;
  border-radius: 2px;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: 650;
  min-height: 38px;
  padding: 8px 18px;
}

.fallback-pin {
  animation: pin-pulse 1.5s ease-in-out infinite;
  background: var(--map-blue);
  border: 4px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 4px 14px rgba(17, 79, 108, 0.22);
  display: block;
  height: 30px;
  margin-bottom: 5px;
  transform: rotate(-45deg);
  width: 30px;
}

.map-ready .map-fallback {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.map-error .map-fallback {
  opacity: 1;
  visibility: visible;
}

.map-error .fallback-pin {
  animation: none;
  background: #79919b;
}

.noscript-message {
  background: #f4f8f9;
  color: var(--map-deep);
  font-size: 13px;
  inset: 0;
  margin: 0;
  padding: 28px;
  position: absolute;
  z-index: 900;
}

.office-marker-wrapper {
  background: transparent;
  border: 0;
}

.office-marker {
  background: var(--map-blue);
  border: 4px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 4px 14px rgba(17, 79, 108, 0.34);
  display: block;
  height: 30px;
  position: relative;
  transform: rotate(-45deg);
  width: 30px;
}

.office-marker::after {
  background: #ffffff;
  border-radius: 50%;
  content: "";
  height: 8px;
  left: 7px;
  position: absolute;
  top: 7px;
  width: 8px;
}

.leaflet-popup-content-wrapper {
  border-radius: 3px;
  box-shadow: 0 10px 30px rgba(17, 49, 63, 0.18);
}

.leaflet-popup-content {
  color: var(--map-deep);
  line-height: 1.55;
  margin: 14px 16px;
  max-width: 220px;
}

.leaflet-popup-content strong {
  display: block;
  font-size: 14px;
  margin-bottom: 4px;
}

.leaflet-popup-content address {
  color: var(--map-muted);
  font-size: 12px;
  font-style: normal;
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 5px 16px rgba(17, 49, 63, 0.16) !important;
}

.leaflet-control-zoom a {
  color: var(--map-deep);
  height: 40px !important;
  line-height: 40px !important;
  width: 40px !important;
}

.map-source-control {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 2px;
  box-shadow: 0 2px 10px rgba(17, 49, 63, 0.1);
  color: #536a75;
  font-size: 9px;
  line-height: 1.35;
  margin: 0 7px 7px 0;
  padding: 3px 6px;
}

.map-source-control a {
  color: #315f75;
  text-decoration: none;
}

.map-source-control a:hover {
  text-decoration: underline;
}

@keyframes pin-pulse {
  0%,
  100% {
    transform: rotate(-45deg) translate(0, 0);
  }
  50% {
    transform: rotate(-45deg) translate(3px, -3px);
  }
}

@media (max-width: 520px) {
  .mode-interactive .office-card {
    left: 10px;
    max-width: calc(100% - 20px);
    padding: 10px 12px;
    top: 10px;
  }

  .mode-interactive .office-card address {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .fallback-pin {
    animation: none;
  }

  .map-fallback {
    transition: none;
  }
}
