/* 博客页样式 —— 复用 style.css 的变量与排版基调，只补充列表和正文渲染所需的部分 */

/* 列表页 */
.blog-intro {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}

.post-list {
  list-style: none;
  padding: 0;
}

.post-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}

.post-list li:first-child {
  border-top: 1px solid var(--border);
}

.post-list a {
  display: block;
}

.post-date {
  font-size: 13px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.post-title {
  font-weight: 600;
  font-size: 16px;
  line-height: 1.5;
  margin-top: 2px;
  color: var(--accent);
}

.post-summary {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-top: 3px;
}

.post-list a:hover .post-title {
  text-decoration: underline;
}

.empty {
  color: var(--text-light);
  font-size: 14px;
  padding: 24px 0;
}

/* 单篇 */
.post-header {
  margin-bottom: 30px;
}

.post-header h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
  margin-bottom: 6px;
}

.post-meta {
  font-size: 13px;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

/* 正文（markdown 渲染结果） */
.post-body {
  font-size: 15px;
  line-height: 1.78;
  color: var(--text-body);
}

.post-body > *:first-child {
  margin-top: 0;
}

/* 长文档常把正文的 `#` 用作章标题，需与文章大标题区分开 */
.post-body h1 {
  font-size: 20px;
  font-weight: 600;
  margin: 40px 0 14px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.post-body h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 34px 0 12px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
}

.post-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 26px 0 10px;
}

.post-body h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 20px 0 8px;
}

.post-body p {
  margin: 0 0 16px;
}

.post-body ul,
.post-body ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.post-body li {
  margin-bottom: 5px;
}

.post-body li > ul,
.post-body li > ol {
  margin-top: 5px;
  margin-bottom: 0;
}

.post-body a {
  color: var(--accent);
}

.post-body blockquote {
  margin: 0 0 16px;
  padding: 2px 0 2px 16px;
  border-left: 2px solid var(--border);
  color: var(--text-muted);
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 13px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 4px;
}

/* 代码块外再包一层，复制按钮才能钉住不随横向滚动跑掉 */
.post-body .code-wrap {
  position: relative;
  margin: 0 0 18px;
}

.post-body pre {
  margin: 0;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow-x: auto;
  line-height: 1.55;
}

.post-body pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 13px;
}

/* 高亮主题自带白色底，会盖掉代码块底色，这里让它透出来 */
.post-body pre code.hljs {
  background: transparent;
  padding: 0;
}

.post-body .code-copy {
  position: absolute;
  top: 8px;
  right: 8px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 11px;
  line-height: 1;
  padding: 5px 8px;
  color: var(--text-light);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.post-body .code-wrap:hover .code-copy {
  opacity: 1;
}

.post-body .code-copy:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 3px;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 18px;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}

.post-body th,
.post-body td {
  border: 1px solid var(--border);
  padding: 7px 11px;
  text-align: left;
}

.post-body th {
  background: var(--surface);
  font-weight: 600;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 28px 0;
}

/* KaTeX 行间公式在窄屏允许横向滚动，避免撑破布局 */
.post-body .katex-display {
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 0;
}

@media (max-width: 640px) {
  .post-header h1 {
    font-size: 22px;
  }

  .post-body {
    font-size: 15px;
  }
}
