:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f7f8fa;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.14);
  --text: #162033;
  --muted: #667085;
  --tertiary: #8a93a3;
  --accent: #2f6fed;
  --accent-soft: rgba(47, 111, 237, 0.1);
  --green: #1f8f63;
  --amber: #b7791f;
  --red: #b44444;
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  --radius-card: 16px;
  --radius-control: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.topbar {
  height: 68px;
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 clamp(20px, 4vw, 56px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 24px;
  font-weight: 650;
}

.brand-mark {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--accent);
  font-size: 20px;
  font-weight: 650;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 0;
}

.nav a:hover,
.panel-title-row a:hover {
  color: var(--text);
}

.login-button,
.toolbar button {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

.login-button {
  margin-left: auto;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--accent);
  border-color: rgba(47, 111, 237, 0.18);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.login-button:hover,
.toolbar .primary:hover {
  background: #255fdb;
}

.toolbar button:hover {
  border-color: var(--line-strong);
  background: var(--surface-muted);
}

.toolbar input:focus {
  outline: 2px solid rgba(47, 111, 237, 0.18);
  outline-offset: 1px;
  border-color: rgba(47, 111, 237, 0.45);
}

main {
  padding: 24px clamp(20px, 4vw, 56px) 48px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.status-strip article {
  min-height: 88px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 0 20px;
  border-right: 1px solid var(--line);
}

.status-strip article:last-child {
  border-right: 0;
}

.status-strip span,
.metrics dt {
  color: var(--tertiary);
  font-size: 13px;
}

.status-strip strong {
  font-size: 22px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.status-strip .good {
  color: var(--green);
}

.status-strip .warn {
  color: var(--amber);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(320px, 0.85fr);
  gap: 16px;
  margin-top: 16px;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header,
.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px;
}

.panel-header {
  border-bottom: 1px solid var(--line);
}

.panel-header > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panel h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

.panel-header span {
  min-width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--muted);
  font-size: 13px;
}

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

.toolbar input {
  width: 220px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  color: var(--text);
  background: var(--surface);
  font-size: 14px;
}

.toolbar button {
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 500;
}

.toolbar .primary {
  color: #fff;
  border-color: rgba(47, 111, 237, 0.18);
  background: var(--accent);
}

.table-wrap {
  max-height: 367px;
  overflow: auto;
  border-top: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 680px;
}

th,
td {
  height: 52px;
  padding: 0 18px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 2;
  height: 42px;
  color: var(--tertiary);
  background: #f8fafc;
  font-size: 12px;
  font-weight: 500;
}

th:last-child,
td:last-child {
  border-right: 0;
}

td {
  font-size: 14px;
}

.editor-link {
  color: var(--accent);
  font-weight: 600;
}

.editor-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

tbody tr:hover td {
  background: rgba(47, 111, 237, 0.03);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}

.running {
  color: var(--green);
  background: rgba(24, 136, 93, 0.1);
}

.warning {
  color: var(--amber);
  background: rgba(217, 119, 6, 0.11);
}

.danger {
  color: var(--red);
  background: rgba(209, 67, 67, 0.1);
}

.side-stack {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.panel-title-row a {
  color: var(--accent);
  font-size: 14px;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0 20px 12px;
}

.timeline li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  border-top: 1px solid var(--line);
}

.timeline strong {
  font-size: 14px;
}

.timeline span,
.timeline time {
  font-size: 13px;
  color: var(--muted);
}

.timeline span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(24, 136, 93, 0.08);
  color: var(--green);
}

.timeline .orange {
  color: var(--amber);
  background: rgba(217, 119, 6, 0.11);
}

.timeline .red {
  color: var(--red);
  background: rgba(209, 67, 67, 0.1);
}

.metrics {
  margin: 0;
  padding: 0 20px 18px;
}

.metrics div {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
}

.metrics dd {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .status-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .status-strip article:nth-child(3) {
    border-right: 0;
  }

  .status-strip article:nth-child(n + 4) {
    border-top: 1px solid var(--line);
  }

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

@media (max-width: 760px) {
  .topbar {
    height: 60px;
    min-height: 60px;
    gap: 12px;
    padding: 0 16px;
  }

  .brand {
    font-size: 20px;
  }

  .brand-mark {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 18px;
  }

  .nav,
  .login-button,
  .status-strip,
  .side-stack,
  .toolbar {
    display: none;
  }

  main {
    padding: 14px 12px 24px;
  }

  .dashboard-grid {
    display: block;
    margin-top: 0;
  }

  .panel {
    border-radius: 12px;
  }

  .panel-header {
    min-height: 52px;
    padding: 0 14px;
    align-items: center;
    flex-direction: row;
  }

  .panel h2 {
    font-size: 15px;
  }

  .table-wrap {
    max-height: none;
    overflow: visible;
  }

  table {
    min-width: 0;
    table-layout: fixed;
  }

  th,
  td {
    height: 56px;
    padding: 0 14px;
    border-right: 0;
  }

  th:nth-child(n + 2):nth-child(-n + 5),
  td:nth-child(n + 2):nth-child(-n + 5) {
    display: none;
  }

  th:first-child,
  td:first-child {
    width: 58%;
  }

  th:last-child,
  td:last-child {
    width: 42%;
    text-align: right;
  }

  .editor-link {
    display: inline-block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
  }
}
