:root {
  --bg: #0c0d10;
  --panel: #15161b;
  --panel-border: #24262e;
  --text: #e7e8ea;
  --muted: #8b8d97;
  --accent: #4f8cff;
  --green: #35c76b;
  --yellow: #e8b23c;
  --red: #ef5b5b;
}

* { box-sizing: border-box; }

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 28px;
  border-bottom: 1px solid var(--panel-border);
  gap: 24px;
  flex-wrap: wrap;
}

.brand {
  font-size: 18px;
  font-weight: 600;
  white-space: nowrap;
}
.brand span { color: var(--accent); }
.brand small {
  font-weight: 400;
  color: var(--muted);
  font-size: 12px;
  margin-left: 8px;
}

.crawl-form {
  display: flex;
  gap: 10px;
  flex: 1;
  max-width: 560px;
}

.crawl-form input {
  flex: 1;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  color: var(--text);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
}
.crawl-form input:focus { outline: 1px solid var(--accent); }

.crawl-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.crawl-form button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.content {
  padding: 24px 28px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.hidden { display: none !important; }

.status-banner {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--muted);
}

.health-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.health-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 16px 18px;
}
.health-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.health-value { font-size: 26px; font-weight: 700; }
.health-card.ok .health-value { color: var(--green); }
.health-card.warn .health-value { color: var(--yellow); }
.health-card.error .health-value { color: var(--red); }

.checks-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}

.check-card {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.check-card:hover { border-color: #3a3d47; }

.check-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.check-name { font-size: 14px; font-weight: 600; }
.check-sub { font-size: 12px; color: var(--muted); margin-top: 4px; }

.check-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.check-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.03em;
}
.badge-pass { background: rgba(53,199,107,0.15); color: var(--green); }
.badge-warn { background: rgba(232,178,60,0.15); color: var(--yellow); }
.badge-fail { background: rgba(239,91,91,0.15); color: var(--red); }

.ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  position: relative;
}
.ring::before {
  content: "";
  position: absolute;
  inset: 5px;
  border-radius: 50%;
  background: var(--panel);
}
.ring span { position: relative; z-index: 1; }

.issues-panel {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 24px;
}
.issues-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.issues-header h3 { margin: 0; font-size: 15px; }
.issues-header button {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
}
.issues-list {
  max-height: 320px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.issue-row {
  border: 1px solid var(--panel-border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
}
.issue-row .issue-page {
  color: var(--accent);
  word-break: break-all;
  font-weight: 600;
  margin-bottom: 3px;
}
.issue-row .issue-detail { color: var(--muted); }
.issue-empty { color: var(--muted); font-size: 13px; padding: 10px 0; }

.empty-state {
  text-align: center;
  color: var(--muted);
  padding: 60px 20px;
  font-size: 14px;
}

@media (max-width: 900px) {
  .health-row { grid-template-columns: repeat(2, 1fr); }
  .checks-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .health-row { grid-template-columns: 1fr; }
  .checks-grid { grid-template-columns: 1fr; }
}
