:root {
  --bg: #faf9f7;
  --surface: #ffffff;
  --text: #1f2328;
  --text-muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --border: #e5e7eb;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111418;
    --surface: #1a1f26;
    --text: #e6e8eb;
    --text-muted: #9aa3ad;
    --accent: #60a5fa;
    --accent-soft: #1e2a3d;
    --border: #2b323b;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Segoe UI", sans-serif;
  line-height: 1.7;
}

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

header.site-header { margin-bottom: 2rem; }
header.site-header h1 { margin: 0 0 0.25rem; font-size: 1.6rem; }
header.site-header p { margin: 0; color: var(--text-muted); }

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

.back-link { display: inline-block; margin-bottom: 1.5rem; font-size: 0.9rem; }

/* 首页工具栏：搜索 + 分类 */
.toolbar { margin-bottom: 2rem; display: flex; flex-direction: column; gap: 0.75rem; }
.toolbar input[type="search"] {
  width: 100%;
  padding: 0.6rem 0.9rem;
  font-size: 0.95rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}
.toolbar input[type="search"]:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.tag-filter { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tag {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.25rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
}
.tag:hover { border-color: var(--accent); color: var(--accent); }
.tag.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 月份分组 */
.month-group { margin-bottom: 2rem; }
.month-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 0.75rem;
  border: none;
  padding: 0;
}
.empty-hint { color: var(--text-muted); text-align: center; margin: 3rem 0; }

/* 首页问题列表 */
.topic-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.75rem; }
.topic-list li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
}
.topic-list .date { font-size: 0.8rem; color: var(--text-muted); display: block; }
.topic-list .title { font-size: 1.05rem; font-weight: 600; }
.topic-list .summary { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.92rem; }

/* Topic 页面 */
article h1 { font-size: 1.5rem; margin: 0 0 0.25rem; }
.meta { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 1.5rem; }

.tldr {
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.tldr h2 { margin: 0 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.tldr p { margin: 0; font-weight: 500; }

article h2 { font-size: 1.15rem; margin-top: 2rem; border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; }
article code { background: var(--accent-soft); padding: 0.1em 0.35em; border-radius: 4px; font-size: 0.9em; }
article pre { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; overflow-x: auto; }
article pre code { background: none; padding: 0; }
article table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
article th, article td { border: 1px solid var(--border); padding: 0.5rem 0.75rem; text-align: left; font-size: 0.92rem; }
article th { background: var(--surface); }
article blockquote { margin: 1rem 0; padding: 0.5rem 1rem; border-left: 3px solid var(--accent); color: var(--text-muted); }

.sources { font-size: 0.9rem; }
.sources li { margin-bottom: 0.35rem; }

footer.site-footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid var(--border); color: var(--text-muted); font-size: 0.8rem; }
