/* 整体：深色背景 + 半透明浮动面板 */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #14171c; color: #e8eaed;
  font: 14px/1.5 -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
#viewport { position: fixed; inset: 0; }
#viewport canvas { display: block; }
.labelLayer { position: absolute; inset: 0; pointer-events: none; }

.panel { position: fixed; background: rgba(28, 32, 39, 0.86); backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.09); border-radius: 12px; padding: 14px 16px; }
h1 { margin: 0 0 2px; font-size: 18px; }
h1 small { font-size: 12px; font-weight: 400; color: #ff7a5c; margin-left: 4px; }
h2 { margin: 0 0 6px; font-size: 16px; color: #ffb199; }
.hint { margin: 0 0 10px; font-size: 12px; color: #8e96a3; }

/* 左侧：零件清单 */
#partPanel { top: 16px; left: 16px; width: 250px; max-height: calc(100% - 32px); display: flex; flex-direction: column; }
#partList { list-style: none; margin: 0 0 10px; padding: 0; overflow-y: auto; flex: 1; }
#partList .groupTitle { margin-top: 8px; font-size: 12px; color: #8e96a3; letter-spacing: 1px; }
#partList .item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border: 0; border-radius: 7px; background: transparent; text-align: left; }
#partList .item:hover { background: rgba(255, 255, 255, 0.07); }
#partList .item.selected { background: rgba(255, 122, 92, 0.24); }
#partList .item.dimmed { opacity: 0.4; }
#partList .swatch { width: 12px; height: 12px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, 0.35); flex: none; }
#partList .count { margin-left: auto; font-size: 12px; color: #8e96a3; }

/* 右上：控制区 */
#controlPanel { top: 16px; right: 16px; width: 270px; display: flex; flex-direction: column; gap: 10px; }
#controlPanel label { display: block; }
#controlPanel label.inline { display: flex; align-items: center; gap: 8px; }
#controlPanel output { float: right; color: #ffb199; font-variant-numeric: tabular-nums; }
input[type=range] { width: 100%; accent-color: #ff7a5c; margin: 4px 0 0; }
select { background: #262b33; color: inherit; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 6px; padding: 3px 6px; }
.buttonRow { display: flex; gap: 8px; }
button { flex: 1; padding: 7px 8px; border: 1px solid rgba(255, 255, 255, 0.15); border-radius: 8px;
  background: #262b33; color: inherit; font: inherit; cursor: pointer; }
button:hover:not(:disabled) { background: #323844; }
button:disabled { opacity: 0.4; cursor: default; }
button.active { background: #ff7a5c; border-color: #ff7a5c; color: #1a1a1a; }

#controlPanel .hint { margin: -6px 0 0; }
/* 动力传到哪了：不同阶段换不同底色 */
#powerStatus { margin: 0; padding: 6px 9px; border-radius: 8px; font-size: 12.5px; min-height: 50px;
  background: rgba(255, 255, 255, 0.06); border-left: 3px solid #5c6470; }
#powerStatus[data-mode=press], #powerStatus[data-mode=hold] { border-left-color: #5aa5ea; }
#powerStatus[data-mode=drive] { border-left-color: #ffa030; background: rgba(255, 160, 48, 0.16); }
#powerStatus[data-mode=coast] { border-left-color: #4fc46a; }

/* 右下：零件说明 */
#infoPanel { right: 16px; bottom: 16px; width: 340px; }
#infoPanel p { margin: 0 0 6px; }
.certainty { font-size: 12px; color: #9fb4c9; }

/* 底部：参考照片 */
#referencePanel { left: 282px; bottom: 16px; display: flex; align-items: center; gap: 8px; padding: 8px 12px; }
#referencePanel span { font-size: 12px; color: #8e96a3; }
#referencePanel .referenceButton { flex: none; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
#referencePanel img { display: block; height: 54px; border-radius: 6px; border: 1px solid rgba(255, 255, 255, 0.15); }
#lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.82); display: flex; align-items: center;
  justify-content: center; cursor: zoom-out; z-index: 10; }
#lightbox[hidden] { display: none; }
#lightbox img { max-width: 92%; max-height: 92%; border-radius: 8px; }

/* 三维场景里的零件标注 */
.partLabel { padding: 2px 7px; border-radius: 10px; background: rgba(20, 23, 28, 0.82); color: #fff;
  font-size: 12px; white-space: nowrap; border: 1px solid rgba(255, 255, 255, 0.2); pointer-events: none; }
