:root {
  --nav: #17345e;
  --nav-deep: #112845;
  --nav-active: #23508a;
  --bg: #f1f3f7;
  --panel: #ffffff;
  --ink: #1e2b3d;
  --muted: #6d7a8d;
  --line: #d8dfea;
  --line-strong: #c2cedd;
  --blue: #244e88;
  --blue-soft: #edf3fc;
  --green: #009b78;
  --green-soft: #e4f7f1;
  --orange: #dc7918;
  --orange-soft: #fff1df;
  --red: #c73e55;
  --red-soft: #fdebef;
  --shadow: 0 1px 3px rgba(22, 39, 65, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

h1,
h2,
h3,
h4,
p,
dl {
  margin: 0;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.shell {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  min-height: 100vh;
  background: var(--nav);
  color: #ecf2fb;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #0c203c;
}

.brand {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 15px 18px;
  background: var(--nav-deep);
}

.brand-mark {
  width: 37px;
  height: 37px;
  border-radius: 6px;
  background: #00a786;
  color: white;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.brand h1 {
  font-size: 18px;
  line-height: 1.2;
}

.brand p {
  color: #a9bdd9;
  font-size: 12px;
  margin-top: 3px;
}

.sidebar-label {
  color: #95aac8;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.cluster-card {
  background: #1c406d;
  padding: 17px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  gap: 8px;
}

.cluster-card strong {
  font-size: 14px;
}

.cluster-card span {
  font-size: 12px;
  color: #c2d1e6;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-menu {
  padding: 22px 10px 8px;
}

.sidebar-label.section {
  padding: 20px 8px 0;
  margin-bottom: 0;
}

.menu-item {
  border: 0;
  width: 100%;
  height: 42px;
  color: #d7e1ee;
  background: transparent;
  border-radius: 5px;
  text-align: left;
  padding: 0 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}

.menu-item.active {
  color: #fff;
  background: var(--nav-active);
}

.menu-icon {
  font-size: 16px;
  width: 17px;
  text-align: center;
}

.project-list {
  display: grid;
  gap: 4px;
  padding: 10px;
}

.nav-card {
  width: 100%;
  border: 0;
  border-radius: 5px;
  padding: 11px 10px;
  color: #d7e1ee;
  background: transparent;
  display: grid;
  gap: 5px;
  text-align: left;
}

.nav-card.active {
  color: #fff;
  background: #285184;
}

.nav-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
}

.nav-title strong {
  overflow-wrap: anywhere;
}

.nav-card small {
  color: #afc2dc;
  font-size: 11px;
}

.clock {
  margin: auto 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  padding-top: 14px;
  display: grid;
  gap: 3px;
}

.clock span {
  font-size: 22px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.clock small {
  color: #a9bdd9;
  font-size: 11px;
}

.main {
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto auto auto minmax(0, 1fr);
  align-content: start;
}

.workspace-header {
  height: 58px;
  padding: 0 22px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs b {
  color: #b0bccd;
  font-weight: 400;
}

.breadcrumbs strong {
  color: var(--ink);
}

.account {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 13px;
}

.server-chip {
  height: 29px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}

.avatar {
  width: 31px;
  height: 31px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.resource-head {
  background: #fff;
  padding: 18px 22px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.resource-kind {
  border-left: 3px solid var(--blue);
  color: var(--muted);
  font-weight: 600;
  padding-left: 10px;
  margin-bottom: 7px;
}

.resource-head h2 {
  font-size: 23px;
  line-height: 1.25;
  font-weight: 650;
}

.resource-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 5px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button,
.toggle {
  height: 37px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.button:hover {
  text-decoration: none;
}

.button.primary {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.button.secondary {
  background: #fff;
  color: var(--blue);
}

.button.danger {
  color: #fff;
  background: var(--orange);
  border-color: var(--orange);
}

.button.disabled {
  opacity: 0.5;
  pointer-events: none;
}

.action-message {
  margin: 10px 22px 0;
  min-height: 36px;
  border-radius: 4px;
  padding: 9px 12px;
  font-size: 13px;
  border: 1px solid var(--line);
}

.action-message.running {
  color: var(--blue);
  background: var(--blue-soft);
}

.action-message.success {
  color: var(--green);
  background: var(--green-soft);
}

.action-message.error {
  color: var(--red);
  background: var(--red-soft);
}

.toggle {
  gap: 7px;
  color: var(--muted);
  background: #fff;
}

.tabs {
  height: 47px;
  padding: 0 22px;
  background: #fff;
  border-top: 1px solid #edf0f5;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 28px;
}

.tab {
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 0 3px;
}

.tab.active {
  color: var(--blue);
  font-weight: 650;
  border-bottom-color: var(--orange);
}

.summary-grid {
  padding: 15px 22px;
  display: grid;
  grid-template-columns: repeat(4, minmax(135px, 1fr));
  gap: 10px;
}

.summary-card {
  min-height: 67px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #fff;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-top-width: 3px;
}

.summary-card.total {
  border-top-color: var(--blue);
}

.summary-card.online {
  border-top-color: var(--green);
}

.summary-card.warning {
  border-top-color: var(--orange);
}

.summary-card.offline {
  border-top-color: var(--red);
}

.summary-card strong {
  font-size: 25px;
  line-height: 1;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.summary-card span {
  color: var(--muted);
  font-size: 12px;
  padding-top: 7px;
}

.operation-grid {
  min-width: 0;
  min-height: 0;
  padding: 0 22px 22px;
  display: grid;
  grid-template-columns: minmax(300px, 354px) minmax(500px, 1fr);
  gap: 12px;
  align-items: stretch;
}

.panel,
.detail-panel {
  min-width: 0;
  min-height: 0;
  height: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 5px;
  box-shadow: var(--shadow);
}

.deployments {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.panel-heading {
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-heading h3,
.detail-header h3 {
  font-size: 15px;
  font-weight: 650;
}

.meta-line {
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.panel-count {
  background: var(--blue-soft);
  color: var(--blue);
  border-radius: 4px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 650;
}

.project-table {
  display: grid;
  align-content: start;
  overflow: auto;
  padding: 10px;
  gap: 8px;
}

.project-row {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 12px;
  cursor: pointer;
  display: grid;
  gap: 11px;
  background: #fff;
}

.project-row.active {
  border-color: #37aa90;
  box-shadow: inset 3px 0 var(--green);
  background: #f7fcfb;
}

.row-header {
  min-width: 0;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.row-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.row-title strong {
  overflow-wrap: anywhere;
}

.deployment-meta {
  background: #f6f8fb;
  border-radius: 4px;
  padding: 8px 9px;
  display: grid;
  grid-template-columns: 39px minmax(0, 1fr);
  gap: 5px;
  font-size: 11px;
}

.deployment-meta span {
  color: var(--muted);
}

.deployment-meta strong {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #96a3b5;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.online {
  background: var(--green);
}

.status-dot.warning {
  background: var(--orange);
}

.status-dot.offline,
.status-dot.missing {
  background: var(--red);
}

.pill-list,
.check-list {
  display: flex;
  gap: 7px;
  flex-wrap: wrap;
}

.pill {
  min-height: 24px;
  border-radius: 4px;
  background: var(--blue-soft);
  color: var(--blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 650;
}

.pill.online,
.check.good {
  color: var(--green);
  background: var(--green-soft);
}

.pill.warning,
.check.warn {
  color: var(--orange);
  background: var(--orange-soft);
}

.pill.offline,
.pill.missing,
.check.bad {
  color: var(--red);
  background: var(--red-soft);
}

.check.neutral {
  color: var(--blue);
  background: var(--blue-soft);
}

.route-line {
  height: 27px;
  border-top: 1px dashed var(--line);
  padding-top: 9px;
}

.public-link {
  color: var(--blue);
  font-size: 12px;
  font-weight: 650;
}

.route-card {
  min-height: 70px;
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 4px;
  padding: 11px 13px;
  display: grid;
  gap: 7px;
}

.route-card div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.route-card a {
  font-weight: 650;
}

.route-card > span {
  color: var(--muted);
  font-size: 12px;
}

.detail-panel {
  display: grid;
  align-content: start;
  overflow: auto;
  overflow: hidden;
}

.detail-header {
  min-height: 68px;
  padding: 15px 17px;
  background: var(--blue);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.detail-header .muted {
  margin-top: 6px;
  color: #c6d5e9;
  font-size: 12px;
}

.status-label.pill {
  background: #176b64;
  color: #eafffa;
  min-height: 28px;
}

.status-label.pill.warning {
  background: #975815;
}

.status-label.pill.offline,
.status-label.pill.missing {
  background: #872d43;
}

.detail-section {
  padding: 14px 17px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 11px;
}

.checks-band {
  border-top: 0;
  background: #f7f9fc;
}

.check {
  min-width: 132px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 7px 10px;
  display: grid;
  gap: 3px;
  font-size: 12px;
}

.check strong {
  font-size: 12px;
}

.check small {
  opacity: 0.8;
}

.section-heading {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.section-heading h4 {
  font-size: 14px;
  font-weight: 650;
}

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

.runtime-table-head,
.runtime-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(128px, 1.4fr) 108px 74px 66px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.runtime-table-head {
  color: #fff;
  background: var(--nav);
  border-radius: 4px 4px 0 0;
  min-height: 30px;
  padding: 0 12px;
}

.runtime-list {
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.runtime-row {
  min-height: 47px;
  padding: 0 11px;
}

.runtime-row + .runtime-row {
  border-top: 1px solid var(--line);
}

.runtime-row div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.runtime-row > span {
  color: var(--muted);
}

.resource-detail {
  background: #fff;
}

.kv {
  min-width: 0;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 9px 12px;
  font-size: 12px;
}

.kv dt {
  color: var(--muted);
}

.kv dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  background: #f2f5f8;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 5px;
}

.log-list {
  display: grid;
  gap: 8px;
}

.log-item {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px;
  display: grid;
  gap: 7px;
}

.log-tail {
  max-height: 125px;
  overflow: auto;
  white-space: pre-wrap;
  color: var(--muted);
  background: #f6f8fb;
  border-radius: 3px;
  padding: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
}

.empty {
  border: 1px dashed var(--line-strong);
  border-radius: 4px;
  color: var(--muted);
  padding: 15px;
  text-align: center;
  font-size: 12px;
}

@media (max-width: 1020px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
  }

  .main {
    height: auto;
    overflow: visible;
  }

  .sidebar-menu {
    display: none;
  }

  .project-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .clock {
    margin: 12px 16px 16px;
  }

  .operation-grid {
    grid-template-columns: 1fr;
  }

  .panel,
  .detail-panel {
    height: auto;
    overflow: visible;
  }
}

@media (max-width: 700px) {
  .workspace-header,
  .resource-head {
    height: auto;
    padding: 14px;
    flex-direction: column;
    align-items: stretch;
  }

  .account {
    justify-content: space-between;
  }

  .actions {
    flex-wrap: wrap;
  }

  .tabs,
  .summary-grid,
  .operation-grid {
    padding-left: 14px;
    padding-right: 14px;
  }

  .summary-grid,
  .project-list {
    grid-template-columns: 1fr 1fr;
  }

  .runtime-table-head,
  .runtime-row {
    grid-template-columns: minmax(102px, 1fr) 86px 58px 60px;
    gap: 5px;
  }
}
