:root {
  --primary: #005cfa;
  --primary-soft: #edf4ff;
  --text: #20242c;
  --muted: #737b8c;
  --border: #e7eaf0;
  --surface: #ffffff;
  --canvas: #f6f8fb;
  --positive: #2f6bff;
  --negative: #f04455;
  --shadow: 0 10px 30px rgba(31, 47, 69, 0.06);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

button,
input { font: inherit; }

a { color: var(--primary); }

.page-header {
  padding: 40px 24px 26px;
  text-align: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  margin: 2px 0 4px;
  font-size: 28px;
  line-height: 1.35;
}

.archive-label {
  margin: 0;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
}

.archive-note {
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 13px;
}

.report-shell {
  display: flex;
  width: min(1152px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 56px;
  flex-direction: column;
  gap: 36px;
}

.report-section {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.section-heading::before {
  width: 4px;
  height: 26px;
  content: "";
  background: var(--primary);
  border-radius: 999px;
}

.section-heading h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.step-badge {
  display: inline-grid;
  width: 25px;
  height: 25px;
  margin-left: -4px;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 12px;
  font-weight: 700;
}

.subheading {
  margin: 24px 0 12px;
  font-size: 15px;
}

.sample-grid {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.sample-row {
  display: grid;
  grid-template-columns: minmax(140px, 34%) 1fr;
  border-bottom: 1px solid var(--border);
}

.sample-row:last-child { border-bottom: 0; }

.sample-label,
.sample-value { padding: 15px 18px; }

.sample-label {
  color: var(--muted);
  font-weight: 600;
  background: #fbfcfe;
}

.purpose-list {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 20px;
}

.metrics-grid,
.platform-grid,
.keyword-grid,
.artifact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric-card,
.platform-card,
.keyword-card,
.artifact-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
}

.metric-card h3,
.platform-card h3,
.keyword-card h3,
.artifact-card h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.metric-definition {
  min-height: 44px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.metric-value {
  margin: 3px 0 9px;
  color: var(--primary);
  font-size: 26px;
  font-weight: 750;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  background: #edf0f5;
  border-radius: 999px;
}

.progress-bar {
  width: var(--progress, 0%);
  height: 100%;
  background: linear-gradient(90deg, #2c75ff, #7c5cff);
  border-radius: inherit;
}

.mini-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.mini-metric {
  padding: 8px;
  text-align: center;
  background: var(--primary-soft);
  border-radius: 8px;
}

.mini-metric strong,
.mini-metric span { display: block; }
.mini-metric span { color: var(--muted); font-size: 11px; }
.mini-metric strong { margin-top: 2px; color: var(--primary); }

.data-block { margin-top: 18px; }

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.table-toolbar h3 {
  margin: 0;
  font-size: 15px;
}

.table-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-input {
  width: min(240px, 45vw);
  height: 34px;
  padding: 0 11px;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 92, 250, .1);
}

.export-button,
.local-link {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 0 13px;
  color: #fff;
  text-decoration: none;
  background: var(--primary);
  border: 0;
  border-radius: 7px;
  cursor: pointer;
}

.export-button:hover,
.local-link:hover { background: #004ed5; }

.table-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.table-scroll {
  max-height: var(--table-height, 420px);
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.data-table {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 11px 12px;
  text-align: left;
  vertical-align: top;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  white-space: normal;
}

.data-table th:last-child,
.data-table td:last-child { border-right: 0; }

.data-table tbody tr:last-child td { border-bottom: 0; }

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #5d6574;
  background: #f7f8fa;
  font-size: 12px;
  font-weight: 700;
}

.data-table tbody tr:hover td { background: #fafcff; }
.empty-cell { color: var(--muted); text-align: center !important; }
.table-link { word-break: break-all; }

.tag-group { margin-top: 12px; }
.tag-title { margin: 0 0 7px; color: var(--muted); font-size: 12px; font-weight: 700; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; }
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 12px;
  background: var(--primary-soft);
  color: var(--positive);
}
.tag.negative { color: var(--negative); background: #fff0f2; }
.tag-count { margin-left: 5px; font-weight: 700; }

.artifact-card p { min-height: 44px; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.artifact-card .local-link { width: 100%; }

.fatal {
  padding: 24px;
  color: #8e1f2e;
  background: #fff0f2;
  border: 1px solid #ffcbd2;
  border-radius: 10px;
}

.page-footer {
  padding: 22px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (max-width: 900px) {
  .metrics-grid,
  .platform-grid,
  .keyword-grid,
  .artifact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  .page-header { padding: 28px 16px 20px; }
  .page-header h1 { font-size: 24px; }
  .report-shell { width: calc(100% - 24px); padding-top: 16px; gap: 20px; }
  .report-section { padding: 16px; }
  .metrics-grid,
  .platform-grid,
  .keyword-grid,
  .artifact-grid { grid-template-columns: 1fr; }
  .sample-row { grid-template-columns: 1fr; }
  .sample-label { padding-bottom: 5px; }
  .sample-value { padding-top: 7px; }
  .table-toolbar { align-items: flex-start; flex-direction: column; }
  .table-controls { width: 100%; }
  .search-input { width: 100%; flex: 1; }
  .mini-metrics { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .page-header { padding-top: 10px; }
  .report-shell { width: 100%; }
  .report-section { break-inside: avoid; box-shadow: none; }
  .table-controls,
  .table-status,
  .archive-note { display: none; }
  .table-scroll { max-height: none; overflow: visible; }
}
