:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e3e7ee;
  --line-soft: #eef1f6;
  --text: #111827;
  --text-2: #3f4a5a;
  --muted: #78839a;
  --brand: #2f6bff;
  --brand-soft: #eaf0ff;
  --pass: #0f9d58;
  --pass-soft: #e8f6ee;
  --warn: #c2760a;
  --warn-soft: #fdf4e3;
  --fail: #d92d20;
  --fail-soft: #fdecea;
  --info: #64748b;
  --info-soft: #eef1f5;
  --skip: #98a2b3;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 16px rgba(16, 24, 40, .05);
}

* { box-sizing: border-box; }

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

.wrap { max-width: 960px; margin: 0 auto; padding: 32px 20px 80px; }

/* ---------- 顶部 ---------- */
header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.logo {
  font-size: 19px; font-weight: 700; letter-spacing: -.3px;
  display: flex; align-items: center; gap: 8px;
}
.logo svg { width: 22px; height: 22px; }
.tagline { color: var(--muted); font-size: 13px; }

/* ---------- 表单 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form { padding: 18px 20px; margin-bottom: 20px; }
.form-main { display: flex; gap: 10px; align-items: center; }
.field { flex: 1; position: relative; }
.field input {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: 14px; color: var(--text);
  background: #fbfcfe; transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.field input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, .12); background: #fff;
}
.field input::placeholder { color: #a6b0c2; }

.btn {
  border: 0; border-radius: 10px; padding: 11px 22px; font-size: 14px;
  font-weight: 600; cursor: pointer; font-family: inherit;
  background: var(--brand); color: #fff; white-space: nowrap;
  transition: background .15s, transform .05s;
}
.btn:hover:not(:disabled) { background: #1e57e6; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: #c3cddd; cursor: not-allowed; }

.btn-ghost {
  background: transparent; color: var(--text-2); border: 1px solid var(--line);
  font-weight: 500; padding: 7px 14px; font-size: 13px;
}
.btn-ghost:hover:not(:disabled) { background: #f6f8fb; border-color: #cfd6e2; }

.advanced-toggle {
  margin-top: 12px; font-size: 13px; color: var(--muted);
  cursor: pointer; user-select: none; display: inline-flex;
  align-items: center; gap: 5px;
}
.advanced-toggle:hover { color: var(--brand); }
.advanced { margin-top: 14px; padding-top: 16px; border-top: 1px dashed var(--line); display: none; }
.advanced.open { display: block; }
.adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.adv-item label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.adv-item input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line);
  border-radius: 8px; font-size: 13px; font-family: inherit; background: #fbfcfe;
}
.adv-item input:focus { outline: none; border-color: var(--brand); background: #fff; }
.adv-note { grid-column: 1 / -1; font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 总览 ---------- */
.summary {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 24px; align-items: center; padding: 22px 24px; margin-bottom: 16px;
}
.ring-wrap { position: relative; width: 104px; height: 104px; flex: none; }
.ring { width: 104px; height: 104px; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.ring-bg { stroke: var(--line-soft); }
.ring-fg { stroke: var(--brand); transition: stroke-dashoffset .9s cubic-bezier(.4,0,.2,1), stroke .4s; }
.ring-val {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  flex-direction: column;
}
.ring-val b { font-size: 26px; font-weight: 700; letter-spacing: -.5px; line-height: 1; }
.ring-val span { font-size: 11px; color: var(--muted); margin-top: 3px; }

.verdict h2 { margin: 0 0 6px; font-size: 19px; font-weight: 700; letter-spacing: -.2px; }
.verdict p { margin: 0; color: var(--text-2); font-size: 13.5px; max-width: 560px; }
.verdict .meta { margin-top: 8px; font-size: 12px; color: var(--muted); font-family: var(--mono); }

.counts { display: flex; gap: 18px; text-align: center; }
.counts div { min-width: 46px; }
.counts b { display: block; font-size: 20px; font-weight: 700; line-height: 1.2; }
.counts span { font-size: 11px; color: var(--muted); }
.c-pass b { color: var(--pass); }
.c-warn b { color: var(--warn); }
.c-fail b { color: var(--fail); }
.c-info b { color: var(--info); }

/* ---------- 客户端矩阵 ---------- */
.section-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 26px 0 12px;
}
.section-head h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: .1px; }
.section-head .hint { font-size: 12px; color: var(--muted); }

.clients { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.client {
  background: var(--panel); border: 1px solid var(--line); border-radius: 11px;
  padding: 13px 15px; display: flex; gap: 11px; align-items: flex-start;
  transition: border-color .15s, box-shadow .15s;
}
.client:hover { box-shadow: var(--shadow); }
.client .mark {
  width: 20px; height: 20px; border-radius: 50%; flex: none; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
}
.client.pass .mark { background: var(--pass); }
.client.warn .mark { background: var(--warn); }
.client.fail .mark { background: var(--fail); }
.client-body { min-width: 0; }
.client-name { font-weight: 600; font-size: 13.5px; }
.client-note { font-size: 11.5px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.client-via {
  font-size: 11px; font-family: var(--mono); color: var(--brand);
  background: var(--brand-soft); padding: 1px 6px; border-radius: 4px;
  display: inline-block; margin-top: 5px;
}
.client.fail .client-via { color: var(--fail); background: var(--fail-soft); }

/* ---------- 分组 ---------- */
.group {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; margin-bottom: 10px; overflow: hidden;
}
.group-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px; cursor: pointer; user-select: none;
}
.group-head:hover { background: #fafbfd; }
.group-title { font-weight: 600; font-size: 13.5px; }
.group-desc { font-size: 11.5px; color: var(--muted); flex: 1; }
.group-bar {
  width: 68px; height: 4px; background: var(--line-soft);
  border-radius: 2px; overflow: hidden; flex: none;
}
.group-bar i { display: block; height: 100%; background: var(--brand); border-radius: 2px; transition: width .5s; }
.group-pct { font-size: 12px; font-family: var(--mono); color: var(--muted); width: 34px; text-align: right; }
.group-caret { color: var(--muted); transition: transform .2s; font-size: 10px; }
.group.open .group-caret { transform: rotate(90deg); }
.group-body { display: none; border-top: 1px solid var(--line-soft); }
.group.open .group-body { display: block; }

/* ---------- 检查项 ---------- */
.item { border-bottom: 1px solid var(--line-soft); }
.item:last-child { border-bottom: 0; }
.item-head {
  display: flex; gap: 11px; padding: 11px 18px;
  cursor: pointer; align-items: baseline;
}
.item-head:hover { background: #fafbfd; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; margin-top: 7px; }
.item[data-status="pass"] .dot { background: var(--pass); }
.item[data-status="warn"] .dot { background: var(--warn); }
.item[data-status="fail"] .dot { background: var(--fail); }
.item[data-status="info"] .dot { background: var(--info); }
.item[data-status="skip"] .dot { background: var(--skip); }

.item-title { font-size: 13px; font-weight: 500; flex: none; min-width: 190px; }
.item-summary { font-size: 12.5px; color: var(--muted); flex: 1; min-width: 0; }
.item[data-status="fail"] .item-summary { color: var(--fail); }
.item[data-status="warn"] .item-summary { color: var(--warn); }

.item-caret {
  color: #b9c2d2; font-size: 16px; line-height: 1; flex: none;
  transition: transform .2s; padding-left: 4px;
}
.item.open .item-caret { transform: rotate(90deg); color: var(--brand); }

.item-body { display: none; padding: 0 18px 15px 36px; }
.item.open .item-body { display: block; }
.detail {
  white-space: pre-wrap; font-size: 12.5px; color: var(--text-2);
  background: #f8fafc; border: 1px solid var(--line-soft);
  border-radius: 8px; padding: 10px 12px; margin: 0 0 10px;
  word-break: break-word;
}
.fix { display: flex; gap: 8px; font-size: 12.5px; color: var(--text-2); }
.fix b { color: var(--brand); font-weight: 600; flex: none; }
.fix span { white-space: pre-wrap; }
.recs { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.rec {
  font-family: var(--mono); font-size: 11.5px; background: #0f172a;
  color: #d6e4ff; padding: 8px 11px; border-radius: 7px;
  display: flex; justify-content: space-between; gap: 10px; align-items: center;
}
.rec code { white-space: pre-wrap; word-break: break-all; }
.copy {
  border: 0; background: rgba(255,255,255,.12); color: #cfe0ff;
  border-radius: 5px; padding: 2px 8px; font-size: 10.5px; cursor: pointer;
  font-family: inherit; flex: none;
}
.copy:hover { background: rgba(255,255,255,.22); }

/* ---------- 记录清单 ---------- */
.records-panel { padding: 18px 20px; }
.records-panel pre {
  margin: 12px 0 0; background: #0f172a; color: #cbd8f0;
  padding: 15px 17px; border-radius: 10px; font-family: var(--mono);
  font-size: 11.5px; line-height: 1.75; overflow-x: auto;
  white-space: pre;
}
.todo-list { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.todo-list li {
  font-family: var(--mono); font-size: 11.5px; color: var(--text-2);
  background: #f8fafc; border: 1px solid var(--line-soft);
  padding: 7px 11px; border-radius: 7px; word-break: break-all;
}

/* ---------- 加载/空状态 ---------- */
.skeleton {
  padding: 14px 18px; color: var(--muted); font-size: 12.5px;
  display: flex; align-items: center; gap: 9px;
}
.spinner {
  width: 13px; height: 13px; border: 2px solid var(--line);
  border-top-color: var(--brand); border-radius: 50%;
  animation: spin .7s linear infinite; flex: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

.empty { text-align: center; padding: 60px 20px; color: var(--muted); }
.empty h3 { font-size: 15px; color: var(--text-2); margin: 0 0 6px; font-weight: 600; }
.empty p { margin: 0; font-size: 13px; }

.notice {
  background: var(--warn-soft); border: 1px solid #f3e0bd; color: #8a5a00;
  padding: 10px 14px; border-radius: 9px; font-size: 12.5px; margin-bottom: 14px;
}

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 9px 18px; border-radius: 9px;
  font-size: 12.5px; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; z-index: 99;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 关于 ---------- */
.about-btn {
  margin-left: auto; align-self: center;
  background: transparent; border: 1px solid var(--line); color: var(--text-2);
  border-radius: 999px; padding: 4px 14px; font-size: 12.5px;
  font-family: inherit; cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.about-btn:hover { background: var(--brand-soft); border-color: var(--brand); color: var(--brand); }

.modal {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; background: rgba(17, 24, 39, .38);
}
.modal[hidden] { display: none; }

.modal-card {
  width: min(560px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  background: var(--panel); border-radius: var(--radius);
  box-shadow: 0 12px 48px rgba(16, 24, 40, .22);
  padding: 22px 22px 18px;
  animation: modalIn .16s ease-out;
}
@keyframes modalIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

.about-body { font-size: 13px; line-height: 1.65; color: var(--text-2); user-select: text; }
.about-title { font-size: 19px; font-weight: 700; color: var(--text); letter-spacing: -.2px; }
.about-title .ver { color: var(--brand); font-weight: 700; margin-left: 8px; }
.about-sub { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.about-h { font-weight: 600; color: var(--text); margin-top: 14px; font-size: 12.5px; }
.about-h strong { font-weight: inherit; }
.about-body p { margin: 10px 0 0; }
.about-list { margin: 6px 0 0; padding-left: 18px; }
.about-list li { margin: 3px 0; }
.about-list li::marker { color: var(--brand); }
.about-foot { margin-top: 14px; font-size: 11px; color: #8a8a8a; line-height: 1.6; }

.about-contact {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fafbfc; border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 9px 14px; margin-top: 16px; font-size: 12.5px; color: var(--text-2);
}
.about-author { color: var(--muted); }
.mail-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 999px;
  padding: 3px 12px; font-size: 12.5px; font-family: inherit;
  color: var(--text-2); cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.mail-pill svg { width: 13px; height: 13px; }
.mail-pill:hover { border-color: #cfd6e2; }
.mail-pill.copied { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.copy-hint { font-size: 11.5px; color: var(--brand); opacity: 0; transition: opacity .18s; }
.copy-hint.show { opacity: 1; }

.about-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.about-actions .btn { padding: 8px 20px; font-size: 13px; }

@media (max-width: 720px) {
  .wrap { padding: 20px 14px 60px; }
  .form-main { flex-direction: column; align-items: stretch; }
  .adv-grid { grid-template-columns: 1fr; }
  .summary { grid-template-columns: 1fr; text-align: center; gap: 16px; }
  .ring-wrap { margin: 0 auto; }
  .counts { justify-content: center; }
  .clients { grid-template-columns: 1fr 1fr; }
  .item-title { min-width: 0; }
  .item-summary { display: none; }
  .group-desc { display: none; }
}
