/* ============================================================
 * 3D 光投影演示 · huifeng.glb 顶部俯视版
 * 独立样式表（20260716 提取自 projection_demo_3d_huifeng.html）
 * ============================================================ */

* { box-sizing: border-box; }

/* ---------- 全局基底 ---------- */
body {
  margin: 0; overflow: hidden;
  background: #060912; color: #e6eefc;
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  height: 100vh; width: 100vw;
}
#scene-canvas {
  position: fixed; inset: 0; width: 100vw; height: 100vh;
  display: block; z-index: 1;
}

/* ===== 顶部说明条（已按用户要求移除）===== */

/* ===== 左上：参数面板 ===== */
#ui-panel { width: 280px; top: 18px; left: 18px; }
#ui-panel h2 {
  margin: 0; font-size: 14px; color: #ffc107; letter-spacing: 0.04em;
}
#ui-panel .intro {
  font-size: 12px; line-height: 1.55;
  color: rgba(230, 238, 252, 0.75); margin: 0 0 12px 0;
}
.param-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 4px 0; font-size: 11.5px;
  border-bottom: 1px dashed rgba(255, 193, 7, 0.12);
}
.param-row:last-child { border-bottom: none; }
.param-label { color: rgba(230, 238, 252, 0.65); }
.param-value {
  color: #ffc107; font-weight: 700;
  font-family: "Consolas", "Monaco", monospace; font-size: 12px;
}

.btn-group { display: flex; gap: 6px; margin-top: 12px; }
.btn {
  flex: 1; padding: 8px 10px;
  background: linear-gradient(135deg, #b8860b 0%, #ffc107 100%);
  color: #1a1300; border: none; border-radius: 7px;
  font-size: 12px; font-weight: 700; cursor: pointer; letter-spacing: 0.04em;
  transition: all 200ms ease; box-shadow: 0 4px 14px rgba(255, 193, 7, 0.25);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 193, 7, 0.4);
}
.btn--ghost {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(230, 238, 252, 0.85);
  border: 1px solid rgba(255, 193, 7, 0.25); box-shadow: none;
}
.btn--ghost:hover { background: rgba(255, 193, 7, 0.12); }

/* ===== 右上：实时统计 ===== */
#stats-panel { width: 250px; top: 18px; right: 18px; }
#stats-panel h3 {
  margin: 0; font-size: 13px; color: #ffc107;
  letter-spacing: 0.06em; display: flex; align-items: center; gap: 6px;
}
#stats-panel h3::before {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: #ffc107; border-radius: 50%; box-shadow: 0 0 8px #ffc107;
  animation: pulse 1.4s infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.4; } }
.stat-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
  border-bottom: 1px dashed rgba(255, 193, 7, 0.12);
  font-size: 11.5px;
}
.stat-row:last-child { border-bottom: none; }
.stat-label { color: rgba(230, 238, 252, 0.6); }
.stat-value {
  color: #ffc107; font-weight: 700;
  font-family: "Consolas", "Monaco", monospace; font-size: 13px;
}
.stat-value.is-highlight { color: #5fe1ff; }

/* ===== 左下：图例 ===== */
#legend-bar {
  font-size: 11px; color: rgba(230, 238, 252, 0.85);
  bottom: 18px; left: 18px;
}
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-dot { width: 9px; height: 9px; border-radius: 2px; }
.legend-dot--black { background: #000; border: 1px solid #555; }
.legend-dot--gold {
  background: #ffc107; border: 1px solid #fff7c2;
  box-shadow: 0 0 6px rgba(255, 193, 7, 0.5);
}
.legend-dot--wire { background: transparent; border: 1px solid #888; }
.legend-dot--beam {
  background: linear-gradient(90deg, transparent, #ffc107, transparent);
}

/* ===== 顶栏播放按钮（已废弃，移至右下角）===== */
.top-bar .play-btn { display: none; }

/* ===== 通用：可拖动面板 ===== */
.draggable-panel {
  position: fixed; z-index: 20;
  background: rgba(11, 16, 32, 0.85); backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 193, 7, 0.2); border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
  user-select: none;
}
.draggable-panel .panel-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; cursor: move;
  background: rgba(255, 193, 7, 0.08);
  border-bottom: 1px solid rgba(255, 193, 7, 0.15);
  border-radius: 13px 13px 0 0;
}
.draggable-panel .panel-header h2,
.draggable-panel .panel-header h3 {
  margin: 0; font-size: 13px; color: #ffc107;
}
.draggable-panel .panel-body {
  padding: 12px 16px; overflow: auto;
  transition: max-height 250ms ease, padding 250ms ease, opacity 200ms ease;
  max-height: 600px; opacity: 1;
}
.draggable-panel.is-minimized .panel-body {
  max-height: 0; padding: 0 16px; opacity: 0; overflow: hidden;
}
.draggable-panel .minimize-btn {
  background: transparent; border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107; width: 24px; height: 24px; border-radius: 5px;
  cursor: pointer; font-size: 14px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all 150ms ease;
}
.draggable-panel .minimize-btn:hover { background: rgba(255, 193, 7, 0.18); }
.draggable-panel.is-minimized .minimize-btn::after { content: "▢"; }
.draggable-panel:not(.is-minimized) .minimize-btn::after { content: "—"; }

/* ===== 右下角播放面板 ===== */
#play-panel {
  bottom: 18px; right: 18px;
  padding: 14px 18px;
  display: flex; flex-direction: column; gap: 10px; align-items: center;
  min-width: 180px;
}
#play-panel .play-header {
  display: flex; justify-content: space-between; align-items: center;
  width: 100%; font-size: 11px; color: rgba(230, 238, 252, 0.6);
  letter-spacing: 0.1em; text-transform: uppercase;
  cursor: move; padding: 2px 0;
}
#play-panel .play-header .play-minimize {
  background: transparent; border: 1px solid rgba(255, 193, 7, 0.3);
  color: #ffc107; width: 22px; height: 22px; border-radius: 4px;
  cursor: pointer; font-size: 12px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
#play-panel.is-minimized .play-body { display: none; }
#play-panel.is-minimized .play-minimize::after { content: "▢"; }
#play-panel:not(.is-minimized) .play-minimize::after { content: "—"; }
#play-panel .play-body {
  display: flex; flex-direction: column; gap: 8px; align-items: center; width: 100%;
}
#play-btn {
  padding: 14px 36px;
  background: linear-gradient(135deg, #b8860b 0%, #ffc107 100%);
  color: #1a1300; border: none; border-radius: 30px;
  font-size: 17px; font-weight: 800; letter-spacing: 0.12em;
  cursor: pointer; min-width: 150px;
  box-shadow: 0 6px 22px rgba(255, 193, 7, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: all 200ms ease;
}
#play-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 193, 7, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.5);
}
#play-btn.is-playing {
  background: linear-gradient(135deg, #1a2238 0%, #2a3658 100%);
  color: #ffc107; border: 1px solid rgba(255, 193, 7, 0.4);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
}
#play-btn.is-playing:hover { transform: translateY(-2px); }
#play-panel .progress-text {
  font-family: "Consolas", monospace; font-size: 12px;
  color: rgba(230, 238, 252, 0.7);
  letter-spacing: 0.04em;
}
#play-panel .progress-text .cur {
  color: #ffc107; font-weight: 800; font-size: 14px;
}
#play-panel .round-status {
  font-size: 10.5px; color: rgba(255, 193, 7, 0.6); text-align: center;
}

/* ===== 3D 投射点浮动标签（已移除）===== */
#center-label { display: none !important; }

/* ===== 底部居中：操作提示（默认隐藏，点"?"才弹出）===== */
#hud-bottom {
  font-size: 12px; color: rgba(230, 238, 252, 0.85);
  bottom: 18px; left: 50%;
  transform: translateX(-50%);
  max-width: 760px;
  display: none;  /* 默认隐藏 */
}
#hud-bottom.is-visible { display: flex; }
#hud-bottom .panel-body {
  gap: 18px; flex-direction: row; flex-wrap: wrap; max-width: 720px;
}
.key {
  display: inline-block; padding: 2px 8px;
  background: rgba(255, 193, 7, 0.18); color: #ffc107;
  border: 1px solid rgba(255, 193, 7, 0.4);
  border-radius: 4px; font-family: monospace; font-size: 11px;
  margin-right: 4px; font-weight: 700;
}

#close-btn { display: none !important; }

/* ===== 模型加载层 ===== */
#loader {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; background: #060912; color: #ffc107; font-size: 14px;
  letter-spacing: 0.1em; flex-direction: column; gap: 14px;
}
#loader .spin {
  width: 36px; height: 36px; border: 3px solid rgba(255, 193, 7, 0.2);
  border-top-color: #ffc107; border-radius: 50%; animation: rot 0.9s linear infinite;
}
@keyframes rot { to { transform: rotate(360deg); } }
#loader.is-hidden { opacity: 0; pointer-events: none; }
