@import url("https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Source+Sans+3:wght@400;600;700&display=swap");

:root {
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --color-bg: #fafafa;
  --color-text: #1a1a1a;
  --color-muted: #666;
  --color-link: #2563eb;
  --color-link-hover: #1d4ed8;
  --color-border: #e5e5e5;
  --color-code-bg: #1e1e1e;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 18px; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-link-hover); }

.shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4rem;
}
.brand {
  color: var(--color-text);
  font-size: 1.25rem;
  font-weight: 700;
}
.brand:hover { color: var(--color-text); }
nav { display: flex; gap: 1.5rem; }
nav a { color: var(--color-text); font-weight: 500; }
nav a:hover { color: var(--color-link); }

.hero { margin-bottom: 2rem; }
.search-panel {
  margin: 0 0 2rem;
}
.search-panel label {
  display: block;
  font-weight: 700;
  margin-bottom: .45rem;
}
.search-panel input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
  padding: .65rem .8rem;
}
.search-panel p {
  color: var(--color-muted);
  font-size: .92rem;
  margin-top: .5rem;
}
.hero h1,
.report-header h1 {
  font-size: 2rem;
  line-height: 1.3;
  margin: .25rem 0 .5rem;
}
.hero p { margin-bottom: .75rem; color: var(--color-muted); }
.eyebrow,
.stat,
.card-meta,
.report-meta {
  color: var(--color-muted);
  font-size: .95rem;
}

.category,
.taxonomy { margin-bottom: 3rem; }
.browse-panel {
  display: grid;
  gap: 1.5rem;
  margin: 0 0 3rem;
  padding: 1.1rem 0 1.35rem;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
}
.browse-panel h2 {
  font-size: 1rem;
  letter-spacing: .04em;
  color: var(--color-muted);
  margin-bottom: .7rem;
}
.category h2,
.taxonomy h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.taxonomy-links { display: flex; flex-wrap: wrap; gap: .55rem .75rem; }
.taxonomy-links a {
  color: var(--color-text);
  font-weight: 600;
  padding: .25rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  background: #fff;
}
.taxonomy-links a:hover { border-color: var(--color-link); color: var(--color-link); }
.taxonomy-links span,
.tags span { color: var(--color-muted); font-size: .82rem; }
.topic-cloud { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .75rem; }
.topic-chip {
  color: var(--color-text);
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.topic-chip:hover { color: var(--color-link); }
.topic-chip span { color: var(--color-muted); font-size: .72em; font-weight: 500; }
.topic-chip-w1 { font-size: .95rem; }
.topic-chip-w2 { font-size: 1.05rem; }
.topic-chip-w3 { font-size: 1.18rem; }
.topic-chip-w4 { font-size: 1.32rem; }
.cards { display: block; }
.search-expanded {
  margin-top: .25rem;
}
.search-expanded-label {
  color: var(--color-muted);
  font-size: .9rem;
  margin-bottom: .35rem;
}
.card {
  padding: .5rem 0;
  border-bottom: 1px solid transparent;
}
.card-title {
  color: var(--color-text);
  font-weight: 600;
}
.card-title:hover { color: var(--color-link); }
.card p { color: var(--color-muted); margin-top: .15rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .35rem; }
.tag {
  color: var(--color-muted);
  font-size: .82rem;
  font-family: var(--font-mono);
}
.tag::before { content: "#"; }

.report-header { margin-bottom: 2.5rem; }
.report-footer {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
}
.report-footer h2 {
  font-size: 1.25rem;
  margin-bottom: .75rem;
}
.report-meta { display: flex; flex-wrap: wrap; gap: .75rem; }
.content h1,
.content h2,
.content h3 { line-height: 1.35; }
.content h2 { font-size: 1.5rem; margin-top: 2.5rem; margin-bottom: 1rem; }
.content h3 { font-size: 1.25rem; margin-top: 2rem; margin-bottom: .75rem; }
.content p,
.content ul,
.content ol { margin-bottom: 1.25rem; }
.content ul,
.content ol { padding-left: 1.5rem; }
.content li { margin-bottom: .5rem; }
.content blockquote {
  border-left: 3px solid var(--color-border);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-muted);
  font-style: italic;
}
.content hr { border: none; border-top: 1px solid var(--color-border); margin: 2rem 0; }
.content img { max-width: 100%; border-radius: 8px; }

pre {
  background: var(--color-code-bg) !important;
  padding: 1.25rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .9rem;
  line-height: 1.5;
}
pre code {
  font-family: var(--font-mono);
  background: none !important;
  padding: 0;
  color: #e5e5e5;
}
code {
  font-family: var(--font-mono);
  background: rgba(255, 160, 100, .2);
  padding: .2em .4em;
  border-radius: 4px;
  font-size: .9em;
}
.search-hit {
  background: #fde68a;
  color: var(--color-text);
  padding: .05em .12em;
  border-radius: 3px;
}
.content table {
  width: 100%;
  border-collapse: collapse;
  display: block;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: .95rem;
  border: 1px solid #d0d7de;
}
th, td {
  padding: .75rem 1rem;
  text-align: left;
  border: 1px solid #d0d7de;
  vertical-align: top;
}
th { font-weight: 600; background: #f6f8fa; }
td { background: #fff; }
tr:hover td { background: #f6f8fa; }
.footnotes { color: var(--color-muted); font-size: .92rem; }
.katex-display { margin: 1.5rem 0; overflow-x: auto; overflow-y: hidden; }
.empty { color: var(--color-muted); }

@media (max-width: 600px) {
  html { font-size: 16px; }
  .site-header { margin-bottom: 3rem; }
  nav { gap: 1rem; }
}
