@font-face { font-family: 'Outfit'; font-weight: 300; src: url('/lab/vendor/fonts/outfit/outfit-latin-300-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 400; src: url('/lab/vendor/fonts/outfit/outfit-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 500; src: url('/lab/vendor/fonts/outfit/outfit-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 600; src: url('/lab/vendor/fonts/outfit/outfit-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Outfit'; font-weight: 700; src: url('/lab/vendor/fonts/outfit/outfit-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 400; src: url('/lab/vendor/fonts/dm-mono/dm-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'DM Mono'; font-weight: 500; src: url('/lab/vendor/fonts/dm-mono/dm-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --bg: #07090d;
  --panel: rgba(11, 20, 34, 0.72);
  --panel-b: rgba(120, 180, 230, 0.16);
  --ink: #e6eef6;
  --ink2: #9fb2c6;
  --cyan: #46e0ff;
  --amber: #ffae5a;
  --violet: #9d90ff;
  --sans: 'Outfit', "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: 'DM Mono', ui-monospace, "PingFang SC", monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#stage canvas.grab { cursor: grab; }
#stage canvas.pointer { cursor: pointer; }
#stage canvas.dragging { cursor: grabbing; }
#labels { position: fixed; inset: 0; pointer-events: none; }
#labels svg.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#labels svg path { fill: none; stroke: rgba(200, 230, 255, 0.55); stroke-width: 1; }
#labels svg circle { fill: #fff; }
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; padding: 4px 10px 4px 9px; border-radius: 999px; font-size: 12px; line-height: 16px;
  background: rgba(10, 18, 30, 0.78); border: 1px solid rgba(140, 200, 240, 0.28); color: var(--ink); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  letter-spacing: 0.02em; will-change: transform, opacity; }
.tag .v { font-family: var(--mono); color: var(--cyan); margin-left: 6px; }
.tag.force .v { color: var(--amber); }
.tag.drag { border-color: rgba(255, 174, 90, 0.6); }
.tag.drag::before { content: '拖动'; font-size: 10px; color: #1a1206; background: var(--amber); border-radius: 999px; padding: 1px 6px; margin-right: 6px; font-weight: 600; }
.tag.part { font-size: 11.5px; }
.tag .k { color: var(--ink2); font-size: 11px; margin-left: 4px; }

#ui { position: fixed; inset: 0; pointer-events: none; transition: opacity .35s; }
#ui.hidden { opacity: 0; }
#ui.hidden * { pointer-events: none !important; }
.panel-left { position: absolute; left: 22px; top: 20px; width: 318px; pointer-events: auto; }
.kicker { font: 600 11px/1 var(--sans); letter-spacing: 0.22em; color: var(--cyan); opacity: .9; }
h1 { margin: 10px 0 8px; font-weight: 700; font-size: 29px; line-height: 1.16; letter-spacing: 0.01em; }
h1 span { display: block; }
h1 .accent { color: var(--amber); }
.hook { margin: 0 0 12px; color: var(--ink2); font-size: 13px; line-height: 1.55; }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card { background: var(--panel); border: 1px solid var(--panel-b); border-radius: 10px; padding: 7px 8px 6px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.c-label { font-size: 10.5px; color: var(--ink2); white-space: nowrap; }
.c-val { font-family: var(--mono); font-size: 19px; color: var(--cyan); margin-top: 3px; white-space: nowrap; }
.c-val small { font-size: 11px; margin-left: 3px; color: var(--ink2); }
.card.hot .c-val { color: var(--amber); }
.c-sub { font-family: var(--mono); font-size: 10px; color: rgba(160, 185, 210, 0.75); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.narr { margin-top: 8px; background: var(--panel); border: 1px solid var(--panel-b); border-left: 2px solid var(--amber); border-radius: 10px; padding: 9px 11px; font-size: 12.5px; line-height: 1.62; color: #d3dde8; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.narr b { color: #fff; font-weight: 600; }

.panel-right { position: absolute; right: 18px; top: 18px; width: 272px; pointer-events: auto; background: var(--panel); border: 1px solid var(--panel-b); border-radius: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.drawer-handle { display: none; }
.grp { border-bottom: 1px solid rgba(140, 190, 230, 0.10); }
.grp:last-child { border-bottom: none; }
.grp summary { list-style: none; cursor: pointer; padding: 9px 12px 7px; font-size: 11px; letter-spacing: 0.16em; color: var(--ink2); font-weight: 600; }
.grp summary::-webkit-details-marker { display: none; }
.grp summary::after { content: '▾'; float: right; opacity: .6; }
.grp:not([open]) summary::after { content: '▸'; }
.row { padding: 0 12px 9px; }
.row.two { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.r-label { font-size: 12px; color: var(--ink2); margin-bottom: 4px; }
.r-label .num { font-family: var(--mono); color: var(--cyan); font-size: 13px; }
.r-label .unit { font-size: 11px; }
.r-label .dim { opacity: .7; margin-left: 4px; }
button { font: 500 12px var(--sans); color: var(--ink); background: rgba(40, 60, 85, 0.45); border: 1px solid rgba(140, 190, 230, 0.18); border-radius: 8px; padding: 6px 8px; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
button:hover { background: rgba(60, 90, 125, 0.6); border-color: rgba(140, 200, 240, 0.4); }
button.wide { width: 100%; }
.seg, .toggles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-radius: 8px; overflow: hidden; border: 1px solid rgba(140, 190, 230, 0.18); }
.seg button, .toggles button { border: none; border-radius: 0; background: rgba(30, 45, 65, 0.4); padding: 6px 0; }
.seg button + button, .toggles button + button { border-left: 1px solid rgba(140, 190, 230, 0.14); }
.seg button.on { background: rgba(70, 224, 255, 0.18); color: var(--cyan); }
.toggles button.on { color: var(--ink); }
.toggles button::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: #445; vertical-align: 1px; }
.toggles button[data-v=current].on::before { background: var(--cyan); box-shadow: 0 0 6px var(--cyan); }
.toggles button[data-v=force].on::before { background: var(--violet); box-shadow: 0 0 6px var(--violet); }
.toggles button[data-v=wave].on::before { background: var(--amber); box-shadow: 0 0 6px var(--amber); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { padding: 4px 8px; border-radius: 999px; font-size: 11.5px; }
.chips button.on { border-color: var(--amber); color: var(--amber); }
#b-sound[aria-pressed=true] { border-color: var(--amber); color: var(--amber); }
.ico { font-size: 12px; }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: linear-gradient(90deg, rgba(70, 224, 255, .75) var(--p, 50%), rgba(140, 170, 200, .22) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; margin-top: -5.5px; background: #fff; box-shadow: 0 0 0 3px rgba(70, 224, 255, .3), 0 0 10px rgba(70, 224, 255, .6); }
input[type=range]::-moz-range-track { height: 3px; background: rgba(140, 170, 200, .3); }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: #fff; border: none; }

#b-hide { position: absolute; right: 18px; bottom: 18px; pointer-events: auto; font-size: 11px; opacity: .75; }
#ui.hidden #b-hide { opacity: 0; }
#help { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(3, 6, 10, 0.55); pointer-events: auto; }
#help[hidden] { display: none; }
.help-card { position: relative; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 40px); overflow: auto; background: rgba(12, 22, 36, 0.94); border: 1px solid var(--panel-b); border-radius: 14px; padding: 18px 22px; }
.help-card h2 { font-size: 15px; margin: 6px 0 8px; color: var(--amber); }
.help-card ul { margin: 0 0 10px; padding-left: 18px; font-size: 13px; line-height: 1.7; color: #cfdae6; }
.help-card ul.small { font-size: 12px; }
#help-close { position: absolute; right: 12px; top: 10px; width: 28px; height: 28px; padding: 0; font-size: 16px; }
#nogl { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; }
#nogl[hidden] { display: none; }
.nogl-card { max-width: 420px; margin: 16px; padding: 18px 20px; background: var(--panel); border: 1px solid var(--panel-b); border-radius: 12px; font-size: 14px; line-height: 1.7; }

@media (max-width: 700px) {
  .panel-left { left: 14px; right: 14px; top: 12px; width: auto; }
  .kicker { font-size: 9.5px; }
  h1 { font-size: 21px; margin: 6px 0 4px; }
  h1 span { display: inline; }
  h1 .accent::before { content: ' '; }
  .hook { display: none; }
  .cards { gap: 5px; }
  .card { padding: 5px 7px 4px; }
  .c-val { font-size: 16px; }
  .c-sub { display: none; }
  .narr { font-size: 11.5px; padding: 7px 9px; line-height: 1.55; }
  .panel-right { left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 14px 14px 0 0; transform: translateY(calc(100% - 40px)); transition: transform .3s; max-height: 70vh; overflow: auto; }
  .panel-right.open { transform: none; }
  .drawer-handle { display: block; width: 100%; border: none; background: transparent; padding: 11px; font-size: 12px; letter-spacing: 0.14em; color: var(--ink2); }
  .drawer-handle::before { content: ''; display: block; width: 36px; height: 4px; border-radius: 4px; background: rgba(160, 190, 220, .4); margin: 0 auto 7px; }
  #b-hide { bottom: 52px; right: 12px; }
}
