:root {
  --bg: #0f1218;
  --panel: #171b23;
  --panel-2: #1e2330;
  --line: #2a3142;
  --text: #e6e9ef;
  --muted: #8b93a7;
  --primary: #4f8cff;
  --ok: #2ecc71;
  --warn: #f5b041;
  --bad: #e74c3c;
  --fp: #9b59b6;
  --na: #5d6d7e;
  --radius: 10px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; border-bottom: 1px solid var(--line); background: var(--panel);
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { font-size: 18px; margin: 0; }
.topbar .badge { margin-right: auto; }

.page { max-width: 1100px; margin: 0 auto; padding: 20px; display: grid; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.req { font-size: 12px; color: var(--bad); font-weight: normal; margin-left: 4px; }

input[type=text], input[type=password], input[type=search], input[type=number], select, textarea {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; font: inherit;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
textarea { resize: vertical; }

.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > input { flex: 1 1 220px; }
.between { justify-content: space-between; }
.actions { margin-top: 14px; }
.grid { display: grid; grid-template-columns: 1fr 160px 1fr; gap: 12px; margin-top: 12px; align-items: end; }
.checks { display: flex; flex-direction: column; gap: 4px; }
.field-label { display: block; margin: 10px 0 6px; color: var(--muted); font-size: 13px; }
.check { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 13px; margin-top: 8px; cursor: pointer; }
.hint { color: var(--muted); font-size: 12px; margin: 6px 0 0; }
.msg { margin: 8px 0 0; color: var(--muted); font-size: 13px; min-height: 1em; }
.msg-error { color: var(--bad); }

.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 8px; padding: 8px 14px; font: inherit; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--primary); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; padding: 9px 22px; }
.btn-ghost { background: transparent; }
.link-btn { background: none; border: 0; color: var(--primary); cursor: pointer; padding: 0; font: inherit; }

.badge { font-size: 12px; padding: 2px 10px; border-radius: 999px; border: 1px solid; }
.badge-warn { color: var(--warn); border-color: var(--warn); }
.badge-ok { color: var(--ok); border-color: var(--ok); }
.badge-bad { color: var(--bad); border-color: var(--bad); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.tab { background: none; border: 0; color: var(--muted); padding: 8px 14px; cursor: pointer; font: inherit; border-bottom: 2px solid transparent; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line);
  border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer;
}
.chip-on { border-color: var(--primary); color: var(--primary); }
.chip-check { display: inline-flex; align-items: center; }
.custom-box { margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 8px; }
.site-options { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; max-height: 160px; overflow: auto; }

.progress { margin-top: 12px; }
.bar { height: 6px; background: var(--panel-2); border-radius: 999px; overflow: hidden; }
.bar span { display: block; height: 100%; width: 0; background: var(--primary); transition: width .4s; }

.cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.card {
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 10px;
  color: var(--text); cursor: pointer; text-align: left; font: inherit; display: flex; flex-direction: column;
}
.card b { font-size: 22px; }
.card span { color: var(--muted); font-size: 12px; }
.card.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }
.card-verified b { color: var(--ok); }
.card-uncertain b { color: var(--warn); }
.card-false_positive b { color: var(--fp); }
.card-available b { color: var(--muted); }
.card-inconclusive b { color: var(--na); }

.results { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 4px; }
.item {
  display: grid; grid-template-columns: 10px 180px 80px minmax(0, 1fr) auto; gap: 10px; align-items: center;
  padding: 8px 10px; background: var(--panel-2); border-radius: 6px;
}
.item .site { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--primary); }
.item .url.muted { color: var(--muted); }
.item .detail { color: var(--muted); font-size: 12px; white-space: nowrap; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot-verified { background: var(--ok); }
.dot-uncertain { background: var(--warn); }
.dot-false_positive { background: var(--fp); }
.dot-available { background: var(--muted); }
.dot-inconclusive { background: var(--na); }
.tag { font-size: 12px; text-align: center; border-radius: 4px; padding: 1px 4px; border: 1px solid; }
.tag-verified { color: var(--ok); }
.tag-uncertain { color: var(--warn); }
.tag-false_positive { color: var(--fp); }
.tag-available { color: var(--muted); }
.tag-inconclusive { color: var(--na); }
.empty { color: var(--muted); padding: 10px; }

.table { width: 100%; border-collapse: collapse; margin-top: 8px; }
.table th, .table td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: normal; font-size: 12px; }
.st-done { color: var(--ok); }
.st-error { color: var(--bad); }
.st-running { color: var(--primary); }
.st-pending, .st-skipped { color: var(--muted); }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); z-index: 10;
  background: var(--panel); border-left: 1px solid var(--line); padding: 16px; overflow: auto;
  box-shadow: -10px 0 30px rgba(0, 0, 0, .4);
}
.history { list-style: none; padding: 0; display: grid; gap: 6px; }
.history-item {
  width: 100%; text-align: left; background: var(--panel-2); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 10px; cursor: pointer; display: flex; flex-direction: column; font: inherit;
}
.history-item span { color: var(--muted); font-size: 12px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: var(--panel-2); border: 1px solid var(--line); padding: 8px 16px; border-radius: 8px;
}

@media (max-width: 760px) {
  .page { padding: 12px; }
  .grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .item { grid-template-columns: 10px minmax(0, 1fr) auto; }
  .item .url, .item .detail { grid-column: 2 / -1; }
  .topbar h1 { font-size: 15px; }
}
