/* 沐旭实验室 · 连实物图工作台（2026-10-10） */
.wb { --wb-ink: #1f2a37; --wb-plate: #c9e6ff; --wb-plate-edge: #4a7fb3; --wb-red: #e0463f; --wb-black: #30353d; font-family: Inter, ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; }
.wb-main { display: grid; grid-template-columns: minmax(0, 1fr) 118px; grid-template-rows: minmax(0, 1fr); height: clamp(440px, 72vh, 780px); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--white); box-shadow: 0 18px 60px rgba(20, 43, 38, .08); }
.wb-canvas-wrap { position: relative; height: 100%; min-height: 0; background: #fff; }
.wb-svg { display: block; width: 100%; height: 100%; touch-action: none; user-select: none; -webkit-user-select: none; cursor: default; outline: none; }
.wb-svg:focus-visible { box-shadow: inset 0 0 0 3px var(--sun); }
.wb-svg[data-mode="pen"] { cursor: crosshair; }
.wb-svg[data-mode="erase"] { cursor: cell; }
.wb-grid-line { fill: none; stroke: #dfe6ef; stroke-width: 1; }

/* 元件 */
.wb-comp { cursor: grab; }
.wb-comp:active { cursor: grabbing; }
.wb-svg[data-mode="erase"] .wb-comp, .wb-svg[data-mode="erase"] .wb-wire { cursor: cell; }
.wb-comp-box { fill: transparent; stroke: transparent; stroke-width: 1.5; stroke-dasharray: 5 4; }
.wb-comp.is-selected .wb-comp-box { stroke: var(--sun); fill: rgba(255, 179, 107, .06); }
.wb-comp.is-warn .wb-comp-box { stroke: #e2544c; }
.wb-comp-label { font-size: 10px; font-weight: 800; letter-spacing: .08em; fill: #8a94a3; pointer-events: none; }
.wb-slab-top { fill: #a9ddf8; stroke: #2f7fb0; stroke-width: 1.4; }
.wb-slab-front { fill: #3f9ad6; stroke: #2f7fb0; stroke-width: 1.4; }
.wb-post-base { fill: #6f7680; stroke: #3b4047; stroke-width: 1; }
.wb-post-body { stroke: rgba(0, 0, 0, .45); stroke-width: 1; }
.wb-post-r .wb-post-body, .wb-post-r .wb-post-top { fill: #e63946; }
.wb-post-k .wb-post-body, .wb-post-k .wb-post-top { fill: #353940; }
.wb-post-m .wb-post-body, .wb-post-m .wb-post-top { fill: #8d99a6; }
.wb-post-top { stroke: rgba(0, 0, 0, .5); stroke-width: 1; filter: brightness(1.25); }
.wb-post-hi { fill: rgba(255, 255, 255, .35); }
.wb-post-hole { fill: rgba(0, 0, 0, .55); }
.wb-post-label { font-size: 9px; font-weight: 800; fill: #fff; text-anchor: middle; pointer-events: none; paint-order: stroke; stroke: rgba(0, 0, 0, .25); stroke-width: 2px; }
.wb-term { cursor: crosshair; }
.wb-term-hit { fill: transparent; }
.wb-term:hover .wb-post-base { stroke: var(--sun); stroke-width: 3; }
.wb-hit { fill: transparent; cursor: pointer; }
.wb-tiny { font-size: 9px; font-weight: 700; fill: #4e5c6b; text-anchor: middle; pointer-events: none; }
.wb-sign { font-size: 13px; font-weight: 800; fill: #2b3b4a; text-anchor: middle; pointer-events: none; }
.wb-lead { stroke: #6c7a89; stroke-width: 2.5; stroke-linecap: round; fill: none; }

.wb-cell-body { fill: #f9c81e; stroke: #1b1b1b; stroke-width: 1.6; }
.wb-cell-cap { fill: #b8bfc8; stroke: #6c7a89; stroke-width: 1; }
.wb-cellbox { fill: #2a9d8f; stroke: #1b6f66; stroke-width: 1.5; }
.wb-cellbox-front { fill: #1f7f74; stroke: #1b6f66; stroke-width: 1.5; }
.wb-cell-shade { fill: rgba(255, 255, 255, .32); }
.wb-cell-plus { fill: #fff; stroke: #d7263d; stroke-width: 1.5; }
.wb-cell-plus-sign { stroke: #d7263d; stroke-width: 1.6; stroke-linecap: round; }
.wb-cell-txt { font-size: 11px; font-weight: 800; fill: #3a2d00; text-anchor: middle; pointer-events: none; }
.wb-batt-body { fill: #4cc5c1; stroke: #1f7f7c; stroke-width: 1.5; }
.wb-batt-lid { fill: #2a9995; }
.wb-batt-slot { fill: #1f7f7c; opacity: .55; }
.wb-batt-txt { font-size: 11px; font-weight: 800; fill: #0b3c3a; text-anchor: middle; pointer-events: none; }

.wb-bulb-glow { fill: url(#wbGlow); pointer-events: none; transition: opacity .2s; }
.wb-bulb-neck { fill: #b8bfc8; stroke: #6c7a89; stroke-width: 1; }
.wb-socket { fill: #c4c9d0; stroke: #4b5560; stroke-width: 1.2; }
.wb-socket-top { fill: #dfe3e8; stroke: #4b5560; stroke-width: 1.2; }
.wb-socket-base { fill: #9aa3ad; stroke: #4b5560; stroke-width: 1.2; }
.wb-bulb-glass { stroke: #6c7a89; stroke-width: 1.5; transition: fill .2s; }
.wb-bulb-glass.is-burn { fill: rgba(120, 120, 120, .18) !important; }
.wb-bulb-fil { fill: none; stroke-width: 1.8; stroke-linejoin: round; }
.wb-bulb-fil.is-burn { stroke-dasharray: 4 5; }
.wb-bulb-x { stroke: #e2544c; stroke-width: 2.5; stroke-linecap: round; }

.wb-coil-body { fill: #d9893a; stroke: #4a2b10; stroke-width: 1.3; }
.wb-coil-turn { stroke: #8a4a16; stroke-width: 2; }
.wb-rh-rod { fill: #c9cfd6; stroke: #4b5560; stroke-width: 1.2; }
.wb-rh-rod-hi { fill: rgba(255, 255, 255, .7); }
.wb-rh-leg { fill: #a9ddf8; stroke: #2f7fb0; stroke-width: 1.4; }
.wb-rh-leg-front { fill: #3f9ad6; stroke: #2f7fb0; stroke-width: 1.4; }
.wb-rh-cap { fill: #e8edf2; stroke: #4b5560; stroke-width: 1.2; }
.wb-rh-slider-top { fill: #bfe3fb; stroke: #2f7fb0; stroke-width: 1.3; }
.wb-rh-slider-arm { fill: #e8edf2; stroke: #4b5560; stroke-width: 1.2; }
.wb-rh-slider { cursor: ew-resize; }
.wb-rh-slider .wb-hit { fill: transparent; stroke: none; }

.wb-sw-contact { fill: #b8bfc8; stroke: #4b5560; stroke-width: 1; }
.wb-sw-stand { fill: #c4c9d0; stroke: #4b5560; stroke-width: 1.2; }
.wb-sw-pivot { fill: #2b2d31; }
.wb-sw-bar { fill: #dfe3e8; stroke: #4b5560; stroke-width: 1.2; }
.wb-sw-knob { fill: #4b4f55; stroke: #1f2225; stroke-width: 1.2; }
.wb-sw-knob-cap { fill: #c4c9d0; stroke: #4b5560; stroke-width: 1.2; }
.wb-sw-clip { fill: #dfe3e8; stroke: #4b5560; stroke-width: 1.2; }
.wb-sw-lever { transition: transform .18s; }

.wb-meter-card { fill: #fff; stroke: #2b2d31; stroke-width: 1.5; }
.wb-meter-band { fill: #e3e4e6; stroke: #2b2d31; stroke-width: 1.5; }
.wb-meter-card-edge { stroke: #2b2d31; stroke-width: 1.5; }
.wb-meter-screw { fill: #cfd2d6; stroke: #5b6168; stroke-width: 1; }
.wb-meter-knob { fill: #b9bcc1; stroke: #5b6168; stroke-width: 1; }
.wb-meter-knob-in { fill: #2b2d31; }
.wb-meter-green { fill: #3ec36b; stroke: #fff; stroke-width: 2; }
.wb-dial-arc { fill: none; stroke: #1f2a37; stroke-width: 1.6; }
.wb-dial-arc-in { stroke-width: 1.1; opacity: .75; }
.wb-dial-tick { stroke: #1f2a37; stroke-width: 1; }
.wb-dial-tick.is-mid { stroke-width: 1.4; }
.wb-dial-tick.is-major { stroke-width: 2; }
.wb-dial-num { font-size: 9px; font-weight: 800; fill: #1f2a37; text-anchor: middle; pointer-events: none; }
.wb-dial-num-in { font-size: 8px; fill: #3f6f9e; }
.wb-dial-unit { font-size: 12px; font-weight: 900; fill: #1f2a37; text-anchor: middle; }
.wb-dial-range { font-size: 7.5px; font-weight: 800; fill: #c2362f; text-anchor: middle; }
.wb-needle { stroke: #e2544c; stroke-width: 2.2; stroke-linecap: round; transition: x1 .25s, y1 .25s, x2 .25s, y2 .25s; }
.wb-needle-pin { fill: #2b3b4a; }

.wb-led-glow { fill: url(#wbLedGlow); pointer-events: none; transition: opacity .2s; }
.wb-led-dome { stroke: #a24; stroke-width: 1.2; }

.wb-motor-ring { fill: #5d3fd3; stroke: #2e1f73; stroke-width: 2; }
.wb-fan-blade { fill: #e9e4ff; stroke: #2e1f73; stroke-width: 1; }
.wb-fan-hub { fill: #2e1f73; }
.wb-fan { transform-origin: 0 0; }
.wb-fan.is-spin { animation: wbSpin 1s linear infinite; }
@keyframes wbSpin { to { transform: rotate(360deg); } }
.wb-motor-foot { fill: #6c7a89; }

.wb-buzz-body { fill: #2f353d; }
.wb-buzz-top { fill: #454c56; stroke: #1b1f25; stroke-width: 1; }
.wb-buzz-hole { fill: #0e1115; }
.wb-buzz-wave path { fill: none; stroke: #ff9f43; stroke-width: 2; stroke-linecap: round; animation: wbWave .7s ease-out infinite; }
@keyframes wbWave { 0% { opacity: .2; } 50% { opacity: 1; } 100% { opacity: .2; } }

.wb-rbox-body { fill: #e8ecf0; stroke: #4b5560; stroke-width: 1.5; }
.wb-rbox-dial { cursor: pointer; }
.wb-rbox-knob { fill: #fff; stroke: #2b3b4a; stroke-width: 1.5; }
.wb-rbox-dial:hover .wb-rbox-knob { stroke: var(--sun); stroke-width: 2.5; }
.wb-rbox-ptr { stroke: #e2544c; stroke-width: 2.5; stroke-linecap: round; }
.wb-rbox-lbl { font-size: 8px; font-weight: 700; fill: #4e5c6b; text-anchor: middle; }
.wb-rbox-val { font-size: 10px; font-weight: 800; fill: #2b3b4a; text-anchor: middle; }
.wb-rbox-total { font-size: 11px; font-weight: 800; fill: #2b3b4a; text-anchor: middle; }

/* 导线 */
.wb-wire-hit { fill: none; stroke: transparent; stroke-width: 16; stroke-linecap: round; }
.wb-wire-line { fill: none; stroke: #6b7684; stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.wb-wire-hi { fill: none; stroke: rgba(255, 255, 255, .45); stroke-width: 1.4; stroke-linecap: round; pointer-events: none; }
.wb-wire-end { fill: #3a4552; stroke: #fff; stroke-width: 1.6; pointer-events: none; }
.wb-wire:hover .wb-wire-line { stroke: #3a4552; }
.wb-svg[data-mode="erase"] .wb-wire:hover .wb-wire-line { stroke: #e2544c; }
.wb-draft { fill: none; stroke: #ff9f43; stroke-width: 4; stroke-dasharray: 8 7; stroke-linecap: round; pointer-events: none; }
.wb-snap { fill: rgba(255, 159, 67, .18); stroke: #ff9f43; stroke-width: 2; pointer-events: none; }
.wb-snap.is-target { fill: rgba(214, 255, 95, .4); stroke: #6aa800; }

/* 全屏 */
.wb.is-full { display: flex; flex-direction: column; box-sizing: border-box; width: 100%; height: 100%; padding: 10px; background: var(--paper); }
.wb.is-full .wb-main { flex: 1; height: auto; min-height: 0; }
.wb.is-full .wb-status { flex: none; max-height: 22vh; overflow: auto; margin-top: 10px; }
.wb.wb-fake-full { position: fixed; inset: 0; z-index: 250; }
html.wb-full-lock { overflow: hidden; }
.wb:fullscreen, .wb:-webkit-full-screen { background: var(--paper); }

/* 工具条（画布底部悬浮） */
.wb-toolbar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: flex; flex-wrap: wrap; gap: 8px; pointer-events: none; }
.wb-tb-group { display: inline-flex; align-items: center; gap: 4px; padding: 6px; border-radius: 14px; background: rgba(31, 42, 55, .92); backdrop-filter: blur(8px); pointer-events: auto; }
.wb-tb-group button { min-height: 36px; padding: 0 12px; border: 0; border-radius: 9px; background: transparent; color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .15s; }
.wb-tb-group button:hover { background: rgba(255, 255, 255, .12); }
.wb-tb-group button:disabled { opacity: .35; cursor: default; }
.wb-tb-group button:disabled:hover { background: transparent; }
.wb-tb-group button.wb-danger { color: #ff9b94; }
.wb-zoom { min-width: 60px; padding: 0 10px; border-radius: 9px; background: #3a5bd9; color: #fff; font-size: 13px; font-weight: 800; line-height: 36px; text-align: center; }
.wb-modes button[aria-pressed="true"] { background: #1f9d6e; }

/* 选中元件的参数面板 */
.wb-selbar { position: absolute; top: 12px; left: 12px; width: 300px; max-width: calc(100% - 24px); max-height: calc(100% - 24px); overflow: auto; padding: 12px 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 253, 248, .97); font-size: 13px; box-shadow: 0 10px 34px rgba(20, 43, 38, .14); }
.wb-selbar[hidden] { display: none; }
.wb-selbar-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.wb-selbar-head strong { font-size: 15px; }
.wb-selbar button { font: inherit; cursor: pointer; }
.wb-selbar [data-sel="close"] { width: 30px; height: 30px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: transparent; color: var(--ink); font-size: 16px; }
.wb-tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 10px; }
.wb-tile { padding: 7px 4px; border-radius: 9px; background: #eef2f6; text-align: center; }
.wb-tile span { display: block; color: var(--muted); font-size: 11px; }
.wb-tile b { display: block; margin-top: 2px; color: #1f9d6e; font-size: 13px; font-weight: 800; white-space: nowrap; }
.wb-tile b em { font-style: normal; font-size: 15px; }
.wb-param { display: grid; grid-template-columns: 62px 1fr auto; align-items: center; gap: 8px; margin: 6px 0; font-weight: 700; }
.wb-param input[type="range"] { width: 100%; min-width: 0; accent-color: #1f9d6e; }
.wb-param output { min-width: 50px; text-align: right; color: #1f9d6e; font-weight: 800; }
.wb-seg { grid-column: 2 / 4; display: flex; gap: 4px; }
.wb-seg button { flex: 1; min-height: 30px; padding: 0 4px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; }
.wb-seg button[aria-pressed="true"] { border-color: #1f9d6e; background: #1f9d6e; color: #fff; }
.wb-selbar-note { margin: 6px 0 0; color: var(--muted); font-size: 12px; }
.wb-selbar-actions { display: flex; gap: 8px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); }
.wb-selbar-actions button { flex: 1; min-height: 34px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font-size: 13px; font-weight: 700; }
.wb-selbar-actions button.wb-danger { background: #fff; color: #c2362f; border-color: #c2362f; }

/* 元件库 */
.wb-palette { display: flex; flex-direction: column; min-height: 0; overflow-y: auto; border-left: 1px solid var(--line); background: #f7f9fb; }
.wb-pal-item .wb-tiny, .wb-pal-item .wb-comp-label { display: none; }
.wb-pal-item { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; padding: 12px 6px; border: 0; border-bottom: 1px solid var(--line); background: transparent; font: inherit; font-size: 12px; font-weight: 700; color: var(--ink); cursor: grab; touch-action: pan-y; transition: background .15s; }
.wb-palette { -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.wb-pal-item:hover { background: #fff; }
.wb-pal-item:active { cursor: grabbing; }
.wb-pal-item { -webkit-touch-callout: none; user-select: none; -webkit-user-select: none; }
.wb-pal-item.is-holding { background: #eef4fa; }
.wb-pal-item.is-dragging { background: #dcefff; opacity: .6; }
.wb-pal-item svg { width: 92px; height: 64px; pointer-events: none; }
.wb-ghost { position: fixed; top: 0; left: 0; z-index: 400; width: 80px; height: 60px; pointer-events: none; opacity: .85; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, .25)); }
.wb-ghost svg { width: 100%; height: 100%; }

/* 读数与提示 */
.wb-status { margin-top: 14px; padding: 16px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--white); font-size: 14px; line-height: 1.7; }
.wb-status p, .wb-status ul { margin: 0; }
.wb-status ul { padding-left: 1.2em; }
.wb-status ul + ul { margin-top: 8px; }
.wb-hint { font-weight: 680; color: var(--ink); }
.wb-hint + ul { margin-top: 8px; }
.wb-hint-muted { color: var(--muted); }
.wb-warns li { color: #b3281f; font-weight: 700; }
.wb-lines li { color: var(--ink-2); }

/* 弹窗 */
.wb-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(10, 23, 38, .55); }
.wb-modal[hidden] { display: none; }
.wb-modal-box { width: min(520px, 100%); max-height: 86vh; overflow: auto; padding: 26px 28px; border-radius: 16px; background: var(--white); box-shadow: var(--shadow); font-size: 14px; line-height: 1.7; }
.wb-modal-box h3 { margin: 0 0 8px; font-size: 20px; }
.wb-modal-box p { margin: 0 0 14px; color: var(--ink-2); }
.wb-modal-label { display: grid; gap: 6px; margin-bottom: 14px; font-weight: 700; }
.wb-modal-label input, .wb-share-url { width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: inherit; font-size: 14px; }
.wb-share-url { resize: none; font-size: 12px; word-break: break-all; color: var(--ink-2); }
.wb-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.wb-modal-actions button, .wb-saves button { min-height: 40px; padding: 0 18px; border: 1px solid var(--ink); border-radius: 999px; background: var(--ink); color: #fff; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.wb-modal-actions button[data-modal-close] { background: transparent; color: var(--ink); }
.wb-modal-actions button.wb-danger, .wb-saves button.wb-danger { background: #fff; color: #c2362f; border-color: #c2362f; }
.wb-saves { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.wb-saves li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.wb-saves li > div:last-child { display: flex; gap: 8px; flex: none; }
.wb-saves strong { display: block; }
.wb-saves small { color: var(--muted); }
.wb-saves button { min-height: 34px; padding: 0 14px; }

@media (max-width: 760px) {
  .wb-main { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; height: clamp(500px, 74vh, 760px); }
  .wb-canvas-wrap, .wb-palette, .wb-toolbar { min-width: 0; }
  .wb-palette { flex-direction: row; overflow-x: auto; overflow-y: hidden; border-left: 0; border-top: 1px solid var(--line); }
  .wb-pal-item { min-width: 92px; padding: 10px 6px; border-bottom: 0; border-right: 1px solid var(--line); touch-action: pan-x; }
  .wb-canvas-wrap { display: flex; flex-direction: column; }
  .wb-svg { flex: 1; min-height: 0; }
  .wb-toolbar { position: static; flex: none; flex-wrap: nowrap; gap: 6px; padding: 6px 8px; overflow-x: auto; background: #1f2a37; pointer-events: auto; }
  .wb-tb-group { flex: none; padding: 2px; border-radius: 10px; }
  .wb-tb-group button { min-height: 34px; padding: 0 9px; font-size: 12px; }
  .wb-selbar { top: 8px; left: 8px; width: 260px; max-width: calc(100% - 16px); }
  .wb-tiles { gap: 4px; }
  .wb-tile b em { font-size: 13px; }
}
