:root {
  color-scheme: light;
  --bg: #f4f7f9;
  --surface: #ffffff;
  --surface-alt: #eef3f5;
  --text: #172027;
  --muted: #62717c;
  --line: #d8e0e5;
  --primary: #0f766e;
  --primary-dark: #0b5f59;
  --good: #12805c;
  --ok: #3465d9;
  --warn: #b36b00;
  --bad: #b42318;
  --shadow: 0 14px 36px rgba(21, 40, 52, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  font-size: 15px;
}

button,
input {
  font: inherit;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 100%;
  margin-top: 12px;
  color: var(--text);
  font-weight: 600;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 28px 0 44px;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 30px;
  line-height: 1.2;
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

h3 {
  margin-bottom: 8px;
  font-size: 16px;
}

.status,
.badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 10px;
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

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

.submit-panel {
  padding: 18px;
  margin-bottom: 18px;
}

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 260px) 116px;
  gap: 10px;
}

input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: #fff;
  color: var(--text);
}

input:focus {
  border-color: var(--primary);
  outline: 2px solid rgba(15, 118, 110, 0.15);
}

button {
  height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 14px;
  background: var(--primary);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button:hover {
  background: var(--primary-dark);
}

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

button.ghost {
  height: 32px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
}

button.ghost:hover {
  background: var(--surface-alt);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.history-panel,
.report-panel {
  padding: 18px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history {
  display: grid;
  gap: 10px;
}

.history-item {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: var(--surface);
  text-align: left;
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--primary);
}

.history-url {
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.empty {
  min-height: 360px;
  display: grid;
  align-content: center;
  justify-items: center;
  color: var(--muted);
  text-align: center;
}

.hidden {
  display: none;
}

.score-hero {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.score-circle {
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  border: 10px solid var(--primary);
  border-radius: 50%;
  background: var(--surface-alt);
}

.score-circle strong {
  display: block;
  font-size: 40px;
  line-height: 1;
}

.score-circle span {
  color: var(--muted);
}

.meta-list {
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.meta-list b {
  color: var(--text);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}

.category-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.category-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  font-weight: 700;
}

.bar {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-alt);
}

.bar > span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.finding-list {
  display: grid;
  gap: 10px;
}

.runtime-box,
.runtime-list {
  margin-bottom: 20px;
}

.runtime-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
}

.runtime-box p {
  margin-bottom: 0;
}

.runtime-list {
  display: grid;
  gap: 10px;
}

.runtime-command {
  border: 1px solid var(--line);
  border-left: 5px solid var(--ok);
  border-radius: 8px;
  padding: 12px;
}

.runtime-command.failed,
.runtime-command.timeout {
  border-left-color: var(--bad);
}

.runtime-command.blocked {
  border-left-color: var(--warn);
}

.runtime-command p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.finding {
  border: 1px solid var(--line);
  border-left: 5px solid var(--muted);
  border-radius: 8px;
  padding: 12px;
}

.finding.critical,
.finding.high {
  border-left-color: var(--bad);
}

.finding.medium {
  border-left-color: var(--warn);
}

.finding.low {
  border-left-color: var(--ok);
}

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

.finding-title strong {
  min-width: 0;
}

.finding p {
  margin-bottom: 8px;
  color: var(--muted);
  line-height: 1.55;
}

.evidence {
  overflow-x: auto;
  border-radius: 6px;
  padding: 8px;
  background: #f8fafb;
  color: #354650;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
}

.good {
  color: var(--good);
}

.ok {
  color: var(--ok);
}

.warn {
  color: var(--warn);
}

.bad {
  color: var(--bad);
}

@media (max-width: 860px) {
  .toolbar,
  .score-hero {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .toolbar {
    display: grid;
  }

  .form-row,
  .grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .score-circle {
    width: 128px;
    height: 128px;
  }
}
