/* 世界时钟地图页样式 */

.map-home {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding: 12px 16px; margin-bottom: 12px;
}
.map-home h2 { font-size: 15px; margin: 0; font-weight: 600; }
.map-home-time {
  font-family: var(--mono); font-size: 14px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.map-home .btn { margin-left: auto; }

.map-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-bottom: 12px;
}

.map-stage {
  position: relative;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-soft);
  margin-bottom: 12px;
}
.map-canvas-wrap { position: relative; width: 100%; aspect-ratio: 1100 / 560; }
.map-canvas-wrap canvas { display: block; width: 100%; height: 100%; touch-action: none; }

/* 窄屏改为球面投影，画布需保持正方形，否则地球会被压扁 */
@media (max-width: 620px) {
  .map-canvas-wrap { aspect-ratio: 1 / 1; }
}

.map-zoom {
  position: absolute; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 6px;
}
.map-zoom button {
  width: 36px; height: 36px; border: none; border-radius: 12px;
  background: rgba(26, 34, 51, 0.55); color: #fff; font-size: 20px; line-height: 1;
  cursor: pointer; display: grid; place-items: center;
}
.map-zoom button:hover { background: rgba(26, 34, 51, 0.75); }
.map-zoom button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }

/* 基准城市脉冲圈：独立于 canvas 的 DOM 层，保证 60fps 流畅 */
.map-home-pulse {
  position: absolute; left: 0; top: 0;
  width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.16);
  box-shadow: 0 0 0 1.5px rgba(37, 99, 235, 0.55);
  pointer-events: none; display: none; z-index: 2;
}
.map-home-pulse::after {
  content: ''; position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid rgba(37, 99, 235, 0.55);
  animation: home-pulse 1.8s ease-out infinite;
}
@keyframes home-pulse {
  0%   { transform: scale(0.9); opacity: .75; }
  100% { transform: scale(3.4); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .map-home-pulse::after { animation: none; opacity: .4; }
}

.map-tooltip {
  position: absolute; z-index: 5; pointer-events: none;
  background: rgba(26, 34, 51, 0.9); color: #fff;
  padding: 5px 10px; border-radius: 8px; font-size: 12px; white-space: nowrap;
  transform: translate(-50%, -140%);
  opacity: 0; transition: opacity .12s;
}
.map-tooltip.show { opacity: 1; }

.map-shift {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.map-shift .toolbar-label { white-space: nowrap; }
.map-shift input[type="range"] {
  flex: 1 1 180px; min-width: 120px; accent-color: var(--accent); height: 20px;
}
.shift-readout {
  font-family: var(--mono); font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums; min-width: 92px;
}
.map-shift.is-preview { background: #fff8e8; }
.map-shift.is-preview .shift-readout { color: #a8630a; }

/* ---------- 详情与列表 ---------- */

.map-lower { display: grid; gap: 14px; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); }
@media (max-width: 860px) { .map-lower { grid-template-columns: 1fr; } }

.city-detail { position: sticky; top: 74px; align-self: start; }
.city-detail-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 2px; }
.city-detail h3 { margin: 0; font-size: 19px; }
.city-detail-country { font-size: 13px; color: var(--text-muted); }
.city-detail-time {
  font-family: var(--mono); font-size: 30px; font-weight: 600;
  font-variant-numeric: tabular-nums; line-height: 1.2; margin: 6px 0 2px;
}
.city-detail-date { font-size: 13px; color: var(--text-muted); margin-bottom: 12px; }
.detail-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 13px; }
.detail-grid dt { color: var(--text-muted); }
.detail-grid dd { margin: 0; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.magic-list { max-height: 460px; overflow-y: auto; }
.magic-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 10px;
  font-size: 14px; font-weight: 600;
}
.pulse-dot {
  width: 7px; height: 7px; border-radius: 50%; background: #15803d;
  animation: pulse 1.8s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.magic-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-top: 1px solid var(--border);
}
.magic-item:first-of-type { border-top: none; }
.magic-dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: #818cf8; }
.magic-dot.golden { background: var(--gold); }
.magic-dot.blue { background: #5b7fd4; }
.magic-name { font-weight: 600; font-size: 14px; color: inherit; }
.magic-name:hover { color: var(--accent); text-decoration: underline; }
.magic-sub { font-size: 12px; color: var(--text-muted); }
.magic-right { margin-left: auto; text-align: right; }
.magic-time { font-family: var(--mono); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.magic-left { font-size: 11px; color: var(--text-muted); }
.magic-empty { padding: 22px 4px; color: var(--text-muted); font-size: 14px; text-align: center; }
