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

:root {
  --panel: rgba(12, 22, 38, 0.72);
  --panel-line: rgba(140, 200, 255, 0.14);
  --text: #e8eef6;
  --muted: #93a4b8;
  --cyan: #5fe3ff;
  --amber: #ffb547;
  --cjk: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #0b1220; color: var(--text);
  font-family: "Outfit", var(--cjk); -webkit-font-smoothing: antialiased; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; }
#ui { position: fixed; inset: 0; pointer-events: none; }
#ui.off { display: none; }
#ui > * { pointer-events: auto; }
.hidden { display: none !important; }

.panel-left { position: absolute; left: 24px; top: 22px; width: 312px; }
.kicker { font-size: 11px; letter-spacing: 0.2em; color: var(--cyan); font-weight: 600; opacity: 0.9; }
h1 { margin: 8px 0 8px; font-size: 30px; line-height: 1.16; font-weight: 700; letter-spacing: 0.01em; text-shadow: 0 2px 18px rgba(0,0,0,0.6); }
h1 span { display: block; }
h1 .accent { color: var(--amber); }
.hook { margin: 0 0 12px; font-size: 13px; line-height: 1.6; color: #c3cfdc; max-width: 312px; text-shadow: 0 1px 10px rgba(0,0,0,0.8); }
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.card { background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px; padding: 7px 10px 8px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.c-label { font-size: 11px; color: var(--muted); white-space: nowrap; }
.c-val { margin-top: 4px; font-family: "DM Mono", monospace; font-size: 20px; color: var(--cyan); font-weight: 500; white-space: nowrap; }
.c-val small { font-size: 10px; margin-left: 3px; color: var(--muted); }
.card.hot .c-val { color: var(--amber); }
.explain { margin-top: 8px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 12px;
  padding: 10px 13px; font-size: 13px; line-height: 1.68; color: #d5dee9; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: opacity .25s; }
.explain b { color: #fff; font-weight: 600; }
.explain .num { font-family: "DM Mono", monospace; color: var(--cyan); font-size: 12.5px; }
.explain.fade { opacity: 0.25; }

.panel-right { position: absolute; right: 18px; top: 18px; width: 236px; background: var(--panel); border: 1px solid var(--panel-line);
  border-radius: 14px; padding: 6px 12px 8px; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.grp { border-bottom: 1px solid rgba(140, 200, 255, 0.08); padding-bottom: 2px; }
.grp summary { list-style: none; cursor: pointer; font-size: 11px; letter-spacing: 0.14em; color: #7f93a8; padding: 7px 0 6px; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.grp summary::-webkit-details-marker { display: none; }
.grp summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid #7f93a8; border-bottom: 1.5px solid #7f93a8; transform: rotate(45deg) translate(-2px, -2px); transition: transform .2s; }
.grp:not([open]) summary::after { transform: rotate(-45deg); }
.grp summary:hover { color: var(--text); }
.ctl { margin-bottom: 8px; }
.ctl-inline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ctl-inline .ctl-label { margin: 0; }
.ctl-inline .seg { flex: 0 0 132px; }
.ctl-label { font-size: 12px; color: var(--muted); margin-bottom: 2px; display: flex; justify-content: space-between; }
.ctl-label b { font-family: "DM Mono", monospace; font-weight: 500; color: var(--cyan); font-size: 12px; }
.ctl.disabled { opacity: 0.4; }
.seg { display: flex; background: rgba(255,255,255,0.05); border-radius: 10px; padding: 3px; gap: 3px; }
.seg button, .presets button, .row-btns button { font: inherit; font-family: "Outfit", var(--cjk); color: var(--text); border: 0; cursor: pointer; }
.seg button { flex: 1; background: transparent; padding: 6px 0; border-radius: 8px; font-size: 13px; color: #b9c6d6; transition: background .2s, color .2s; }
.seg button:hover { background: rgba(255,255,255,0.06); }
.seg button.on { background: rgba(95, 227, 255, 0.16); color: #fff; box-shadow: inset 0 0 0 1px rgba(95,227,255,0.45); }
#seg-lock button[data-v="locked"].on { background: rgba(255,181,71,0.18); box-shadow: inset 0 0 0 1px rgba(255,181,71,0.55); }
.presets { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.presets button { background: rgba(255,255,255,0.05); padding: 7px 6px; border-radius: 8px; font-size: 12px; color: #c9d4e2; text-align: left; }
.presets button:hover { background: rgba(255,255,255,0.1); }
.presets button.on { box-shadow: inset 0 0 0 1px rgba(255,181,71,0.6); color: #fff; }
input[type=range] { width: 100%; appearance: none; -webkit-appearance: none; height: 22px; background: transparent; cursor: pointer; }
input[type=range]::-webkit-slider-runnable-track { height: 4px; border-radius: 2px; background: linear-gradient(90deg, var(--cyan) var(--p, 50%), rgba(255,255,255,0.12) var(--p, 50%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; margin-top: -6px; background: #fff; box-shadow: 0 0 0 3px rgba(95,227,255,0.35); }
input[type=range]::-moz-range-track { height: 4px; border-radius: 2px; background: rgba(255,255,255,0.12); }
input[type=range]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 0; }
.presets { padding-bottom: 8px; }
.row-btns { display: flex; gap: 6px; margin-bottom: 8px; }
.row-btns button { flex: 1; background: rgba(255,255,255,0.06); padding: 6px 0; border-radius: 9px; font-size: 13px; }
.row-btns button:hover { background: rgba(255,255,255,0.12); }
#btn-help { flex: 0 0 40px; font-weight: 700; color: var(--amber); }
.slowmo { margin-top: 6px; font-size: 10.5px; color: #6f8197; text-align: center; }
.drawer-handle { display: none; }

.btn-hide, .btn-show { position: fixed; right: 22px; bottom: 20px; font: 12px "Outfit", var(--cjk); color: #b9c6d6; background: var(--panel);
  border: 1px solid var(--panel-line); border-radius: 999px; padding: 8px 14px; cursor: pointer; backdrop-filter: blur(8px); }
.btn-show { z-index: 5; }

.help { position: fixed; inset: 0; background: rgba(4, 8, 16, 0.55); display: flex; align-items: center; justify-content: center; z-index: 10; }
.help-card { position: relative; width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 60px); overflow: auto; background: rgba(14, 25, 43, 0.96);
  border: 1px solid var(--panel-line); border-radius: 16px; padding: 18px 22px; font-size: 13.5px; line-height: 1.7; color: #d1dbe7; }
.help-card h3 { margin: 6px 0 6px; font-size: 15px; color: var(--cyan); }
.help-card ul { margin: 0 0 10px; padding-left: 18px; }
.help-card b { color: #fff; }
.help-x { position: absolute; right: 12px; top: 8px; background: none; border: 0; color: #9fb0c3; font-size: 24px; cursor: pointer; }
kbd { font-family: "DM Mono", monospace; background: rgba(255,255,255,0.1); padding: 0 5px; border-radius: 4px; }

.nogl { position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; background: #0b1220; z-index: 20; padding: 24px; }
.nogl h2 { color: var(--amber); font-size: 20px; } .nogl p { color: #c3cfdc; max-width: 420px; line-height: 1.7; }

@media (max-width: 1180px) {
  .panel-left { width: 300px; }
  h1 { font-size: 27px; }
}

@media (max-width: 699px) {
  .panel-left { left: 14px; right: 14px; top: 12px; width: auto; }
  .kicker { display: none; }
  h1 { font-size: 21px; margin: 5px 0 4px; }
  h1 span { display: inline; } h1 .accent::before { content: " "; }
  .hook { display: none; }
  .cards { gap: 6px; }
  .card { padding: 4px 8px 5px; border-radius: 10px; }
  .c-label { font-size: 10px; }
  .c-val { font-size: 16px; }
  .explain { position: fixed; left: 14px; right: 14px; bottom: 76px; margin: 0; font-size: 12px; line-height: 1.5; padding: 7px 11px; }
  .panel-right { left: 0; right: 0; top: auto; bottom: 0; width: auto; border-radius: 18px 18px 0 0; padding: 8px 14px 14px;
    max-height: 72vh; overflow: auto; transform: translateY(calc(100% - 66px)); transition: transform .35s cubic-bezier(.2,.8,.2,1); z-index: 4; }
  .panel-right.open { transform: translateY(0); }
  .panel-right.open ~ .btn-hide { display: none; }
  .drawer-handle { display: block; width: 100%; height: 22px; background: none; border: 0; padding: 0; margin-bottom: 4px; cursor: pointer; }
  .drawer-handle span { display: block; width: 42px; height: 4px; border-radius: 2px; background: rgba(255,255,255,0.35); margin: 6px auto; }
  #g-drive > summary { display: none; }
  #g-drive .ctl:first-of-type { margin-bottom: 14px; }
  .btn-hide { bottom: auto; top: 12px; right: 12px; padding: 5px 10px; font-size: 11px; display: none; }
}
