:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --line: #dfe4ea;
  --text: #18202a;
  --muted: #66717f;
  --blue: #1f74ff;
  --green: #168a4a;
  --amber: #a56600;
  --red: #c62828;
  --shadow: 0 6px 18px rgba(24, 32, 42, 0.06);
}

* {
  box-sizing: border-box;
}

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

button,
input,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 600;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.workspace {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 16px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.topbar h1 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.25;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.icon-button {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  font-size: 22px;
  line-height: 40px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 88px;
  gap: 10px;
  margin-bottom: 12px;
}

.search-row input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

.search-row input {
  height: 42px;
  padding: 0 12px;
}

.search-row button {
  height: 42px;
}

textarea {
  display: block;
  min-height: 86px;
  padding: 10px 12px;
  resize: vertical;
}

.notice {
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #f0cf8b;
  border-radius: 6px;
  background: #fff8ea;
  color: #684500;
  font-size: 13px;
}

.hidden {
  display: none;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  min-height: 80px;
  padding: 12px;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.25;
  word-break: break-word;
}

.panel {
  margin-bottom: 12px;
  padding: 14px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

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

.panel-title span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
}

.detail-item {
  min-width: 0;
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-item strong {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.35;
  word-break: break-all;
}

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

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  text-align: left;
  font-size: 13px;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-weight: 600;
}

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

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eaf2ff;
  color: #1357c8;
  font-size: 12px;
  font-weight: 600;
}

.tag.ok {
  background: #e8f6ee;
  color: var(--green);
}

.tag.warn {
  background: #fff4df;
  color: var(--amber);
}

.tag.bad {
  background: #ffecec;
  color: var(--red);
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.actions button {
  min-width: 96px;
  height: 38px;
  padding: 0 14px;
}

.logs {
  margin: 0;
  padding: 0;
  list-style: none;
}

.logs li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.logs li:last-child {
  border-bottom: 0;
}

.logs time {
  color: var(--muted);
}

@media (max-width: 760px) {
  .workspace {
    padding: 12px;
  }

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

  .metric strong {
    font-size: 17px;
  }
}

@media (max-width: 460px) {
  .summary-grid,
  .detail-grid,
  .logs li {
    grid-template-columns: 1fr;
  }

  .search-row {
    grid-template-columns: 1fr;
  }

  .topbar h1 {
    font-size: 19px;
  }
}
