* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; background: #0e1116; font-family: "Microsoft YaHei", "PingFang SC", sans-serif; }
#viewer { position: absolute; inset: 0; }

#topbar {
  position: absolute; top: 0; left: 0; right: 0; height: 46px; z-index: 10;
  display: flex; align-items: center; gap: 18px; padding: 0 16px;
  background: linear-gradient(180deg, rgba(12,16,22,.94), rgba(12,16,22,.82));
  color: #e8eef6; border-bottom: 1px solid rgba(255,255,255,.08);
}
#topbar .brand { font-size: 15px; font-weight: 600; letter-spacing: .5px; white-space: nowrap; }
#topbar .crumb { font-size: 13px; color: #9fb2c8; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar .top-right { font-size: 12px; color: #7fe3b0; white-space: nowrap; }

#leftpanel {
  position: absolute; top: 58px; left: 12px; bottom: 42px; width: 214px; z-index: 10;
  display: flex; flex-direction: column; gap: 10px;
  background: rgba(14,19,26,.86); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; padding: 10px; color: #cbd7e5; backdrop-filter: blur(6px);
}
#leftpanel .module { background: rgba(255,255,255,.03); border-radius: 5px; padding: 8px; }
#leftpanel .module + .module { border-top: 1px solid rgba(255,255,255,.07); }
.section-head { font-size: 13px; font-weight: 600; color: #8fd0ff; margin-bottom: 8px; }
.tree { font-size: 12px; color: #8595a8; line-height: 1.6; }
.tools { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.tool-btn {
  background: rgba(255,255,255,.06); color: #cbd7e5; border: 1px solid rgba(255,255,255,.1);
  border-radius: 4px; padding: 7px 4px; font-size: 12px; cursor: pointer;
}
.tool-btn:hover { background: rgba(143,208,255,.16); color: #fff; }
.tool-btn:disabled { opacity: .42; cursor: not-allowed; }
.tools-inline { grid-template-columns: 1.15fr .7fr .8fr; }
.tools-three { grid-template-columns: 1fr 1.3fr 1fr; }
.row-label { display: block; font-size: 11px; color: #6f8296; margin: 8px 0 5px; }
.view-row .row-label { margin-top: 0; }

/* 剖切手柄覆盖层：与点云平台一致 */
.clip-gizmo { position: fixed; left: 0; top: 0; width: 100vw; height: 100vh; z-index: 26; pointer-events: none; overflow: visible; }
.clip-gizmo .clip-axis line { pointer-events: none; }
.clip-gizmo .clip-axis-handle { pointer-events: all; cursor: grab; touch-action: none; }
.clip-gizmo .clip-axis-handle:active { cursor: grabbing; }

#rightpanel {
  position: absolute; top: 58px; right: 12px; bottom: 42px; width: 256px; z-index: 10;
  background: rgba(14,19,26,.86); border: 1px solid rgba(255,255,255,.08);
  border-radius: 6px; padding: 10px; color: #cbd7e5; backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 10px; overflow-y: auto;
}
#rightpanel .module { flex: 1 1 0; min-height: 0; }
#rightpanel .tools-module, #rightpanel .clip-module { flex: 0 0 auto; }
.clip-panel { font-size: 12px; }
.clip-row { display: grid; grid-template-columns: 28px 1fr 1fr; gap: 5px; align-items: center; margin-bottom: 5px; }
.clip-row .axis { color: #8fd0ff; font-weight: 600; }
.clip-row input {
  width: 100%; background: rgba(255,255,255,.06); color: #e8eef6;
  border: 1px solid rgba(255,255,255,.12); border-radius: 3px; padding: 3px 4px; font-size: 11px;
}
.clip-row input:focus { outline: none; border-color: #40e0ff; }
.clip-row label { font-size: 10px; color: #6f8296; display: block; }
.clip-row.clip-yaw { grid-template-columns: 28px 1fr auto; }
.clip-row.clip-yaw .axis { color: #f0b429; }
.mini-btn {
  background: rgba(240,180,41,.16); color: #f0b429; border: 1px solid rgba(240,180,41,.45);
  border-radius: 3px; padding: 4px 7px; font-size: 11px; cursor: pointer; white-space: nowrap;
}
.mini-btn:hover { background: rgba(240,180,41,.3); color: #fff; }
.tool-hint { font-size: 11px; color: #6f8296; margin-top: 6px; line-height: 1.5; }
.measure-list { font-size: 12px; max-height: 100%; overflow-y: auto; }
.measure-list .empty { color: #6f8296; }
.measure-item { display: flex; justify-content: space-between; padding: 6px 4px; border-bottom: 1px solid rgba(255,255,255,.06); }
.measure-item .v { color: #ffd35c; font-variant-numeric: tabular-nums; }
.tool-btn.active { background: rgba(64,224,255,.22); color: #fff; border-color: #40e0ff; }

#toast {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 30;
  background: rgba(12,16,22,.94); color: #e8eef6; font-size: 13px;
  padding: 8px 18px; border-radius: 5px; border: 1px solid rgba(143,208,255,.35);
  opacity: 0; pointer-events: none; transition: opacity .25s;
}
#toast.show { opacity: 1; }

#bottombar {
  position: absolute; bottom: 10px; left: 50%; transform: translateX(-50%); z-index: 10;
  background: rgba(12,16,22,.82); color: #9fb2c8; font-size: 12px;
  padding: 6px 16px; border-radius: 20px; border: 1px solid rgba(255,255,255,.08);
  white-space: nowrap;
}

/* Cesium 控件收敛：只留必要的，避免与自有界面重叠 */
.cesium-viewer-animationContainer,
.cesium-viewer-timelineContainer,
.cesium-viewer-geocoderContainer,
.cesium-viewer-fullscreenContainer,
.cesium-widget-credits,
.cesium-viewer-bottom { display: none !important; }
.cesium-viewer-toolbar { top: 4px !important; }
