:root { --i3d-accent: #c8742b; --i3d-ink: #20242a; --i3d-bg: #eef0f3; --i3d-line: #d4d8de; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 14px/1.45 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; color: var(--i3d-ink); background: transparent; }
#app { height: 100%; }
.i3d { display: flex; height: 100%; min-height: 360px; background: var(--i3d-bg); }
.i3d-stage { position: relative; flex: 1 1 auto; min-width: 0; background: radial-gradient(ellipse at 50% 35%, #ffffff 0%, #e6e9ee 70%, #d9dde4 100%); overflow: hidden; }
.i3d-canvas { position: absolute; inset: 0; z-index: 0; }
.i3d-canvas canvas { display: block; pointer-events: none; }
.i3d-view { position: absolute; touch-action: none; overflow: hidden; }
.i3d-view.is-big { inset: 0; z-index: 1; cursor: grab; }
.i3d-view.is-pip { z-index: 4; top: 10px; right: 10px; width: var(--pip-w); aspect-ratio: 4 / 3; border: 2px solid #fff; border-radius: 10px; box-shadow: 0 2px 12px rgba(0,0,0,.35); background: rgba(255,255,255,.35); cursor: pointer; transition: box-shadow .15s, border-color .15s; }
.i3d-view.is-pip:hover { border-color: var(--i3d-accent); box-shadow: 0 2px 16px rgba(200,116,43,.55); }
.i3d-viewtag { position: absolute; left: 8px; top: 8px; padding: 1px 8px; font-size: 12px; background: rgba(32,36,42,.78); color: #fff; border-radius: 10px; pointer-events: none; }
.i3d-view.is-big .i3d-viewtag { top: auto; bottom: 84px; left: 12px; }
.i3d-view.is-pip .i3d-viewtag::after { content: " ⇄"; }
.i3d-stage { --pip-w: clamp(150px, 30%, 340px); }
.i3d-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 2; }
.i3d-lines line { stroke: var(--i3d-accent); stroke-width: 1.2; }
.i3d-lines circle { fill: var(--i3d-accent); stroke: #fff; stroke-width: 1.5; }
.i3d-labels { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
.i3d-label { position: absolute; left: 0; top: 0; padding: 2px 8px; font-size: 12px; white-space: nowrap; background: rgba(255,255,255,.94); border: 1px solid var(--i3d-accent); border-radius: 4px; color: var(--i3d-ink); box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.i3d-label-ab { border-color: #555; background: rgba(32,36,42,.88); color: #fff; }
.i3d-caption { position: absolute; z-index: 3; top: 10px; left: 10px; max-width: calc(100% - var(--pip-w) - 34px); padding: 6px 14px; background: rgba(32,36,42,.88); color: #fff; border-radius: 16px; font-size: 14px; pointer-events: none; }
.i3d-hint { position: absolute; z-index: 3; left: 12px; bottom: 58px; font-size: 12px; color: #6b7280; pointer-events: none; }
.i3d-bar { position: absolute; z-index: 5; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; padding: 6px 8px; background: rgba(255,255,255,.92); border: 1px solid var(--i3d-line); border-radius: 10px; }
.i3d-btn { border: 1px solid var(--i3d-line); background: #fff; border-radius: 8px; padding: 5px 12px; min-width: 38px; font: inherit; cursor: pointer; color: var(--i3d-ink); }
.i3d-btn:hover { border-color: var(--i3d-accent); }
.i3d-btn.is-on { background: var(--i3d-accent); color: #fff; border-color: var(--i3d-accent); }
.i3d-play { background: var(--i3d-accent); color: #fff; border-color: var(--i3d-accent); }
.i3d-range { flex: 1; accent-color: var(--i3d-accent); min-width: 60px; }
.i3d-panel { flex: 0 0 300px; width: 300px; padding: 12px; overflow-y: auto; background: #fff; border-left: 1px solid var(--i3d-line); }
.i3d-panel h4 { margin: 14px 0 6px; font-size: 13px; color: #555; font-weight: 600; }
.i3d-tabs, .i3d-seg { display: flex; gap: 0; border: 1px solid var(--i3d-line); border-radius: 8px; overflow: hidden; }
.i3d-tabs button, .i3d-seg button { flex: 1; padding: 8px 6px; border: 0; background: #f6f7f9; font: inherit; cursor: pointer; color: var(--i3d-ink); }
.i3d-tabs button.is-on, .i3d-seg button.is-on { background: var(--i3d-accent); color: #fff; }
.i3d-cards { display: flex; flex-direction: column; gap: 6px; }
.i3d-card { text-align: left; padding: 8px 10px; border: 1px solid var(--i3d-line); border-radius: 8px; background: #fff; cursor: pointer; font: inherit; color: var(--i3d-ink); }
.i3d-card b { display: block; font-size: 14px; }
.i3d-card span { display: none; font-size: 12px; color: #5b6470; margin-top: 3px; }
.i3d-card.is-on { border-color: var(--i3d-accent); box-shadow: 0 0 0 2px rgba(200,116,43,.25); background: #fff8f1; }
.i3d-card.is-on span { display: block; }
.i3d-sws { display: flex; gap: 8px; }
.i3d-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; background: var(--c); box-shadow: 0 0 0 1px #bbb; cursor: pointer; padding: 0; }
.i3d-sw.is-on { box-shadow: 0 0 0 2px var(--i3d-accent); }
.i3d-sw-panel { border-style: dashed; border-color: #666; }
.i3d-glue { margin-top: 14px; padding: 8px 10px; border-radius: 8px; background: #eef7ee; border: 1px solid #b9dcb9; font-size: 12.5px; }
.i3d-glue.is-wall { background: #f1f6fa; border-color: #c4d6e2; }
.i3d-note { margin: 8px 0 0; font-size: 12px; color: #5b6470; }
.i3d-toggles { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 12px; font-size: 13px; }
.i3d-toggles label { cursor: pointer; }
@media (max-width: 760px) {
  .i3d { flex-direction: column; }
  .i3d-stage { flex: 1 1 60%; min-height: 280px; }
  .i3d-panel { flex: 0 0 auto; width: 100%; max-height: 40%; border-left: 0; border-top: 1px solid var(--i3d-line); }
  .i3d-hint { display: none; }
}
