:root {
  /* Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f2f2f2;
  --bg-header: #111111;
  --text-primary: #000000;
  --text-muted: #2b2b2b;
  --text-inverse: #ffffff;
  --border-color: #000000;
  --focus-ring: #005fcc;
  --focus-ring-alpha: rgba(0, 95, 204, 0.25);

  /* Semantic */
  --success: #22c55e;
  --warning: #eab308;
  --error: #ef4444;

  /* Typography */
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans SC", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Helvetica, Arial, sans-serif;
  --line-height-cjk: 1.6;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --text-xs: 12px;
  --text-sm: 13px;
  --text-base: 14px;
  --text-lg: 16px;
  --text-xl: 18px;
  --text-2xl: 24px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
}

:lang(zh-CN) {
  line-height: var(--line-height-cjk);
  word-break: break-word;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wrap {
  max-width: 1200px;
  margin: 0 auto;
  padding: 18px 14px 26px;
}

.site-header,
.page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border: 2px solid var(--border-color);
  padding: 12px;
}

.site-header h1,
.page-header h1 {
  font-size: var(--text-xl);
  margin: 0;
  line-height: 1.2;
}

.site-nav {
  display: flex;
  gap: 12px;
  font-size: var(--text-sm);
  font-weight: 700;
}

.sub {
  margin: 6px 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.breadcrumb {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

label {
  font-size: var(--text-sm);
  font-weight: 700;
}

input[type="search"] {
  appearance: none;
  border: 2px solid var(--border-color);
  padding: 8px 10px;
  font-size: var(--text-base);
  width: min(360px, 80vw);
  outline: none;
  font-family: var(--font-sans);
}

input[type="search"]:focus {
  box-shadow: 0 0 0 3px var(--focus-ring-alpha);
  border-color: var(--focus-ring);
}

button {
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-weight: 800;
  padding: 8px 10px;
  cursor: pointer;
  font-family: var(--font-sans);
}

button:focus {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring-alpha);
  border-color: var(--focus-ring);
}

.card {
  border: 2px solid var(--border-color);
  padding: 12px;
  background: var(--bg-primary);
}

.card-link {
  display: block;
  border: 3px solid var(--border-color);
  padding: 16px;
  background: linear-gradient(135deg, #ffffff 0%, #f4f4f4 100%);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card.card-link h2 {
  font-size: var(--text-lg);
  text-transform: none;
  letter-spacing: 0.01em;
}

.card-link:hover,
.card-link:focus-visible {
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 6px 6px 0 var(--border-color);
}

.card-link:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 3px var(--focus-ring-alpha), 6px 6px 0 var(--border-color);
}

.card-cta {
  display: inline-block;
  margin-top: 10px;
  border: 2px solid var(--border-color);
  padding: 6px 10px;
  background: var(--bg-header);
  color: var(--text-inverse);
  font-size: var(--text-xs);
  font-weight: 800;
}

.card-link:hover .card-cta,
.card-link:focus-visible .card-cta {
  background: var(--bg-primary);
  color: var(--text-primary);
}

.card h2 {
  margin: 0 0 6px;
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.card p,
.card li {
  font-size: var(--text-sm);
  line-height: 1.35;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.section {
  margin-top: 16px;
}

.legend {
  margin-top: 12px;
  border: 2px solid var(--border-color);
  background: var(--bg-primary);
}

.legend details {
  padding: 8px 10px;
}

.legend summary {
  cursor: pointer;
  font-weight: 900;
  list-style: none;
  display: flex;
  gap: 10px;
  align-items: baseline;
}

.legend summary::-webkit-details-marker {
  display: none;
}

.legend .sum-title {
  font-size: var(--text-base);
}

.legend .sum-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 700;
}

.legend-body {
  padding: 8px 0 2px;
}

.legend .note {
  margin: 6px 0 10px;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.legend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}

.ref {
  margin: 10px 0 0;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.table-wrap {
  margin-top: 14px;
  border: 2px solid var(--border-color);
  overflow: auto;
  max-height: 72vh;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 980px;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--bg-header);
  color: var(--text-inverse);
  border-bottom: 2px solid var(--border-color);
  padding: 10px;
  text-align: left;
  font-size: var(--text-sm);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

thead th:hover {
  filter: brightness(1.08);
}

thead th:focus {
  outline: none;
  box-shadow: inset 0 0 0 3px rgba(0, 95, 204, 0.35);
}

.th-label {
  margin-right: 8px;
}

.th-ind {
  display: inline-block;
  width: 12px;
  text-align: center;
  font-weight: 900;
}

tbody td {
  border-top: 1px solid var(--border-color);
  padding: 8px 10px;
  font-size: var(--text-sm);
  white-space: nowrap;
}

tbody tr:nth-child(even) td {
  background: var(--bg-secondary);
}

/* Freeze first column for wide benchmark tables when horizontally scrolling. */
table.sticky-first-col th:first-child,
table.sticky-first-col td:first-child {
  position: sticky;
  left: 0;
  border-right: 2px solid var(--border-color);
}

table.sticky-first-col thead th:first-child {
  z-index: 4;
}

table.sticky-first-col tbody td:first-child {
  z-index: 1;
  background: var(--bg-primary);
  font-weight: 700;
}

table.sticky-first-col tbody tr:nth-child(even) td:first-child {
  background: var(--bg-secondary);
}

.right {
  text-align: right;
}

.mono {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.status {
  margin-top: 10px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.site-footer {
  margin-top: 24px;
  border-top: 2px solid var(--border-color);
  padding-top: 12px;
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.lang-switch {
  margin-left: auto;
  font-size: var(--text-sm);
}

.lang-switch a {
  padding: 4px 8px;
  border: 2px solid var(--border-color);
  text-decoration: none;
}

.lang-switch a:hover {
  background: var(--bg-secondary);
  text-decoration: none;
}
