/* Minimal theme — 极简手搓主题
   单栏居中、系统字体、明暗自适应；除 Giscus 外不加载任何外部资源。 */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e5e7eb;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --code-bg: #f1f5f9;
  --code-text: #0f172a;
  --pre-bg: #1e293b;
  --pre-text: #e2e8f0;
  --quote-bg: #f8fafc;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1115;
    --surface: #16181d;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #2a2e37;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --code-bg: #23272f;
    --code-text: #e5e7eb;
    --pre-bg: #16181d;
    --pre-text: #dbe2ec;
    --quote-bg: #16181d;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px;
}

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

img { max-width: 100%; height: auto; }

/* ---------- 页眉 / 页脚 ---------- */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}
.site-title { font-size: 20px; font-weight: 700; color: var(--text); }
.site-title:hover { color: var(--accent); text-decoration: none; }
.site-nav a { margin-left: 20px; font-size: 15px; color: var(--muted); }
.site-nav a:hover { color: var(--accent); }

main.container { padding-top: 40px; padding-bottom: 64px; }

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

/* ---------- 标题 ---------- */
h1, h2, h3, h4 { line-height: 1.4; font-weight: 700; }
h1 { font-size: 28px; margin: 0 0 16px; }
h2 { font-size: 23px; margin: 40px 0 16px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 19px; margin: 32px 0 12px; }
p { margin: 0 0 18px; }

/* ---------- 首页文章列表 ---------- */
.post-item { padding: 24px 0; border-bottom: 1px solid var(--border); }
.post-item:first-of-type { padding-top: 0; }
.post-item time { font-size: 14px; color: var(--muted); }
.post-item h2 { margin: 6px 0 8px; padding: 0; border: none; font-size: 22px; }
.post-item h2 a { color: var(--text); }
.post-item h2 a:hover { color: var(--accent); }
.post-item .excerpt { margin: 0; font-size: 15px; color: var(--muted); }

/* ---------- 文章页 ---------- */
.post-header { margin-bottom: 32px; }
.post-title { font-size: 30px; }
.post-meta { font-size: 14px; color: var(--muted); }
.post-tags a { margin-left: 12px; font-size: 14px; }
.post-content { overflow-wrap: break-word; }

.post-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  font-size: 15px;
}
.post-nav-next { text-align: right; }

/* ---------- 归档 / 标签页 ---------- */
.page-title { margin-bottom: 24px; }
.archive-year { margin: 32px 0 8px; padding: 0; border: none; font-size: 21px; }
.archive-item { display: flex; gap: 16px; padding: 8px 0; border-bottom: 1px dashed var(--border); }
.archive-item time { flex-shrink: 0; font-size: 14px; color: var(--muted); line-height: 1.8; }
.archive-item a { color: var(--text); }
.archive-item a:hover { color: var(--accent); }

/* ---------- 分页 ---------- */
.pagination { margin-top: 40px; text-align: center; font-size: 15px; }
.pagination a, .pagination span { margin: 0 6px; }
.pagination .current { font-weight: 700; color: var(--text); }

/* ---------- 评论区 ---------- */
.comments { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border); }

/* ---------- 代码 / 引用 / 表格 ---------- */
code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.88em;
  background: var(--code-bg);
  color: var(--code-text);
  padding: 2px 6px;
  border-radius: 4px;
}
pre {
  margin: 0 0 18px;
  padding: 16px;
  background: var(--pre-bg);
  color: var(--pre-text);
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
  font-size: 14px;
}
pre code { background: none; color: inherit; padding: 0; }
/* Hexo highlight.js 结构 */
.highlight { margin: 0 0 18px; background: var(--pre-bg); border-radius: 8px; overflow-x: auto; }
.highlight pre { margin: 0; border-radius: 0; }
.highlight table { margin: 0; border: none; }
.highlight td { border: none; padding: 0; }
.highlight .gutter { width: 1%; opacity: 0.5; text-align: right; padding-right: 12px; user-select: none; }
.highlight .gutter pre { color: var(--muted); }

blockquote {
  margin: 0 0 18px;
  padding: 4px 20px;
  background: var(--quote-bg);
  border-left: 4px solid var(--accent);
  color: var(--muted);
}
blockquote p { margin: 8px 0; }

hr { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

table { width: 100%; margin: 0 0 18px; border-collapse: collapse; font-size: 15px; }
th, td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; }
th { background: var(--code-bg); }

ul, ol { margin: 0 0 18px; padding-left: 24px; }
li { margin-bottom: 4px; }

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .post-title { font-size: 25px; }
  .post-item h2 { font-size: 20px; }
  .site-title { font-size: 18px; }
  .archive-item { gap: 12px; }
}
