/* 管理端预览与客户扫码页共用的查看器控件（视觉风格对齐影棚式三维展示基准） */
[hidden] { display: none !important; }
.viewer-scope { position: relative; }

.viewer-menu {
  position: absolute; top: 14px; right: 14px; z-index: 6;
  display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end;
  max-width: 66vw;
}
.viewer-menu button {
  min-width: 42px; height: 38px; padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, .72); border-radius: 9px;
  background: rgba(255, 255, 255, .88); color: #374151;
  font-size: 13px; font-weight: 600; backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
  transition: background-color .15s, box-shadow .15s, transform .15s;
}
.viewer-menu button:hover { background: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .24); transform: translateY(-1px); }
.viewer-menu button:active { transform: scale(.95); }
.viewer-menu button.active { background: #3b82f6; color: #fff; border-color: rgba(255, 255, 255, .65); }

/* 背景切换：按钮左侧小色块显示当前档，点击展开三档浮层 */
.viewer-menu button.bg-toggle { display: inline-flex; align-items: center; }
.viewer-menu button.bg-toggle::before {
  content: ''; display: inline-block; width: 11px; height: 11px;
  margin-right: 6px; border-radius: 3px;
  background: var(--bg-swatch, #d0d0d0); border: 1px solid rgba(0, 0, 0, .28);
}
.bg-picker {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 12;
  width: 112px; box-sizing: border-box; padding: 5px;
  display: flex; flex-direction: column; gap: 3px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 11px;
  background: rgba(28, 32, 40, .92); box-shadow: 0 8px 26px rgba(0, 0, 0, .35);
  backdrop-filter: blur(16px);
}
.viewer-menu .bg-picker button {
  width: 100%; min-width: 0; height: 30px; padding: 0 8px;
  display: flex; align-items: center; justify-content: flex-start; gap: 8px;
  border: 1px solid transparent; border-radius: 7px;
  background: transparent; color: #e5e7eb;
  font-size: 12px; font-weight: 500; box-shadow: none; backdrop-filter: none;
}
.viewer-menu .bg-picker button:hover { background: rgba(255, 255, 255, .12); }
.viewer-menu .bg-picker button.active { background: rgba(59, 130, 246, .28); color: #fff; border-color: rgba(130, 180, 255, .55); }
.bg-dot { width: 14px; height: 14px; flex: none; border-radius: 4px; border: 1px solid rgba(255, 255, 255, .4); }

/* 底部面板固定占展示区 1/5：深色玻璃拟态，与影棚背景和模型配色统一 */
.parts-panel {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 6;
  height: 20%;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  padding: 6px 12px 8px;
  background: linear-gradient(180deg, rgba(12, 14, 18, .06) 0%, rgba(12, 14, 18, .78) 45%, rgba(12, 14, 18, .86) 100%);
  backdrop-filter: blur(10px);
  border-top: 1px solid rgba(255, 255, 255, .1);
  overflow: hidden;
}
.parts-title {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 0 0 5px; font-size: 12px; color: #e5e7eb; white-space: nowrap;
}
.parts-title > span:first-child { overflow: hidden; text-overflow: ellipsis; }
.parts-tip { flex: none; font-size: 11px; color: #aab2bd; }

/* 部位过多时向左滑动查看剩余卡片 */
.parts-scroll {
  flex: 1 1 auto; min-height: 0;
  display: flex; align-items: flex-start; gap: 10px;
  overflow-x: auto; overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  touch-action: pan-x;
  scrollbar-width: thin;
  padding-bottom: 3px;
}
.parts-scroll::-webkit-scrollbar { height: 5px; }
.parts-scroll::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .3); border-radius: 9px; }

.part-card {
  flex: 0 0 auto; width: 176px; box-sizing: border-box;
  display: flex; flex-direction: column; gap: 3px;
  padding: 5px 8px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 10px;
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(16px);
  scroll-snap-align: start;
  transition: border-color .15s, box-shadow .15s;
}
.part-card.active { border-color: rgba(130, 180, 255, .9); box-shadow: 0 0 0 2px rgba(90, 150, 255, .28); }
.part-head { display: flex; align-items: center; gap: 6px; min-height: 16px; }
.part-swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; box-shadow: 0 0 6px rgba(0, 0, 0, .35); }
.part-name {
  flex: 1 1 auto; min-width: 0; font-size: 12px; color: #f3f4f6;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.part-home {
  flex: none; border: 0; border-radius: 5px; padding: 1px 5px;
  background: rgba(255, 255, 255, .14); color: #e5e7eb; font-size: 10px; line-height: 1.5;
}
.part-home:hover { background: rgba(255, 255, 255, .26); color: #fff; }
.part-ctl { display: flex; align-items: center; gap: 6px; min-height: 20px; font-size: 11px; color: #c7ccd4; }
.part-ctl > span:first-child { width: 34px; flex: none; }
.part-card input[type="color"] {
  width: 30px; height: 20px; padding: 0; border: 1px solid rgba(255, 255, 255, .4);
  border-radius: 5px; background: transparent; cursor: pointer; flex: none;
}
.part-card input[type="range"] { flex: 1 1 auto; min-width: 60px; height: 18px; accent-color: #7cb0ff; }
.part-value { width: 32px; text-align: right; flex: none; font-size: 11px; color: #e5e7eb; }

@media (max-width: 600px) {
  .viewer-menu { top: 10px; right: 10px; gap: 4px; max-width: 50vw; }
  .viewer-menu button { min-width: 34px; height: 30px; padding: 0 7px; font-size: 11px; }
  .parts-panel { height: 20%; padding: 5px 8px 6px; }
  .parts-title { font-size: 11px; }
  .part-card { width: 164px; }
}
