/* LLM Price — style */

:root {
  --bg: #0d1117;
  --bg-panel: #161b22;
  --border: #2b3240;
  --text: #e6e8eb;
  --text-dim: #9aa4b2;
  --text-faint: #6b7484;
  --accent: #7ab8ff;
  --c-input: #4c9aff;
  --c-output: #38c793;
  --radius: 10px;
  --cw: 150px;          /* center column width (model names) */
  --chart-pad: 38px;    /* side padding so edge value labels fit */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

main, .site-header, .site-footer {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.site-header { padding-top: 44px; padding-bottom: 8px; }
.site-header h1 { font-size: 2rem; letter-spacing: -0.02em; font-weight: 700; }
.subtitle { color: var(--text-dim); margin-top: 6px; font-size: 1.02rem; }
.meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  color: var(--text-dim);
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
}

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 22px;
}
.panel-title { font-size: 1.05rem; margin-bottom: 6px; font-weight: 650; }
.panel-sub { font-size: 0.8rem; color: var(--text-faint); margin-bottom: 14px; }

/* ---- legend ---- */
.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.legend-item { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.sw-input { background: rgba(76, 154, 255, 0.35); border: 1px solid var(--c-input); }
.sw-cached { background: var(--c-input); }
.sw-output { background: var(--c-output); }
.legend-note { color: var(--text-faint); font-size: 0.75rem; margin-left: auto; }

/* ---- log-scale callout ---- */
.log-callout {
  margin: -6px 0 16px;
  padding: 9px 14px;
  font-size: 0.8rem;
  color: var(--text-dim);
  background: rgba(76, 154, 255, 0.06);
  border: 1px solid rgba(76, 154, 255, 0.25);
  border-radius: 6px;
}
.log-callout strong { color: var(--c-input); font-weight: 650; }

/* ---- diverging chart ---- */
.chart { padding: 0 var(--chart-pad); }

.axis-row, .chart-row, .group-row {
  display: grid;
  grid-template-columns: 1fr var(--cw) 1fr;
}

.axis-row { height: 24px; margin-bottom: 4px; }
.axis-side { position: relative; border-bottom: 1px solid var(--border); }
.axis-tick {
  position: absolute;
  bottom: 3px;
  font-size: 0.68rem;
  color: var(--text-faint);
  white-space: nowrap;
}

#rows { position: relative; }

/* log gridlines overlay — zones mirror the row grid geometry */
.gl-zone { position: absolute; top: 0; bottom: 0; pointer-events: none; }
.gl-left { left: 0; width: calc(50% - var(--cw) / 2); }
.gl-right { right: 0; width: calc(50% - var(--cw) / 2); }
.gl-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.05);
}

.group-row { margin-top: 6px; }
.group-row:first-child { margin-top: 0; }
.group-name {
  grid-column: 2;
  text-align: center;
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: 10px 0 2px;
}

.chart-row { align-items: center; padding: 6px 0; }
.side { position: relative; height: 26px; }
.center-label {
  font-size: 0.82rem;
  text-align: center;
  padding: 0 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  height: 12px;
  border-radius: 2px;
}
.side-left .bar { right: 0; background: rgba(76, 154, 255, 0.35); }
.side-right .bar { left: 0; background: var(--c-output); }
.bar .cached-seg {
  position: absolute;
  top: 0; bottom: 0;
  background: var(--c-input);
  border-radius: 2px 0 0 2px;
}
/* left bar is anchored at center (right edge) → solid segment sits at right end */
.side-left .cached-seg { right: 0; }

.bar .val {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.68rem;
  color: var(--text-dim);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.side-left .val { right: calc(100% + 7px); }
.side-right .val { left: calc(100% + 7px); }

/* ---- scatter ---- */
.scatter-wrap { width: 100%; }
#scatter { width: 100%; height: auto; display: block; }
#scatter text { font-family: inherit; }
.sc-axis-line { stroke: var(--border); stroke-width: 1; }
.sc-grid { stroke: rgba(255, 255, 255, 0.05); stroke-width: 1; }
.sc-ref { stroke: var(--text-faint); stroke-width: 1; stroke-dasharray: 4 4; }
.sc-tick { fill: var(--text-faint); font-size: 11px; }
.sc-axis-label { fill: var(--text-dim); font-size: 12px; }
.sc-dot { stroke: rgba(255, 255, 255, 0.25); stroke-width: 1; cursor: default; }
.sc-label { fill: var(--text-dim); font-size: 9.5px; }

.vendor-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 14px;
  font-size: 0.78rem;
  color: var(--text-dim);
}
.vendor-legend span { display: inline-flex; align-items: center; gap: 6px; }
.vendor-legend i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---- table ---- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.86rem; min-width: 560px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid #21262e; }
th { color: var(--text-dim); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
th.num { text-align: right; }
td.dim { color: var(--text-faint); }
td a { color: var(--accent); text-decoration: none; }
td a:hover { text-decoration: underline; }
tbody tr:hover { background: #1a2029; }

/* ---- notes ---- */
.notes { list-style: none; }
.notes li {
  position: relative;
  padding-left: 18px;
  color: var(--text-dim);
  font-size: 0.86rem;
  margin-bottom: 8px;
}
.notes li::before {
  content: "";
  position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--text-faint);
}
.notes strong { color: var(--text); font-weight: 600; }
.notes a { color: var(--accent); text-decoration: none; }
.notes a:hover { text-decoration: underline; }

.site-footer {
  margin-top: 36px;
  padding-bottom: 40px;
  color: var(--text-faint);
  font-size: 0.8rem;
  text-align: center;
}
.site-footer a { color: var(--text-dim); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }

/* ---- mobile ---- */
@media (max-width: 640px) {
  :root { --cw: 92px; --chart-pad: 10px; }

  .site-header { padding-top: 30px; }
  .site-header h1 { font-size: 1.55rem; }
  .panel { padding: 16px 12px; margin-top: 16px; }
  .legend-note { margin-left: 0; width: 100%; }

  .center-label { font-size: 0.72rem; padding: 0 4px; }
  .bar { height: 10px; }
  .bar .val { display: none; }   /* values live in the table on small screens */
  .axis-tick { font-size: 0.58rem; }
  .group-name { font-size: 0.58rem; }
  .sc-label { display: none; }
}
