/* 访客概览：全国真实省界图 + 哈密静态图 + 统计面板（对齐 ihchina #page5） */

.visitor-overview {
  flex: 0 0 auto;
}

/* ---------- 全国页（近全屏） ---------- */
.ov-china {
  position: relative;
  padding: 0;
  min-height: calc(100vh - 56px);
  height: calc(100vh - 56px);
  min-height: calc(100dvh - 56px);
  height: calc(100dvh - 56px);
  background:
    radial-gradient(ellipse 80% 60% at 50% 40%, rgba(90, 45, 20, 0.25), transparent 70%),
    linear-gradient(160deg, #1a0f0a 0%, #3d2416 35%, #2a160e 70%, #120b08 100%);
  color: #f3e7d3;
  border-bottom: 1px solid rgba(255, 220, 170, 0.12);
  overflow: hidden;
}
.ov-china::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.03) 2px,
      rgba(0, 0, 0, 0.03) 3px
    );
  pointer-events: none;
  opacity: 0.45;
  z-index: 2;
}

.ov-china-title {
  display: none !important;
}

.ov-china-board {
  position: absolute;
  inset: 0;
  z-index: 1;
  max-width: none;
  margin: 0;
  display: block;
}

.ov-china-map-pane {
  position: absolute;
  inset: 0;
  min-height: 0;
  height: 100%;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
}
#ov-china-map {
  width: 100%;
  height: 100%;
  background: transparent;
}
#ov-china-map .leaflet-container {
  background: transparent;
  font: inherit;
}

/* 右下角南海诸岛附图（完整九段线范围） */
.ov-nanhai-inset {
  position: absolute;
  right: max(12px, calc(min(320px, 32vw) + 28px));
  bottom: 2.6rem;
  z-index: 7;
  width: min(168px, 22vw);
  height: min(200px, 34vh);
  background: rgba(212, 196, 168, 0.96);
  border: 2px solid #7a6548;
  border-radius: 4px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
  overflow: hidden;
  pointer-events: none;
}
.ov-nanhai-caption {
  position: absolute;
  top: 4px;
  left: 0;
  right: 0;
  z-index: 2;
  text-align: center;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #3a2c1c;
  text-shadow: 0 0 4px rgba(255, 248, 235, 0.9);
  pointer-events: none;
}
#ov-nanhai-map {
  width: 100%;
  height: 100%;
}
#ov-nanhai-map .leaflet-container {
  background: transparent;
  font: inherit;
}
@media (max-width: 920px) {
  .ov-nanhai-inset {
    right: 0.75rem;
    bottom: calc(42vh + 1rem);
    width: min(132px, 36vw);
    height: min(156px, 28vh);
  }
}
@media (max-width: 560px) {
  .ov-nanhai-inset {
    width: 108px;
    height: 128px;
    bottom: calc(42vh + 0.6rem);
  }
}

.china-prov-label {
  color: #4a3a28;
  font-size: 11px;
  font-weight: 650;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 3px rgba(255, 248, 235, 0.95),
    0 0 6px rgba(255, 248, 235, 0.8);
  line-height: 1.1;
}
.china-prov-label.is-xj {
  color: #2c2116;
  font-size: 13px;
  font-weight: 800;
}

.china-hami-marker {
  background: none !important;
  border: none !important;
}
.china-hami-marker .wrap {
  position: relative;
  display: block;
  width: 12px;
  height: 12px;
}
.china-hami-marker .dot {
  position: absolute;
  left: 0;
  top: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e85d2a;
  box-shadow: 0 0 0 2px rgba(255, 240, 220, 0.85);
  z-index: 2;
}
.china-hami-marker .pulse {
  position: absolute;
  left: -8px;
  top: -8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(232, 93, 42, 0.35);
  animation: hamiPulse 1.8s ease-out infinite;
  z-index: 1;
}
@keyframes hamiPulse {
  0% { transform: scale(0.6); opacity: 0.8; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}
.china-hami-marker .lab {
  position: absolute;
  left: 18px;
  top: -10px;
  color: #fff4e0;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.55);
  line-height: 1.25;
}
.china-hami-marker .lab small {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: #f0c090;
}

.ov-china-side {
  position: absolute;
  top: 4.2rem;
  right: 1rem;
  bottom: 2.4rem;
  width: min(320px, 32vw);
  z-index: 6;
  background: rgba(243, 233, 214, 0.96);
  color: #3a2c1c;
  border: 1px solid #d2c3a8;
  border-radius: 6px;
  padding: 1.05rem 1.1rem 0.95rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(6px);
}
@media (max-width: 920px) {
  .ov-china-side {
    position: absolute;
    top: auto;
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    max-height: 42vh;
  }
}
.ov-china-side h3 {
  margin: 0;
  font-size: 1.25rem;
  letter-spacing: 0.06em;
}
.ov-china-side .ov-side-sub {
  margin: 0.3rem 0 0.9rem;
  color: #6a5a45;
  font-size: 0.86rem;
}
.ov-china-side .ov-side-tip {
  margin: 0 0 1rem;
  padding: 0.75rem 0.8rem;
  background: rgba(196, 90, 44, 0.1);
  border-left: 3px solid #c45a2c;
  font-size: 0.88rem;
  line-height: 1.5;
}
.ov-china-side .ov-side-tip strong { color: #c45a2c; }
.ov-china-preview {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
  flex: 1;
  align-content: start;
}
.ov-china-preview .cell {
  text-align: center;
  padding: 0.55rem 0.25rem;
  border-bottom: 1px dashed rgba(90, 70, 40, 0.18);
}
.ov-china-preview .n {
  font-size: 1.35rem;
  font-weight: 750;
  color: #8a3b22;
}
.ov-china-preview .l {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  color: #5c4a36;
}
.ov-china-side .ov-enter-btn {
  margin-top: auto;
  width: 100%;
  background: #c45a2c;
  border-color: #c45a2c;
  color: #fff7ec;
  padding: 0.65rem 1rem;
  font-weight: 700;
}
.ov-map-credit {
  position: absolute;
  left: 0.85rem;
  bottom: 0.55rem;
  z-index: 5;
  margin: 0;
  font-size: 0.7rem;
  color: rgba(243, 231, 211, 0.55);
  text-align: left;
  pointer-events: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

/* ---------- 哈密页 ---------- */
.ov-hami {
  padding: 1.4rem 1rem 1.75rem;
  background: linear-gradient(180deg, #efe6d6 0%, #e7dfd0 100%);
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 0.5rem;
}
.ov-hami-title {
  max-width: 1200px;
  margin: 0 auto 1rem;
  text-align: center;
}
.ov-hami-title h2 {
  margin: 0;
  font-size: 1.35rem;
  color: #3a2c1c;
}
.ov-hami-title p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}
.ov-county-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: center;
  margin-top: 0.75rem;
}
.ov-tab {
  border: 1px solid #b79a72;
  background: #f7efe2;
  color: #3a2c1c;
  border-radius: 999px;
  padding: 0.3rem 0.85rem;
  cursor: pointer;
  font: inherit;
  font-size: 0.85rem;
}
.ov-tab:hover { filter: brightness(1.03); }
.ov-tab.is-active {
  background: #c45a2c;
  border-color: #c45a2c;
  color: #fff7ec;
}

.ov-hami-row {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.9fr);
  gap: 1rem;
  align-items: stretch;
}
@media (max-width: 900px) {
  .ov-hami-row { grid-template-columns: 1fr; }
}

.ov-hami-map {
  position: relative;
  background: #d9cbb3;
  border: 1px solid #c9b79a;
  border-radius: 4px;
  min-height: 460px;
  height: min(62vh, 560px);
  overflow: hidden;
  box-shadow: var(--shadow);
}
#ov-hami-map {
  width: 100%;
  height: 100%;
}
#ov-hami-map .leaflet-container {
  background: #d9cbb3;
  font: inherit;
}
.hami-county-label {
  color: #2c2116;
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  text-shadow:
    0 0 4px rgba(255, 248, 235, 0.95),
    0 0 8px rgba(255, 248, 235, 0.85);
}
.ov-stats {
  background: #f4ebda;
  border: 1px solid #d2c3a8;
  border-radius: 4px;
  padding: 1rem 1.05rem 0.95rem;
  box-shadow: var(--shadow);
  color: #3a2c1c;
  display: flex;
  flex-direction: column;
  min-height: 460px;
}
.ov-stats-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.ov-stats .ov-enter-btn {
  margin-top: 0.95rem;
  width: 100%;
  background: #c45a2c;
  border: 1px solid #c45a2c;
  color: #fff7ec;
  padding: 0.72rem 1.2rem;
  font-weight: 700;
  font-size: 1.02rem;
  border-radius: 10px;
  letter-spacing: 0.04em;
}
.ov-stats .ov-enter-btn:hover {
  background: #b04e24;
  border-color: #b04e24;
}
.ov-stats-head h2 {
  margin: 0;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}
.ov-stats-sub {
  margin: 0.25rem 0 0.85rem;
  color: #6a5a45;
  font-size: 0.85rem;
}
.ov-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.65rem 0.5rem;
  flex: 1;
}
.ov-stat-cell {
  text-align: center;
  padding: 0.45rem 0.2rem;
  border-bottom: 1px dashed rgba(90, 70, 40, 0.18);
}
.ov-stat-num {
  font-size: 1.55rem;
  font-weight: 750;
  color: #8a3b22;
  line-height: 1.1;
}
.ov-stat-label {
  margin-top: 0.2rem;
  font-size: 0.72rem;
  color: #5c4a36;
  line-height: 1.25;
}
.ov-stats-foot {
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(90, 70, 40, 0.18);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: flex-end;
  justify-content: space-between;
}
.ov-stats-note {
  margin: 0;
  flex: 1 1 12rem;
  font-size: 0.72rem;
  color: #7a684f;
  line-height: 1.45;
}
.ov-stats-total {
  margin: 0;
  font-size: 1.05rem;
  white-space: nowrap;
}
.ov-stats-total strong {
  color: #8a3b22;
  font-size: 1.35rem;
}

.ov-back-hint {
  max-width: 1200px;
  margin: 0.9rem auto 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted);
}
.ov-back-hint a { color: var(--accent-2); }

body.is-admin .visitor-overview { display: none !important; }
body.is-visitor .layout {
  min-height: min(72vh, 760px);
}
body.is-visitor .layout::before {
  content: "交互式分布底图";
  display: block;
  grid-column: 1 / -1;
  padding: 0.55rem 1rem 0;
  font-size: 0.85rem;
  font-weight: 650;
  color: var(--muted);
  letter-spacing: 0.04em;
}
