/* geo.geolix.ai — minimal reading theme. Dark by default, light via [data-theme="light"]. */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --fg: #0a0a0a;
  --muted: #737373;
  --border: #e5e5e5;
  --muted-bg: #f5f5f5;
  --kbd-bg: #ffffff;
  --underline: rgba(10, 10, 10, 0.4);
}
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --fg: #fafafa;
  --muted: #a1a1a1;
  --border: rgba(255, 255, 255, 0.1);
  --muted-bg: #262626;
  --kbd-bg: #0a0a0a;
  --underline: rgba(250, 250, 250, 0.4);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--fg);
  font-family: Geist, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.container { width: 100%; max-width: 896px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 95%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 56px; }
.brand { font-size: 14px; font-weight: 600; color: var(--fg); text-decoration: none; white-space: nowrap; }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.search-btn {
  display: none; width: 256px; align-items: center; gap: 8px;
  border: 1px solid var(--border); background: var(--muted-bg); color: var(--muted);
  border-radius: 6px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.search-btn:hover { opacity: 0.85; }
.search-btn svg { width: 16px; height: 16px; flex: none; }
.search-btn kbd {
  margin-left: auto; border: 1px solid var(--border); background: var(--kbd-bg);
  border-radius: 4px; padding: 2px 6px; font-size: 12px; font-weight: 600; font-family: inherit; color: var(--muted);
}
.icon-btn {
  display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
  border: 1px solid var(--border); background: transparent; color: var(--muted); border-radius: 6px; cursor: pointer;
}
.icon-btn:hover { background: var(--muted-bg); }
.icon-btn svg { width: 16px; height: 16px; }
html[data-theme="dark"] .icon-sun { display: none; }
html:not([data-theme="dark"]) .icon-moon { display: none; }
@media (min-width: 768px) {
  .search-btn { display: flex; }
  .icon-btn.search-mobile { display: none; }
}

/* Page */
main { flex: 1; }
.page { padding-top: 32px; padding-bottom: 32px; }
.article-header { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.article-header h1 { margin: 0 0 16px; font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.025em; }
.article-header .meta { margin-top: 16px; font-size: 12px; color: var(--muted); }
.article-header .meta a { color: inherit; }

/* Prose */
.prose { font-size: 16px; line-height: 24px; }
.prose > * { margin-top: 0; margin-bottom: 12px; }
.prose h2 { margin-top: 28px; font-size: 20px; line-height: 28px; font-weight: 600; }
.prose h3 { margin-top: 22px; font-size: 17px; line-height: 26px; font-weight: 600; }
.prose h4 { margin-top: 18px; font-size: 16px; line-height: 24px; font-weight: 600; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose a { color: inherit; text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 2px; }
.prose a:hover { text-decoration-color: currentColor; }
.prose ul, .prose ol { padding-left: 24px; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 6px 0; }
.prose li > ul, .prose li > ol { margin-bottom: 0; }
.prose strong { font-weight: 600; }
.prose blockquote { margin: 0 0 12px; padding-left: 16px; border-left: 2px solid var(--border); color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--border); margin: 24px 0; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; background: var(--muted-bg); padding: 1px 4px; border-radius: 4px; }
.prose img { max-width: 100%; height: auto; }
.table-scroll { overflow-x: auto; margin: 16px 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.prose th, .prose td { padding: 8px 12px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.prose th { font-weight: 600; color: var(--fg); }
.prose th:first-child, .prose td:first-child { padding-left: 0; }
.prose th:last-child, .prose td:last-child { padding-right: 0; }
.callout { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--border); background: var(--muted-bg); border-radius: 8px; }
.callout p { margin: 0; }
.callout p + p { margin-top: 8px; }

/* Breadcrumb (visible twin of the BreadcrumbList JSON-LD) */
.crumbs { margin-bottom: 12px; font-size: 12px; color: var(--muted); }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs .sep { margin: 0 2px; opacity: 0.6; }

/* Article lists: index, topic hubs, related block */
.post-list { list-style: none; padding: 0; margin: 0 0 20px; }
.post-list li { padding: 12px 0; border-bottom: 1px solid var(--border); }
.post-list li:last-child { border-bottom: 0; }
.post-list a { font-weight: 500; text-decoration: none; }
.post-list a:hover { text-decoration: underline; }
.post-list p { margin: 4px 0 4px; font-size: 14px; line-height: 20px; color: var(--muted); }
.post-list time { font-size: 12px; color: var(--muted); }
.post-list .kind { display: inline-block; margin-right: 6px; padding: 0 5px; font-size: 11px; line-height: 16px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; vertical-align: middle; }
.topic-links { padding-left: 0; list-style: none; }
.topic-links li { margin: 8px 0; font-size: 14px; line-height: 20px; color: var(--muted); }
.topic-links a { color: var(--fg); font-weight: 500; text-decoration: none; }
.topic-links a:hover { text-decoration: underline; }
.prose h2 .count { margin-left: 8px; font-size: 13px; font-weight: 400; color: var(--muted); }
.prose .topic-desc { color: var(--muted); }
.related { margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--border); }
.related h2 { margin: 0 0 8px; font-size: 18px; line-height: 26px; font-weight: 600; }
.related .translation { margin: 0 0 16px; font-size: 14px; }
.related .translation a, .related .view-all a { color: inherit; text-decoration: underline; text-decoration-color: var(--underline); text-underline-offset: 2px; }
.related .view-all { margin: 0; font-size: 14px; }

/* Footer */
.site-footer { border-top: 1px solid var(--border); }
.site-footer .container { padding-top: 32px; padding-bottom: 32px; color: var(--muted); font-size: 14px; line-height: 20px; }
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--fg); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }

/* Search dialog */
dialog.search {
  width: min(640px, calc(100vw - 32px)); margin: 10vh auto 0; padding: 0;
  border: 1px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--fg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}
dialog.search::backdrop { background: rgba(0, 0, 0, 0.5); }
.search-input-wrap { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.search-input-wrap svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: inherit; font: inherit; font-size: 15px; }
.search-results { list-style: none; margin: 0; padding: 6px; max-height: 60vh; overflow-y: auto; }
.search-results a { display: block; padding: 8px 10px; border-radius: 6px; color: inherit; text-decoration: none; }
.search-results .t { font-size: 14px; font-weight: 500; }
.search-results .d { margin-top: 2px; font-size: 12px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-results li.active a, .search-results a:hover { background: var(--muted-bg); }
.search-lang { margin-left: 6px; padding: 0 4px; font-size: 11px; font-weight: 400; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; vertical-align: middle; }
.search-empty { padding: 16px; font-size: 14px; color: var(--muted); }
.search-empty[hidden] { display: none; }
