:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #6b7280;
  --line: #d9dee7;
  --accent: #0f766e;
  --watch: #d97706;
  --danger: #dc2626;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px 28px;
  background: #111827;
  color: #fff;
  border-bottom: 1px solid #0b1220;
}

.topbar h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.topbar p {
  margin: 0;
  color: #cbd5e1;
  font-size: 13px;
}

.freshness {
  margin-top: 6px;
  font-weight: 700;
}

.freshness.fresh {
  color: #99f6e4;
}

.freshness.stale {
  color: #fecaca;
}

.level {
  min-width: 112px;
  padding: 10px 14px;
  border-radius: 8px;
  background: #334155;
  text-align: center;
}

.level span {
  display: block;
  font-size: 12px;
  color: #e5e7eb;
}

.level strong {
  display: block;
  font-size: 30px;
  line-height: 1.1;
}

.level-0 {
  background: #0f766e;
}

.level-1 {
  background: #ca8a04;
}

.level-2 {
  background: #ea580c;
}

.level-3 {
  background: #dc2626;
}

main {
  max-width: 1380px;
  margin: 0 auto;
  padding: 22px;
}

.summary,
.risk-grid {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.summary {
  grid-template-columns: 180px 1fr 240px;
}

.risk-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.status-grid article {
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.status-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.status-grid strong {
  display: block;
  font-size: 16px;
}

.status-grid small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.ok {
  color: #047857;
}

.bad {
  color: #dc2626;
}

.summary > div,
.risk-grid article,
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.summary > div,
.risk-grid article {
  padding: 14px;
}

label,
.risk-grid span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
}

.summary strong,
.risk-grid strong {
  font-size: 18px;
  line-height: 1.35;
}

.two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.panel {
  margin-bottom: 16px;
  overflow: hidden;
}

.panel-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: #f9fafb;
}

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

.panel-head span {
  color: var(--muted);
  font-size: 12px;
  word-break: break-all;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f9fafb;
  color: #374151;
  font-weight: 700;
}

td:last-child {
  min-width: 260px;
}

pre {
  margin: 0;
  padding: 14px;
  max-height: 520px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: "Cascadia Mono", "Consolas", monospace;
  font-size: 13px;
  line-height: 1.55;
}

.radar-image {
  display: block;
  width: 100%;
  max-height: 760px;
  object-fit: contain;
  background: #111827;
}

.empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .summary,
  .risk-grid,
  .status-grid,
  .two-col {
    grid-template-columns: 1fr;
  }
}
