:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #64748b;

  --blue: #2563eb;
  --blue-hover: #1d4ed8;
  --blue-soft: #eff6ff;
  --blue-border: #bfdbfe;

  --green: #16a34a;
  --green-soft: #f0fdf4;
  --green-border: #bbf7d0;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-border: #fecaca;

  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.03);
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
code, .mono { font-family: var(--font-mono); }
.strong { font-weight: 600; }
.muted { color: var(--text-muted); }
.small { font-size: 12px; }
.hidden { display: none !important; }

/* Lock Screen */
.lock-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lock-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border-radius: 16px;
  padding: 28px 26px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
  border: 1px solid var(--border);
}
.lock-card h2 { margin: 4px 0 8px; font-size: 20px; }
.lock-card input {
  width: 100%;
  margin-top: 12px;
  padding: 10px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-size: 14px;
  outline: none;
}
.lock-card input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14); }

.notice-bar {
  margin-bottom: 14px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: #92400e;
  font-size: 12.5px;
}

.app-shell { max-width: 1120px; margin: 0 auto; padding: 24px 20px 64px; }

.top-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.brand-kicker { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; color: var(--blue); margin-bottom: 4px; }
.page-title { margin: 0; font-size: 25px; font-weight: 700; letter-spacing: -0.02em; }
.header-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pill-badge {
  display: inline-flex; align-items: center; padding: 6px 12px;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  color: var(--text-sub); font-size: 12px; font-weight: 500;
}
.count-dot {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--blue-soft); color: var(--blue); font-size: 11px; font-weight: 700; margin-left: 4px;
}

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 16px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 13px; font-weight: 600; cursor: pointer; transition: all 0.15s ease;
  font-family: inherit; white-space: nowrap;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-lg { padding: 10px 20px; font-size: 14px; }
.btn-sm { padding: 6px 11px; font-size: 12px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn-outline { background: var(--surface); border-color: var(--border-strong); color: var(--text); }
.btn-outline:hover:not(:disabled) { background: var(--surface-soft); border-color: #94a3b8; }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-sub); }
.btn-ghost:hover:not(:disabled) { background: var(--surface); color: var(--text); }
.btn-danger { background: var(--red-soft); border-color: var(--red-border); color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #fee2e2; }
.btn-icon { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 14px; color: var(--text-sub); }
.btn-icon:hover { background: var(--border); }

.compact-bar { padding: 12px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.compact-info { display: flex; align-items: center; gap: 8px; font-size: 14px; flex-wrap: wrap; }
.compact-info .sep { color: var(--border-strong); }
.compact-actions { display: flex; gap: 8px; }

.config-card { padding: 20px 22px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.section-title { margin: 0; font-size: 16px; font-weight: 700; }
.section-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
@media (max-width: 720px) { .form-grid { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text); }
.req { color: var(--red); }
.field input[type="text"], .field input[type="url"], .field input[type="password"], .field input:not([type]), .field select {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff; outline: none;
}
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.hint { font-size: 11.5px; color: var(--text-muted); }
.input-with-btn { display: flex; gap: 8px; }
.input-with-btn input { flex: 1; }

.model-chips {
  display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px;
  max-height: 92px; overflow-y: auto; padding: 6px;
  background: var(--surface-soft); border: 1px solid var(--border); border-radius: 8px;
}
.model-chip {
  padding: 3px 9px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: #fff; font-family: var(--font-mono); font-size: 11.5px; cursor: pointer; color: var(--text-sub);
}
.model-chip:hover, .model-chip.selected { background: var(--blue-soft); border-color: var(--blue); color: var(--blue); }

.mode-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 820px) { .mode-grid { grid-template-columns: 1fr; } }
.mode-card { position: relative; border: 1.5px solid var(--border); border-radius: 11px; padding: 12px 13px; cursor: pointer; background: #fff; }
.mode-card input { position: absolute; opacity: 0; pointer-events: none; }
.mode-card:hover { border-color: #93c5fd; }
.mode-card.active { border-color: var(--blue); background: var(--blue-soft); }
.mode-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-bottom: 6px; flex-wrap: wrap; }
.mode-top strong { font-size: 13.5px; }
.mode-body p { margin: 0; font-size: 12px; color: var(--text-sub); line-height: 1.5; }
.tag-soft, .tag-blue { font-size: 11px; padding: 2px 7px; border-radius: 999px; font-weight: 600; }
.tag-soft { background: #f1f5f9; color: var(--text-sub); }
.tag-blue { background: #dbeafe; color: var(--blue); }

.advanced-box { margin-top: 4px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.advanced-box summary { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--text-sub); cursor: pointer; user-select: none; }
.advanced-inner { padding: 4px 14px 14px; border-top: 1px solid var(--border); }
.checkbox-row { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.chk-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-sub); cursor: pointer; }

.alert-error { margin-top: 12px; padding: 10px 13px; border-radius: 9px; background: var(--red-soft); border: 1px solid var(--red-border); color: var(--red); font-size: 13px; }
.form-actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.action-hint { font-size: 12px; color: var(--text-muted); }

.progress-card { padding: 18px 22px; }
.progress-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.progress-title-row { display: flex; align-items: center; gap: 10px; }
.progress-right { display: flex; align-items: center; gap: 12px; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--blue); animation: pulse 1.5s infinite; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.55); }
  70% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
.progress-bar-track { height: 7px; background: #e2e8f0; border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #3b82f6, #2563eb); border-radius: 999px; transition: width 0.3s ease; }
.live-feed { display: flex; flex-direction: column; gap: 6px; max-height: 260px; overflow-y: auto; padding-right: 4px; }
.feed-item { display: flex; align-items: flex-start; gap: 10px; padding: 8px 11px; border-radius: 8px; background: var(--surface-soft); border: 1px solid var(--border); font-size: 12.5px; }
.feed-item.running { background: var(--blue-soft); border-color: var(--blue-border); }
.feed-badge { font-weight: 700; flex-shrink: 0; }
.feed-body { flex: 1; min-width: 0; }
.feed-title { font-weight: 600; }
.feed-summary { color: var(--text-sub); margin-top: 2px; word-break: break-word; }

.overview-card { padding: 22px 24px; }
.overview-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.overview-left { display: flex; align-items: center; gap: 20px; flex: 1; min-width: 300px; }
.overview-exports { display: flex; gap: 8px; flex-wrap: wrap; }
.overview-meta { flex: 1; min-width: 240px; }
.overview-title-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.rep-model-name { margin: 0; font-family: var(--font-mono); font-size: 22px; font-weight: 700; }
.verdict-pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.verdict-pass { background: var(--green-soft); color: var(--green); border: 1px solid var(--green-border); }
.verdict-warn { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.verdict-fail { background: var(--red-soft); color: var(--red); border: 1px solid var(--red-border); }
.platform-pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f1f5f9; color: var(--text-sub); }
.rep-exec-summary { margin: 0 0 8px; font-size: 13.5px; color: var(--text-sub); line-height: 1.6; }
.rep-stats-line { font-size: 12.5px; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: 14px; }

.score-ring-wrap { position: relative; width: 106px; height: 106px; flex-shrink: 0; }
.score-ring-wrap.sm { width: 88px; height: 88px; }
.score-ring-text { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.score-num { font-size: 28px; font-weight: 800; line-height: 1; }
.score-ring-wrap.sm .score-num { font-size: 24px; }
.score-label { font-size: 11px; color: var(--text-muted); margin-top: 3px; }

.billing-banner {
  margin-top: 18px; padding: 12px 15px; border-radius: 10px;
  display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600;
  border: 1px solid var(--blue-border); background: #f5f8ff; color: #1e3a8a;
}
.billing-banner.risk-warn { border-color: var(--amber-border); background: var(--amber-soft); color: #92400e; }
.billing-banner.risk-critical { border-color: var(--red-border); background: var(--red-soft); color: #991b1b; }

.switcher-caption { margin: 18px 0 10px; font-size: 12.5px; color: var(--text-muted); }
.module-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 820px) { .module-cards { grid-template-columns: 1fr; } }
.mod-card {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 15px 16px; background: #fff;
  cursor: pointer; transition: all 0.15s ease; display: flex; flex-direction: column; justify-content: space-between; gap: 10px;
}
.mod-card:hover { border-color: #93c5fd; transform: translateY(-1px); }
.mod-card.active { border-color: var(--blue); background: #f8fbff; box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.10); }
.mod-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mod-card-title { font-size: 13px; font-weight: 600; color: var(--text-sub); }
.mod-card-status { font-size: 12px; font-weight: 700; }
.mod-card-main { display: flex; align-items: baseline; gap: 6px; }
.mod-big-score { font-size: 26px; font-weight: 800; line-height: 1.1; }
.mod-denom { font-size: 13px; color: var(--text-muted); }
.mod-card-foot { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--text-muted); }
.mod-link { color: var(--blue); font-weight: 600; }

.detail-card { padding: 22px 24px; }
.detail-header { margin-bottom: 18px; }
.detail-title { margin: 0; font-size: 17px; font-weight: 700; }
.detail-sub { margin: 4px 0 0; font-size: 13px; color: var(--text-muted); }
.detail-summary-row { display: flex; align-items: center; gap: 18px; padding-bottom: 18px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.detail-summary-meta { flex: 1; min-width: 240px; }
.detail-headline { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.detail-counts { display: flex; gap: 14px; font-size: 13px; font-weight: 600; margin-bottom: 10px; flex-wrap: wrap; }
.cnt-pass { color: var(--green); }
.cnt-warn { color: var(--amber); }
.cnt-fail { color: var(--red); }
.cnt-skip { color: var(--text-muted); }

.flag-row { display: flex; flex-wrap: wrap; gap: 7px; }
.flag-pill { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--red-soft); color: var(--red); border: 1px solid var(--red-border); }
.flag-pill.clean { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }

.billing-box { border: 1px solid var(--blue-border); background: #f8faff; border-radius: 12px; padding: 16px 18px; margin-bottom: 20px; }
.billing-box.risk-critical { border-color: var(--red-border); background: #fff8f8; }
.billing-box.risk-warn { border-color: var(--amber-border); background: #fffdf5; }
.billing-box-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.billing-box-title { font-weight: 700; font-size: 14px; }
.billing-lines { background: rgba(255, 255, 255, 0.85); border: 1px solid var(--border); border-radius: 9px; padding: 12px 14px; font-size: 13px; line-height: 1.85; }
.billing-note { margin-top: 8px; font-size: 11.5px; color: var(--text-muted); }

.cat-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
@media (max-width: 720px) { .cat-bars { grid-template-columns: repeat(2, 1fr); } }
.cat-card { padding: 11px 13px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-soft); }
.cat-card-top { display: flex; justify-content: space-between; font-size: 12.5px; font-weight: 600; margin-bottom: 6px; }
.cat-track { height: 6px; background: #e2e8f0; border-radius: 999px; overflow: hidden; }
.cat-fill { height: 100%; border-radius: 999px; background: var(--green); }
.cat-fill.warn { background: var(--amber); }
.cat-fill.fail { background: var(--red); }

.q-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; }
.q-chip { padding: 4px 9px; border-radius: 7px; font-family: var(--font-mono); font-size: 11.5px; font-weight: 600; border: 1px solid transparent; }
.q-chip.ok { background: var(--green-soft); color: var(--green); border-color: var(--green-border); }
.q-chip.bad { background: var(--red-soft); color: var(--red); border-color: var(--red-border); }

.checks-list { display: flex; flex-direction: column; gap: 10px; }
.check-item { border: 1px solid var(--border); border-radius: 11px; overflow: hidden; background: #fff; }
.check-head { padding: 13px 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; cursor: pointer; user-select: none; }
.check-head:hover { background: var(--surface-soft); }
.check-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.st-pill { padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; flex-shrink: 0; margin-top: 2px; }
.st-pass { background: var(--green-soft); color: var(--green); }
.st-warn { background: var(--amber-soft); color: var(--amber); }
.st-fail { background: var(--red-soft); color: var(--red); }
.st-skip { background: #f1f5f9; color: var(--text-muted); }
.check-info { flex: 1; min-width: 0; }
.check-title-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.check-id { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-muted); }
.check-title { font-weight: 700; font-size: 13.5px; }
.check-summary { margin-top: 4px; font-size: 13px; color: var(--text-sub); word-break: break-word; }
.check-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; color: var(--text-muted); font-size: 12px; }
.chevron { transition: transform 0.15s; }
.check-item.open .chevron { transform: rotate(90deg); }
.check-body { display: none; padding: 12px 15px 15px; border-top: 1px solid var(--border); background: var(--surface-soft); }
.check-item.open .check-body { display: block; }
.evidence-pre { margin: 0; padding: 12px; border-radius: 8px; background: #0f172a; color: #e2e8f0; font-family: var(--font-mono); font-size: 12px; line-height: 1.55; overflow-x: auto; max-height: 360px; }

.drawer-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.35); z-index: 40; }
.history-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw; background: #fff; box-shadow: -8px 0 30px rgba(15, 23, 42, 0.14); z-index: 50; display: flex; flex-direction: column; }
.drawer-head { padding: 18px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: flex-start; }
.drawer-head h3 { margin: 0 0 3px; font-size: 16px; }
.history-list { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.hist-item { border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; cursor: pointer; background: #fff; }
.hist-item:hover { border-color: var(--blue); background: #f8fbff; }
.hist-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
.hist-host { font-family: var(--font-mono); font-weight: 700; font-size: 13px; }
.hist-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.hist-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; color: var(--text-sub); }
.btn-del-hist { border: none; background: transparent; color: var(--text-muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 5px; }
.btn-del-hist:hover { background: var(--red-soft); color: var(--red); }

.color-pass { color: var(--green); }
.color-warn { color: var(--amber); }
.color-fail { color: var(--red); }
