/* SPEC: PJ2026-010405 云端控制台，MDTODO hwlab-web-product-experience/R2。 */
/* Responsibility: 统一非 Workbench 页面的工业运营台壳层、密度、状态和响应式视觉。 */

:root {
  --console-canvas: #dfe5e2;
  --console-surface: #f5f6f2;
  --console-surface-raised: #fbfcf8;
  --console-surface-muted: #edf0ec;
  --console-border: #bcc7c4;
  --console-border-strong: #8fa09c;
  --console-shadow-sm: 0 1px 0 rgb(255 255 255 / 65%), 0 1px 3px rgb(8 20 22 / 9%);
  --console-shadow-md: 0 18px 48px rgb(8 20 22 / 22%);
  --console-sidebar-width: 256px;
  --console-sidebar-collapsed-width: 68px;
  --console-topbar-height: 46px;
}

.platform-shell {
  grid-template-columns: var(--console-sidebar-width) minmax(0, 1fr);
  background: transparent;
}

.platform-shell.is-sidebar-collapsed {
  grid-template-columns: var(--console-sidebar-collapsed-width) minmax(0, 1fr);
}

.platform-sidebar {
  gap: 14px;
  border-right-color: #263538;
  background:
    linear-gradient(180deg, rgb(255 255 255 / 4%), transparent 120px),
    #10191c;
  padding: 14px 10px;
  color: #dce7e4;
  box-shadow: 8px 0 28px rgb(8 20 22 / 12%);
}

.brand-lockup {
  min-height: 42px;
  border-bottom: 1px solid #2b3b3e;
  padding: 0 6px 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 1px solid #37565a;
  border-radius: 5px;
  background: #18272a;
  color: #59d0d0;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 3%);
}

.brand-lockup strong {
  color: #f3f8f6;
  font-family: var(--console-font-mono);
  font-size: 13px;
  letter-spacing: 0;
}

.brand-lockup small {
  color: #819492;
  font-family: var(--console-font-mono);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-groups {
  gap: 10px;
}

.nav-section {
  gap: 2px;
}

.nav-section h2 {
  margin: 7px 8px 4px;
  color: #718582;
  font-family: var(--console-font-mono);
  font-size: 9px;
  letter-spacing: 0;
}

.nav-item {
  position: relative;
  min-height: 34px;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 5px 8px;
  color: #b7c6c3;
  font-size: 12px;
}

.nav-item::before {
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: -10px;
  width: 2px;
  background: transparent;
  content: "";
}

.nav-item:hover {
  border-color: #2f4346;
  background: #172427;
  color: #f0f6f4;
}

.nav-icon {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 3px;
  background: transparent;
  color: #809793;
}

.nav-item[data-active="true"] {
  border-color: #31565a;
  background: #173135;
  color: #eaf8f6;
  box-shadow: inset 0 0 0 1px rgb(70 204 204 / 4%);
}

.nav-item[data-active="true"]::before {
  background: #43c7c7;
}

.nav-item[data-active="true"] .nav-icon {
  background: transparent;
  color: #54d2d0;
}

.platform-main {
  grid-template-rows: var(--console-topbar-height) minmax(0, 1fr);
}

.platform-topbar {
  gap: 8px;
  border-bottom-color: var(--console-border-strong);
  background: rgb(245 247 244 / 94%);
  padding: 0 14px;
  backdrop-filter: blur(12px);
}

.platform-topbar .icon-button,
.platform-topbar .btn {
  min-height: 30px;
  height: 30px;
  border-radius: 4px;
}

.topbar-status {
  gap: 8px;
  font-family: var(--console-font-mono);
}

.topbar-status::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--console-green-700);
  box-shadow: 0 0 0 3px var(--console-green-100);
  content: "";
}

.topbar-status span {
  color: var(--console-graphite-600);
  font-size: 9px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.topbar-status strong {
  overflow: hidden;
  color: var(--console-graphite-800);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.platform-content {
  background:
    linear-gradient(rgb(17 25 28 / 3%) 1px, transparent 1px),
    linear-gradient(90deg, rgb(17 25 28 / 3%) 1px, transparent 1px),
    var(--console-canvas);
  background-size: 24px 24px;
  padding: 14px clamp(12px, 1.5vw, 24px) 24px;
  scrollbar-gutter: stable;
}

.route-stack,
.hwpod-console {
  gap: 12px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-bar {
  position: relative;
  min-height: 76px;
  align-items: center;
  border: 1px solid var(--console-border);
  border-radius: 6px;
  background:
    linear-gradient(90deg, rgb(0 131 138 / 6%), transparent 34%),
    var(--console-surface-raised);
  padding: 12px 14px 12px 18px;
  box-shadow: var(--console-shadow-sm);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-bar::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 4px;
  border-radius: 5px 0 0 5px;
  background: var(--console-cyan-600);
  content: "";
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-bar[data-sticky="true"] {
  top: 8px;
  border-bottom: 1px solid var(--console-border);
  background: rgb(251 252 248 / 96%);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-copy {
  gap: 2px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-eyebrow {
  color: var(--console-cyan-700);
  font-size: 9px;
  letter-spacing: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-title {
  font-size: 24px;
  font-weight: 720;
  letter-spacing: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-description {
  color: var(--console-graphite-600);
  font-size: 12px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-strip {
  gap: 0;
  border-radius: 5px;
  background: var(--console-surface-raised);
  box-shadow: var(--console-shadow-sm);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item {
  position: relative;
  min-width: 132px;
  min-height: 46px;
  border-right: 1px solid var(--console-border);
  background: transparent;
  padding: 7px 10px 7px 15px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item:last-child {
  border-right: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 7px;
  width: 2px;
  height: auto;
  border-radius: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item dt {
  font-size: 9px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item dd {
  font-family: var(--console-font-mono);
  font-size: 12px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .data-panel,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-page-layout,
:where(.route-stack, .hwpod-console, .mdtodo-page) .console-section-frame,
:where(.route-stack, .hwpod-console, .mdtodo-page) .operations-workspace,
:where(.route-stack, .hwpod-console, .mdtodo-page) .bounded-workspace,
:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-index,
:where(.route-stack, .hwpod-console, .mdtodo-page) .operations-inspector-panel,
:where(.route-stack, .hwpod-console, .mdtodo-page) .metric-card,
:where(.route-stack, .hwpod-console, .mdtodo-page) .empty-state {
  border-color: var(--console-border);
  border-radius: 6px;
  background: var(--console-surface-raised);
  box-shadow: var(--console-shadow-sm);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .data-panel,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-page-layout,
:where(.route-stack, .hwpod-console, .mdtodo-page) .admin-crud-panel {
  padding: 12px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .panel-header,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-page-header,
:where(.route-stack, .hwpod-console, .mdtodo-page) .operations-inspector-header,
:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-index-toolbar {
  border-bottom-color: var(--console-border);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .panel-header h2,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-page-header h2,
:where(.route-stack, .hwpod-console, .mdtodo-page) .operations-inspector-header h2 {
  color: var(--console-graphite-900);
  font-size: 13px;
  font-weight: 760;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .segmented-control,
:where(.route-stack, .hwpod-console, .mdtodo-page) .view-mode-switch,
:where(.route-stack, .hwpod-console, .mdtodo-page) .console-tabs {
  border-radius: 4px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .btn,
:where(.route-stack, .hwpod-console, .mdtodo-page) .icon-button,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-action,
:where(.route-stack, .hwpod-console, .mdtodo-page) .segmented-control button,
:where(.route-stack, .hwpod-console, .mdtodo-page) .view-mode-switch button,
:where(.route-stack, .hwpod-console, .mdtodo-page) .console-tabs button {
  border: 1px solid var(--console-border-strong);
  border-radius: 4px;
  background: var(--console-surface-raised);
  color: var(--console-graphite-700);
  font-family: var(--console-font-mono);
  font-size: 10px;
  letter-spacing: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .btn-primary,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-action.primary {
  border-color: #006b70;
  background: #007b80;
  color: #fff;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .btn-primary:hover,
:where(.route-stack, .hwpod-console, .mdtodo-page) .table-action.primary:hover:not(:disabled) {
  background: #00666b;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) :is(
  .input,
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea
) {
  border-color: var(--console-border-strong);
  border-radius: 4px;
  background: #fff;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) :is(
  .input:focus,
  input:focus,
  select:focus,
  textarea:focus,
  button:focus-visible,
  [tabindex]:focus-visible
) {
  outline: 2px solid color-mix(in srgb, var(--console-focus) 55%, transparent);
  outline-offset: 2px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid-wrap,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table-wrap {
  border-color: var(--console-border);
  border-radius: 4px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table {
  font-size: 11px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid thead,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table thead {
  background: #e5eae7;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid th,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table th {
  color: var(--console-graphite-700);
  font-family: var(--console-font-mono);
  font-size: 9px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid td,
:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid th,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table td,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table th {
  border-color: #d5dcda;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid tbody tr:nth-child(even),
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table tbody tr:nth-child(even) {
  background: #f5f7f4;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .console-data-grid tbody tr:hover,
:where(.route-stack, .hwpod-console, .mdtodo-page) .data-table tbody tr:hover {
  background: var(--console-cyan-100);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .resource-collection-items[data-view="cards"] {
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-card-heading {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  gap: 9px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-card-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #80aaa7;
  border-radius: 4px;
  background: #dcecea;
  color: #146866;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-card-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 5px 10px;
  color: var(--console-graphite-600);
  font-family: var(--console-font-mono);
  font-size: 9px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .industrial-fact-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .industrial-fact-row div {
  min-width: 0;
  border-top: 1px solid #dce3e1;
  padding-top: 7px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .industrial-fact-row dt {
  color: var(--console-graphite-600);
  font-family: var(--console-font-mono);
  font-size: 9px;
  text-transform: uppercase;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .industrial-fact-row dd {
  overflow: hidden;
  margin: 3px 0 0;
  text-overflow: ellipsis;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .industrial-card-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .resource-collection-virtual {
  border: 1px solid var(--console-border);
  border-radius: 4px;
  background: var(--console-surface-raised);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .resource-collection-item--virtual {
  height: 100%;
  border-bottom: 1px solid #d8dfdd;
  padding: 4px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .resource-collection-item--virtual .entity-card {
  height: 100%;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 6px 9px;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-card,
:where(.route-stack, .hwpod-console, .mdtodo-page) .pcb-card,
:where(.route-stack, .hwpod-console, .mdtodo-page) .node-card {
  border-color: var(--console-border);
  border-radius: 5px;
  background:
    linear-gradient(135deg, rgb(0 131 138 / 5%), transparent 46%),
    var(--console-surface-raised);
  box-shadow: var(--console-shadow-sm);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .entity-card[data-interactive="true"]:hover {
  border-color: var(--console-cyan-600);
  box-shadow: 0 8px 22px rgb(11 31 33 / 11%);
  transform: translateY(-1px);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .empty-state-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid #6faaa7;
  border-radius: 5px;
  background: #d9eeeb;
  color: #126764;
  font-size: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .status-pill,
:where(.route-stack, .hwpod-console, .mdtodo-page) .status-badge,
:where(.route-stack, .hwpod-console, .mdtodo-page) .pm-status,
:where(.route-stack, .hwpod-console, .mdtodo-page) .task-state,
:where(.route-stack, .hwpod-console, .mdtodo-page) .stage-status {
  border-radius: 3px;
  font-family: var(--console-font-mono);
  font-size: 9px;
  letter-spacing: 0;
}

:where(.route-stack, .hwpod-console, .mdtodo-page) :is(
  .mini-log,
  .json-panel,
  .content-viewer pre,
  .source-output,
  .report-markdown
) {
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  border-color: #c4cfcc;
  border-radius: 4px;
  background: #f7f9f8;
  color: #243532;
  font-family: var(--console-font-mono);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .hwpod-workspace {
  min-height: min(72vh, 760px);
}

:where(.route-stack, .hwpod-console, .mdtodo-page) .pcb-trace,
:where(.route-stack, .hwpod-console, .mdtodo-page) .pcb-grid-line {
  color: var(--console-cyan-600);
}

@media (max-width: 1100px) {
  :root {
    --console-sidebar-width: 224px;
  }

  .platform-content {
    padding: 10px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-bar {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-actions {
    justify-content: flex-start;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .platform-shell,
  .platform-shell.is-sidebar-collapsed {
    grid-template-columns: minmax(0, 1fr);
  }

  .platform-sidebar,
  .desktop-sidebar-toggle {
    display: none;
  }

  .platform-topbar {
    padding: 0 8px;
  }

  .platform-content {
    padding: 8px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-bar {
    min-height: 0;
    padding: 10px 10px 10px 15px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-title {
    font-size: 19px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-description {
    font-size: 11px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item {
    min-width: 118px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .overview-grid,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .field-grid,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .resource-collection-items[data-view="cards"] {
    grid-template-columns: minmax(0, 1fr);
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .hwpod-workspace {
    min-height: 0;
  }
}

@media (max-width: 430px) {
  .topbar-status span,
  .topbar-actions .btn span {
    display: none;
  }

  .topbar-actions .btn {
    padding: 0 8px;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-actions,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-filters,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .table-page-actions,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .table-actions-inline {
    align-items: stretch;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-actions > *,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .page-command-filters > * {
    max-width: 100%;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-strip {
    scroll-snap-type: x proximity;
  }

  :where(.route-stack, .hwpod-console, .mdtodo-page) .console-status-item {
    flex-basis: 136px;
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  :where(.route-stack, .hwpod-console, .mdtodo-page) .entity-card,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .pcb-card,
  :where(.route-stack, .hwpod-console, .mdtodo-page) .node-card {
    transform: none !important;
  }
}
