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

:root {
  --panel: rgba(9, 20, 36, 0.72);
  --panel-2: rgba(16, 32, 54, 0.78);
  --line: rgba(140, 200, 240, 0.16);
  --text: #e6f0f8;
  --dim: rgba(214, 230, 244, 0.62);
  --cyan: #5fd8ff;
  --amber: #ffb347;
  --orange: #ff8a3d;
  --sans: 'Outfit', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: 'DM Mono', 'PingFang SC', monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #070b12; color: var(--text); font-family: var(--sans); -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#stage.grab canvas { cursor: grab; }
#stage.grabbing canvas { cursor: grabbing; }

/* ───── 左上 ───── */
.panel-left { position: fixed; left: 26px; top: 22px; width: 330px; pointer-events: none; }
.panel-left > * { pointer-events: auto; }
.kicker { font-size: 11px; letter-spacing: 0.22em; color: var(--cyan); font-weight: 500; text-transform: uppercase; }
h1 { margin: 8px 0 6px; font-weight: 600; font-size: 30px; line-height: 1.16; letter-spacing: 0.01em; text-shadow: 0 2px 18px rgba(0,0,0,0.5); }
h1 span { display: block; }
h1 .accent { color: var(--amber); }
.hook { margin: 0 0 10px; font-size: 13px; line-height: 1.55; color: var(--dim); max-width: 320px; text-shadow: 0 1px 8px rgba(0,0,0,0.6); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 11px; padding: 7px 10px 6px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.card.hot { border-color: rgba(255, 179, 71, 0.35); }
.c-label { font-size: 11px; color: var(--dim); letter-spacing: 0.04em; }
.c-val { font-family: var(--mono); font-size: 21px; font-weight: 500; margin-top: 3px; color: var(--cyan); white-space: nowrap; }
.card.hot .c-val { color: var(--amber); }
.c-val small { font-family: var(--sans); font-size: 11px; color: var(--dim); margin-left: 3px; font-weight: 400; }
.c-sub { font-size: 10.5px; color: var(--dim); margin-top: 2px; font-family: var(--mono); white-space: nowrap; }
.panel-bl { position: fixed; left: 26px; top: 172px; width: 330px; }
.narr { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--amber); border-radius: 12px; padding: 10px 13px; font-size: 13px; line-height: 1.65; color: rgba(230, 240, 248, 0.9); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); transition: opacity .25s; }
.narr b { color: #fff; font-weight: 600; background: linear-gradient(transparent 62%, rgba(255, 179, 71, 0.28) 62%); }
.narr.fade { opacity: 0.35; }

/* ───── 右上控制面板 ───── */
.panel-right { position: fixed; right: 20px; top: 20px; width: 272px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px 12px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.drawer-handle { display: none; }
.row { margin-bottom: 9px; }
.grp { border-bottom: 1px solid var(--line); padding-bottom: 2px; margin-bottom: 8px; }
.grp summary { list-style: none; cursor: pointer; font-size: 12px; font-weight: 500; letter-spacing: 0.06em; color: var(--text); padding: 8px 0 7px; display: flex; align-items: center; gap: 6px; user-select: none; }
.grp summary::-webkit-details-marker { display: none; }
.grp summary::after { content: ""; margin-left: auto; width: 6px; height: 6px; border-right: 1.5px solid var(--dim); border-bottom: 1.5px solid var(--dim); transform: rotate(45deg); transition: transform .2s; }
.grp[open] summary::after { transform: rotate(225deg); }
.grp .sum-note { font-size: 11px; color: var(--dim); font-weight: 400; letter-spacing: 0; }
.row:last-child { margin-bottom: 0; }
.r-label { font-size: 11.5px; color: var(--dim); margin-bottom: 5px; display: flex; align-items: baseline; gap: 4px; }
.r-label .num { font-family: var(--mono); color: var(--cyan); font-size: 13px; margin-left: auto; }
.r-label .unit { font-size: 11px; }
.seg { display: flex; background: rgba(0,0,0,0.28); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button { flex: 1; font: inherit; font-size: 12px; color: var(--dim); background: transparent; border: 0; border-radius: 7px; padding: 5px 4px; cursor: pointer; transition: background .2s, color .2s; white-space: nowrap; }
.seg button:hover { color: var(--text); background: rgba(95, 216, 255, 0.08); }
.seg button.on { background: rgba(95, 216, 255, 0.18); color: #fff; box-shadow: inset 0 0 0 1px rgba(95,216,255,0.45); }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chips button { font: inherit; font-size: 11.5px; color: var(--text); background: rgba(255,179,71,0.08); border: 1px solid rgba(255,179,71,0.28); border-radius: 999px; padding: 5px 9px; cursor: pointer; transition: background .2s; }
.chips button:hover { background: rgba(255,179,71,0.2); }
.chips button.on { background: rgba(255,179,71,0.3); border-color: rgba(255,179,71,0.7); }
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 18px; background: transparent; margin: 4px 0 0; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan) var(--fill, 50%), rgba(255,255,255,0.14) var(--fill, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: -6px; border-radius: 50%; background: #fff; border: 3px solid var(--cyan); box-shadow: 0 0 10px rgba(95,216,255,0.6); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.14); }
input[type=range]::-moz-range-progress { height: 4px; background: var(--cyan); }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 3px solid var(--cyan); }
.legend { margin-top: 7px; }
.legend .bar { height: 6px; border-radius: 3px; }
.legend .ticks { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10px; color: var(--dim); margin-top: 3px; }
.tools { display: flex; gap: 6px; }
.tool { font: inherit; font-size: 12px; color: var(--text); background: rgba(255,255,255,0.06); border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; cursor: pointer; flex: 1; }
.tool:hover { background: rgba(255,255,255,0.12); }
.tool.fire { color: var(--amber); border-color: rgba(255,179,71,0.35); }
.tool.fire.off { color: #fff; background: rgba(255,138,61,0.35); }
.tool.round { flex: 0 0 34px; padding: 7px 0; font-weight: 600; }

.hide-ui, .show-ui { position: fixed; right: 20px; bottom: 20px; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 50%; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; backdrop-filter: blur(8px); }
.show-ui { width: auto; border-radius: 999px; padding: 0 14px; font: inherit; font-size: 12px; opacity: 0.5; }
.show-ui:hover { opacity: 1; }
#ui.hidden, #labels.hidden, .show-ui[hidden] { display: none; }

/* ───── 帮助 ───── */
.help { position: fixed; inset: 0; background: rgba(3, 8, 15, 0.55); display: grid; place-items: center; z-index: 30; backdrop-filter: blur(4px); }
.help[hidden] { display: none; }
.help-card { position: relative; width: min(640px, calc(100vw - 32px)); max-height: calc(100vh - 48px); overflow: auto; background: var(--panel-2); border: 1px solid var(--line); border-radius: 18px; padding: 22px 26px 18px; font-size: 13.5px; line-height: 1.7; }
.help-card h2 { font-size: 15px; margin: 4px 0 6px; color: var(--amber); font-weight: 600; }
.help-card ul { margin: 0 0 14px; padding-left: 18px; }
.help-card li { margin-bottom: 5px; color: rgba(230,240,248,0.88); }
.help-card b { color: #fff; }
.help-card kbd { font-family: var(--mono); background: rgba(255,255,255,0.1); border-radius: 4px; padding: 0 5px; }
.close { position: absolute; right: 12px; top: 10px; background: none; border: 0; color: var(--dim); font-size: 24px; cursor: pointer; }

/* ───── 3D 标签 ───── */
#labels { position: fixed; inset: 0; pointer-events: none; z-index: 5; }
.leaders { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.leaders line { stroke: rgba(210, 236, 255, 0.7); stroke-width: 1; opacity: 0; transition: opacity .3s; }
.leaders circle { fill: #fff; opacity: 0; transition: opacity .3s; }
.leaders .on { opacity: 1; }
.tag { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 12px; padding: 4px 10px 4px 9px; border-radius: 999px; background: rgba(9, 20, 36, 0.8); border: 1px solid rgba(140, 200, 240, 0.3); color: var(--text); opacity: 0; transition: opacity .3s; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.tag.on { opacity: 1; }
.tag .v { font-family: var(--mono); color: var(--cyan); margin-left: 5px; }
.tag .w { font-family: var(--mono); color: var(--amber); margin-left: 5px; }
.tag-drag { border-color: rgba(255, 179, 71, 0.6); }
.tag-drag::before { content: '⇕'; color: var(--amber); margin-right: 5px; }
.tag .hint { color: var(--amber); margin-left: 5px; }

#nogl { position: fixed; inset: 0; display: grid; place-items: center; padding: 24px; background: #0a1220; z-index: 50; text-align: center; }
#nogl[hidden] { display: none; }
#nogl h2 { color: var(--amber); font-weight: 600; }
#nogl p { color: var(--dim); max-width: 440px; line-height: 1.7; }

/* ───── 手机 ───── */
@media (max-width: 699px) {
  .panel-left { left: 14px; top: 12px; right: 14px; width: auto; }
  .kicker { font-size: 9.5px; }
  h1 { font-size: 22px; margin: 5px 0 4px; }
  .hook { display: none; }
  .cards { gap: 6px; margin-bottom: 6px; }
  .card { padding: 6px 8px; border-radius: 10px; }
  .c-val { font-size: 17px; }
  .c-sub { display: none; }
  .panel-bl { left: 12px; right: 12px; top: auto; bottom: 62px; width: auto; }
  .narr { font-size: 12px; line-height: 1.6; padding: 9px 11px; }
  .panel-right { top: auto; bottom: 0; right: 0; left: 0; width: auto; border-radius: 16px 16px 0 0; padding: 0 14px 10px; transform: translateY(calc(100% - 52px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); z-index: 20; max-height: 78vh; overflow: auto; }
  .panel-right.open { transform: translateY(0); }
  .drawer-handle { display: block; width: 100%; background: none; border: 0; color: var(--text); font: inherit; font-size: 13px; padding: 15px 0 12px; cursor: pointer; }
  .drawer-handle::before { content: ''; display: block; width: 38px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.3); margin: -6px auto 8px; }
  .hide-ui { bottom: auto; top: 12px; right: 12px; width: 34px; height: 34px; }
  .tag { font-size: 10.5px; padding: 3px 8px; }
}
