/* SPEC: PJ2026-010405 云端控制台. */
/* Responsibility: 应用壳、认证入口和 Workbench 共享诊断表面。 */
.platform-shell {
  display: grid;
  height: 100dvh;
  min-height: 100vh;
  grid-template-columns: 248px minmax(0, 1fr);
  overflow: hidden;
  background: #eef3f8;
}

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

.platform-sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  min-height: 0;
  flex-direction: column;
  gap: 20px;
  border-right: 1px solid #d8e1eb;
  background: #f8fafc;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px 14px;
  scrollbar-width: none;
}

.platform-sidebar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.platform-sidebar[data-collapsed="true"] {
  width: auto;
  align-items: center;
  overflow-x: hidden;
  padding-right: 8px;
  padding-left: 8px;
}

.platform-main {
  display: grid;
  min-width: 0;
  min-height: 0;
  grid-template-rows: 44px minmax(0, 1fr);
}

.platform-topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #d8e1eb;
  background: rgba(248, 250, 252, 0.92);
  padding: 0 12px;
}

.platform-content {
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px;
}

.platform-content.is-bounded-layout {
  overflow: hidden;
}

.platform-content.is-bounded-layout > * {
  height: 100%;
  overflow: hidden;
}

.platform-content > * {
  min-height: 0;
}

.brand-lockup {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.brand-lockup.centered {
  justify-content: center;
}

.brand-mark {
  display: inline-flex;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: #111827;
  color: #67e8f9;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  font-weight: 850;
}

.brand-lockup strong,
.brand-lockup small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-lockup small,
.topbar-status span {
  color: #64748b;
  font-size: 12px;
}

.nav-groups,
.nav-section,
.route-stack,
.workbench-route {
  display: grid;
  gap: 16px;
}

.route-stack {
  align-content: start;
  overflow: visible;
}

.workbench-route {
  height: 100%;
  min-height: 0;
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
}

.nav-section h2 {
  margin: 0 0 4px;
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  padding: 9px 10px;
  color: #334155;
  text-align: left;
}

.nav-icon {
  display: inline-flex;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  background: #e2e8f0;
  color: #334155;
  font-size: 12px;
  font-weight: 850;
}

.nav-item[data-active="true"] .nav-icon {
  background: #bae6fd;
  color: #075985;
}

.platform-sidebar[data-collapsed="true"] .brand-lockup div,
.platform-sidebar[data-collapsed="true"] .nav-section h2,
.platform-sidebar[data-collapsed="true"] .nav-label {
  display: none;
}

.platform-sidebar[data-collapsed="true"] .nav-item {
  justify-content: center;
  padding: 9px;
}

.nav-item[data-active="true"] {
  background: #e0f2fe;
  color: #0c4a6e;
  font-weight: 750;
}

.nav-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #94a3b8;
}

.nav-item[data-active="true"] .nav-dot {
  background: #0891b2;
}

.topbar-status {
  display: flex;
  min-width: 0;
  flex: 1;
  align-items: center;
  gap: 10px;
}

.topbar-actions {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.topbar-progress {
  display: inline-flex;
  width: 18px;
  height: 18px;
  align-items: center;
  justify-content: center;
}

.topbar-progress span {
  width: 14px;
  height: 14px;
  border: 2px solid #bae6fd;
  border-top-color: #0e7490;
  border-radius: 999px;
  animation: workbench-spin 0.8s linear infinite;
}

@keyframes workbench-spin {
  to { transform: rotate(360deg); }
}

.auth-main,
.login-shell {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: #eef3f8;
  padding: 20px;
}

.login-card {
  display: grid;
  width: min(420px, 100%);
  gap: 14px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: white;
  padding: 22px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

.register-card {
  width: min(520px, 100%);
}

.auth-link {
  color: #0e7490;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.login-card label,
.settings-grid label {
  display: grid;
  gap: 6px;
  color: #475569;
  font-size: 13px;
  font-weight: 650;
}

.login-note,
.form-error {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
}

.form-error {
  color: #b91c1c;
}

.api-error-diagnostic {
  display: inline-grid;
  max-width: min(720px, 100%);
  width: fit-content;
  gap: 8px;
  border-left: 3px solid #b91c1c;
  background: #f8fafc;
  padding: 8px 10px;
  text-align: left;
}

.empty-state .api-error-diagnostic {
  max-width: min(760px, 100%);
  margin: 4px auto 0;
}

.api-error-diagnostic-summary {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.api-error-diagnostic-summary-text {
  display: inline-flex;
  min-width: 0;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}

.api-error-diagnostic strong {
  display: block;
  color: #991b1b;
  font-size: 13px;
}

.api-error-diagnostic p {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
  color: #334155;
  font-size: 13px;
  line-height: 1.35;
}

.api-error-diagnostic-toggle {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid #f59e0b;
  border-radius: 999px;
  background: #fff7ed;
  color: #92400e;
  cursor: pointer;
  padding: 0;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.api-error-diagnostic-toggle[aria-expanded="true"] {
  background: #fffbeb;
  color: #78350f;
}

.api-error-diagnostic-details {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.api-error-diagnostic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 0;
}

.api-error-diagnostic-grid div {
  min-width: 0;
}

.api-error-diagnostic-grid dt,
.api-error-diagnostic-grid dd {
  min-width: 0;
  margin: 0;
}

.api-error-diagnostic-grid dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 750;
}

.api-error-diagnostic-grid dd {
  overflow-wrap: anywhere;
  color: #0f172a;
  font-size: 12px;
  line-height: 1.45;
}

.api-error-diagnostic-grid code {
  white-space: normal;
}

.workbench-diagnostics-toggle {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: white;
  color: #334155;
  padding: 4px 8px;
  font-weight: 800;
}

.workbench-diagnostics-toggle > span:first-child,
.message-detail-button {
  display: inline-flex;
  width: 22px;
  height: 22px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e0f2fe;
  color: #0c4a6e;
  font-size: 12px;
  font-weight: 850;
}

.workbench-diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.workbench-diagnostics-summary {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.workbench-diagnostics-summary div {
  min-width: 0;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 8px;
}

.workbench-diagnostics-summary dt,
.workbench-diagnostics-summary dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.workbench-diagnostics-summary dt {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.workbench-diagnostics-summary dd {
  color: #0f172a;
  font-size: 12px;
  font-weight: 750;
}

.probe-card,
.live-build-summary {
  min-width: min(320px, 100%);
  flex: 1 1 320px;
}

.status-chip-button {
  display: flex;
  width: 100%;
  min-height: 42px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: white;
  padding: 8px 10px;
  color: #334155;
  text-align: left;
}

.status-chip-label,
.status-chip-meta {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-chip-label {
  color: #0f172a;
  font-size: 12px;
  font-weight: 800;
}

.status-chip-meta {
  margin-left: auto;
  color: #64748b;
  font-size: 12px;
}

.workbench-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.34);
  padding: 18px;
}

.workbench-dialog {
  display: grid;
  width: min(720px, 100%);
  max-height: min(760px, calc(100vh - 36px));
  gap: 12px;
  overflow: auto;
  border: 1px solid #d8e1eb;
  border-radius: 8px;
  background: white;
  padding: 16px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.2);
}

.workbench-dialog.wide {
  width: min(920px, 100%);
}

.workbench-dialog header,
.hwpod-event-panel header {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.dialog-close {
  width: 30px;
  height: 30px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #334155;
  font-weight: 800;
}

.dialog-title-stack {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.dialog-title-stack h2,
.dialog-title-stack p {
  margin: 0;
}

.dialog-title-stack p {
  color: #64748b;
  font-size: 13px;
}

.dialog-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.probe-list,
.live-build-list,
.hwpod-errors ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.probe-row,
.live-build-row,
.hwpod-errors {
  display: grid;
  gap: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  padding: 10px;
}

.probe-row-head,
.live-build-row-head {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.probe-row-label,
.live-build-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.probe-row-meta,
.live-build-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #64748b;
  font-size: 12px;
}

.probe-row p,
.live-build-dialog-summary p,
.live-build-reason {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.45;
}
