:root {
  color-scheme: light;
  --bg: #f2f5f9;
  --panel: #ffffff;
  --panel-2: #f7faff;
  --panel-3: #ffffff;
  --line: #d8e1ec;
  --line-soft: #e8edf4;
  --text: #1c2738;
  --muted: #65758b;
  --cyan: #0878e8;
  --cyan-soft: #e8f3ff;
  --green: #16a36a;
  --amber: #e89213;
  --red: #e5484d;
}

body {
  background: #f2f5f9;
  color: var(--text);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
}

.app-shell {
  max-width: none;
  padding: 0 12px 40px;
}

.app-bar {
  height: 52px;
  margin: 0 -12px 18px;
  padding: 0 26px;
  background: #0868d8;
  border-bottom: 1px solid #075bc2;
  box-shadow: 0 2px 8px #0755b833;
}

.brand {
  flex: 0 0 auto;
  gap: 12px;
  color: #ffffff;
}

.brand strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .03em;
  white-space: nowrap;
}

.brand > i {
  width: 1px;
  height: 23px;
  background: #ffffff80;
}

.brand h1 {
  color: #ffffff;
  font-size: 17px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
}

.top-navigation {
  align-self: stretch;
  display: flex;
  align-items: stretch;
  margin: 0 auto 0 28px;
}

.top-navigation a,
.top-navigation .top-nav {
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #eaf4ff;
  border: 0;
  background: transparent;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: background .16s;
}

.top-navigation a:hover,
.top-navigation a.active,
.top-navigation .top-nav:hover,
.top-navigation .top-nav.active {
  background: #0759bd;
  color: #ffffff;
}

.top-navigation a.active,
.top-navigation .top-nav.active {
  box-shadow: inset 0 -2px #ffffff;
}

.app-actions {
  color: #ffffff;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.top-tool,
.view-switch {
  border: 0;
  background: transparent;
  color: #ffffff;
}

.top-tool {
  width: 30px;
  height: 30px;
  padding: 6px;
  border-radius: 3px;
}

.top-tool svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.top-tool:hover,
.view-switch:hover {
  background: #ffffff18;
}

.top-separator {
  width: 1px;
  height: 16px;
  background: #ffffff70;
}

.view-switch {
  height: 30px;
  padding: 0 7px;
  border-radius: 3px;
  font-size: 12px;
}

.view-switch span {
  margin-left: 4px;
  color: #d9ebff;
}

.user-account {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 12px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #ffffff;
  color: #0868d8;
  font-size: 12px;
  font-weight: 750;
}

.panel {
  background: #ffffff;
  border-color: #dfe6ef;
  box-shadow: 0 2px 8px #1e3f6610;
}

.login input,
.mode-picker select,
.builder-inspector input,
.builder-inspector select,
.estimate-form input,
.estimate-form select {
  border-color: #cfd9e6;
  background: #ffffff;
  color: var(--text);
}

.login input:focus,
.mode-picker select:focus,
.builder-inspector input:focus,
.builder-inspector select:focus,
.estimate-form input:focus,
.estimate-form select:focus {
  border-color: #1682ee;
  outline: 2px solid #1682ee20;
}

.primary,
.production-run {
  border-color: #0871dd;
  background: #0878e8;
  color: #ffffff;
  box-shadow: 0 1px 2px #075dbb30;
}

.primary:hover,
.production-run:hover {
  background: #066bd2;
  filter: none;
}

.launchpad {
  border-color: #dbe5f0;
  background: #ffffff;
}

.production-primary {
  border: 1px solid #d9e6f3;
  background: #f6faff;
}

.production-copy small,
.eyebrow,
.estimator-heading small,
.workload-panel > summary small,
.diagnostics summary small {
  color: #0878e8;
}

.production-copy > span,
.production-copy p,
.mode-picker,
.muted {
  color: var(--muted);
}

.production-design {
  border-color: #b8cce2;
  background: #ffffff;
  color: #25628f;
}

.production-design:hover {
  border-color: #0878e8;
  color: #0878e8;
  background: #f2f8ff;
}

.board-panel {
  background: #ffffff;
}

.workbench-tabs {
  border-color: #dbe3ed;
  background: #f1f4f8;
}

.workbench-tab {
  color: #52647a;
}

.workbench-tab:hover {
  color: #0878e8;
}

.workbench-tab.active {
  border-color: #8fc3f6;
  background: #ffffff;
  color: #0878e8;
  box-shadow: 0 1px 4px #1766aa15;
}

.pipeline-builder,
.pipeline-estimator,
.graph-workbench {
  border-color: #dfe6ef;
  background: #ffffff;
}

.builder-toolbar,
.graph-header {
  border-color: #e4eaf1;
  background: #f8fafc;
}

.builder-toolbar p,
.estimator-heading p,
.graph-header p {
  color: var(--muted);
}

.data-binding-panel {
  border-bottom-color: #e4eaf1;
  background: #ffffff;
}

.data-binding-panel input,
.data-binding-panel select {
  border-color: #cdd9e6;
  background: #ffffff;
  color: #1c2738;
  box-shadow: 0 1px 2px #1f4f7a0a;
}

.data-binding-panel input:focus,
.data-binding-panel select:focus {
  border-color: #0878e8;
  outline: 2px solid #dcebfa;
  outline-offset: 0;
}

.data-binding-panel input::placeholder {
  color: #94a3b4;
}

.builder-toolbar-actions button,
.module-edit-actions button {
  border-color: #cdd9e6;
  background: #ffffff;
  color: #36536f;
}

.builder-toolbar-actions button:hover,
.module-edit-actions button:hover {
  border-color: #0878e8;
  color: #0878e8;
  background: #f2f8ff;
}

.builder-toolbar-actions .primary-action {
  border-color: #0878e8;
  background: #0878e8;
  color: #ffffff;
}

.builder-main {
  background: #ffffff;
}

.module-legend {
  color: #66788c;
}

.module-legend .fixed {
  border-color: #aebccc;
  background: repeating-linear-gradient(135deg, #e8edf3 0, #e8edf3 5px, #f8fafc 5px, #f8fafc 10px);
  color: #526274;
}

.builder-lane {
  border-color: #b8d3ee;
  background-color: #f8fbff;
  background-image: radial-gradient(#bdd3e8 1px, transparent 1px);
}

.builder-module {
  border-color: #75b7ed;
  background: #f4f9ff;
}

.builder-module.fixed {
  border-color: #aebccc;
  background-color: #f5f7fa;
  background-image: repeating-linear-gradient(135deg, #e8edf3aa 0, #e8edf3aa 6px, #f8fafccc 6px, #f8fafccc 13px);
}

.builder-module:hover,
.builder-module.selected {
  border-color: #0878e8;
  box-shadow: 0 0 0 2px #0878e820;
}

.builder-module-top,
.builder-module-foot,
.builder-module p {
  color: #6c7c8f;
}

.builder-module-top span,
.module-kind {
  color: #0878e8;
}

.builder-module.fixed .builder-module-top span,
.module-kind.fixed {
  color: #566779;
}

.builder-module-foot {
  border-color: #dce6f0;
}

.module-palette button {
  border-color: #77b9ee;
  background: #f5faff;
  color: #21466a;
}

.module-palette button:hover {
  border-color: #0878e8;
  background: #eaf5ff;
}

.module-palette button span {
  color: #0878e8;
}

.builder-inspector,
.estimator-inputs,
.stage-inspector {
  border-color: #e0e7ef;
  background: #fbfcfe;
}

.module-advanced,
.effect-preview {
  border-color: #e0e7ef;
}

.module-advanced > small,
.builder-inspector-head small,
.inspector-kicker {
  color: #0878e8;
}

.parameter-checks label,
.module-contract,
.inspector-message {
  border-color: #dce5ef;
  background: #ffffff;
}

.quality-review-shell {
  border-color: #dfe6ef;
  background: #ffffff;
  box-shadow: 0 2px 8px #1e3f660d;
}

.quality-review-heading {
  border-bottom-color: #e4eaf1;
  background: #f8fafc;
}

.quality-review-heading h3 {
  color: #1c2738;
}

.quality-review-heading p {
  color: #65758b;
}

.quality-review-heading button,
.quality-case-actions button {
  border-color: #c8d8e8;
  background: #ffffff;
  color: #36536f;
  box-shadow: 0 1px 2px #1f4f7a0a;
}

.quality-review-heading button:hover,
.quality-case-actions button:hover:not(:disabled) {
  border-color: #0878e8;
  background: #f2f8ff;
  color: #0878e8;
}

.quality-review-summary {
  border-bottom-color: #dfe6ef;
  background: #dfe6ef;
}

.quality-review-summary span {
  background: #f7faff;
}

.quality-review-summary small,
.quality-case-priority small,
.quality-case-title p,
.quality-case-samples,
.quality-case-metrics small {
  color: #65758b;
}

.quality-review-summary b,
.quality-case-metrics b,
.quality-case-title h4 {
  color: #1c2738;
}

.quality-review-queue {
  background: #f7f9fc;
}

.quality-review-empty {
  color: #65758b;
}

.quality-review-empty.error {
  color: #b72f2f;
}

.quality-case {
  border-color: #d7e1eb;
  background: #ffffff;
  box-shadow: 0 1px 4px #1e3f660d;
}

.quality-case:hover {
  border-color: #a9c9e8;
  box-shadow: 0 3px 10px #1e3f6614;
}

.quality-case.adjudication_required {
  border-color: #e3b75e;
  background: #fffdf7;
}

.quality-case-priority {
  background: #eaf4ff;
}

.quality-case-priority b,
.quality-case-title > span {
  color: #0878e8;
}

.quality-case-metrics b.danger {
  color: #c43c3c;
}

.quality-case-actions button.danger {
  border-color: #efb9b9;
  background: #fff8f8;
  color: #b72f2f;
}

.quality-case-actions button.danger:hover:not(:disabled) {
  border-color: #dd7777;
  background: #fff0f0;
  color: #a52323;
}

.quality-case-actions button:disabled {
  color: #9aa8b6;
  background: #f3f5f7;
}

.quality-case-actions small {
  color: #946400;
}

.parameter-checks span,
.module-contract b {
  color: var(--text);
}

.module-edit-actions .remove,
.stop-button {
  border-color: #efb4b6;
  background: #fff7f7;
  color: #d63f45;
}

.preview-image {
  border-color: #ccd9e7;
  background: #eef3f8;
}

.pipeline-canvas {
  background-color: #f8fbff;
  background-image: radial-gradient(#c8d9e9 1px, transparent 1px);
}

.augmentation-role {
  border-color: #b8d7f4;
  background: #f1f7fd;
}

.pipeline-map-group,
.pipeline-branch-group {
  border-color: #d7e3ee;
  background: #f7faff;
}

.pipeline-branch-lane {
  border-color: #d9e5ef;
  background: #ffffff;
}

.pipeline-map-card,
.pipeline-map-card.fixed {
  border-color: #b7c9da;
  background: #ffffff;
  background-image: none;
  color: #1c2738;
  box-shadow: 0 2px 7px #2949660c;
}

.pipeline-map-card:hover,
.pipeline-map-card:focus,
.pipeline-map-card.selected {
  border-color: #0878e8;
  background: #f4f9ff;
  box-shadow: 0 0 0 2px #0878e818, 0 8px 18px #29496614;
}

.pipeline-card-dependency {
  border-color: #e6edf4;
}

.run-status-overview {
  border-color: #bdd5ea;
  background: #f2f8ff;
}

.run-status-overview > div:last-child > span {
  border-color: #d2deea;
  background: #ffffff;
}

.run-status-lane {
  border-color: #d9e4ee;
  background: #f7faff;
}

.run-stage-card {
  border-color: #b9cbdc;
  background: #ffffff;
  color: #1c2738;
  box-shadow: 0 2px 7px #2949660c;
}

.run-stage-card:hover,
.run-stage-card:focus-visible,
.run-stage-card.selected {
  border-color: #0878e8;
  background: #f4f9ff;
  box-shadow: 0 0 0 2px #0878e818, 0 7px 16px #29496612;
}

.run-stage-card.running {
  background: #f4f9ff;
  box-shadow: inset 0 0 18px #0878e80b;
}

.run-stage-card.failed {
  background: #fff6f6;
}

.run-chip {
  border-color: #d4dee9;
  background: #ffffff;
  color: #607184;
}

.run-chip:hover,
.run-chip.active {
  border-color: #7bb7ee;
  background: #edf6ff;
  color: #165f9f;
}

.edit-stage-button {
  border-color: #8dc2f2;
  background: #edf6ff;
  color: #0878e8;
}

.estimate-total {
  border-color: #8ec4f3;
  background: linear-gradient(115deg, #edf7ff, #f8fbff);
}

.estimate-total strong {
  color: #0869cd;
}

.breakdown-row > div {
  background: #e3eaf2;
}

.breakdown-row i {
  background: #90a6bb;
}

.breakdown-row i.gpu {
  background: #1682ee;
  box-shadow: none;
}

.estimate-bottleneck {
  border-color: #d6e1ec;
  background: #f8fafc;
}

.health-panel,
.resource-panel,
.storage-panel,
.workload-panel {
  background: #ffffff;
}

.metric,
.node {
  border-color: #dfe6ee;
  background: #ffffff;
}

.metric span,
.node-facts,
.node button,
.resource-panel .muted {
  color: #66778a;
}

.tag {
  background: #edf3f8;
  color: #53687d;
}

.node button {
  border-color: #cfdbe7;
  background: #ffffff;
}

.node button:hover {
  border-color: #0878e8;
  color: #0878e8;
  background: #f3f8ff;
}

.storage-location {
  border-color: #dfe6ee;
  background: #f8fafc;
}

.resource-node {
  border-color: #dfe6ee;
  background: #f8fafc;
}

.resource-node .node-role,
.resource-node .node-capacity > span,
.resource-node .node-card-foot span,
.resource-node .node-card-foot b {
  color: #66778a;
}

.resource-node .node-facts,
.resource-node .node-card-foot {
  border-top-color: #dfe6ee;
}

.storage-empty {
  color: #66778a;
}

.workload-panel > summary {
  color: var(--text);
}

table {
  background: #ffffff;
}

th {
  color: #586b7f;
  background: #f7f9fc;
}

th,
td {
  border-color: #e6ebf1;
}

.job-name {
  color: #758598;
}

.notice {
  background: #edf7ff;
  color: #0872da;
  box-shadow: 0 8px 22px #24517b22;
}

.notice:not(:empty) {
  border-color: #9bcaf4;
}

.notice.bad {
  border-color: #efb1b4;
  background: #fff3f3;
  color: #d83e45;
}

@media (max-width: 620px) {
  .app-bar {
    padding: 0 14px;
  }

  .brand h1 {
    font-size: 16px;
  }
}

.main-view[hidden] {
  display: none !important;
}

.agent-scope[hidden],
.agent-sharing[hidden],
.agent-claim[hidden],
.agent-readonly[hidden],
.collaboration-messages[hidden],
.collaboration-composer[hidden] {
  display: none !important;
}

.collaboration-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  max-width: 1500px;
  margin: 0 auto;
}

.collaboration-sidebar,
.collaboration-main {
  padding: 20px;
}

.collaboration-sidebar {
  position: sticky;
  top: 16px;
}

.collaboration-status {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 11px 16px;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: 9px;
  background: #f8fafc;
}

.collaboration-status span {
  color: var(--muted);
  font-size: 12px;
}

.collaboration-status strong {
  color: #29445f;
  font-size: 12px;
  text-align: right;
}

.control-boundary {
  margin-top: 16px;
  padding: 14px;
  border-left: 3px solid #73afe7;
  background: #f3f8fe;
}

.control-boundary h3 {
  margin-bottom: 8px;
  font-size: 13px;
}

.control-boundary p {
  margin: 7px 0 0;
  color: #60758a;
  font-size: 11px;
  line-height: 1.65;
}

.collaboration-main {
  min-height: calc(100vh - 92px);
  display: flex;
  flex-direction: column;
}

.collaboration-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-soft);
}

.collaboration-heading p:last-child {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.secondary-button,
.message-actions button {
  border: 1px solid #c8d8e8;
  border-radius: 6px;
  background: #ffffff;
  color: #285c89;
  padding: 8px 12px;
}

.secondary-button:hover,
.message-actions button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  background: #f3f8ff;
}

.primary:disabled,
.secondary-button:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.collaboration-messages {
  flex: 1 1 320px;
  min-height: 320px;
  max-height: calc(100vh - 340px);
  overflow-y: auto;
  padding: 18px 4px 18px 0;
  scrollbar-color: #b6c9dc transparent;
}

.collaboration-empty {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.collaboration-empty strong {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
}

.message-card {
  margin-bottom: 14px;
  border: 1px solid #dce5ee;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.message-card.own-message { border-left: 3px solid #1682ee; }
.message-avatar { display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: #e8f3ff; color: #176bb7; font-size: 10px; font-weight: 800; }
.message-owner-mark { padding: 1px 6px; border-radius: 99px; background: #e8f3ff; color: #176bb7; font-size: 9px; font-weight: 700; }

.message-card.running,
.message-card.queued {
  border-color: #83bced;
  box-shadow: 0 0 0 2px #1682ee12;
}

.message-card.failed,
.message-card.rejected {
  border-color: #efb9bb;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-bottom: 1px solid #edf1f5;
  background: #fafbfd;
  color: var(--muted);
  font-size: 11px;
}

.message-meta b {
  color: #29445f;
  font-size: 12px;
}

.message-state {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 99px;
  background: #edf3f8;
  color: #556a7f;
}

.message-card.running .message-state,
.message-card.queued .message-state {
  background: #e7f3ff;
  color: #0871d9;
}

.message-card.complete .message-state {
  background: #e8f7f0;
  color: #14865a;
}

.message-card.failed .message-state,
.message-card.rejected .message-state {
  background: #fff0f0;
  color: #d84348;
}

.message-content,
.message-response {
  padding: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
}

.message-content {
  color: #26384c;
}

.message-response {
  border-top: 1px solid #e2eaf2;
  background: #f6faff;
  color: #23364a;
}

.message-response::before {
  content: "Codex 回复";
  display: block;
  margin-bottom: 8px;
  color: #0878e8;
  font-size: 10px;
  font-weight: 700;
}

.message-error {
  margin: 0 14px 14px;
  padding: 9px 11px;
  border-radius: 6px;
  background: #fff2f2;
  color: #ce3e44;
  font-size: 12px;
}

.message-activities {
  margin: 0 14px 14px;
  color: var(--muted);
  font-size: 11px;
}

.message-activities summary {
  cursor: pointer;
}

.message-activities ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.message-actions {
  display: flex;
  justify-content: flex-end;
  gap: 7px;
  padding: 0 14px 14px;
}

.message-actions .reject-message {
  border-color: #efb6b8;
  color: #cc3d43;
}

.collaboration-composer {
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

.collaboration-composer > label {
  display: block;
  margin-bottom: 7px;
  color: #425a72;
  font-size: 12px;
  font-weight: 700;
}

.collaboration-composer textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #cdd9e5;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text);
  padding: 11px 12px;
  font: inherit;
  line-height: 1.6;
}

.collaboration-composer textarea:focus {
  border-color: #1682ee;
  outline: 2px solid #1682ee20;
}

.collaboration-composer textarea:disabled {
  background: #f2f4f7;
  color: #8a97a5;
}

.composer-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 9px;
}

.composer-footer span {
  color: var(--muted);
  font-size: 11px;
}

.composer-guidance { display: grid; gap: 3px; }
.composer-guidance small { color: #8a99a8; font-size: 10px; }

.collaboration-login {
  display: grid;
  grid-template-columns: 72px minmax(220px, 1fr) minmax(300px, 420px);
  align-items: center;
  gap: 28px;
  width: min(860px, calc(100% - 32px));
  margin: 9vh auto;
  padding: 32px;
  border: 1px solid #d8e3ee;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 18px 50px #173c6217;
}

.collaboration-login[hidden] { display: none; }
.collaboration-login-mark { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 18px; background: #e8f3ff; color: #0878e8; font-size: 25px; font-weight: 800; }
.collaboration-login h2 { margin: 5px 0 8px; font-size: 22px; }
.collaboration-login > div:nth-child(2) > p:last-child { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.65; }
.collaboration-login form { display: grid; gap: 12px; }
.collaboration-login label { display: grid; gap: 5px; color: #425a70; font-size: 11px; font-weight: 650; }
.collaboration-login input { width: 100%; border: 1px solid #cdd9e5; border-radius: 8px; background: #ffffff; color: var(--text); padding: 10px 11px; }
.collaboration-login input:focus { border-color: #0878e8; outline: 2px solid #dcebfa; }
.collaboration-login form > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.collaboration-login form button { min-height: 40px; }
.collaboration-login .error { min-height: 16px; margin: -3px 0; font-size: 10px; }
.agent-logout { width: 100%; margin-top: 9px; }

.controller-state {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #cfe0ef;
  border-radius: 9px;
  background: #f7fbff;
}

.controller-state strong { color: #14805e; }
.controller-state strong.bad { color: #c43c3c; }
.controller-state span { color: var(--muted); font-size: 11px; }

.agent-list-title {
  margin: 20px 0 9px;
  color: #334d66;
  font-size: 13px;
}

.agent-slots { display: grid; gap: 8px; }

.agent-slot {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  grid-template-areas: "number title state" "number owner state";
  align-items: center;
  gap: 2px 9px;
  width: 100%;
  padding: 10px;
  border: 1px solid #d5e0ea;
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  text-align: left;
}

.agent-slot:hover, .agent-slot.selected { border-color: #1682ee; background: #f2f8ff; }
.agent-slot.mine i { background: #dff5ec; color: #14805e; }
.agent-slot.joined i { background: #e8f3ff; color: #176bb7; }
.agent-slot i { grid-area: number; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: #eaf3fd; color: #176bb7; font-style: normal; font-weight: 800; }
.agent-slot b { grid-area: title; font-size: 13px; }
.agent-slot span { grid-area: owner; color: var(--muted); font-size: 11px; }
.agent-slot em { grid-area: state; color: #14805e; font-size: 11px; font-style: normal; }
.agent-slot.occupied em { color: #9a6500; }
.agent-slot.allocating em { color: #176bb7; }
.agent-slot.allocation_failed em { color: #c43c3c; }
.agent-slot.management { border-color: #9fc9ef; background: #f4f9ff; }
.agent-slot.management i { border-radius: 9px; background: #dceeff; color: #0d6fc9; }
.management-access-note { margin: 0; padding: 10px 11px; border: 1px dashed #cedbe7; border-radius: 9px; color: var(--muted); font-size: 11px; }

.agent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.danger-button { border-color: #efb9b9 !important; color: #b72f2f !important; background: #fff8f8 !important; }
.agent-actions button:disabled { opacity: .58; cursor: not-allowed; }
.agent-actions button.action-busy { min-width: 96px; color: #176bb7 !important; border-color: #9fc9ef !important; background: #f2f8ff !important; }
.agent-actions button.action-busy::before { content: ""; display: inline-block; width: 11px; height: 11px; margin-right: 7px; border: 2px solid #9fc9ef; border-top-color: #176bb7; border-radius: 50%; vertical-align: -2px; animation: agent-action-spin .7s linear infinite; }
@keyframes agent-action-spin { to { transform: rotate(360deg); } }

.agent-action-status { display: flex; align-items: flex-start; gap: 9px; margin: 12px 0; padding: 10px 12px; border: 1px solid #cfe0ef; border-radius: 9px; background: #f7fbff; color: #425a72; font-size: 12px; line-height: 1.5; }
.agent-action-status::before { content: "i"; display: grid; flex: 0 0 18px; place-items: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: #dceeff; color: #176bb7; font-size: 11px; font-weight: 800; }
.agent-action-status.progress { border-color: #9fc9ef; background: #f2f8ff; color: #176bb7; }
.agent-action-status.progress::before { content: ""; width: 12px; height: 12px; border: 2px solid #9fc9ef; border-top-color: #176bb7; background: transparent; animation: agent-action-spin .7s linear infinite; }
.agent-action-status.bad { border-color: #efb9b9; background: #fff8f8; color: #a52d2d; }
.agent-action-status.bad::before { content: "!"; background: #ffe2e2; color: #b72f2f; }

.agent-scope {
  display: grid;
  gap: 8px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #cfe0ef;
  border-radius: 9px;
  background: #f7fbff;
}

.agent-scope div { display: grid; grid-template-columns: 100px 1fr; gap: 12px; }
.agent-scope span { color: var(--muted); font-size: 11px; }
.agent-scope strong, .agent-scope code { color: #314a63; font-size: 12px; white-space: normal; }


.agent-sharing {
  display: grid;
  gap: 14px;
  margin: 12px 0;
  padding: 16px;
  border: 1px solid #b9d7f2;
  border-radius: 10px;
  background: #f7fbff;
}
.agent-sharing h3 { margin: 0 0 4px; font-size: 14px; }
.agent-sharing p { margin: 0; color: var(--muted); font-size: 12px; }
.agent-sharing-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.agent-sharing-heading > div:last-child { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.agent-sharing-users { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.agent-sharing-users label { display: flex; align-items: center; gap: 9px; padding: 10px; border: 1px solid #d5e0ea; border-radius: 8px; background: #fff; cursor: pointer; }
.agent-sharing-users label.current-user { border-color: #b9ddcf; background: #f2fbf7; cursor: default; }
.agent-sharing-users input { width: 16px; height: 16px; }
.agent-sharing-users span { display: grid; gap: 2px; }
.agent-sharing-users b { color: #314a63; font-size: 12px; }
.agent-sharing-users small { color: var(--muted); font-size: 10px; }
.agent-sharing-actions { display: flex; justify-content: flex-end; gap: 8px; }

.agent-claim {
  display: grid;
  gap: 14px;
  max-width: 680px;
  margin: 44px auto;
  padding: 22px;
  border: 1px solid #d5e0ea;
  border-radius: 12px;
  background: #fbfdff;
}

.agent-claim h3 { margin: 0; }
.agent-claim label { display: grid; gap: 6px; color: #425a72; font-size: 12px; font-weight: 700; }
.agent-claim input, .agent-claim textarea { width: 100%; border: 1px solid #cdd9e5; border-radius: 8px; padding: 10px 12px; font: inherit; }
.agent-readonly { margin: 20px 0; padding: 18px; border-radius: 9px; background: #f4f6f8; color: #52677b; }
.agent-readonly p { margin: 6px 0 0; font-size: 12px; }

@media (max-width: 920px) {
  .collaboration-layout {
    grid-template-columns: 1fr;
  }

  .collaboration-sidebar {
    position: static;
  }

  .collaboration-main {
    min-height: 700px;
  }

  .collaboration-messages {
    max-height: none;
  }

}

@media (max-width: 1280px) {
  .top-navigation a {
    padding: 0 10px;
  }

  .top-navigation a:nth-last-child(-n + 3) {
    display: none;
  }
}

@media (max-width: 920px) {
  .top-navigation {
    display: none;
  }

  .app-actions {
    margin-left: auto;
  }

  .collaboration-login { grid-template-columns: 58px 1fr; }
  .collaboration-login-mark { width: 58px; height: 58px; border-radius: 14px; }
  .collaboration-login form { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  .agent-sharing-heading { flex-direction: column; }
  .agent-sharing-heading > div:last-child { justify-content: flex-start; }

  .brand strong,
  .brand > i,
  .view-switch,
  .app-actions .top-separator {
    display: none;
  }

  .user-account b {
    display: none;
  }

  .collaboration-login { grid-template-columns: 1fr; width: 100%; margin: 24px 0; padding: 22px; }
  .collaboration-login-mark { display: none; }
  .collaboration-login form { grid-column: auto; }
  .collaboration-login form > div { grid-template-columns: 1fr; }
}

/* 视觉层级：中性表面承载结构，品牌色只用于关键操作、选中态与焦点。 */
:root {
  --bg: #f2f6fb;
  --panel: #ffffff;
  --panel-2: #f7faff;
  --panel-3: #ffffff;
  --line: #cedae7;
  --line-soft: #e1e8f0;
  --text: #182534;
  --muted: #5f6f82;
  --cyan: #175cd3;
  --cyan-soft: #edf4ff;
  --green: #16875f;
  --amber: #a95b00;
  --red: #c4323b;
  --surface-canvas: #f2f6fb;
  --surface-panel: #ffffff;
  --surface-subtle: #f7faff;
  --surface-muted: #eef4fa;
  --border-subtle: #e1e8f0;
  --border-default: #cedae7;
  --border-strong: #a8b5c4;
  --border-control: #8493a6;
  --text-strong: #182534;
  --text-secondary: #4e5f73;
  --text-tertiary: #607084;
  --primary: #175cd3;
  --primary-hover: #124eaf;
  --primary-subtle: #edf4ff;
  --primary-border: #9dbcf0;
  --focus-ring: #175cd338;
  --success-subtle: #ecf8f3;
  --warning-subtle: #fff6e8;
  --danger-subtle: #fff1f2;
  --shadow-panel: 0 1px 2px #102a4312, 0 8px 24px #102a4308;
  --shadow-raised: 0 1px 3px #102a4314, 0 6px 16px #102a430a;
}

body {
  background: var(--surface-canvas);
  color: var(--text-strong);
}

.app-bar {
  background: #0868d8;
  border-bottom-color: #075bc2;
  box-shadow: 0 2px 8px #0755b833;
}

.top-navigation a,
.top-navigation .top-nav {
  color: #dce8f2;
}

.top-navigation a:hover,
.top-navigation a.active,
.top-navigation .top-nav:hover,
.top-navigation .top-nav.active {
  background: #0759bd;
  color: #ffffff;
}

.top-navigation a.active,
.top-navigation .top-nav.active {
  box-shadow: inset 0 -2px #8ec5ff;
}

.user-avatar {
  color: #0868d8;
}

.panel {
  border-color: var(--border-subtle);
  box-shadow: var(--shadow-panel);
}

.board-panel {
  border-color: var(--border-default);
  box-shadow: var(--shadow-panel);
}

.section-heading h2,
.data-binding-heading b,
.builder-toolbar h3,
.builder-estimate-heading h3,
.quality-review-heading h3 {
  color: var(--text-strong);
}

.eyebrow,
.workload-panel > summary small,
.diagnostics summary small {
  color: var(--text-tertiary);
  letter-spacing: .06em;
}

.workbench-tabs {
  border-color: var(--border-subtle);
  background: var(--surface-muted);
  box-shadow: inset 0 0 0 1px #ffffff80;
}

.workbench-tab {
  color: var(--text-secondary);
  font-weight: 650;
}

.workbench-tab:hover {
  color: var(--text-strong);
  background: #ffffff99;
}

.workbench-tab.active {
  border-color: var(--border-default);
  background: var(--surface-panel);
  color: var(--text-strong);
  box-shadow: 0 1px 3px #102a4314, inset 0 -2px var(--primary);
}

.pipeline-builder,
.pipeline-estimator,
.graph-workbench,
.quality-review-shell {
  border-color: var(--border-default);
  background: var(--surface-panel);
  box-shadow: none;
}

.data-binding-panel {
  border-bottom-color: var(--border-default);
  background: var(--surface-panel);
}

.data-binding-heading {
  border-bottom-color: var(--border-subtle);
  background: var(--surface-panel);
}

.data-binding-heading-copy {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
}

.data-binding-heading-copy > div {
  display: grid;
  gap: 0;
}

.data-binding-heading-copy > .builder-toolbar-step {
  color: var(--primary);
  font-size: 13px;
}

.data-binding-panel small {
  color: var(--text-tertiary);
}

.data-binding-heading-copy h3 {
  margin: 2px 0 5px;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.25;
}

.data-binding-heading-copy p {
  max-width: 620px;
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.6;
}

.data-binding-section {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.builder-layout .builder-inspector {
  position: sticky;
  top: 68px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  height: min(720px, calc(100vh - 88px));
  min-height: 560px;
  padding: 0;
  overflow: hidden;
}

.builder-inspector-head {
  min-height: 0;
  margin: 0;
  padding: 18px 18px 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.builder-inspector-membership {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 9px 18px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--surface-panel);
}

.builder-inspector-membership > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-secondary);
  font-size: 9px;
  font-weight: 700;
}

.builder-inspector-membership > span i {
  display: grid;
  place-items: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--success-subtle);
  color: var(--green);
  font-size: 10px;
  font-style: normal;
}

.builder-inspector-membership > small {
  color: var(--text-tertiary);
  font-size: 9px;
}

.builder-inspector-membership .remove {
  padding: 6px 9px;
  border: 1px solid color-mix(in srgb, var(--red) 38%, var(--border-default));
  border-radius: 7px;
  background: var(--surface-panel);
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
}

.builder-inspector-page {
  min-height: 0;
  padding: 16px 18px 20px;
  overflow: auto;
  scrollbar-color: var(--border-strong) transparent;
}

.builder-inspector-page > label:first-child {
  margin-top: 0;
}

.builder-inspector-pagination {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 9px 14px;
  border-top: 1px solid var(--border-default);
  background: var(--surface-panel);
}

.builder-inspector-pagination button {
  width: 38px;
  height: 34px;
  border: 1px solid var(--border-default);
  border-radius: 8px;
  background: var(--surface-panel);
  color: var(--primary);
  font-size: 16px;
}

.builder-inspector-pagination button:disabled {
  cursor: default;
  color: var(--border-strong);
  background: var(--surface-subtle);
}

.builder-inspector-pagination span {
  display: grid;
  gap: 1px;
  text-align: center;
}

.builder-inspector-pagination b {
  color: var(--text-strong);
  font-size: 10px;
}

.builder-inspector-pagination small {
  color: var(--text-tertiary);
  font-size: 8px;
}

.module-release-details {
  border: 1px solid var(--border-default);
  border-radius: 10px;
  overflow: hidden;
  background: var(--surface-panel);
}

.module-release-details > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.module-release-details > summary::-webkit-details-marker {
  display: none;
}

.module-release-details > summary::after {
  content: "⌄";
  grid-column: 2;
  color: var(--primary);
}

.module-release-details[open] > summary::after {
  content: "⌃";
}

.module-release-details > summary span {
  color: var(--text-strong);
  font-size: 10px;
  font-weight: 750;
}

.module-release-details > summary b {
  grid-column: 1;
  overflow-wrap: anywhere;
  color: var(--text-tertiary);
  font-size: 8px;
  font-weight: 600;
}

.module-release-details .module-release {
  margin: 0;
  border-top: 1px solid var(--border-subtle);
  border-radius: 0;
  background: var(--surface-subtle);
}

.data-binding-section-head {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.dataset-choice-card,
.delivery-target-card {
  border-color: var(--border-default);
  background: var(--surface-panel);
  box-shadow: 0 1px 2px #102a4308;
}

.dataset-choice-card:hover,
.dataset-choice-card:focus-visible,
.delivery-target-card:hover,
.delivery-target-card:focus-visible {
  border-color: var(--primary-border);
  box-shadow: var(--shadow-raised), 0 0 0 3px var(--focus-ring);
}

.dataset-choice-card.selected,
.delivery-target-card.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 1px var(--primary);
}

.dataset-choice-head > span,
.dataset-choice-source,
.dataset-format small,
.delivery-target-facts small,
.delivery-target-root small {
  color: var(--text-tertiary) !important;
}

.dataset-choice-head > b,
.delivery-target-head > small {
  color: var(--primary);
}

.dataset-facts > span {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.dataset-information-types > span {
  background: var(--surface-muted);
  color: var(--text-secondary) !important;
}

.delivery-route-summary {
  border-color: var(--primary-border);
  background: var(--primary-subtle);
}

.builder-toolbar,
.graph-header,
.quality-review-heading {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.data-binding-heading,
.builder-toolbar {
  min-height: 82px;
  padding: 18px 22px;
  background: var(--surface-panel);
}

.task-step-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.data-binding-heading > .task-step-heading,
.builder-toolbar .task-step-heading,
.builder-estimate .task-step-heading {
  gap: 12px;
}

.task-step-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--primary-subtle);
  color: var(--primary) !important;
  font-size: 13px !important;
  font-weight: 800;
  line-height: 1;
}

.task-step-heading > div {
  display: grid;
  gap: 0;
  min-width: 0;
}

.task-step-heading h3 {
  margin: 0 0 4px;
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.25;
}

.task-step-heading p {
  max-width: 620px;
  margin: 0;
  color: var(--text-tertiary);
  font-size: 11px;
  line-height: 1.6;
}

.builder-toolbar p,
.builder-estimate-heading p,
.graph-header p,
.quality-review-heading p {
  color: var(--text-tertiary);
}

.builder-toolbar-actions button,
.module-edit-actions button,
.quality-review-heading button,
.quality-case-actions button,
.node button {
  border-color: var(--border-default);
  background: var(--surface-panel);
  color: var(--text-secondary);
  box-shadow: 0 1px 2px #102a4308;
}

.login input,
.mode-picker select,
.builder-inspector input,
.builder-inspector select,
.estimate-form input,
.estimate-form select,
.data-binding-panel input,
.data-binding-panel select,
.agent-claim input,
.agent-claim textarea {
  border-color: var(--border-control);
}

.builder-toolbar-actions button:hover,
.module-edit-actions button:hover,
.quality-review-heading button:hover,
.quality-case-actions button:hover:not(:disabled),
.node button:hover {
  border-color: var(--primary-border);
  background: var(--primary-subtle);
  color: var(--primary);
}

.builder-main {
  background: var(--surface-panel);
}

.builder-lane,
.pipeline-canvas {
  border-color: var(--border-default);
  background-color: var(--surface-subtle);
  background-image: radial-gradient(#cbd4de 1px, transparent 1px);
}

.run-status-overview {
  border-color: var(--border-default);
  background: var(--surface-muted);
}

.pipeline-map-group,
.pipeline-branch-group,
.run-augmentation-group,
.run-status-lane {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.pipeline-augmentation-shared,
.pipeline-branch-lane {
  border-color: var(--border-subtle);
  background: var(--surface-panel);
}

.pipeline-map-group > header > span,
.pipeline-branch-group > header > span {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

.pipeline-map-card,
.pipeline-map-card.fixed,
.run-stage-card {
  border-color: var(--border-default);
  background: var(--surface-panel);
  color: var(--text-strong);
  box-shadow: 0 1px 2px #102a4308;
}

.pipeline-map-card,
.pipeline-map-card.fixed {
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 98px;
  padding: 11px;
}

.pipeline-card-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.pipeline-card-heading h3 {
  min-width: 0;
  margin: 1px 0 0;
  font-size: 12px;
}

.task-toggle-state {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 700;
  white-space: nowrap;
}

.task-toggle-state i {
  display: grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}

.task-toggle-state.enabled i {
  background: var(--success-subtle);
  color: var(--green);
}

.task-toggle-state.disabled i {
  background: var(--danger-subtle);
  color: var(--red);
}

.pipeline-card-summary {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.pipeline-card-predecessor {
  min-width: 0;
  overflow: hidden;
  color: var(--text-tertiary);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pipeline-card-resource {
  flex: none;
  color: var(--text-secondary);
  font-size: 8px;
  font-weight: 700;
}

.pipeline-map-card.task-disabled {
  border-style: dashed;
  background: color-mix(in srgb, var(--surface-subtle) 76%, #ffffff);
}

.pipeline-branch-lanes {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.pipeline-branch-lane {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.pipeline-branch-lane .pipeline-map-cards {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}


.pipeline-branch-lane.hand-only,
.pipeline-branch-lane.whole-robot {
  border-color: var(--border-default);
}

.pipeline-branch-lane.hand-only h4,
.pipeline-branch-lane.whole-robot h4 {
  color: var(--text-strong);
}

.pipeline-branch-lane > div:first-child > span {
  color: var(--primary);
}

.pipeline-map-card.branch-hand_only,
.pipeline-map-card.branch-whole_robot {
  border-top-color: var(--border-default);
}

.pipeline-map-card:hover,
.pipeline-map-card:focus,
.pipeline-map-card.selected,
.run-stage-card:hover,
.run-stage-card:focus-visible,
.run-stage-card.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 2px var(--focus-ring), var(--shadow-raised);
}

.builder-inspector,
.estimator-inputs,
.stage-inspector {
  border-color: var(--border-default);
  background: var(--surface-subtle);
}

.parameter-checks label,
.module-contract,
.inspector-message,
.builder-estimate-facts > span,
.estimate-bottleneck {
  border-color: var(--border-subtle);
  background: var(--surface-panel);
}

.builder-estimate {
  border-top-color: var(--border-default);
  background: var(--surface-subtle);
}

.builder-estimate > summary,
.builder-estimate[open] > summary {
  border-color: var(--border-subtle);
  background: var(--surface-panel);
}

.builder-estimate-total strong {
  color: var(--primary);
}

.builder-launch {
  border-top-color: var(--border-default);
  background: var(--surface-panel);
}

.builder-run-mode button {
  border-color: var(--border-default);
  background: var(--surface-subtle);
}

.builder-run-mode button.active {
  border-color: var(--primary);
  background: var(--primary-subtle);
  box-shadow: 0 0 0 2px var(--focus-ring);
}

.builder-launch .primary-action,
.builder-toolbar-actions .primary-action,
.primary,
.production-run {
  border-color: var(--primary);
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 2px #124eaf33;
}

.builder-launch .primary-action:hover,
.builder-toolbar-actions .primary-action:hover,
.primary:hover,
.production-run:hover {
  border-color: var(--primary-hover);
  background: var(--primary-hover);
  color: #ffffff;
}

.quality-review-summary {
  border-bottom-color: var(--border-subtle);
  background: var(--border-subtle);
}

.quality-review-summary span,
.quality-review-queue {
  background: var(--surface-subtle);
}

.quality-case {
  border-color: var(--border-default);
  background: var(--surface-panel);
  box-shadow: 0 1px 2px #102a4308;
}

.quality-case:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-raised);
}

.quality-case-priority {
  background: var(--surface-muted);
}

.quality-case.adjudication_required {
  border-color: #e4ae57;
  background: var(--warning-subtle);
}

.run-stage-card.running {
  background: var(--primary-subtle);
}

.run-stage-card.failed {
  background: var(--danger-subtle);
}

.run-chip {
  border-color: var(--border-default);
  background: var(--surface-panel);
  color: var(--text-secondary);
}

.run-chip:hover,
.run-chip.active {
  border-color: var(--primary-border);
  background: var(--primary-subtle);
  color: var(--primary);
}

.health-panel,
.resource-panel,
.storage-panel,
.workload-panel,
.metric,
.node {
  background: var(--surface-panel);
}

.metric,
.node,
.storage-location,
.resource-node {
  border-color: var(--border-subtle);
}

.metric {
  background: var(--surface-subtle);
}

.tag {
  background: var(--surface-muted);
  color: var(--text-secondary);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

@media (max-width: 720px) {
  .pipeline-branch-lanes {
    grid-template-columns: 1fr;
  }

  .pipeline-branch-lane {
    grid-template-columns: 1fr;
  }

  .pipeline-branch-lane .pipeline-map-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1100px) {
  .builder-layout .builder-inspector {
    position: static;
    top: auto;
    height: min(680px, calc(100vh - 32px));
  }
}

.resource-disclosure {
  border-color: var(--border-default);
  background: var(--surface-panel);
}

.resource-disclosure-summary {
  color: var(--text-secondary);
  background: var(--surface-panel);
}

.resource-disclosure-summary:hover {
  background: var(--surface-subtle);
}

.resource-disclosure[open] > .resource-disclosure-summary {
  background: var(--primary-subtle);
}

.resource-disclosure-title small,
.resource-disclosure-state,
.resource-disclosure-facts {
  color: var(--text-secondary);
}

.resource-disclosure-title b,
.resource-disclosure-facts b {
  color: var(--text-strong);
}

.resource-disclosure-body {
  border-top-color: var(--border-subtle);
  background: var(--surface-panel);
}

/* 运行状态只通过状态点、进度条和步骤卡片左边线表达。 */
.run-status-overview,
.run-augmentation-group,
.run-status-lane {
  border-color: var(--border-default);
  background: var(--surface-panel);
}

.run-overall-progress em,
.run-lane-heading p,
.run-lane-progress > span,
.run-lane-progress > span em,
.run-stage-work em,
.run-stage-resource,
.run-stage-node {
  color: var(--text-secondary);
}

.run-status-overview .run-overall-progress b,
.run-lane-progress b {
  color: var(--text-strong);
}

.run-overall-progress > div,
.run-lane-progress > div {
  background: var(--surface-muted);
}

.run-overall-progress > div i {
  background: var(--text-secondary);
}

.run-status-overview > div:last-child > span,
.run-status-overview > div:last-child > span.running,
.run-status-overview > div:last-child > span.failed {
  border-color: var(--border-subtle);
  background: var(--surface-panel);
  color: var(--text-secondary);
}

.run-status-overview .complete::before {
  background: var(--green);
}

.run-status-overview .running::before {
  background: var(--primary);
}

.run-status-overview .failed::before {
  background: var(--red);
}

.run-status-overview .planned::before {
  background: var(--border-strong);
}

.run-status-lane {
  --run-state: var(--border-strong);
}

.run-status-lane.state-complete {
  --run-state: var(--green);
}

.run-status-lane.state-running {
  --run-state: var(--primary);
}

.run-status-lane.state-failed {
  --run-state: var(--red);
}

.run-status-lane > header {
  border-right: 1px solid var(--border-subtle);
  background: var(--surface-subtle);
}

.run-lane-heading > i,
.run-lane-progress > div i {
  background: var(--run-state);
}

.run-stage-card,
.run-stage-card.running,
.run-stage-card.failed {
  border-color: var(--border-default);
  border-left-color: var(--border-strong);
  background: var(--surface-panel);
  box-shadow: 0 1px 2px #102a4308;
}

.run-stage-card.complete {
  border-left-color: var(--green);
}

.run-stage-card.running {
  border-left-color: var(--primary);
}

.run-stage-card.failed {
  border-left-color: var(--red);
}

.run-stage-work > div {
  background: var(--surface-muted);
}

.run-stage-work > div i {
  background: var(--border-strong);
}

.run-stage-card.complete .run-stage-work > div i {
  background: var(--green);
}

.run-stage-card.running .run-stage-work > div i {
  background: var(--primary);
}

.run-stage-card.failed .run-stage-work > div i {
  background: var(--red);
}

.run-stage-bottleneck {
  border-top-color: var(--border-subtle);
  color: var(--text-secondary);
  font-weight: 650;
}

.run-stage-card.failed .run-stage-bottleneck {
  color: var(--red);
}

.inspector-work-progress {
  border-color: var(--border-subtle);
  background: var(--surface-subtle);
}

.inspector-work-progress em,
.inspector-bottleneck span {
  color: var(--text-secondary);
}

.inspector-work-progress > div {
  background: var(--surface-muted);
}

.inspector-work-progress > div i {
  background: var(--primary);
}

.inspector-bottleneck {
  border-color: var(--border-default);
  background: var(--surface-subtle);
}

.run-stage-card:hover,
.run-stage-card:focus-visible,
.run-stage-card.selected {
  border-color: var(--border-strong);
  background: var(--surface-panel);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text-secondary) 14%, transparent), var(--shadow-raised);
}
