:root {
  --bg: #f7f9fb;
  --surface: #ffffff;
  --text: #1a2430;
  --text-muted: #5a6b7d;
  --accent: #0b6e4f;
  --accent-soft: #e3f2ec;
  --border: #e2e8ee;
  --tip-bg: #fdf6e3;
  --tip-border: #e8d9a8;
  --shadow: 0 1px 3px rgba(16, 32, 48, 0.08);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10161d;
    --surface: #18212b;
    --text: #e8eef4;
    --text-muted: #9db0c2;
    --accent: #4cc79a;
    --accent-soft: #16302a;
    --border: #263241;
    --tip-bg: #262218;
    --tip-border: #4a4229;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 4.5rem; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 3.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.1rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
}

.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.95rem;
}

.header-nav a:hover { color: var(--accent); }

/* Hero */
.hero {
  padding: 3.5rem 0 2rem;
  text-align: center;
}

.hero h1 {
  font-size: clamp(1.7rem, 4.5vw, 2.6rem);
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.hero-sub {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 40rem;
  margin: 0 auto 1.75rem;
}

.search-wrap { max-width: 28rem; margin: 0 auto; }

#q-search {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

#q-search:focus { border-color: var(--accent); }

/* TOC */
.toc {
  margin-bottom: 2.5rem;
}

.toc ol {
  margin: 0;
  padding: 1rem 1rem 1rem 2.4rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  columns: 1;
}

@media (min-width: 640px) {
  .toc ol { columns: 2; column-gap: 2rem; }
}

.toc li { margin: 0.3rem 0; break-inside: avoid; }

.toc a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

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

/* Question cards */
.questions { padding-bottom: 1rem; }

.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.75rem 1.5rem;
  margin-bottom: 1.5rem;
}

.q-card h2 {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 1.3rem;
  line-height: 1.35;
  margin: 0 0 0.9rem;
}

.q-num {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
  align-self: center;
}

.q-card h3 {
  font-size: 1.02rem;
  margin: 1.3rem 0 0.5rem;
  color: var(--accent);
}

.q-card p, .q-card li { color: var(--text); }

.q-card ul, .q-card ol { padding-left: 1.4rem; }

.q-card li { margin: 0.35rem 0; }

.tip {
  margin-top: 1.2rem;
  padding: 0.85rem 1rem;
  background: var(--tip-bg);
  border: 1px solid var(--tip-border);
  border-radius: 8px;
  font-size: 0.95rem;
}

/* Table */
.table-scroll { overflow-x: auto; }

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.93rem;
  margin: 0.5rem 0;
}

th, td {
  text-align: left;
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--border);
  vertical-align: top;
}

thead th { background: var(--accent-soft); color: var(--text); }

.no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
}

/* About + footer */
.about {
  padding: 1rem 0 2.5rem;
}

.about h2 { font-size: 1.3rem; }

.disclaimer {
  font-size: 0.88rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.25rem 0;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

@media (max-width: 480px) {
  .q-card { padding: 1.25rem 1.1rem 1.1rem; }
}
