/* Hi-Filter static site — shared stylesheet
   Design goals: readable, calm, no external dependencies, light + dark, mobile-first. */

:root {
  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --bg-elev: #ffffff;
  --border: #e4e6eb;
  --border-strong: #d2d6dd;
  --text: #16192b;
  --text-soft: #4b5163;
  --text-mute: #757c8f;
  --accent: #4f46e5;
  --accent-soft: #eef0ff;
  --accent-text: #ffffff;
  /* 与 logo「H」字形**完全同一个色号**（取自 assets/logo-hi.svg 的 path fill）。
     用户明确要求「一模一样」⇒ 不要再调浅或调深。 */
  --brand-amber: #FFB301;
  --code-bg: #f2f3f7;
  --shadow: 0 1px 2px rgba(16, 20, 40, 0.04), 0 8px 24px rgba(16, 20, 40, 0.06);
  --radius: 14px;
  --radius-sm: 10px;
  --maxw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1118;
    --bg-soft: #161a24;
    --bg-elev: #171b26;
    --border: #262b38;
    --border-strong: #333a4a;
    --text: #eef0f6;
    --text-soft: #b6bccd;
    --text-mute: #8b93a7;
    --accent: #8b87ff;
    --accent-soft: #1e2140;
    --accent-text: #0f1118;
    --code-bg: #1b202c;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 650;
  color: var(--text);
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand .mark {
  width: 28px;
  height: auto;
  display: block;
  background: none;
  border-radius: 0;
}
.site-nav { margin-left: auto; display: flex; gap: 18px; font-size: 15px; }
.site-nav a { color: var(--text-soft); }
.site-nav a[aria-current="page"] { color: var(--text); font-weight: 600; }

/* ---------- Layout ---------- */
main { display: block; }
.page { padding: 48px 0 24px; }
.hero { padding: 68px 0 40px; text-align: center; }
.hero .mark-lg {
  width: 72px;
  height: auto;
  margin: 0 auto 22px;
  display: block;
  background: none;
  border-radius: 0;
  box-shadow: none;
}
.hero h1 {
  font-size: clamp(28px, 5vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 14px;
}
.hero p.lede {
  font-size: clamp(17px, 2.4vw, 20px);
  color: var(--text-soft);
  margin: 0 auto;
  max-width: 34em;
}

h2 {
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 40px 0 12px;
  padding-top: 8px;
}
h3 { font-size: 18px; margin: 26px 0 8px; }
p { margin: 0 0 16px; }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin: 6px 0; }

.muted { color: var(--text-mute); }
.small { font-size: 14.5px; }
.center { text-align: center; }

.hr { height: 1px; background: var(--border); border: 0; margin: 40px 0; }

/* ---------- Buttons ---------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 28px 0 8px; }
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  border: 1px solid transparent;
  transition: transform .06s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--bg-soft); }

/* ---------- Cards ---------- */
.grid { display: grid; gap: 14px; grid-template-columns: 1fr; margin: 24px 0; }
@media (min-width: 620px) { .grid.two { grid-template-columns: 1fr 1fr; } }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}
.card h3 { margin-top: 0; color: var(--brand-amber); }
.card p:last-child { margin-bottom: 0; }

.callout {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  margin: 20px 0;
}
.callout p:last-child { margin-bottom: 0; }

/* ---------- Table ---------- */
.table-wrap { overflow-x: auto; margin: 18px 0; -webkit-overflow-scrolling: touch; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 15.5px;
  min-width: 460px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
th { color: var(--text-soft); font-weight: 600; background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: 0; }

/* Narrow screens: stack each row into a labelled block so nothing is cramped
   and there is no horizontal scrolling (matters when the page is opened on a phone). */
@media (max-width: 560px) {
  .table-wrap { overflow-x: visible; }
  table { min-width: 0; }
  thead { display: none; }
  tbody, tr, td { display: block; width: auto; }
  tbody tr {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-elev);
    padding: 6px 4px;
    margin-bottom: 12px;
  }
  tbody tr:last-child { margin-bottom: 0; }
  td { border-bottom: 0; padding: 7px 12px; }
  td::before {
    content: attr(data-label);
    display: block;
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--text-mute);
    margin-bottom: 2px;
  }
  tbody tr td:first-child { font-weight: 600; }
}

/* ---------- Prose extras ---------- */
.doc-meta {
  font-size: 14.5px;
  color: var(--text-mute);
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
code {
  font-family: var(--mono);
  font-size: 0.9em;
  background: var(--code-bg);
  padding: 2px 6px;
  border-radius: 6px;
}
.toc { font-size: 15.5px; }
.toc a { color: var(--text-soft); }
.toc a:hover { color: var(--accent); }
.lang-link { font-size: 14px; color: var(--text-mute); }

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 64px;
  padding: 28px 0 48px;
  font-size: 14.5px;
  color: var(--text-mute);
}
.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  align-items: center;
}
.site-footer nav { display: flex; gap: 16px; margin-left: auto; }
.site-footer a { color: var(--text-soft); }

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