/* ════════════════════════════════════════════════════════════════════
   Viewport
   ════════════════════════════════════════════════════════════════════ */

#viewport {
  position: fixed;   /* full-bleed Canvas behind the glass chrome (DESIGN.md §9.1) */
  inset: 0;
  z-index: 0;
  background: var(--paper);
  overflow: hidden;
}

#stage {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

#drag-ghost {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  display: none;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--ink-1);
  border-radius: 4px;
  font-size: 11px;
  font-family: var(--font-ui);
  color: var(--ink);
  box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.32);
  transform: translate(-50%, -50%);
}

#drag-ghost.active { display: block; }

/* B-4: realtime invalid-zone feedback. Replaces the old release-time modal
   (#invalid-chip out-of-bench branch). Library-drag toggles `.invalid` on
   the ghost while the cursor is over an out-of-bench / un-placeable area. */
#drag-ghost.invalid {
  background: rgba(220, 38, 38, 0.18);
  border-color: var(--bad, #dc2626);
  color: var(--bad, #dc2626);
  opacity: 0.55;
}

/* 库拖入统一 3D 预览（2026-06-10）：光标在视口内时 3D 临时实例接管视觉，
   DOM 小图标隐藏；离开视口（library-drag dragleave）移除该类恢复显示。 */
#drag-ghost.in-viewport { display: none; }

/* B-4: small grey status hint at the bottom while a library drag hovers an
   invalid drop zone. Sits above the action-dock; cleared on valid hover and
   on drag end. Plain grey text (no badge) per spec. */
.drag-status {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-3, #888);
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 6;
  white-space: nowrap;
}

.drag-status.visible { opacity: 1; }

#drop-hint {
  position: absolute;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  padding: 8px 16px;
  background: var(--ink-1);
  color: var(--surface);
  border-radius: 999px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
  z-index: 5;
}

#drop-hint.visible { opacity: 1; }

/* #32 框选（marquee select）：Ctrl/Shift + 空白拖拽画出的橡皮筋矩形，纯 DOM 覆层
   （同 overhead-stack 的 pointer.js-driven 定位手法，不进 Three.js 场景）。故意用中性
   --ink-2（非 --sig-select 青色）—— 拖拽中的取景框 ≠ 已选中态的青色描边，两者不能视觉
   混淆（DESIGN.md §15 UX-8 第三轮裁决 ①）。 */
.marquee-select {
  position: absolute;
  z-index: 6;
  border: 1px solid var(--ink-2);
  background: color-mix(in srgb, var(--ink-2) 12%, transparent);
  pointer-events: none;
}

/* 屏幕 ± 缩放（bug #4，2026-07-06）：轻量右缘竖条，垂直居中——避开顶右角的 `?`
   速查钮（top: calc(topbar+12px)）与 Inspector 默认落位（右下角）。同 .help-fab
   的"淡→hover 亮"语言，两颗按钮堆叠，中间一条分隔线，没有第三颗 Reset（Fit 已覆盖）。 */
.zoom-strip {
  position: fixed;
  top: 50%;
  right: 14px;
  transform: translateY(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  border-radius: 999px;
  overflow: hidden;
  background: var(--float-bg);
  border: 1px solid var(--line-1);
  backdrop-filter: blur(var(--float-blur)) saturate(var(--float-sat));
  -webkit-backdrop-filter: blur(var(--float-blur)) saturate(var(--float-sat));
  box-shadow: var(--float-edge);
  opacity: .42;
  transition: opacity 140ms ease;
}
.zoom-strip:hover, .zoom-strip:focus-within { opacity: 1; }
.zoom-strip button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: none;
  background: none;
  cursor: pointer;
  color: var(--ink-2-v1);
  transition: color 120ms ease, background 120ms ease;
}
.zoom-strip button:hover { color: var(--ink-1); background: color-mix(in srgb, var(--ink-1) 8%, transparent); }
.zoom-strip button:active { color: var(--ink-1); }
.zoom-strip button:focus-visible { outline: 2px solid var(--ink-1); outline-offset: -2px; }
.zoom-strip button + button { border-top: 1px solid var(--line-1); }

