/* 全屏可拖拽地图页 · 林场档案风配色 */

.map-app {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  background: #D6B27C;
  user-select: none;
  -webkit-user-select: none;
}

.map-viewport {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  touch-action: none;
  cursor: grab;
  overflow: hidden;
}

.map-viewport.is-dragging {
  cursor: grabbing;
}

.map-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
  will-change: transform;
}

.map-stage img {
  display: block;
  width: 2800px;
  height: 1134px;
  max-width: none;
  pointer-events: none;
}

.map-topbar {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 12px;
  right: 12px;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  pointer-events: none;
}

.map-title-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: rgba(17, 36, 27, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #F6EFDF;
  border: 1px solid rgba(227, 163, 95, 0.35);
  box-shadow: var(--shadow);
}

.map-title-pill strong {
  display: block;
  font-family: var(--serif);
  font-size: 13.5px;
  letter-spacing: 0.06em;
  line-height: 1.15;
}

.map-title-pill span {
  display: block;
  font-size: 10px;
  color: rgba(246, 239, 223, 0.76);
}

.map-top-actions {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.map-chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(251, 248, 241, 0.94);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--shadow);
}

.map-chip-btn .icon {
  width: 15px;
  height: 15px;
}

.map-chip-btn.is-red {
  background: var(--stamp);
  border-color: var(--stamp);
  color: #fff;
}

.map-gesture-hint {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 64px);
  transform: translateX(-50%);
  z-index: 42;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(17, 36, 27, 0.82);
  color: #F6EFDF;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.map-gesture-hint.is-hidden {
  opacity: 0;
}

.map-landscape-btn {
  position: absolute;
  left: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 45;
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(22, 91, 67, 0.78);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
}

.map-landscape-btn .icon {
  width: 16px;
  height: 16px;
}

.map-landscape-btn:active {
  transform: scale(0.95);
}

.map-controls {
  position: absolute;
  right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 16px);
  z-index: 45;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 900px) {
  .map-controls {
    bottom: 24px;
    right: 24px;
  }
}

/* 手机一键模拟横屏全览（隐藏顶部冗余按钮，其余控件精简半透明，让地图最大化清晰展示） */
body.is-map-landscape .mobile-nav,
body.is-map-landscape .map-top-actions,
body.is-map-landscape .map-gesture-hint {
  display: none;
}

body.is-map-landscape .map-app {
  top: 50%;
  left: 50%;
  right: auto;
  bottom: auto;
  width: var(--land-w, 100dvh);
  height: var(--land-h, 100vw);
  transform: translate(-50%, -50%) rotate(90deg);
  transform-origin: center center;
}

body.is-map-landscape .map-topbar {
  top: 8px;
  left: calc(env(safe-area-inset-top, 0px) + 12px);
  right: calc(env(safe-area-inset-bottom, 0px) + 12px);
}

body.is-map-landscape .map-title-pill {
  padding: 4px 10px 4px 7px;
  gap: 6px;
  background: rgba(17, 36, 27, 0.34);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: none;
  opacity: 0.56;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

body.is-map-landscape .map-title-pill img {
  width: 18px;
  height: 16px;
}

body.is-map-landscape .map-title-pill strong {
  font-size: 12px;
}

body.is-map-landscape .map-title-pill span {
  display: none;
}

body.is-map-landscape .map-landscape-btn {
  left: calc(env(safe-area-inset-top, 0px) + 12px);
  bottom: 10px;
  height: 32px;
  padding: 0 11px;
  font-size: 12px;
  gap: 4px;
  background: rgba(17, 36, 27, 0.36);
  border-color: rgba(255, 255, 255, 0.22);
  color: rgba(255, 255, 255, 0.94);
  box-shadow: none;
  opacity: 0.64;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

body.is-map-landscape .map-landscape-btn .icon {
  width: 14px;
  height: 14px;
}

body.is-map-landscape .map-landscape-btn:active {
  opacity: 1;
  background: rgba(17, 36, 27, 0.78);
}

body.is-map-landscape .map-controls {
  flex-direction: row;
  right: calc(env(safe-area-inset-bottom, 0px) + 12px);
  bottom: 10px;
  gap: 6px;
}

body.is-map-landscape .map-ctrl-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  font-size: 16px;
  background: rgba(255, 255, 255, 0.38);
  border-color: rgba(22, 34, 28, 0.12);
  color: rgba(15, 63, 46, 0.92);
  box-shadow: none;
  opacity: 0.64;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  transition: opacity 0.2s ease, background-color 0.2s ease;
}

body.is-map-landscape .map-ctrl-btn:active {
  opacity: 1;
  background: rgba(255, 255, 255, 0.85);
}

body.is-map-landscape .map-ctrl-btn.is-text {
  width: auto;
  padding: 0 10px;
  font-size: 11.5px;
}

body.is-map-landscape .info-sheet {
  bottom: 12px;
  max-height: 78%;
}

/* 手机物理横握自适应：同样隐藏交通/电话按钮、半透明精简其余按钮，最大化清晰看图 */
@media (orientation: landscape) and (max-height: 540px) {
  .map-top-actions,
  .map-gesture-hint {
    display: none;
  }

  .page-map .mobile-nav {
    height: calc(44px + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.72);
  }

  .page-map .mobile-nav .icon {
    width: 17px;
    height: 17px;
  }

  .page-map .mobile-nav a {
    font-size: 10px;
    gap: 1px;
  }

  .map-topbar {
    top: 8px;
    left: calc(env(safe-area-inset-left, 0px) + 12px);
    right: calc(env(safe-area-inset-right, 0px) + 12px);
  }

  .map-title-pill {
    padding: 4px 10px 4px 7px;
    gap: 6px;
    background: rgba(17, 36, 27, 0.38);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: none;
    opacity: 0.65;
  }

  .map-title-pill img {
    width: 18px;
    height: 16px;
  }

  .map-title-pill strong {
    font-size: 12px;
  }

  .map-title-pill span {
    display: none;
  }

  .map-controls {
    flex-direction: row;
    right: calc(env(safe-area-inset-right, 0px) + 12px);
    bottom: calc(44px + env(safe-area-inset-bottom, 0px) + 8px);
    gap: 6px;
  }

  .map-ctrl-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.44);
    border-color: rgba(22, 34, 28, 0.12);
    box-shadow: none;
    opacity: 0.72;
  }

  .map-ctrl-btn.is-text {
    width: auto;
    padding: 0 10px;
    font-size: 11.5px;
  }

  .info-sheet {
    bottom: calc(44px + env(safe-area-inset-bottom, 0px) + 8px);
    max-height: 74dvh;
  }
}

.map-ctrl-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  border: 1px solid rgba(22, 34, 28, 0.12);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--pine);
  font-size: 19px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}

.map-ctrl-btn.is-text {
  font-size: 12px;
}

.map-ctrl-btn:active {
  transform: scale(0.94);
}

.info-sheet {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px) + 12px);
  z-index: 55;
  max-width: 520px;
  max-height: 68dvh;
  margin-inline: auto;
  overflow-y: auto;
  padding: 18px 16px;
  border-radius: var(--radius-lg);
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 3px solid var(--pine);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

@media (min-width: 900px) {
  .info-sheet {
    bottom: 88px;
  }
}

.info-sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.info-sheet-head h2 {
  font-family: var(--serif);
  font-size: 19px;
  color: var(--ink);
}

.info-sheet-head p {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
}

.info-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.info-quick-btns {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 14px;
}

@media (min-width: 440px) {
  .info-quick-btns {
    grid-template-columns: 1fr 1fr;
  }
}

.info-quick-btns .btn {
  width: 100%;
  min-width: 0;
  padding: 0 12px;
  font-size: 13px;
}

.info-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-card {
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
}

.info-card strong {
  display: block;
  font-family: var(--serif);
  font-size: 14.5px;
  color: var(--pine);
  margin-bottom: 4px;
}

.info-card p {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.6;
}

.info-card p + p {
  margin-top: 4px;
}
