@import url("./ego-shared.css");

body.studio {
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
}

/* Login — left intro + download / right web auth */
.login-wrap {
  min-height: 100vh; display: grid; place-items: center; padding: 28px 20px;
  background:
    radial-gradient(ellipse 70% 55% at 12% 18%, var(--login-glow-a), transparent 55%),
    radial-gradient(ellipse 55% 45% at 88% 72%, var(--login-glow-b), transparent 50%),
    var(--bg-grad);
}
.login-shell {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 0;
  border: 1px solid var(--line2);
  border-radius: 18px;
  overflow: hidden;
  background: color-mix(in srgb, var(--elev) 88%, transparent);
  box-shadow: var(--shadow);
  animation: loginIn .55s ease both;
}
@keyframes loginIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.login-intro {
  padding: 36px 34px 32px;
  border-right: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(61, 184, 168, 0.07), transparent 42%),
    linear-gradient(200deg, rgba(232, 165, 75, 0.05), transparent 50%),
    var(--bg2);
}
.login-intro-brand {
  font-size: 22px; margin: 0 0 18px;
  animation: loginIn .6s .05s ease both;
}
.login-kicker {
  margin: 0 0 8px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); font-weight: 700;
}
.login-intro-title {
  margin: 0 0 14px; font-family: var(--display); font-weight: 800;
  font-size: clamp(26px, 3.2vw, 34px); letter-spacing: -0.03em; line-height: 1.2;
}
.login-intro-lead {
  margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.65; max-width: 38ch;
}
.login-feats {
  list-style: none; margin: 0 0 26px; padding: 0;
  display: grid; gap: 12px;
}
.login-feats li {
  display: grid; gap: 2px;
  padding-left: 12px; border-left: 2px solid rgba(61, 184, 168, 0.45);
}
.login-feats strong {
  font-size: 13px; color: var(--text); font-weight: 600;
}
.login-feats span {
  font-size: 12px; color: var(--muted); line-height: 1.45;
}
.login-desktop {
  padding-top: 18px; border-top: 1px solid var(--line);
}
.login-desktop-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.login-desktop-head strong { font-size: 14px; }
.login-desktop-tag {
  font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--amber); border: 1px solid rgba(232, 165, 75, 0.35);
  padding: 3px 7px; border-radius: 6px;
}
.login-desktop p {
  margin: 0 0 14px; font-size: 13px; color: var(--muted); line-height: 1.55;
}
.login-desktop-cta {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.login-desktop-cta .btn { text-decoration: none; }
.login-card {
  margin: 0; padding: 36px 32px 30px;
  border: 0; border-radius: 0;
  background: color-mix(in srgb, var(--elev) 96%, transparent);
  box-shadow: none;
  display: flex; flex-direction: column; justify-content: center;
}
.login-card-kicker {
  margin: 0 0 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--amber); font-weight: 700;
}
.login-card h2 {
  font-family: var(--display); font-size: 24px; margin: 0 0 6px; letter-spacing: -0.03em;
}
.login-card .lead { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.login-card label { display: block; font-size: 12px; color: var(--muted); margin: 0 0 6px; }
.login-card input {
  width: 100%; height: 42px; margin-bottom: 12px; padding: 0 12px;
  border-radius: 8px; border: 1px solid var(--line2); background: var(--bg2);
}
.login-card input:focus {
  outline: none; border-color: rgba(61, 184, 168, 0.55);
  box-shadow: 0 0 0 3px rgba(61, 184, 168, 0.12);
}
.login-card .err { color: #ffb4ac; font-size: 12px; min-height: 18px; margin: 0 0 8px; }
.login-card .hint { margin-top: 14px; font-size: 11px; color: var(--faint); line-height: 1.55; }

@media (max-width: 820px) {
  .login-shell { grid-template-columns: 1fr; }
  .login-intro { border-right: 0; border-bottom: 1px solid var(--line); padding: 28px 22px 22px; }
  .login-card { padding: 26px 22px 24px; }
  .login-intro-title { font-size: 26px; }
}

/* Shell */
.app {
  height: 100vh; display: grid;
  grid-template-columns: 220px 1fr;
  grid-template-rows: 52px 1fr;
  grid-template-areas: "top top" "side main";
  transition: grid-template-columns .2s ease;
  background: var(--bg);
}
.app.side-collapsed {
  grid-template-columns: 0 1fr;
}
.app.side-collapsed .app-side {
  overflow: hidden; padding: 0; border-right: 0; opacity: 0; pointer-events: none;
}
.app-top {
  grid-area: top; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--line);
  background: rgba(14,16,20,.94); backdrop-filter: blur(10px);
  z-index: 5;
}
.app-top .spacer { flex: 1; }
.app-side {
  grid-area: side; border-right: 1px solid var(--line);
  background: var(--bg2); padding: 12px 10px; overflow: auto;
  transition: opacity .18s ease, padding .18s ease;
}
.app-main { grid-area: main; overflow: auto; padding: 18px 20px 28px; }
.app-main.is-explore,
.app-main.is-monitor,
.app-main.is-capture,
.app-main.is-overview {
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.app-main.is-monitor,
.app-main.is-capture { padding: 8px 10px; }
.app-main.is-overview { padding: 6px 8px 8px; overflow: hidden; }
.icon-btn {
  width: 36px; min-width: 36px; height: 36px; padding: 0;
  font-size: 16px; line-height: 1;
}
.side-fab {
  position: fixed; left: 12px; bottom: 18px; z-index: 40;
  height: 36px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line2); background: var(--elev2);
  color: var(--text); cursor: pointer; font-size: 12px; font-weight: 600;
  box-shadow: var(--shadow);
}
.side-fab:hover { border-color: var(--teal); }
.app.is-fullscreen,
.app:fullscreen {
  width: 100%; height: 100%;
  background: var(--bg);
}
.app:fullscreen .app-main {
  padding: 14px 16px 20px;
}

.nav-group {
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
}
.nav-group:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: 0;
}
.nav-label {
  font-size: 10px; letter-spacing: .12em;
  color: var(--muted); padding: 4px 10px 6px; font-weight: 700;
}
.nav-btn {
  width: 100%; display: flex; align-items: center; gap: 10px;
  text-align: left; border: 0; background: transparent;
  color: var(--text); padding: 8px 12px; border-radius: 8px;
  cursor: pointer; font-size: 13px; font-weight: 560; margin-bottom: 1px;
  opacity: 0.88;
  transition: background .15s, color .15s, opacity .15s;
}
.nav-btn:hover { background: var(--elev); color: var(--text); opacity: 1; }
.nav-btn.on { background: var(--teal-dim); color: var(--text); opacity: 1; box-shadow: inset 3px 0 0 var(--teal); }
.nav-btn .nav-ico {
  flex: 0 0 16px; width: 16px; height: 16px;
  opacity: .9; color: inherit;
  transition: opacity .15s, color .15s, transform .15s;
}
.nav-btn:hover .nav-ico { opacity: .95; }
.nav-btn.on .nav-ico {
  opacity: 1; color: var(--teal);
  filter: drop-shadow(0 0 4px rgba(61, 184, 168, .35));
}
.nav-btn .nav-txt { flex: 1; min-width: 0; line-height: 1.2; }

.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-h h1 {
  margin: 0; font-family: var(--display); font-size: 22px; letter-spacing: -0.02em;
  color: var(--text); font-weight: 750;
}
.page-h p { margin: 4px 0 0; font-size: 13px; color: var(--muted); font-weight: 500; }

.grid-2 { display: grid; grid-template-columns: 1.15fr .85fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.box {
  border: 1px solid var(--line); border-radius: 10px; background: var(--elev); padding: 14px;
}
.box h3 {
  margin: 0 0 10px; font-size: 12px; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text); font-weight: 700; opacity: 0.92;
}
.kpi b { display: block; font-family: var(--mono); font-size: 22px; margin-bottom: 4px; }
.kpi span { font-size: 12px; color: var(--muted); }

.table { width: 100%; border-collapse: collapse; font-size: 12px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-size: 11px; letter-spacing: .05em; text-transform: uppercase; }
.table .mono { font-family: var(--mono); }

.form-row { margin-bottom: 10px; }
.form-row label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.form-row input, .form-row select, .form-row textarea {
  width: 100%; min-height: 38px; padding: 8px 10px;
  border-radius: 8px; border: 1px solid var(--line2);
  background: var(--bg2); color: var(--text);
}
/* 工具栏 / 页面内裸 select：避免白底 + 浅字看不清 */
body.studio select,
body.studio input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]),
body.studio textarea {
  background: var(--bg2);
  color: var(--text);
  border: 1px solid var(--line2);
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 36px;
  color-scheme: dark;
}
body.studio select {
  min-width: 132px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%233db8a8' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}
body.studio select option,
body.studio select optgroup {
  background: #14181f;
  color: #e8ebe6;
}
body.studio .toolbar select {
  background-color: var(--elev2);
  border-color: var(--line2);
  color: var(--text);
}
body.studio .toolbar select:hover,
body.studio .toolbar select:focus {
  border-color: var(--teal);
  outline: none;
}
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.toast {
  position: fixed; right: 18px; bottom: 18px; z-index: 50;
  max-width: 360px; padding: 12px 14px; border-radius: 10px;
  background: var(--elev2); border: 1px solid var(--line2); box-shadow: var(--shadow);
  font-size: 13px; display: none;
}
.toast.show { display: block; }

.preview {
  aspect-ratio: 16/10; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--line2); background: #0c1016; position: relative;
}
.preview video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.preview .arm-live {
  position: absolute; inset: 0; display: grid; gap: 2px; background: #000;
}
.preview .arm-live.cols-1 { grid-template: 1fr / 1fr; }
.preview .arm-live.cols-2 { grid-template: 1fr / 1fr 1fr; }
.preview .arm-live.cols-3 { grid-template: 1fr / 1fr 1fr 1fr; }
.preview .arm-live.cols-4 { grid-template: 1fr 1fr / 1fr 1fr; }
.preview .arm-live-cell {
  position: relative; min-width: 0; min-height: 0; background: #000; overflow: hidden;
}
.preview .arm-live img { width: 100%; height: 100%; object-fit: contain; background: #000; display: block; }
.preview .arm-live-empty {
  display: flex; align-items: center; justify-content: center;
  background: #05080a; color: var(--muted); font-size: 12px;
}
.preview .imu-pose-cell {
  background: #0f1217;
  display: flex; flex-direction: column;
}
.preview .imu-pose-cell .imu-pose-wrap {
  flex: 1 1 auto; min-height: 0; height: 100%;
}
.imu-pose-wrap {
  position: relative; width: 100%; height: 100%;
  display: block; min-height: 0;
  background: #0f1217;
}
.imu-pose-3d {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden; background: #0f1217;
}
.imu-pose-3d canvas {
  display: block; width: 100% !important; height: 100% !important;
  cursor: grab;
}
.imu-pose-hud {
  position: absolute; left: 8px; top: 6px; right: 8px; z-index: 2;
  font-size: 10px; line-height: 1.35; color: #3db8a8;
  text-shadow: 0 1px 2px rgba(0,0,0,.85);
  pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cam-tile.is-imu-pose { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
/* 覆盖 .cam-body 的 place-items:center，否则 3D 容器高度塌成 0 */
.cam-tile.is-imu-pose .cam-body {
  display: block;
  position: relative;
  padding: 0;
  background: #0f1217;
  place-items: unset;
}
.preview .arm-live-lab {
  position: absolute; left: 6px; bottom: 4px;
  font-size: 10px; font-family: var(--mono); color: rgba(232,236,239,.85);
  text-shadow: 0 1px 2px #000; pointer-events: none;
}
.preview .ov.bottom { top: auto; bottom: 10px; }
.preview .ov {
  position: absolute; left: 10px; top: 10px; z-index: 2;
  font-family: var(--mono); font-size: 11px; color: var(--teal);
}

/* 采集控制台 · 单视口 */
.cap-page {
  flex: 1; min-height: 0; height: 100%;
  display: flex; flex-direction: column; gap: 8px; overflow: hidden;
}
.cap-bar {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px;
  padding: 6px 2px;
}
.cap-bar-left, .cap-bar-right {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.cap-bar-right { margin-left: auto; }
.cap-hotkeys { font-size: 12px; }
.cap-banner { flex: 0 0 auto; margin: 0; padding: 8px 10px; }
.cap-banner .qc-head { margin: 0; }
.cap-body {
  flex: 1; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 360px); gap: 10px;
  overflow: hidden;
}
.cap-body-solo {
  grid-template-columns: 1fr;
}
.cap-task-chip {
  font-size: 12px;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg2);
}
.cap-stage {
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--elev); padding: 8px;
  overflow: hidden;
}
.sop-panel-modal {
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
.ego-modal-sm .ego-modal-panel,
.ego-modal-panel.ego-modal-sm {
  max-width: 480px;
}
.cap-preview {
  flex: 1; min-height: 0; aspect-ratio: auto; border-radius: 8px;
}
.cap-transport {
  flex: 0 0 auto;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
}
.cap-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.cap-kpis { display: flex; gap: 10px; align-items: stretch; }
.cap-kpi {
  min-width: 72px; padding: 4px 8px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--bg2); text-align: center;
}
.cap-kpi b { display: block; font-size: 14px; line-height: 1.2; }
.cap-kpi span { font-size: 10px; color: var(--muted); }
.cap-side {
  min-width: 0; min-height: 0;
  border: 1px solid var(--line); border-radius: 10px; background: var(--elev);
  overflow: hidden; display: flex; flex-direction: column;
}
.cap-side-scroll {
  flex: 1; min-height: 0; overflow: auto; padding: 10px 12px 14px;
}
.cap-side h3 { margin: 0 0 8px; font-size: 12px; letter-spacing: .04em; }
.cap-form .form-row { margin-bottom: 8px; }
.cap-form-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
@media (max-width: 1100px) {
  .cap-body { grid-template-columns: 1fr; }
  .cap-body:not(.cap-body-solo) { grid-template-rows: minmax(220px, 1fr) minmax(200px, 42vh); }
  .cap-bar-right { margin-left: 0; width: 100%; }
}
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  border: 1px solid var(--line2); background: var(--elev2); color: var(--text);
  border-radius: 999px; padding: 7px 12px; font-size: 12px; cursor: pointer;
}
.tag:hover, .tag.on { border-color: var(--amber); background: var(--amber-dim); color: var(--amber); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.stat-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 13px;
}
.stat-row:last-child { border-bottom: 0; }
.stat-row .v { font-family: var(--mono); color: var(--teal); font-size: 12px; }

.sys-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 16px; font-size: 13px; border-bottom: 1px solid var(--line2);
  background: var(--amber-dim); color: var(--amber);
}
.sys-banner.warn { background: var(--amber-dim); color: var(--amber); }
.sys-banner.error, .sys-banner.fatal {
  background: color-mix(in srgb, var(--danger) 22%, var(--bg));
  color: #ffb4ac;
}
.lamp {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok); margin-right: 4px; vertical-align: middle;
}
.lamp.yellow { background: var(--warn); }
.lamp.red { background: var(--danger); }
.lamp.green { background: var(--ok); }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--muted);
}
.badge.live { border-color: var(--teal); color: var(--teal); background: var(--teal-dim); }
.badge.qc-fail { border-color: var(--danger); color: #ffb4ac; background: color-mix(in srgb, var(--danger) 18%, transparent); }
.rework-inbox h3 { display: flex; align-items: center; gap: 8px; }
.rework-list { display: grid; gap: 10px; max-height: 320px; overflow: auto; }
.rework-item {
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 10px; padding: 10px 12px;
  background: color-mix(in srgb, var(--danger) 8%, var(--elev));
}
.rework-item-h { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.rework-tips { margin: 0; padding-left: 0; list-style: none; font-size: 12px; line-height: 1.45; }
.rework-tips li { margin: 4px 0; color: var(--text); }
.rework-tips code {
  font-family: var(--mono); font-size: 10px; color: var(--amber);
  margin-right: 6px;
}
.sys-banner.warn {
  background: color-mix(in srgb, var(--amber) 16%, transparent);
  border: 1px solid color-mix(in srgb, var(--amber) 40%, transparent);
  color: var(--text); padding: 10px 14px; border-radius: 10px; font-size: 13px;
}

/* 采集规范 / 流水线 / 质检打回 */
.sop-panel {
  border: 1px solid var(--line); border-radius: 10px; background: var(--elev);
  padding: 0 14px 12px; margin-bottom: 4px;
}
.sop-panel > summary {
  cursor: pointer; list-style: none; padding: 12px 0 8px;
  font-size: 12px; font-weight: 600; letter-spacing: .04em; color: var(--muted);
}
.sop-panel > summary::-webkit-details-marker { display: none; }
.sop-panel > summary::before { content: "▸ "; color: var(--teal); }
.sop-panel[open] > summary::before { content: "▾ "; }
.sop-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.sop-grid h4 { margin: 0 0 6px; font-size: 12px; color: var(--text); }
.sop-grid ul { margin: 0; padding-left: 16px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.sop-check { margin-top: 10px; }
.sop-check-item {
  display: flex; align-items: flex-start; gap: 8px; margin: 6px 0;
  font-size: 13px; color: var(--text); cursor: pointer; line-height: 1.45;
}
.sop-check-item input { margin-top: 3px; accent-color: var(--teal); }
.status-dict { margin-bottom: 0; }

.group-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--bg, #0f1210);
  color: var(--muted); border-radius: 999px; padding: 5px 12px;
  font-size: 12px; cursor: pointer;
}
.chip.on { border-color: var(--teal); color: var(--text); background: color-mix(in srgb, var(--teal) 18%, transparent); }
.chip-x { margin-left: 4px; opacity: .7; }
.chip-x:hover { color: var(--danger); opacity: 1; }
.table-scroll { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.presence-badge {
  display: inline-block; min-width: 36px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: .02em;
  padding: 2px 8px; border-radius: 999px; margin-right: 6px;
  border: 1px solid var(--line); color: var(--muted); background: transparent;
  vertical-align: middle;
}
.presence-badge.offline { color: #c9a0a0; border-color: color-mix(in srgb, #c44 45%, var(--line)); }
.presence-badge.online { color: #8fd4c8; border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); background: color-mix(in srgb, var(--teal) 12%, transparent); }
.presence-badge.pushing { color: #9ec1ff; border-color: color-mix(in srgb, #4a7fd4 50%, var(--line)); background: color-mix(in srgb, #4a7fd4 14%, transparent); }
.presence-badge.recording { color: #ffb4a8; border-color: color-mix(in srgb, #e85d4c 55%, var(--line)); background: color-mix(in srgb, #e85d4c 16%, transparent); }

.perf-panel .perf-kpi { padding: 12px; }
.perf-panel .table.compact th,
.perf-panel .table.compact td { padding: 6px 8px; }
.table.compact { font-size: 12px; }
.table-scroll-tall { max-height: min(68vh, 720px); }
.dev-list-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px;
}
.dev-list-head h3 { margin: 0; }
.table-devices tbody tr.dev-row { cursor: pointer; transition: background .15s ease; }
.table-devices tbody tr.dev-row > td:first-child { box-shadow: inset 3px 0 0 transparent; }
/* 业务状态行底色：离线 / 在线 / 推送 / 录制 */
.table-devices tbody tr.dev-row.is-offline {
  background: color-mix(in srgb, #5a3a3a 28%, var(--elev, #12151a));
}
.table-devices tbody tr.dev-row.is-offline > td:first-child {
  box-shadow: inset 3px 0 0 #8a5555;
}
.table-devices tbody tr.dev-row.is-online {
  background: color-mix(in srgb, var(--teal, #3db8a8) 14%, var(--elev, #12151a));
}
.table-devices tbody tr.dev-row.is-online > td:first-child {
  box-shadow: inset 3px 0 0 var(--teal, #3db8a8);
}
.table-devices tbody tr.dev-row.is-pushing {
  background: color-mix(in srgb, #4a7fd4 18%, var(--elev, #12151a));
}
.table-devices tbody tr.dev-row.is-pushing > td:first-child {
  box-shadow: inset 3px 0 0 #6a9ae8;
}
.table-devices tbody tr.dev-row.is-recording {
  background: color-mix(in srgb, #e85d4c 18%, var(--elev, #12151a));
}
.table-devices tbody tr.dev-row.is-recording > td:first-child {
  box-shadow: inset 3px 0 0 #e85d4c;
}
/* 链路告警时加深一点（在线但仍红/黄） */
.table-devices tbody tr.dev-row.is-online.lamp-red {
  background: color-mix(in srgb, #c44 16%, var(--elev, #12151a));
}
.table-devices tbody tr.dev-row.is-online.lamp-yellow {
  background: color-mix(in srgb, #c9a24a 16%, var(--elev, #12151a));
}
.table-devices tbody tr.dev-row:hover {
  filter: brightness(1.08);
}
.dev-row-actions { white-space: nowrap; }
.dev-row-actions .btn { margin: 2px 2px 2px 0; }
.form-grid-2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px;
}
@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
}

/* 设备编辑 / 参数弹窗 */
body.ego-modal-open { overflow: hidden; }
.ego-modal {
  position: fixed; inset: 0; z-index: 1200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.ego-modal[hidden] { display: none !important; }
.ego-modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(6, 8, 10, 0.62);
  backdrop-filter: blur(4px);
}
.ego-modal-panel {
  position: relative; z-index: 1;
  width: min(560px, 100%);
  max-height: min(90vh, 780px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--elev, #12151a);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.ego-modal-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--elev, #12151a); z-index: 2;
}
.ego-modal-head h3 {
  margin: 0; font-size: 15px; letter-spacing: 0; text-transform: none; font-weight: 700; color: var(--text);
}
.ego-modal-body { padding: 16px; }
.ego-modal-actions {
  display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; padding-top: 12px;
  border-top: 1px solid var(--line);
}
.dev-pick {
  display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; min-width: 0;
}
.dev-pick .dev-pick-group {
  flex: 0 0 108px; width: 108px; min-width: 96px; height: 34px; padding: 0 8px;
}
.dev-pick .dev-pick-q {
  flex: 0 1 120px; width: 120px; min-width: 88px; max-width: 140px; height: 34px; padding: 0 8px;
}
.dev-pick .dev-pick-sn {
  flex: 1 1 160px; min-width: 140px; height: 34px; padding: 0 8px;
}
.dev-pick .dev-pick-hint {
  flex: 0 0 auto; min-width: 1.6em; text-align: center;
  font-size: 11px; font-variant-numeric: tabular-nums;
  padding: 0 4px; opacity: 0.75;
}
.dev-pick-bar { display: flex; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.dev-pick-bar select, .dev-pick-bar input { flex: 1; min-width: 120px; }
.check-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 6px 10px; font-size: 12px; color: var(--text);
}
.check-grid label { display: flex; gap: 6px; align-items: flex-start; cursor: pointer; }
.admin2-perms {
  margin-top: 8px; padding: 10px 12px; border: 1px dashed var(--line); border-radius: 8px;
  background: color-mix(in srgb, var(--elev) 90%, transparent);
}

.settings-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}
.settings-subnav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: sticky;
  top: 12px;
}
.settings-tab {
  text-align: left;
  border: 1px solid var(--line);
  background: var(--elev);
  color: var(--muted);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.settings-tab b { font-size: 13px; color: var(--text); font-weight: 600; }
.settings-tab span { font-size: 11px; line-height: 1.35; }
.settings-tab:hover { border-color: color-mix(in srgb, var(--teal) 45%, var(--line)); }
.settings-tab.on {
  border-color: var(--teal);
  background: color-mix(in srgb, var(--teal) 16%, var(--elev));
  box-shadow: inset 3px 0 0 var(--teal);
}
.settings-pane { min-width: 0; }
@media (max-width: 900px) {
  .settings-layout { grid-template-columns: 1fr; }
  .settings-subnav { position: static; flex-direction: row; flex-wrap: wrap; }
  .settings-tab { flex: 1 1 140px; }
}
.table.compact th, .table.compact td { padding: 7px 6px; font-size: 12px; }

.pipe-bar {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--elev) 88%, transparent);
}
.pipe-step {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 88px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid transparent; color: var(--faint);
}
.pipe-step .pipe-k { font-family: var(--mono); font-size: 10px; letter-spacing: .06em; }
.pipe-step .pipe-t { font-size: 12px; font-weight: 600; }
.pipe-step.on {
  color: var(--text); border-color: var(--teal);
  background: var(--teal-dim); box-shadow: inset 0 0 0 1px rgba(61,184,168,.25);
}
.pipe-step.done { color: var(--muted); }
.pipe-step.done .pipe-k { color: var(--teal); }
.pipe-sep {
  width: 18px; height: 1px; background: var(--line2); flex: 0 0 18px;
}

.qc-card {
  margin: 10px 0; padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--line2); font-size: 12px;
}
.qc-card.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); background: color-mix(in srgb, var(--ok) 12%, transparent); }
.qc-card.warn { border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: var(--amber-dim); }
.qc-card.bad { border-color: color-mix(in srgb, var(--danger) 45%, transparent); background: color-mix(in srgb, var(--danger) 14%, transparent); }
.qc-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; margin-bottom: 8px; }
.qc-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.qc-list li { display: grid; grid-template-columns: 88px 1fr; gap: 8px; align-items: start; }
.qc-list code {
  font-family: var(--mono); font-size: 10px; color: var(--amber);
  padding: 2px 6px; border-radius: 4px; border: 1px solid var(--line2); background: var(--bg2);
  height: fit-content;
}

@media (max-width: 960px) {
  .sop-grid { grid-template-columns: 1fr; }
  .qc-list li { grid-template-columns: 1fr; }
}
.steps { margin: 0; padding-left: 18px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 28px; padding: 0 8px; margin-left: 4px;
  border: 1px solid var(--line2); border-radius: 6px; font-family: var(--mono);
  font-size: 11px; color: var(--muted); background: var(--elev2);
}
.mon-page {
  flex: 1;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.mon-bar {
  flex: 0 0 auto;
  padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--bg2);
}
.mon-bar-main {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px;
}
.mon-bar-left, .mon-bar-right {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.mon-bar-right { margin-left: auto; justify-content: flex-end; flex: 1 1 420px; min-width: 0; }
.mon-bar-right .mon-src {
  flex: 0 0 auto; width: auto; min-width: 118px; max-width: 140px; height: 34px;
}
.mon-bar-right .dev-pick { flex: 1 1 320px; min-width: 260px; max-width: 560px; }
.mon-arm-tip {
  flex: 0 1 auto; font-size: 11px; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.85;
}
.mon-layout-lab {
  font-size: 12px; font-weight: 700; color: var(--muted);
}
.mon-layout-btns { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.mon-layout-btns .btn { height: 30px; padding: 0 10px; font-size: 12px; }

.cam-grid {
  flex: 1;
  min-height: 0;
  display: grid;
  gap: 6px;
  overflow: hidden;
}
.cam-grid.lay-1 { grid-template: 1fr / 1fr; }
.cam-grid.lay-2 { grid-template: 1fr / 1fr 1fr; }
.cam-grid.lay-4 { grid-template: 1fr 1fr / 1fr 1fr; }
.cam-grid.lay-4m {
  grid-template: 1fr 1fr / 2fr 1fr;
}
.cam-grid.lay-4m .cam-tile:nth-child(1) { grid-row: 1 / span 2; }
.cam-grid.lay-6 { grid-template: 1fr 1fr / 1fr 1fr 1fr; }
.cam-grid.lay-6m {
  grid-template: 2fr 1fr / 1fr 1fr 1fr;
}
.cam-grid.lay-6m .cam-tile:nth-child(1) { grid-column: 1 / span 2; }
.cam-grid.lay-8 { grid-template: 1fr 1fr / repeat(4, 1fr); }
.cam-grid.lay-9 { grid-template: 1fr 1fr 1fr / 1fr 1fr 1fr; }
.cam-grid.has-focus {
  grid-template: 1fr / 1fr !important;
}
.cam-grid.has-focus .cam-tile { grid-column: auto; grid-row: auto; }

.cam-tile {
  position: relative;
  min-width: 0; min-height: 0;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #0c1016;
}
.cam-tile.is-closed,
.cam-tile.is-dimmed { display: none; }
.cam-tile.is-rec { border-color: #e07a5f; box-shadow: inset 0 0 0 1px rgba(224,122,95,.35); }
.cam-tile.is-frozen { border-color: #e8a54b; }
.cam-toolbar {
  position: absolute; right: 6px; bottom: 28px; z-index: 3;
  display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 4px;
  max-width: calc(100% - 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .15s ease;
}
.cam-tile:hover .cam-toolbar,
.cam-tile:focus-within .cam-toolbar {
  opacity: 1;
  pointer-events: auto;
}
.cam-btn {
  height: 26px; padding: 0 8px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.18);
  background: rgba(12,16,22,.88); color: #e8ecef;
  font-size: 11px; font-weight: 600; line-height: 1; cursor: pointer;
  backdrop-filter: blur(6px);
}
.cam-btn:hover { border-color: var(--teal); color: #fff; }
.cam-btn.on { border-color: #e07a5f; color: #ffb4ac; background: rgba(80,24,20,.85); }
.cam-rec-badge,
.cam-freeze-badge {
  position: absolute; top: 8px; right: 8px; z-index: 4;
  padding: 2px 7px; border-radius: 4px;
  color: #fff; font-size: 10px; font-weight: 700;
  letter-spacing: .06em; pointer-events: none;
}
.cam-rec-badge { background: #c0392b; }
.cam-freeze-badge { background: #b8860b; right: auto; left: 8px; }
.cam-tile.is-rec .cam-freeze-badge { left: 8px; }
.cam-body {
  flex: 1; min-height: 0;
  display: grid; place-items: center;
  font-family: var(--mono); color: var(--faint); font-size: 13px;
  background: #000;
}
.cam-body:fullscreen,
.cam-tile:fullscreen .cam-body {
  width: 100%; height: 100%; background: #000;
}
.cam-body .arm-frame { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-meta {
  flex: 0 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px;
  padding: 4px 8px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line);
  background: rgba(12,16,22,.92);
}
.mon-telemetry {
  flex: 0 0 110px;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.2fr 1.2fr 1fr;
  gap: 8px;
  overflow: hidden;
}
.mon-tele-card {
  margin: 0; padding: 8px 10px; min-width: 0; overflow: hidden;
  display: flex; flex-direction: column; gap: 4px;
}
.mon-tele-card h3 {
  margin: 0; font-size: 12px; display: flex; justify-content: space-between; gap: 8px; align-items: baseline;
}
.mon-tele-card canvas {
  width: 100%; height: 56px; background: #0c1016; border-radius: 6px; display: block;
}
.mon-tele-card .stat-row { margin: 0; font-size: 11px; }
.mon-local {
  position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none;
}
.mon-local video { width: 160px; height: 90px; }
.meter {
  flex: 1; height: 8px; border-radius: 99px; background: var(--elev2); overflow: hidden; max-width: 140px;
}
.meter i { display: block; height: 100%; background: var(--teal); }
.steps-h { display: flex; flex-wrap: wrap; gap: 6px; }
.step-pill {
  font-size: 11px; padding: 6px 10px; border-radius: 999px;
  border: 1px solid var(--line2); color: var(--muted);
}
.step-pill.on { border-color: var(--teal); color: var(--text); background: var(--teal-dim); }
.step-pill.done { border-color: var(--ok); color: var(--ok); }
.codeblock {
  margin-top: 12px; padding: 10px; border-radius: 8px; background: #0c1016;
  border: 1px solid var(--line); font-family: var(--mono); font-size: 11px;
  max-height: 280px; overflow: auto; color: var(--muted); white-space: pre-wrap;
}
.warn-text { color: #ffb4ac; }
.ok-text { color: var(--ok); }

/* Sync demo (customer pitch) */
.sync-hero { margin-bottom: 14px; }
.sync-meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
  margin-bottom: 12px; font-size: 13px;
}
.sync-meta .k { display: inline-block; min-width: 52px; color: var(--muted); font-size: 11px; margin-right: 6px; }
.sync-kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.sync-kpi-item { margin: 0; padding: 10px 12px; }
.sync-stage {
  display: grid; grid-template-columns: 1.6fr .7fr; gap: 12px; margin-bottom: 12px;
}
.sync-cams {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.sync-cam-tile {
  border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #0c1016;
}
.sync-cam-tile canvas { display: block; width: 100%; height: auto; }
.sync-side .sync-evt {
  display: block; width: 100%; text-align: left; margin-bottom: 6px;
  border: 1px solid var(--line2); background: var(--elev2); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font-size: 12px; cursor: pointer;
}
.sync-side .sync-evt:hover, .sync-side .sync-evt.on {
  border-color: var(--teal); background: var(--teal-dim);
}
.sync-transport canvas { display: block; width: 100%; height: 120px; margin-top: 10px; border-radius: 8px; }
.sync-scrub-wrap { position: relative; margin-top: 12px; }
.sync-scrub-track {
  position: relative; height: 6px; border-radius: 99px; background: var(--elev2); margin-bottom: 6px;
}
.sync-scrub-track i {
  display: block; height: 100%; width: 0; border-radius: 99px; background: var(--teal);
}
.sync-scrub-track em {
  position: absolute; top: -3px; width: 2px; height: 12px; background: var(--amber);
  transform: translateX(-50%); pointer-events: none;
}
#syncScrub { width: 100%; accent-color: var(--teal); }
.sync-legend { font-size: 11px; margin-top: 6px; }

/* —— Desktop 探索风格 · 离线解析回看 —— */
.ex-page {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
}
.ex-page-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 16px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--bg2);
  flex: 0 0 auto;
}
.ex-page-bar h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.ex-page-bar p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.ex-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 0;
  align-items: stretch;
}
.ex-sess-list {
  border-right: 1px solid var(--line);
  background: var(--bg2);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ex-task-scroll {
  flex: 1;
  overflow: auto;
  padding: 4px 8px 12px;
}
.ex-task {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  padding: 10px 10px;
  margin: 0 0 4px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.ex-task:hover { background: color-mix(in srgb, var(--teal) 10%, transparent); }
.ex-task.on {
  background: var(--teal-dim);
  border-color: color-mix(in srgb, var(--teal) 45%, transparent);
}
.ex-task-name {
  grid-column: 1;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ex-task-meta {
  grid-column: 1;
  font-size: 10px;
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-task-badge { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
.ex-task-empty { padding: 12px 8px; font-size: 12px; }
.ex-workspace {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #12151a;
}
.ex-host {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: #12151a;
}
.ex-empty {
  flex: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 40px 24px;
  text-align: center;
}
.ex-qc {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--bg2);
  max-height: 42px;
  overflow: hidden;
  transition: max-height .2s ease;
}
.ex-qc.open { max-height: 42vh; overflow: auto; }
.ex-qc-toggle {
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ex-qc-toggle:hover { color: var(--teal); }
.ex-qc-body { padding: 0 16px 16px; }
.ex-qc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }

.ex-shell {
  display: grid;
  grid-template-columns: 210px 1fr;
  height: 100%;
  min-height: 0;
  background: #15181e;
}
.ex-side {
  border-right: 1px solid #2a303a;
  background: #171b22;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}
.ex-side-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #2a303a;
  flex: 0 0 auto;
}
.ex-side-tab {
  flex: 1;
  padding: 10px 8px;
  border: 0;
  background: transparent;
  color: #8a93a0;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.ex-side-tab.on {
  color: var(--teal);
  box-shadow: inset 0 -2px 0 var(--teal);
  background: #1a1f28;
}
.ex-side-pane {
  display: none;
  flex: 1;
  overflow: auto;
  padding: 10px 12px;
}
.ex-side-pane.on { display: block; }
.ex-sec {
  color: #6b7380;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .12em;
  padding: 10px 2px 6px;
}
.ex-card {
  background: #1e2430;
  border: 1px solid #2f3644;
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
}
.ex-list { list-style: none; margin: 0; padding: 0; }
.ex-list li {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 6px 4px; border-radius: 8px; font-size: 12px; color: #c8d0d8;
  cursor: default;
}
.ex-sen-lab {
  display: flex; gap: 8px; align-items: flex-start; cursor: pointer; width: 100%;
}
.ex-sen-lab input { margin-top: 3px; accent-color: var(--teal); }
.ex-list.ex-events li { cursor: pointer; }
.ex-list.ex-events li:hover { background: #232833; }
.ex-list li.dim { color: #6b7380; }
.ex-list .mark {
  width: 8px; height: 12px; border-radius: 2px; margin-top: 2px;
  background: #ff9f43; flex: 0 0 auto;
}
.ex-notes {
  width: 100%; background: #12161c; border: 1px solid #2f3644;
  border-radius: 8px; color: var(--text); padding: 8px; resize: vertical;
}
.ex-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.ex-transport {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid #2a303a; background: #1a1e26;
  flex: 0 0 auto;
}
.ex-transport .spacer { flex: 1; }
.ex-time {
  font-size: 15px; font-weight: 600; color: #e8ecef; letter-spacing: .02em;
}
.ex-sync-row {
  display: flex; align-items: center; gap: 10px;
  background: #12151a; border-bottom: 1px solid #2a303a;
  flex: 0 0 auto; min-width: 0;
}
.ex-sync-hud {
  flex: 1 1 auto; min-width: 0;
  padding: 4px 12px;
  font-size: 11px;
  line-height: 1.35;
  color: #3db8a8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ex-sync-help {
  flex: 0 0 auto;
  padding: 0 12px 0 0;
  font-size: 11px;
  font-weight: 600;
  color: var(--amber, #e8a54b);
  text-decoration: none;
}
.ex-sync-help:hover { color: #fff; }
.ex-sync-hud.warn { color: #e8a54b; }
.ex-sync-hud.bad { color: #e07a5f; }
.ex-sync-hud.ok { color: #3db8a8; }
.ex-lane-lab.sync-ok { box-shadow: inset 3px 0 0 #3db8a8; }
.ex-lane-lab.sync-warn { box-shadow: inset 3px 0 0 #e8a54b; }
.ex-lane-lab.sync-bad { box-shadow: inset 3px 0 0 #e07a5f; }
.ex-lane-lab.sync-unk { box-shadow: inset 3px 0 0 #5c635c; }
.ex-preview {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: #000;
  border-bottom: 1px solid #2a303a;
  flex: 0 0 auto;
  min-height: 160px;
  max-height: 280px;
  height: 32vh;
}
.ex-preview.off { display: none; }
.ex-preview.no-rgb .ex-cams { display: none; }
.ex-preview.no-depth .ex-depth-tile { display: none; }
.ex-cams {
  flex: 1;
  min-width: 0;
  display: flex;
  gap: 8px;
  overflow: hidden;
}
.ex-cam-tile, .ex-depth-tile {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #000;
  border: 1px solid #222;
}
.ex-cam-tile.off, .ex-depth-tile.off, .ex-lane.off { display: none; }
.ex-tile-head {
  flex: 0 0 auto;
  height: 22px;
  line-height: 22px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #000;
}
.ex-cam-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #000;
  display: grid;
  place-items: center;
}
.ex-cam-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.ex-hand-overlay {
  position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none;
}
.ex-depth-body {
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #000;
}
.ex-depth-body canvas,
.ex-depth-body img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  background: #000;
}
.ex-depth-body .ex-ph {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
}
.ex-rgb-empty {
  display: grid; place-items: center; width: 100%; color: #6b7380; font-size: 12px;
}
.ex-tracks {
  position: relative; flex: 1; overflow: auto;
  background: #12151a; min-height: 120px;
}
.ex-lane {
  display: grid; grid-template-columns: 72px 1fr;
  border-bottom: 1px solid #2a303a; min-height: 56px;
}
.ex-lane-lab {
  padding: 8px 6px; font-size: 11px; font-weight: 700; color: #8a93a0;
  border-right: 1px solid #2a303a; background: #171b22;
  display: flex; flex-direction: column; justify-content: center;
}
.ex-lane-lab .ex-unit { font-weight: 500; font-size: 9px; color: #5c635c; margin-top: 2px; }
.ex-lane-body { position: relative; min-height: 48px; overflow: hidden; }
.ex-lane-body canvas { display: block; width: 100%; }
.ex-valid { margin-top: 8px; font-size: 12px; line-height: 1.45; }
.ex-valid .ok { color: #3db8a8; }
.ex-valid .bad { color: #e07a5f; }
.ex-ph {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 11px; color: #6b7380; pointer-events: none;
}
.ex-playhead {
  position: absolute; top: 0; bottom: 0; width: 2px;
  background: #ff9f43; pointer-events: none; z-index: 5;
  box-shadow: 0 0 0 1px rgba(255,159,67,.25);
}
.ex-playhead::before {
  content: ""; position: absolute; top: 0; left: -5px;
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid #ff9f43;
}
.ex-overview {
  display: flex; align-items: center; gap: 10px;
  height: 40px; border-top: 1px solid #2a303a;
  background: #12151a; padding: 0 12px; flex: 0 0 auto;
}
.ex-ov-lab { font-size: 11px; color: #8a93a0; flex: 0 0 auto; }
.ex-ov-canvas-wrap { position: relative; flex: 1; min-width: 0; height: 36px; }
.ex-overview canvas { display: block; width: 100%; height: 36px; }
.ex-ov-win {
  position: absolute; top: 2px; height: 32px;
  border: 1.5px solid var(--teal); border-radius: 4px;
  background: rgba(61,184,168,.12); pointer-events: none;
  box-shadow: inset 2px 0 0 var(--teal), inset -2px 0 0 var(--teal);
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; grid-template-rows: 52px auto 1fr; grid-template-areas: "top" "side" "main"; }
  .app.side-collapsed { grid-template-rows: 52px 0 1fr; }
  .app.side-collapsed .app-side { display: none; }
  .app-side { display: flex; gap: 8px; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); align-items: stretch; }
  .nav-group {
    display: flex; flex-direction: row; flex-wrap: nowrap; gap: 2px;
    margin: 0; padding: 0 8px 0 0; border-bottom: 0;
    border-right: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  }
  .nav-group:last-child { border-right: 0; padding-right: 0; }
  .nav-label { display: none; }
  .nav-btn { width: auto; white-space: nowrap; }
  .grid-2, .grid-3, .grid-4,
  .cam-grid.lay-2,
  .cam-grid.lay-4,
  .cam-grid.lay-4m,
  .cam-grid.lay-6,
  .cam-grid.lay-6m,
  .cam-grid.lay-8,
  .cam-grid.lay-9 { grid-template: none; grid-auto-rows: minmax(120px, 1fr); grid-template-columns: 1fr; }
  .cam-grid.lay-4m .cam-tile:nth-child(1),
  .cam-grid.lay-6m .cam-tile:nth-child(1) { grid-row: auto; grid-column: auto; }
  .mon-telemetry { grid-template-columns: 1fr; flex: 0 0 auto; max-height: 28vh; overflow: auto; }
  .mon-bar-right { margin-left: 0; width: 100%; }
  .sync-stage, .sync-kpi, .sync-meta, .sync-cams { grid-template-columns: 1fr; }
  .ex-layout { grid-template-columns: 1fr; grid-template-rows: 160px 1fr; }
  .ex-sess-list { border-right: 0; border-bottom: 1px solid var(--line); max-height: 160px; }
  .ex-shell { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .ex-side { border-right: 0; border-bottom: 1px solid #2a303a; max-height: 200px; }
  .ex-preview { height: 22vh; max-height: 200px; }
  .ex-qc-stats { grid-template-columns: 1fr; }
}

/* 系统概览 · Three.js */
.ov3-page {
  flex: 1; min-height: 0; height: 100%;
  display: flex; flex-direction: column; gap: 6px; overflow: hidden;
}
.ov3-bar {
  flex: 0 0 auto;
  display: flex; flex-wrap: nowrap; align-items: center; justify-content: space-between; gap: 10px;
  min-height: 0;
}
.ov3-bar-title {
  display: flex; align-items: baseline; gap: 10px; min-width: 0; flex: 0 1 auto;
}
.ov3-bar h1 {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: .02em;
  white-space: nowrap; line-height: 1.2;
}
.ov3-bar-title > .muted {
  font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov3-bar-actions { flex: 0 0 auto; gap: 6px; }
.ov3-bar-actions .btn { height: 30px; padding: 0 10px; font-size: 12px; }
.ov3-stats {
  flex: 1 1 auto;
  display: flex; flex-wrap: nowrap; gap: 6px;
  justify-content: center; min-width: 0; overflow: hidden;
}
.ov3-kpi {
  min-width: 0; padding: 4px 10px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--elev);
  display: flex; flex-direction: row; align-items: baseline; gap: 6px;
}
.ov3-kpi b { font-size: 14px; font-family: var(--mono); line-height: 1.1; }
.ov3-kpi span { font-size: 10px; color: var(--muted); white-space: nowrap; }
.ov3-kpi.on b { color: #2dd4bf; }
.ov3-kpi.push b { color: #60a5fa; }
.ov3-kpi.rec b { color: #f97316; }
.ov3-kpi.off b { color: #94a3b8; }
.ov3-stage {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}
.ov3-canvas-wrap {
  position: relative; min-width: 0; min-height: 0; height: 100%;
  overflow: hidden;
}
.ov3-canvas {
  position: absolute; inset: 0;
  border: 1px solid var(--line); border-radius: 12px;
  background:
    radial-gradient(120% 80% at 50% 0%, color-mix(in srgb, var(--teal) 16%, transparent), transparent 55%),
    linear-gradient(180deg, #0c1216 0%, #081014 100%);
  overflow: hidden;
}
.ov3-canvas canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.ov3-canvas canvas:active { cursor: grabbing; }
.ov3-legend {
  border: 1px solid var(--line); border-radius: 10px; background: var(--elev);
  padding: 8px 10px; overflow: hidden;
}
.ov3-legend-float {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: min(168px, calc(100% - 20px));
  max-height: none;
  background: color-mix(in srgb, var(--elev) 92%, transparent);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}
.ov3-legend-float p.muted {
  font-size: 10px; line-height: 1.35; margin: 6px 0 0;
}
#ov3DetailModal.ego-modal {
  z-index: 4000;
}
.ov3-detail-modal {
  width: min(480px, 94vw);
  max-height: none;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.ov3-detail-modal-head {
  padding: 10px 12px;
  flex: 0 0 auto;
}
.ov3-detail-modal-title {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.ov3-detail-modal-title h3 {
  margin: 0; font-size: 14px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov3-detail-modal-title #ov3DetailSn { font-size: 11px; }
.ov3-detail-tabs {
  flex: 0 0 auto;
  display: flex; gap: 0; padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: var(--elev, #12151a);
}
.ov3-detail-tab {
  flex: 1; height: 34px; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 12px; font-weight: 600;
}
.ov3-detail-tab:hover { color: var(--text); }
.ov3-detail-tab.on {
  color: var(--teal, #3db8a8);
  border-bottom-color: var(--teal, #3db8a8);
}
.ov3-detail {
  min-height: 0;
  padding: 12px !important;
  border: none;
  background: transparent;
  overflow: hidden;
  flex: 1 1 auto;
}
.ov3-detail-pane {
  display: flex; flex-direction: column; gap: 10px;
  overflow: hidden;
}
.ov3-detail-head {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
}
.ov3-detail-head h3 { margin: 0; font-size: 15px; }
.ov3-detail-video {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  min-height: 0;
  border-radius: 10px; overflow: hidden; background: #05080a;
  border: 1px solid var(--line);
}
.ov3-detail-video img {
  width: 100%; aspect-ratio: 16/10; max-height: 140px; object-fit: cover; display: block; background: #05080a;
}
.ov3-detail-video .ov3-live-ph {
  grid-column: 1 / -1; min-height: 100px; max-height: 140px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; line-height: 1.45; font-size: 12px; color: var(--muted);
}
.ov3-detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px 8px;
}
.ov3-detail-grid > div {
  display: flex; flex-direction: column; gap: 2px;
  padding: 6px 8px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line);
}
.ov3-detail-grid span { font-size: 10px; color: var(--muted); }
.ov3-detail-grid b { font-size: 12px; font-weight: 600; word-break: break-all; }
.ov3-detail-tip {
  font-size: 12px; margin: 0; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ov3-detail-actions { margin-top: 0; }
.ov3-legend h3 { margin: 0 0 6px; font-size: 11px; }
.ov3-legend ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.ov3-legend li { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text); }
.ov3-dot {
  width: 8px; height: 8px; border-radius: 50%; display: inline-block;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
}
.ov3-dot.on { background: #2dd4bf; color: #2dd4bf; }
.ov3-dot.push { background: #60a5fa; color: #60a5fa; }
.ov3-dot.rec { background: #f97316; color: #f97316; }
.ov3-dot.off { background: #6b7280; color: #6b7280; }
.ov3-live {
  flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 10px; background: var(--elev);
  padding: 6px 8px 8px; overflow: hidden;
}
.ov3-live-h {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px;
}
.ov3-live-h h3 { margin: 0; font-size: 12px; }
.ov3-live-h .muted { font-size: 11px; }
.ov3-live-strip { overflow: hidden; }
.ov3-live-track {
  display: flex; gap: 8px; width: max-content;
  animation: ov3-marquee 36s linear infinite;
}
.ov3-live-strip:hover .ov3-live-track { animation-play-state: paused; }
@keyframes ov3-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.ov3-live-card {
  width: 148px; flex: 0 0 auto;
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden;
  background: var(--bg2);
}
.ov3-live-card.is-recording { border-color: color-mix(in srgb, #f97316 55%, var(--line)); }
.ov3-live-card.is-pushing { border-color: color-mix(in srgb, #60a5fa 55%, var(--line)); }
.ov3-live-card.is-online { border-color: color-mix(in srgb, #2dd4bf 40%, var(--line)); }
.ov3-live-media {
  aspect-ratio: 16/9; height: 72px; background: #05080a;
  display: flex; align-items: center; justify-content: center;
}
.ov3-live-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ov3-live-ph {
  font-size: 10px; color: var(--muted); letter-spacing: .04em; text-transform: uppercase;
}
.ov3-live-card footer {
  display: flex; flex-direction: column; gap: 0;
  padding: 4px 7px; border-top: 1px solid var(--line);
}
.ov3-live-card footer b { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ov3-live-card footer span { font-size: 9px; color: var(--muted); }
.ov3-live-empty {
  padding: 10px; text-align: center; color: var(--muted); font-size: 12px;
  border: 1px dashed var(--line); border-radius: 8px;
}
.ov3-fallback {
  padding: 40px; text-align: center; color: var(--muted);
}
@media (max-width: 1100px) {
  .ov3-bar { flex-wrap: wrap; gap: 6px; }
  .ov3-stats { order: 3; width: 100%; justify-content: flex-start; }
}
@media (max-width: 960px) {
  .ov3-stage { grid-template-columns: 1fr; }
}

/* 列表分页 */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.pager-info { font-size: 12px; }
.pager-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
}
.pager-jump {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted);
}
.pager-jump input {
  width: 64px; height: 32px; text-align: center;
}
.pager-controls select { height: 32px; width: auto; min-width: 72px; }
