/* 服务端诊断报告页。配色与导航沿用 assets/site.css。 */

main#root { width: min(980px, 100%); margin: 0 auto; padding: 20px 16px 56px; }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  min-width: 0;
}
.card h1 { font-size: 1.45rem; margin: 0 0 8px; line-height: 1.3; }
.card h2 { font-size: 1.2rem; margin: 0 0 8px; line-height: 1.3; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.err { color: var(--bad); }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.grow { flex: 1 1 240px; min-width: 0; }
label { display: block; font-weight: 700; font-size: 0.92rem; }
label input { width: 100%; margin-top: 4px; font-size: 1rem; }
button, .btn { cursor: pointer; }
.no-print { print-color-adjust: exact; }

#setup details { flex: 1 1 100%; border-top: 1px dashed var(--line); padding-top: 8px; }
#setup summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.auth-fields { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-top: 8px; }

.overview { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; margin: 12px 0; }
.donut { width: 140px; height: 140px; flex: 0 0 auto; }
.donut-total { font-size: 26px; font-weight: 800; fill: var(--text); }
.donut-label { font-size: 11px; fill: var(--muted); }
.overview-right { flex: 1 1 320px; min-width: 0; }
.stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat { flex: 1 1 78px; min-width: 0; padding: 10px 6px; border-radius: 12px; text-align: center; background: var(--bg-muted); }
.stat b { display: block; font-size: 1.5rem; line-height: 1.1; }
.stat.ok { background: var(--ok-bg); color: var(--ok); }
.stat.bad { background: var(--bad-bg); color: var(--bad); }
.stat.shaky { background: var(--diagram-shaky-bg); color: var(--diagram-shaky); }
.stat.unk { background: var(--unk-bg); color: var(--unk); }
.stat.ask { background: var(--junior-soft); }
.legend-list { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: 0.86rem; color: var(--muted); }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }

.notice { color: var(--warn); background: var(--warn-bg); padding: 8px 12px; border-radius: 10px; margin-top: 10px; }
.tag { display: inline-block; font-size: 0.78rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; margin-right: 4px; background: var(--bg-muted); color: var(--text); }
.tag.weak { background: var(--bad-bg); color: var(--bad); }
.tag.mastered, .tag.correct { background: var(--ok-bg); color: var(--ok); }
.tag.unknown, .tag.skip { background: var(--unk-bg); color: var(--unk); }
.tag.shaky { background: var(--diagram-shaky-bg); color: var(--diagram-shaky); }
.tag.wrong, .tag.manual { background: var(--bad-bg); color: var(--bad); }
.tag.root { background: var(--bad); color: var(--on-bad); }
.tag.target { background: var(--junior); color: var(--on-brand); }
.tag.ext { background: var(--junior-soft); }

.root-list, .topic-list, .path { list-style: none; padding: 0; margin: 0; }
.root-item { border-bottom: 1px solid var(--line); padding: 10px 0; }
.root-item:last-child { border-bottom: 0; }
.root-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; margin-bottom: 4px; }
.prereq-line { margin-top: 6px; font-size: 0.9rem; }
.topic-list li, .path-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.topic-list li:last-child, .path-row:last-child { border-bottom: 0; }
.path { counter-reset: step; }
.path-row { counter-increment: step; padding-left: 42px; position: relative; }
.path-row::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 28px;
  height: 28px;
  border-radius: 14px;
  background: var(--brand);
  color: var(--on-brand);
  text-align: center;
  line-height: 28px;
  font-size: 0.85rem;
  font-weight: 800;
}

.graph-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--bg-muted); padding: 8px; }
.report-graph { display: block; width: 100%; min-width: 660px; height: auto; }
.graph-title { font-size: 13px; font-weight: 800; fill: var(--text); }
.graph-sub { font-size: 11px; fill: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.92rem; }
th, td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 800; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }

body.share-open { overflow: hidden; }
.share-modal { position: fixed; inset: 0; z-index: 80; background: rgba(15, 23, 42, 0.55); display: flex; align-items: flex-end; justify-content: center; }
.share-panel { width: min(520px, 100%); background: var(--bg-elev); border-radius: 16px 16px 0 0; padding: 14px; max-height: 90vh; overflow: auto; }
.share-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.share-bar h2 { margin: 0; font-size: 1.1rem; }
.share-hint { color: var(--muted); font-size: 0.86rem; }
.share-scroll { text-align: center; }
.share-scroll img { max-width: 100%; max-height: 60vh; border-radius: 10px; }
.share-actions { margin-top: 10px; text-align: center; }

@media print {
  .site-header, .site-footer, #setup, #report-actions, .no-print { display: none !important; }
  main#root { width: 100%; max-width: none; padding: 0; }
  .card { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  .graph-wrap { background: transparent; }
}
