/* ==========================================================================
   3D 地图页样式：全屏画布 + 悬浮面板
   ========================================================================== */

.m3d-stage {
  position: relative;
  height: calc(100vh - 56px);
  min-height: 420px;
  background: #0d1117;
  overflow: hidden;
}
.m3d-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  outline: none;
  touch-action: none;
}
.m3d-stage:fullscreen { height: 100vh; }

/* ---------- 悬浮面板通用外观 ---------- */
.m3d-panel {
  position: absolute;
  background: rgba(20, 21, 23, .88);
  border: 1px solid var(--line2);
  border-radius: var(--radius);
  backdrop-filter: blur(6px);
  color: var(--text);
  font-size: 13px;
  z-index: 5;
}

/* 左上：标题与操作 */
.m3d-tools {
  top: 14px; left: 14px;
  padding: 12px 14px;
  max-width: 320px;
}
.m3d-tools h2 {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .03em;
  margin-bottom: 2px;
}
.m3d-tools h2 em { font-style: normal; color: var(--gold); }
.m3d-tools .m3d-sub {
  color: var(--mute);
  font-size: 12px;
  margin-bottom: 10px;
}
.m3d-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.m3d-btn, .m3d-select {
  background: var(--panel2);
  border: 1px solid var(--line2);
  color: var(--text);
  border-radius: var(--radius);
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .03em;
}
.m3d-btn:hover, .m3d-select:hover { border-color: var(--gold-dim); color: var(--gold); }
.m3d-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.m3d-check input { accent-color: var(--gold); }
.m3d-hint {
  color: var(--mute);
  font-size: 11.5px;
  line-height: 1.7;
  margin-top: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}
.m3d-hint kbd {
  background: var(--panel3);
  border: 1px solid var(--line2);
  border-radius: 2px;
  padding: 0 4px;
  font-size: 11px;
  font-family: inherit;
  color: var(--dim);
}

/* 右上：数据来源 */
.m3d-meta {
  top: 14px; right: 14px;
  padding: 10px 12px;
  color: var(--mute);
  font-size: 11.5px;
  text-align: right;
  max-width: 220px;
}
.m3d-meta b { color: var(--dim); }

/* 右下：性能统计 */
.m3d-stats {
  right: 14px; bottom: 14px;
  padding: 10px 12px;
  font-variant-numeric: tabular-nums;
  color: var(--dim);
  font-size: 11.5px;
  line-height: 1.75;
  min-width: 150px;
}
.m3d-stats b { color: var(--text); }
.m3d-stats.hidden { display: none; }

/* 左下：图例 */
.m3d-legend {
  left: 14px; bottom: 14px;
  padding: 10px 12px;
  color: var(--mute);
  font-size: 11.5px;
  line-height: 1.7;
}
.m3d-legend b { color: var(--dim); }

/* ---------- 加载遮罩 ---------- */
.m3d-loading {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: radial-gradient(circle at 50% 45%, #171a1f 0%, #0a0b0c 70%);
  transition: opacity .4s ease;
}
.m3d-loading.hidden { opacity: 0; pointer-events: none; visibility: hidden; }
.m3d-loading.error .m3d-loading-title { color: var(--danger); }
.m3d-loading-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--gold);
}
.m3d-loading-sub { font-size: 12.5px; letter-spacing: .06em; color: var(--mute); }
.m3d-progress {
  width: min(320px, 62vw);
  height: 3px;
  background: var(--panel2);
  border-radius: 2px;
  overflow: hidden;
}
.m3d-progress i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold-dim), var(--gold));
  transition: width .25s ease;
}

/* ---------- 页面下方的说明区 ---------- */
.m3d-notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.m3d-note {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.m3d-note h3 {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}
.m3d-note p { color: var(--dim); font-size: 13.5px; }
.m3d-note ul { margin: 6px 0 0 18px; color: var(--dim); font-size: 13.5px; }
.m3d-note li { margin-bottom: 3px; }

@media (max-width: 720px) {
  .m3d-tools { max-width: none; right: 14px; }
  .m3d-hint { display: none; }
  .m3d-legend { display: none; }
  .m3d-meta { top: auto; bottom: 14px; right: 14px; }
  .m3d-stats { bottom: 14px; right: 14px; }
}
