@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; }
.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; grid-template-columns: 1fr 1fr;
  gap: 2px; background: #000;
}
.preview .arm-live.cols-1 { grid-template-columns: 1fr; }
.preview .arm-live img { width: 100%; height: 100%; object-fit: contain; background: #000; }
.preview .ov.bottom { top: auto; bottom: 10px; }
.preview .ov {
  position: absolute; left: 10px; top: 10px;
  font-family: var(--mono); font-size: 11px; color: var(--teal);
}
.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; }
.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);
}
.cam-grid { display: grid; gap: 8px; }
.cam-grid.cam-1 { grid-template-columns: 1fr; max-width: 960px; }
.cam-grid.cam-2 { grid-template-columns: 1fr 1fr; }
.cam-grid.cam-4 { grid-template-columns: 1fr 1fr; }
.cam-grid.cam-6 { grid-template-columns: repeat(3, 1fr); }
.cam-grid.cam-8 { grid-template-columns: repeat(4, 1fr); }
.cam-tile {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: #0c1016;
}
.cam-body {
  aspect-ratio: 16/10; display: grid; place-items: center;
  font-family: var(--mono); color: var(--faint); font-size: 13px;
  background: linear-gradient(160deg, #141a22, #0c1016);
}
.cam-body .arm-frame { width: 100%; height: 100%; object-fit: contain; background: #000; }
.cam-meta {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px;
  padding: 6px 8px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line);
}
.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; }

/* —— EgoCapture 风格多轨 Explore（离线解析） —— */
.ex-layout {
  display: grid;
  grid-template-columns: minmax(200px, 240px) 1fr;
  gap: 12px;
  align-items: start;
}
.ex-sess-list { max-height: 70vh; overflow: auto; }
.ex-sess-list tr.on { background: var(--teal-dim); }
.ex-workspace { min-width: 0; }
.ex-host {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: #12151a;
  min-height: 520px;
}
.ex-empty { min-height: 280px; display: grid; align-content: center; gap: 8px; }
.ex-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 520px;
  background: #15181e;
}
.ex-side {
  border-right: 1px solid #2a303a;
  background: #171b22;
  padding: 10px 12px;
  overflow: auto;
  max-height: 70vh;
}
.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: 8px 6px; border-radius: 8px; font-size: 12px; color: #c8d0d8;
  cursor: default;
}
.ex-list.ex-events li { cursor: pointer; }
.ex-list.ex-events li:hover { background: #232833; }
.ex-list li.dim { color: #6b7380; }
.ex-list .dot {
  width: 8px; height: 8px; border-radius: 50%; margin-top: 4px;
  background: var(--teal); flex: 0 0 auto;
}
.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; }
.ex-transport {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid #2a303a; background: #1a1e26;
}
.ex-transport .spacer { flex: 1; }
.ex-time {
  font-size: 15px; font-weight: 600; color: #e8ecef; letter-spacing: .02em;
}
.ex-tracks {
  position: relative; flex: 1; overflow: auto;
  background: #12151a;
}
.ex-lane {
  display: grid; grid-template-columns: 72px 1fr;
  border-bottom: 1px solid #2a303a; min-height: 64px;
}
.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: 56px; overflow: hidden; }
.ex-lane-body canvas { display: block; width: 100%; }
.ex-rgb-body {
  min-height: 140px; background: #0c1016;
  display: grid; place-items: center;
}
.ex-rgb-body video {
  width: 100%; max-height: 180px; object-fit: contain; background: #000;
}
.ex-rgb-empty { place-items: center; font-size: 12px; display: none; }
.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: 36px; 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 {
  position: relative; height: 40px; border-top: 1px solid #2a303a;
  background: #12151a;
}
.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.cam-2, .cam-grid.cam-4, .cam-grid.cam-6, .cam-grid.cam-8 { grid-template-columns: 1fr; }
  .cam-grid.cam-1 { max-width: none; }
  .sync-stage, .sync-kpi, .sync-meta, .sync-cams { grid-template-columns: 1fr; }
  .ex-layout { grid-template-columns: 1fr; }
  .ex-shell { grid-template-columns: 1fr; }
  .ex-side { max-height: none; border-right: 0; border-bottom: 1px solid #2a303a; }
}
