/* Static doc pages — align with apps/web design tokens (no purple browser links). */
:root {
  --canvas: #f0e4b2;
  --canvas-soft: #f7edca;
  --surface: #fff9e6;
  --surface-bright: #fffdf4;
  --primary: #f6c84e;
  --primary-hover: #ddb13b;
  --ink: #2d3029;
  --muted: #626a54;
  --border: rgba(45, 48, 41, 0.22);
  --border-strong: rgba(45, 48, 41, 0.52);
  --page-max: 860px;
  --page-gutter: 24px;
  color: var(--ink);
  background: var(--canvas);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body.doc-page {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--canvas);
  color: var(--ink);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
a:hover { color: var(--ink); }
::selection { background: var(--primary); color: var(--ink); }
:focus-visible {
  outline: 3px solid #795900 !important;
  outline-offset: 3px;
}

/* Inline content links: ink, hairline underline on hover only — never browser purple */
a.doc-link,
.doc-prose a {
  color: var(--ink);
  font-weight: 650;
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--ink) 28%, transparent);
  transition: border-color 160ms cubic-bezier(.4, 0, .2, 1), background-color 160ms cubic-bezier(.4, 0, .2, 1);
}
a.doc-link:hover,
.doc-prose a:hover {
  border-bottom-color: var(--ink);
  background: color-mix(in srgb, var(--primary) 28%, transparent);
}

.doc-top {
  flex: 0 0 auto;
  border-bottom: 1px solid var(--border);
  background: var(--canvas-soft);
}
.doc-top-inner {
  max-width: calc(var(--page-max) + 80px);
  margin: 0 auto;
  padding: 14px var(--page-gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.doc-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  border: 0;
}
.doc-brand:hover { color: var(--ink); }
.doc-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--primary);
  border: 1px solid var(--border-strong);
  border-radius: 8px 8px 8px 2px;
  box-shadow: 2px 2px 0 rgba(45, 48, 41, 0.18);
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}
.doc-top-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.doc-top-nav a {
  color: var(--muted);
  text-decoration: none;
  border: 0;
  padding: 4px 0;
}
.doc-top-nav a:hover { color: var(--ink); }
.doc-top-nav a[aria-current="page"] {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 var(--ink);
}

.doc-main {
  flex: 1 1 auto;
  width: 100%;
  max-width: calc(var(--page-max) + 80px);
  margin: 0 auto;
  padding: 28px var(--page-gutter) 48px;
}
.doc-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 1px 0 rgba(45, 48, 41, 0.04);
  padding: clamp(24px, 4vw, 40px) clamp(20px, 3.5vw, 36px) clamp(28px, 4vw, 44px);
}
.doc-card > h1:first-child,
.doc-card article > h1:first-child { margin-top: 0; }

h1 {
  margin: 0 0 12px;
  font-family: "Bricolage Grotesque", "Noto Sans SC", sans-serif;
  font-size: clamp(1.75rem, 4.5vw, 2.35rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--ink);
}
h2 {
  margin: 2rem 0 0.65rem;
  font-size: 1.15rem;
  font-weight: 750;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink);
}
h2:first-of-type { margin-top: 1.25rem; }
p { margin: 0 0 0.85rem; color: var(--ink); }
.lede,
.note {
  margin: 0 0 1.25rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.65;
}
.kicker {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.doc-prose section {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
}
.doc-prose section:first-of-type {
  margin-top: 0.5rem;
  padding-top: 0;
  border-top: 0;
}
.doc-prose ol,
.doc-prose ul {
  margin: 0 0 0.85rem;
  padding-left: 1.2rem;
}
.doc-prose li { margin: 0.35rem 0; }
.doc-prose li::marker { color: var(--muted); }

.faq-item {
  padding: 1rem 0;
  border-top: 1px solid var(--border);
}
.faq-item:first-of-type { border-top: 0; padding-top: 0.25rem; }
.faq-item strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.98rem;
  font-weight: 750;
  color: var(--ink);
}
.faq-item p {
  margin: 0;
  color: color-mix(in srgb, var(--ink) 88%, var(--muted));
  font-size: 0.94rem;
}

dl { margin: 0; }
dl > div {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
}
dt { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
dd { margin: 0; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  margin: 0.5rem 0 1rem;
}
th, td {
  text-align: left;
  padding: 0.6rem 0.45rem;
  border-top: 1px solid color-mix(in srgb, var(--ink) 10%, transparent);
  vertical-align: top;
}
th { color: var(--muted); font-weight: 700; font-size: 0.85rem; }

.doc-footer {
  flex: 0 0 auto;
  margin-top: auto;
  background: var(--ink);
  color: #f7edca;
  font-size: 12px;
}
.doc-footer-inner {
  max-width: calc(var(--page-max) + 80px);
  margin: 0 auto;
  padding: 16px var(--page-gutter);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 14px;
}
.doc-footer nav {
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0;
}
.doc-footer a {
  color: #f7edca;
  text-decoration: none;
  font-weight: 650;
  border: 0;
  opacity: 0.92;
}
.doc-footer a:hover {
  color: #fff;
  opacity: 1;
}
.doc-footer-sep {
  opacity: 0.45;
  margin: 0 0.35em;
  user-select: none;
}
.doc-footer-copy {
  opacity: 0.72;
  font-weight: 500;
}

@media (max-width: 560px) {
  :root { --page-gutter: 16px; }
  .doc-top-inner { flex-direction: column; align-items: flex-start; }
  .doc-card { border-radius: 10px; }
  dl > div { grid-template-columns: 1fr; gap: 0.2rem; }
  table, thead, tbody, th, td, tr { display: block; }
  th { border-top: none; padding-bottom: 0; }
  td { border-top: none; padding-top: 0.15rem; padding-bottom: 0.85rem; }
}
