/* iq-live-results · 本轮实时成绩 / Live grades, between the round-progress card and the published board.
   Scoped to .iqlr; same radar-ui tokens and console fallbacks as .iqlp so both cards read as one family.
   Only motion: an optional one-shot fade on cells/rows that really changed. None under reduced motion
   or [data-view-hidden]. */

.iqlr {
  --iqlr-accent: var(--accent, #39ff88);
  --iqlr-line: var(--line, #193a29);
  --iqlr-line-2: var(--line-2, #2a5a40);
  --iqlr-surface: var(--surface, #09110c);
  --iqlr-text: var(--text, #ddeae1);
  --iqlr-text-2: var(--text-2, #a2b8aa);
  --iqlr-text-3: var(--text-3, #6f8a79);
  --iqlr-warn: var(--warn, #f2c14e);
  --iqlr-mono: var(--font-mono, ui-monospace, "SF Mono", Menlo, Consolas, monospace);
  --iqlr-ease: var(--ease, cubic-bezier(.2, .7, .2, 1));
  --iqlr-total: var(--iqlr-accent);
  container: iqlr / inline-size;
  position: relative;
  min-width: 0;
  margin: 0 0 12px;
  padding: 11px 14px 10px 16px;
  border: 1px solid var(--iqlr-line);
  border-radius: var(--r-md, 4px);
  background: var(--iqlr-surface);
  color: var(--iqlr-text);
  font: 400 13px/1.5 var(--font-sans, system-ui, sans-serif);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-align: left;
}
:root[data-theme="light"] .iqlr { --iqlr-total: var(--accent-strong, #055a2f); }
.iqlr *, .iqlr *::before, .iqlr *::after { box-sizing: border-box; }
.iqlr [hidden] { display: none !important; }
:where(.iqlr) p { margin: 0; }

/* Last value after a failed read: dashed frame like the progress card. */
.iqlr[data-freshness="stale"] { border-style: dashed; }

/* ── Head ── */
.iqlr-head { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; min-width: 0; }
.iqlr-title { margin: 0; color: var(--iqlr-text); font-size: 13px; font-weight: 600; line-height: 1.4; }
.iqlr-tag {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 7px;
  border: 1px dashed color-mix(in srgb, var(--iqlr-warn) 55%, transparent); border-radius: var(--r-sm, 3px);
  color: var(--iqlr-warn);
  font: 600 10px/1 var(--iqlr-mono); letter-spacing: .06em; white-space: nowrap;
}
.iqlr-meta { display: flex; flex-wrap: wrap; gap: 0 14px; margin-top: 4px; color: var(--iqlr-text-3); font: 11px/1.7 var(--iqlr-mono); }
.iqlr-meta-item { white-space: nowrap; }
.iqlr-meta-item:first-child { white-space: normal; min-width: 0; }
.iqlr-round, .iqlr-meta time { color: var(--iqlr-text-2); }
.iqlr-round { overflow-wrap: anywhere; }
.iqlr-note { margin-top: 8px; color: var(--iqlr-text-2); font-size: 12px; line-height: 1.6; }
.iqlr-legend { margin-top: 6px; color: var(--iqlr-text-3); font: 11px/1.6 var(--iqlr-mono); }

/* ── Table: keyboard-scrollable region, sticky header row and model column ── */
.iqlr-scroll {
  margin-top: 8px;
  max-block-size: min(70vh, 36rem);
  overflow: auto;
  overscroll-behavior-inline: contain;
  border-radius: var(--r-sm, 3px);
}
.iqlr-scroll:focus-visible { outline: 2px solid var(--focus, var(--iqlr-accent)); outline-offset: 2px; }
.iqlr-table {
  width: 100%; min-width: 31rem; max-width: 52rem;
  border-collapse: separate; border-spacing: 0;
  font: 500 13px/1.3 var(--iqlr-mono);
}
.iqlr-table th, .iqlr-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--iqlr-line);
  text-align: right; vertical-align: middle; white-space: nowrap;
}
.iqlr-table tbody tr:last-child > * { border-bottom: 0; }
.iqlr-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--iqlr-surface);
  border-bottom-color: var(--iqlr-line-2);
  vertical-align: bottom;
  font-weight: 400;
}
.iqlr-name { display: block; color: var(--iqlr-text-2); font: 500 12px/1.3 var(--font-sans, system-ui, sans-serif); }
.iqlr-max { display: block; color: var(--iqlr-text-3); font: 400 11px/1.4 var(--iqlr-mono); }
.iqlr-table .iqlr-corner, .iqlr-table .iqlr-row {
  position: sticky; left: 0;
  text-align: left;
  background: var(--iqlr-surface);
  box-shadow: inset -1px 0 0 var(--iqlr-line);
}
.iqlr-table .iqlr-corner {
  z-index: 2;
  color: var(--iqlr-text-3);
  font: 400 11px/1.4 var(--iqlr-mono); letter-spacing: .04em;
}
.iqlr-table .iqlr-row { z-index: 1; min-width: 9rem; white-space: normal; }
.iqlr-model { color: var(--iqlr-text); font-weight: 700; }
.iqlr-effort { margin-left: 4px; color: var(--iqlr-text-3); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.iqlr-table td { color: var(--iqlr-text); }
.iqlr-table td[data-empty] { color: var(--iqlr-text-3); }
.iqlr-c-total { box-shadow: inset 1px 0 0 var(--iqlr-line); }
.iqlr-table td.iqlr-c-total:not([data-empty]) { color: var(--iqlr-total); font-weight: 700; }

.iqlr-sr {
  position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; clip-path: inset(50%) !important; white-space: nowrap !important; border: 0 !important;
}

/* One-shot fade on a real change; never on first render, round switch or stale data. */
.iqlr .is-new { animation: iqlr-in 260ms var(--iqlr-ease) both; }
@keyframes iqlr-in { from { opacity: .2; } to { opacity: 1; } }

@container iqlr (max-width: 420px) {
  .iqlr-table { min-width: 28rem; }
  .iqlr-table th, .iqlr-table td { padding: 5px 8px; }
  .iqlr-table .iqlr-row { min-width: 7.25rem; max-width: 9rem; }
  .iqlr-effort { display: block; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .iqlr, .iqlr *, .iqlr *::before, .iqlr *::after { animation: none !important; transition: none !important; }
}
[data-view-hidden] .iqlr, [data-view-hidden] .iqlr *,
.iqlr[data-view-hidden], .iqlr[data-view-hidden] * { animation: none !important; transition: none !important; }
@media print {
  .iqlr-scroll { max-block-size: none; overflow: visible; }
  .iqlr-table thead th, .iqlr-corner, .iqlr-row { position: static; }
}
