/* pai.ink — editorial style sheet
   Pure CSS, no external font CDN (works in CN without proxy delays). */

:root {
  --bg: #fbfaf7;
  --bg-elev: #ffffff;
  --fg: #111111;
  --muted: #6b6b6b;
  --hairline: #e7e4dc;
  --accent: #b03a2e;
  --accent-soft: #f5e6e2;

  --serif: 'Source Serif 4', 'Source Serif Pro', 'Iowan Old Style', Charter, 'Songti SC', 'STSong', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'Inter', 'Helvetica Neue', 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, 'JetBrains Mono', Menlo, Consolas, monospace;

  --w: 680px;
  --pad: 24px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15140f;
    --bg-elev: #1c1a14;
    --fg: #ecebdf;
    --muted: #8b8a82;
    --hairline: #2d2a22;
    --accent: #e3826f;
    --accent-soft: #2d1f1c;
  }
}

* { box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* ---------- masthead ---------- */
.masthead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 32px 0 28px;
  border-bottom: 1px solid var(--hairline);
}
.masthead .brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.masthead .brand a { color: var(--fg); text-decoration: none; }
.masthead nav { display: flex; gap: 22px; }
.masthead nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  letter-spacing: 0.02em;
}
.masthead nav a:hover,
.masthead nav a[aria-current="page"] { color: var(--fg); }

/* ---------- hero ---------- */
.hero { padding: 56px 0 16px; }
.hero h1 {
  font-family: var(--serif);
  font-size: 38px;
  line-height: 1.15;
  font-weight: 600;
  margin: 0 0 18px;
  letter-spacing: -0.015em;
}
.hero p {
  font-size: 17px;
  color: var(--muted);
  max-width: 540px;
  margin: 0;
}
@media (max-width: 480px) {
  .hero { padding: 32px 0 8px; }
  .hero h1 { font-size: 30px; }
}

/* ---------- zone feed (landing) ---------- */
.zone {
  padding: 48px 0 8px;
  border-top: 1px solid var(--hairline);
  margin-top: 56px;
}
.zone:first-of-type { border-top: none; margin-top: 0; }
.zone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 24px;
}
.zone-head h2 {
  font-family: var(--serif);
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin: 0;
}
.zone-head .more {
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
}
.zone-head .more:hover { text-decoration: underline; }

/* ---------- article list ---------- */
.articles { list-style: none; padding: 0; margin: 0; }
.articles li { border-top: 1px solid var(--hairline); }
.articles li:first-child { border-top: none; }

.article-link {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: 22px 0;
  transition: padding-left 120ms ease;
}
.article-link:hover { padding-left: 6px; }
.article-link h3 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.article-link:hover h3 { color: var(--accent); }
.article-link .dek {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 10px;
  line-height: 1.5;
}
.article-link .meta {
  color: var(--muted);
  font-size: 13px;
  margin: 0;
  letter-spacing: 0.01em;
}
.article-link .meta .sep { margin: 0 8px; opacity: 0.5; }
.article-link .verify-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}
.article-row { display: flex; align-items: baseline; gap: 12px; }
.article-row .article-link { flex: 1; }

/* ---------- zone listing page ---------- */
.page-head {
  padding: 48px 0 32px;
}
.page-head .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 8px;
}
.page-head h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.015em;
}
.page-head .lede {
  color: var(--muted);
  font-size: 16px;
  margin: 14px 0 0;
  max-width: 540px;
}

.empty {
  color: var(--muted);
  font-size: 15px;
  padding: 48px 0;
  border-top: 1px solid var(--hairline);
}

/* ---------- verify page ---------- */
.verify-head {
  padding: 48px 0 24px;
  border-bottom: 1px solid var(--hairline);
}
.verify-head .eyebrow {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin: 0 0 12px;
}
.verify-head .status {
  font-family: var(--serif);
  font-size: 28px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.01em;
}
.verify-head .status.ok::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #2e7d4f;
  margin-right: 12px;
  vertical-align: middle;
}
.verify-head .status.warn::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #b8842a;
  margin-right: 12px;
  vertical-align: middle;
}
.verify-head .sub {
  color: var(--muted);
  font-size: 15px;
  margin: 12px 0 0;
}

dl.manifest {
  margin: 32px 0;
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px 24px;
  font-size: 14px;
}
dl.manifest dt {
  color: var(--muted);
  font-weight: 400;
  letter-spacing: 0.02em;
}
dl.manifest dd {
  margin: 0;
  word-break: break-all;
}
dl.manifest dd code,
dl.manifest dd .mono {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--fg);
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 3px;
}
dl.manifest dd a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
dl.manifest dd a:hover { text-decoration-color: var(--accent); }

details.raw {
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  margin-top: 32px;
}
details.raw summary {
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  letter-spacing: 0.02em;
}
details.raw summary::-webkit-details-marker { display: none; }
details.raw summary::after { content: " ↓"; }
details.raw[open] summary::after { content: " ↑"; }
details.raw pre {
  margin: 16px 0 0;
  padding: 16px;
  background: var(--bg-elev);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.5;
  overflow-x: auto;
}

/* ---------- about page ---------- */
.prose { padding: 32px 0 48px; }
.prose h2 {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 40px 0 12px;
  letter-spacing: -0.01em;
}
.prose h2:first-child { margin-top: 16px; }
.prose p { margin: 0 0 16px; font-size: 16px; }
.prose ol, .prose ul { padding-left: 22px; margin: 0 0 16px; }
.prose li { margin-bottom: 6px; }
.prose code {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--accent-soft);
  padding: 1px 6px;
  border-radius: 3px;
}
.prose a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: 3px; }
.prose a:hover { text-decoration-color: var(--accent); color: var(--accent); }

/* ---------- footer ---------- */
footer.site {
  margin-top: 96px;
  padding: 32px 0 48px;
  border-top: 1px solid var(--hairline);
  color: var(--muted);
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
footer.site a {
  color: var(--muted);
  text-decoration: none;
}
footer.site a:hover { color: var(--fg); }
