/* ==========================================================================
   Markdown 渲染样式
   ========================================================================== */

.post-body .md-p,
.md-content .md-p {
  margin: 0 0 10px;
  line-height: 1.72;
}

.md-content > *:last-child { margin-bottom: 0; }

/* 标题 */
.md-h {
  font-weight: 700;
  color: var(--primary);
  line-height: 1.35;
  margin: 18px 0 8px;
}
.md-h1 { font-size: 21px; }
.md-h2 { font-size: 18px; }
.md-h3 { font-size: 16px; }
.md-h4 { font-size: 15px; }
.md-h5, .md-h6 { font-size: 14px; color: var(--text2); }
.md-content > .md-h:first-child { margin-top: 0; }

/* 列表 */
.md-list {
  margin: 0 0 10px;
  padding-left: 22px;
}
.md-list li { margin: 3px 0; line-height: 1.68; }
.md-list ul, .md-list ol { margin: 3px 0; padding-left: 20px; }
.md-list li > ul, .md-list li > ol { margin-top: 3px; }

/* 引用 */
.md-quote {
  margin: 10px 0;
  padding: 8px 14px;
  background: var(--hover);
  border-left: 3px solid var(--tertiary);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--text2);
}
.md-quote .md-p:last-child { margin-bottom: 0; }

/* 代码 */
.md-content code, .post-body code {
  background: var(--hover);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 13px;
  font-family: Consolas, Monaco, "Courier New", monospace;
  color: #c7254e;
}

body.dark .md-content code,
body.dark .post-body code { color: #ff8787; }

.md-code {
  margin: 10px 0;
  padding: 12px 14px;
  background: #1e1e2e;
  border-radius: var(--radius);
  overflow-x: auto;
  position: relative;
}
.md-code code {
  background: none;
  padding: 0;
  color: #cdd6f4;
  font-size: 12.5px;
  line-height: 1.65;
  font-family: Consolas, Monaco, "Courier New", monospace;
}
.md-code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 4px;
  right: 10px;
  font-size: 10.5px;
  color: #6c7086;
  letter-spacing: .5px;
  text-transform: uppercase;
}
body.dark .md-code { background: #16161e; }

/* 表格 */
.md-table-wrap {
  margin: 10px 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.md-table th {
  background: var(--hover);
  text-align: left;
  padding: 8px 12px;
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.md-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}
.md-table tr:last-child td { border-bottom: none; }

/* 分隔线 */
.md-hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 16px 0;
}

/* 高亮 */
.md-content mark, .post-body mark {
  background: #fff3c4;
  color: inherit;
  padding: 0 2px;
  border-radius: 2px;
}
body.dark .md-content mark,
body.dark .post-body mark { background: #4a3f14; color: #ffe066; }

/* 删除线 */
.md-content del, .post-body del { color: var(--faint); }

/* 图片 */
.md-content img, .post-body img {
  max-width: 100%;
  border-radius: var(--radius);
  display: block;
  margin: 8px 0;
}

/* 链接 */
.md-content a, .post-body a {
  color: var(--tertiary);
  text-decoration: none;
}
.md-content a:hover, .post-body a:hover { text-decoration: underline; }
