/*
 * Minimalist Flat: pure black and white plus one accent, 2px black borders,
 * square corners everywhere, no shadows, no gradients, no grey surfaces.
 * Status colors (#ffcc00, #ff3366) always carry black text and a text label,
 * so color is never the only signal.
 */
:root {
  --bg: #ffffff;
  --fg: #000000;
  --muted: #6b7280; /* deliberate de-emphasis only: crumbs, dates, captions */
  --accent: #ff3366;
  --warn: #ffcc00;
  --ok: #00d4aa;
  --border: 2px solid var(--fg);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --fg: #ffffff;
    --muted: #a3a3a3;
  }
}
* { box-sizing: border-box; border-radius: 0; box-shadow: none; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
main, .top-inner, .foot-inner { max-width: 1152px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) {
  main, .top-inner, .foot-inner { padding: 0 32px; }
}

/* Links: black with underline; hover switches to the accent, never moves. */
a { color: var(--fg); text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }
a:hover { color: var(--accent); }
a:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Header */
.top { border-bottom: var(--border); }
.top-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 32px; padding-top: 16px; padding-bottom: 16px; }
.brand { font-weight: 800; font-size: 18px; letter-spacing: -0.01em; text-decoration: none; }
.top nav { display: flex; flex-wrap: wrap; gap: 0 20px; font-size: 14px; }
.top nav a { text-decoration: none; font-weight: 600; display: inline-block; padding: 10px 0; }
.top nav a:hover { color: var(--accent); }

/* Type scale and generous vertical rhythm */
h1 { font-size: 30px; line-height: 1.15; font-weight: 800; letter-spacing: -0.02em; margin: 40px 0 20px; overflow-wrap: anywhere; }
h2 { font-size: 24px; line-height: 1.25; font-weight: 800; letter-spacing: -0.01em; margin: 64px 0 20px; scroll-margin-top: 16px; }
h3 { font-size: 18px; font-weight: 800; margin: 32px 0 12px; }
@media (min-width: 768px) {
  h1 { font-size: 48px; margin-top: 64px; }
  h2 { font-size: 30px; margin-top: 96px; }
}
p, li { max-width: 46em; }
.lead { font-size: 18px; }
.crumb, .meta, .legend { color: var(--muted); font-size: 14px; }
.crumb { margin: 32px 0 0; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }
.crumb + h1 { margin-top: 12px; }
.jump { font-size: 14px; font-weight: 600; }
.jump a { margin-right: 4px; }
.draft { border: var(--border); background: var(--warn); color: #000; padding: 12px 16px; font-weight: 600; }
.pitfalls li { margin-bottom: 12px; }

/* Tables: 2px black grid, black header bar */
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 15px; border: var(--border); }
th, td { border: var(--border); padding: 10px 12px; text-align: left; vertical-align: top; }
thead th { background: var(--fg); color: var(--bg); white-space: nowrap; font-weight: 700; }
.engines th[scope="row"] { white-space: nowrap; }
.engines td[data-label="依据"] { white-space: nowrap; }

/* Code */
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; }
code { overflow-wrap: break-word; font-weight: 600; }
pre { margin: 0; padding: 16px; overflow-x: auto; }
pre code { font-weight: 400; overflow-wrap: normal; }
figure.code { margin: 0 0 16px; border: var(--border); background: var(--bg); }
figure.code figcaption { font-size: 12px; font-weight: 700; padding: 6px 16px; border-bottom: var(--border); }

/* Support tags: square label + solid fill, text always black on color */
.tag { display: inline-block; font-size: 13px; font-weight: 700; padding: 0 8px; border: var(--border); white-space: nowrap; line-height: 1.6; }
.tag-yes { background: var(--bg); color: var(--fg); }
.tag-alias, .tag-alt { background: var(--warn); color: #000; border-color: #000; }
.tag-no { background: var(--accent); color: #000; border-color: #000; }
.status-unverified { background: var(--warn); color: #000; font-size: 13px; font-weight: 700; padding: 0 6px; }

/* Home matrix: only the cells that need attention get color */
.filter {
  width: 100%; max-width: 420px; margin: 8px 0 24px; padding: 10px 0;
  font: inherit; color: var(--fg); background: transparent;
  border: 0; border-bottom: var(--border); outline: none;
  transition: border-color 75ms ease-out;
}
.filter:focus { border-bottom-color: var(--accent); }
.filter::placeholder { color: var(--muted); }
.matrix td { text-align: center; white-space: nowrap; font-size: 14px; font-weight: 700; }
.matrix td.tag-yes { background: var(--bg); }
.matrix td.tag-alias, .matrix td.tag-alt { background: var(--warn); color: #000; }
.matrix td.tag-no { background: var(--accent); color: #000; }
.matrix th[scope="row"] { font-weight: 600; }
.matrix td.purpose { text-align: left; font-weight: 400; white-space: nowrap; }
.engines td[data-label="用途"] { white-space: nowrap; }
.matrix tr.group th { background: var(--bg); font-size: 13px; font-weight: 800; letter-spacing: 0.04em; padding-top: 16px; }

.grid { columns: 2 240px; padding-left: 20px; }
.grid li { margin-bottom: 6px; }

/* Footer: solid black block */
footer { background: #000; color: #fff; margin-top: 96px; border-top: var(--border); }
.foot-inner { padding-top: 48px; padding-bottom: 48px; font-size: 14px; }
footer p { margin: 4px 0; }

/* On phones the engine table becomes one bordered card per row, so nothing scrolls sideways. */
@media (max-width: 640px) {
  .engines { border: 0; }
  .engines thead { display: none; }
  .engines, .engines tbody, .engines tr, .engines th, .engines td { display: block; width: 100%; }
  .engines tr { border: var(--border); margin-bottom: 16px; padding: 8px 0; }
  .engines th, .engines td { border: 0; padding: 6px 16px; }
  .engines th[scope="row"] { font-size: 17px; }
  .engines td[data-label]::before { content: attr(data-label) "："; color: var(--muted); font-size: 13px; }
  .engines td:empty { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
