:root {
  --bg: #f4f6f9;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #667085;
  --line: #e3e8ef;
  --brand: #2f5bea;
  --brand-dark: #2346b8;
  --ok-bg: #e6f6ec;
  --ok: #19774a;
  --warn-bg: #fff5e0;
  --warn: #9a5b00;
  --danger-bg: #fdecec;
  --danger: #b42318;
  --run-bg: #e8f0ff;
  --run: #2346b8;
  --radius: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

[v-cloak] { display: none; }

h1, h2, h3, h4 { margin: 0 0 8px; line-height: 1.35; }
h1 { font-size: 26px; }
h2 { font-size: 22px; }
h3 { font-size: 17px; }
h4 { font-size: 15px; margin-top: 14px; }
p { margin: 6px 0; }
a { color: var(--brand); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 24px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.brand { font-weight: 700; cursor: pointer; font-size: 17px; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 500;
  padding: 4px 2px;
  border-bottom: 2px solid transparent;
}
.topbar nav a.active { color: var(--brand); border-bottom-color: var(--brand); }
.topbar .user { color: var(--muted); font-size: 14px; }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 20px 60px;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-head h2 { margin-top: 6px; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-card { width: 100%; max-width: 440px; }
.auth-card h1 { margin-bottom: 4px; }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.strong { font-weight: 600; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; }

.row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.actions { margin-top: 12px; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1 1 260px; }

label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
label.inline { flex-direction: row; align-items: center; gap: 6px; }
label.check { flex-direction: row; align-items: flex-start; gap: 8px; font-size: 14px; color: var(--text); margin: 6px 0; }
label.check input { margin-top: 4px; }

input, select, textarea {
  font: inherit;
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  min-width: 0;
}
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(47, 91, 234, 0.25); border-color: var(--brand); }
.form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.form label { font-size: 13px; }

button {
  font: inherit;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  cursor: pointer;
}
button:hover:not(:disabled) { border-color: var(--brand); }
button:disabled { opacity: 0.55; cursor: not-allowed; }
button.primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
button.primary:hover:not(:disabled) { background: var(--brand-dark); }
button.small { padding: 4px 10px; font-size: 12.5px; }
button.danger { color: var(--danger); border-color: #f3c4c0; }
button.danger:hover:not(:disabled) { border-color: var(--danger); }
button.link {
  border: none;
  background: none;
  color: var(--brand);
  padding: 2px 0;
  font-size: 13px;
}

.tabs { display: flex; gap: 6px; margin-top: 16px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  background: none;
  color: var(--muted);
  font-weight: 500;
}
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }

.error { color: var(--danger); font-size: 13.5px; margin: 8px 0 0; }
.alert { border-radius: 8px; padding: 10px 12px; margin: 10px 0; font-size: 14px; }
.alert.danger { background: var(--danger-bg); color: var(--danger); }
.alert.warn { background: var(--warn-bg); color: var(--warn); }

.table-wrap { overflow-x: auto; margin-top: 10px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #fafbfd; }

.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #eef1f5;
  color: var(--muted);
  white-space: nowrap;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.danger { background: var(--danger-bg); color: var(--danger); }
.badge.running { background: var(--run-bg); color: var(--run); }
.badge.neutral { background: #eef1f5; color: var(--muted); }
.badge.type { background: #f1edff; color: #5b35c9; }

.dropzone {
  margin-top: 10px;
  border: 2px dashed #c8d2e0;
  border-radius: var(--radius);
  background: #fbfcfe;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
}
.dropzone:hover { border-color: var(--brand); background: #f6f9ff; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}
.stat {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12.5px;
  color: var(--muted);
}
.stat .num { font-size: 20px; font-weight: 700; color: var(--text); }

.confirm { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }

.stages { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.stage {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f1f3f7;
  color: var(--muted);
  font-size: 13.5px;
}
.stage .dot { width: 9px; height: 9px; border-radius: 50%; background: #c3cad6; }
.stage.active { background: var(--run-bg); color: var(--run); font-weight: 600; }
.stage.active .dot { background: var(--brand); }
.stage.done { background: var(--ok-bg); color: var(--ok); }
.stage.done .dot { background: var(--ok); }

.progressbar { height: 10px; border-radius: 999px; background: #e9edf3; overflow: hidden; }
.progressbar .fill { height: 100%; background: linear-gradient(90deg, #5b83ff, var(--brand)); transition: width 0.4s ease; }

.report .summary .oneline { font-size: 16px; font-weight: 500; }
.top3 { margin: 8px 0 0; padding-left: 20px; }
.top3 li { margin: 6px 0; }
.top3 .link { font-size: 15px; }

.gap-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-top: 12px;
  overflow: hidden;
}
.gap-card.observation { border-style: dashed; }
.gap-head {
  padding: 14px 16px;
  cursor: pointer;
  background: #fbfcfe;
}
.gap-head:hover { background: #f5f8ff; }
.gap-head h3 { margin: 6px 0 2px; }
.gap-head .code { font-weight: 700; color: var(--brand); margin-right: 8px; }
.gap-body {
  padding: 14px 16px 18px;
  border-top: 1px solid var(--line);
}
.field { margin: 8px 0; }
.field .label {
  display: inline-block;
  min-width: 96px;
  color: var(--muted);
  font-size: 13px;
  margin-right: 6px;
}
.code-box { background: #f6f9ff; border: 1px solid #c9d7ff; padding: 10px 12px; border-radius: 8px; }

.evidence {
  border-left: 3px solid #c9d7ff;
  background: #f8faff;
  border-radius: 0 8px 8px 0;
  padding: 10px 12px;
  margin: 10px 0;
}
.evidence blockquote {
  margin: 0 0 6px;
  font-size: 14.5px;
  color: #1a2440;
  font-style: italic;
}
.ev-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }
.evidence details { margin-top: 6px; font-size: 13px; }
.evidence summary { cursor: pointer; color: var(--brand); }
.context { color: var(--muted); background: #fff; border-radius: 6px; padding: 8px; margin: 6px 0 0; }

.topic-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-top: 12px;
  background: #fdfdff;
}
.topic-card h4 { margin: 0; }

@media (max-width: 760px) {
  .topbar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .page { padding: 16px 12px 48px; }
  .field .label { display: block; }
  th, td { padding: 8px 6px; }
}
