/**
 * MWordStar — 文章内容 Markdown 统一排版
 * 与主题原有选择器同级，加载于 style-20221121.css 之后生效
 * 对齐 XEditor / Vditor 预览风格
 */

.archive main article .post-content,
.article-page main article .post-content,
.page main article .post-content,
.content-area .post-content {
  --md-text: #444;
  --md-text-muted: #686868;
  --md-heading: #333;
  --md-border: #e1e4e8;
  --md-code-bg: #f6f8fa;
  --md-code-text: #333;
  --md-blockquote-bg: #f8f9fa;
  --md-blockquote-border: #dfe2e5;
  --md-table-stripe: #f6f8fa;
  --md-radius: 6px;
  --md-space: 1em;
  --md-line-height: 1.75;
  --md-font-size: 16px;

  font-size: var(--md-font-size);
  line-height: var(--md-line-height);
  color: var(--md-text);
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: left;
}

/* ---------- 标题 ---------- */
.archive main article .post-content h1,
.archive main article .post-content h2,
.archive main article .post-content h3,
.archive main article .post-content h4,
.archive main article .post-content h5,
.archive main article .post-content h6,
.article-page main article .post-content h1,
.article-page main article .post-content h2,
.article-page main article .post-content h3,
.article-page main article .post-content h4,
.article-page main article .post-content h5,
.article-page main article .post-content h6,
.page main article .post-content h1,
.page main article .post-content h2,
.page main article .post-content h3,
.page main article .post-content h4,
.page main article .post-content h5,
.page main article .post-content h6,
.content-area .post-content h1,
.content-area .post-content h2,
.content-area .post-content h3,
.content-area .post-content h4,
.content-area .post-content h5,
.content-area .post-content h6 {
  font-weight: 600;
  color: var(--md-heading);
  line-height: 1.35;
  margin-top: 1.5em;
  margin-bottom: 0.75em;
}

.archive main article .post-content > :first-child,
.article-page main article .post-content > :first-child,
.page main article .post-content > :first-child,
.content-area .post-content > :first-child {
  margin-top: 0;
}

.archive main article .post-content h1,
.article-page main article .post-content h1,
.page main article .post-content h1,
.content-area .post-content h1 { font-size: 1.875em; margin-top: 1.25em; }

.archive main article .post-content h2,
.article-page main article .post-content h2,
.page main article .post-content h2,
.content-area .post-content h2 { font-size: 1.5em; }

.archive main article .post-content h3,
.article-page main article .post-content h3,
.page main article .post-content h3,
.content-area .post-content h3 { font-size: 1.25em; }

.archive main article .post-content h4,
.article-page main article .post-content h4,
.page main article .post-content h4,
.content-area .post-content h4 { font-size: 1.125em; }

.archive main article .post-content h5,
.article-page main article .post-content h5,
.page main article .post-content h5,
.content-area .post-content h5 { font-size: 1em; }

.archive main article .post-content h6,
.article-page main article .post-content h6,
.page main article .post-content h6,
.content-area .post-content h6 { font-size: 0.875em; color: var(--md-text-muted); }

/* ---------- 段落与分隔 ---------- */
.archive main article .post-content p,
.article-page main article .post-content p,
.page main article .post-content p,
.content-area .post-content p {
  margin: 0 0 var(--md-space);
  line-height: var(--md-line-height);
  color: var(--md-text);
}

.archive main article .post-content hr,
.article-page main article .post-content hr,
.page main article .post-content hr,
.content-area .post-content hr {
  height: 0;
  margin: 2em 0;
  border: 0;
  border-top: 1px solid var(--md-border);
  background: transparent;
  color: transparent;
}

/* ---------- 列表 ---------- */
.archive main article .post-content ul,
.archive main article .post-content ol,
.article-page main article .post-content ul,
.article-page main article .post-content ol,
.page main article .post-content ul,
.page main article .post-content ol,
.content-area .post-content ul,
.content-area .post-content ol {
  margin: 0 0 var(--md-space);
  padding-left: 2em;
}

.archive main article .post-content li,
.article-page main article .post-content li,
.page main article .post-content li,
.content-area .post-content li {
  margin: 0.25em 0;
  padding: 0;
  line-height: var(--md-line-height);
  color: var(--md-text);
}

.archive main article .post-content li > p,
.article-page main article .post-content li > p,
.page main article .post-content li > p,
.content-area .post-content li > p {
  margin-bottom: 0.5em;
}

.archive main article .post-content li > p:last-child,
.article-page main article .post-content li > p:last-child,
.page main article .post-content li > p:last-child,
.content-area .post-content li > p:last-child {
  margin-bottom: 0;
}

.archive main article .post-content ul ul,
.archive main article .post-content ul ol,
.archive main article .post-content ol ul,
.archive main article .post-content ol ol,
.article-page main article .post-content ul ul,
.article-page main article .post-content ul ol,
.article-page main article .post-content ol ul,
.article-page main article .post-content ol ol,
.page main article .post-content ul ul,
.page main article .post-content ul ol,
.page main article .post-content ol ul,
.page main article .post-content ol ol,
.content-area .post-content ul ul,
.content-area .post-content ul ol,
.content-area .post-content ol ul,
.content-area .post-content ol ol {
  margin-bottom: 0;
  margin-top: 0.25em;
}

.archive main article .post-content ul.contains-task-list,
.article-page main article .post-content ul.contains-task-list,
.page main article .post-content ul.contains-task-list,
.content-area .post-content ul.contains-task-list,
.archive main article .post-content .task-list-item,
.article-page main article .post-content .task-list-item,
.page main article .post-content .task-list-item,
.content-area .post-content .task-list-item {
  list-style: none;
}

.archive main article .post-content ul.contains-task-list,
.article-page main article .post-content ul.contains-task-list,
.page main article .post-content ul.contains-task-list,
.content-area .post-content ul.contains-task-list {
  padding-left: 1.5em;
}

.archive main article .post-content .task-list-item input[type="checkbox"],
.article-page main article .post-content .task-list-item input[type="checkbox"],
.page main article .post-content .task-list-item input[type="checkbox"],
.content-area .post-content .task-list-item input[type="checkbox"] {
  margin: 0 0.4em 0.15em 0;
  vertical-align: middle;
}

/* ---------- 引用 ---------- */
.archive main article .post-content blockquote,
.article-page main article .post-content blockquote,
.page main article .post-content blockquote,
.content-area .post-content blockquote {
  margin: 0 0 var(--md-space);
  padding: 0.75em 1em;
  border-left: 4px solid var(--md-blockquote-border);
  background: var(--md-blockquote-bg);
  color: var(--md-text-muted);
  font-size: 1em;
  font-style: normal;
}

.archive main article .post-content blockquote p:last-child,
.article-page main article .post-content blockquote p:last-child,
.page main article .post-content blockquote p:last-child,
.content-area .post-content blockquote p:last-child {
  margin-bottom: 0;
}

/* ---------- 行内代码 ---------- */
.archive main article .post-content :not(pre) > code,
.article-page main article .post-content :not(pre) > code,
.page main article .post-content :not(pre) > code,
.content-area .post-content :not(pre) > code,
.archive main article .post-content p > code,
.archive main article .post-content li > code,
.archive main article .post-content td > code,
.archive main article .post-content th > code,
.article-page main article .post-content p > code,
.article-page main article .post-content li > code,
.article-page main article .post-content td > code,
.article-page main article .post-content th > code,
.page main article .post-content p > code,
.page main article .post-content li > code,
.page main article .post-content td > code,
.page main article .post-content th > code,
.content-area .post-content p > code,
.content-area .post-content li > code,
.content-area .post-content td > code,
.content-area .post-content th > code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  font-size: 0.9em;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  background: var(--md-code-bg);
  color: var(--md-code-text);
  word-break: break-word;
}

/* ---------- 代码块（保留 hljs 配色，只统一布局） ---------- */
.archive main article .post-content pre,
.article-page main article .post-content pre,
.page main article .post-content pre,
.content-area .post-content pre {
  margin: 0 0 var(--md-space);
  overflow: auto;
  border-radius: var(--md-radius);
  -webkit-overflow-scrolling: touch;
}

.archive main article .post-content pre code,
.article-page main article .post-content pre code,
.page main article .post-content pre code,
.content-area .post-content pre code {
  display: block;
  overflow-x: auto;
  line-height: 1.6;
  word-break: normal;
  white-space: pre;
}

/* ---------- 图片与媒体 ---------- */
.archive main article .post-content img,
.article-page main article .post-content img,
.page main article .post-content img,
.content-area .post-content img,
.archive main article .post-content video,
.article-page main article .post-content video,
.page main article .post-content video,
.content-area .post-content video {
  max-width: 100%;
  height: auto;
  margin: 1em auto;
  display: block;
  border-radius: var(--md-radius);
}

.archive main article .post-content figure,
.article-page main article .post-content figure,
.page main article .post-content figure,
.content-area .post-content figure {
  margin: 1em 0;
  text-align: center;
}

.archive main article .post-content figcaption,
.article-page main article .post-content figcaption,
.page main article .post-content figcaption,
.content-area .post-content figcaption {
  margin-top: 0.5em;
  font-size: 0.875em;
  color: var(--md-text-muted);
  text-align: center;
}

/* ---------- 表格 ---------- */
.archive main article .post-content table,
.article-page main article .post-content table,
.page main article .post-content table,
.content-area .post-content table {
  width: 100%;
  max-width: 100%;
  margin: 0 0 var(--md-space);
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.95em;
}

.archive main article .post-content thead,
.article-page main article .post-content thead,
.page main article .post-content thead,
.content-area .post-content thead {
  background: var(--md-table-stripe);
}

.archive main article .post-content th,
.archive main article .post-content td,
.article-page main article .post-content th,
.article-page main article .post-content td,
.page main article .post-content th,
.page main article .post-content td,
.content-area .post-content th,
.content-area .post-content td {
  padding: 0.6em 0.85em;
  border: 1px solid var(--md-border);
  text-align: left;
  vertical-align: top;
  min-width: 4em;
  word-break: break-word;
}

.archive main article .post-content th,
.article-page main article .post-content th,
.page main article .post-content th,
.content-area .post-content th {
  font-weight: 600;
  color: var(--md-heading);
}

.archive main article .post-content tbody tr:nth-child(even),
.article-page main article .post-content tbody tr:nth-child(even),
.page main article .post-content tbody tr:nth-child(even),
.content-area .post-content tbody tr:nth-child(even) {
  background: var(--md-table-stripe);
}

/* ---------- KaTeX / MathJax 公式 ---------- */
.archive main article .post-content .katex,
.article-page main article .post-content .katex,
.page main article .post-content .katex,
.content-area .post-content .katex,
.archive main article .post-content .katex-display,
.article-page main article .post-content .katex-display,
.page main article .post-content .katex-display,
.content-area .post-content .katex-display,
.archive main article .post-content .vditor-math,
.article-page main article .post-content .vditor-math,
.page main article .post-content .vditor-math,
.content-area .post-content .vditor-math,
.archive main article .post-content mjx-container,
.article-page main article .post-content mjx-container,
.page main article .post-content mjx-container,
.content-area .post-content mjx-container {
  max-width: 100%;
}

.archive main article .post-content .katex-display,
.article-page main article .post-content .katex-display,
.page main article .post-content .katex-display,
.content-area .post-content .katex-display,
.archive main article .post-content mjx-container[display="true"],
.article-page main article .post-content mjx-container[display="true"],
.page main article .post-content mjx-container[display="true"],
.content-area .post-content mjx-container[display="true"],
.archive main article .post-content mjx-container.MathJax_Display,
.article-page main article .post-content mjx-container.MathJax_Display,
.page main article .post-content mjx-container.MathJax_Display,
.content-area .post-content mjx-container.MathJax_Display {
  display: block;
  margin: 1em auto;
  padding: 0.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
  text-align: center;
  -webkit-overflow-scrolling: touch;
}

.archive main article .post-content .katex-display > .katex,
.article-page main article .post-content .katex-display > .katex,
.page main article .post-content .katex-display > .katex,
.content-area .post-content .katex-display > .katex {
  display: inline-block;
  text-align: center;
  max-width: 100%;
}

.archive main article .post-content .katex,
.article-page main article .post-content .katex,
.page main article .post-content .katex,
.content-area .post-content .katex {
  font-size: 1.05em;
  overflow-x: auto;
  overflow-y: hidden;
  vertical-align: middle;
}

.archive main article .post-content p .katex,
.archive main article .post-content li .katex,
.article-page main article .post-content p .katex,
.article-page main article .post-content li .katex,
.page main article .post-content p .katex,
.page main article .post-content li .katex,
.content-area .post-content p .katex,
.content-area .post-content li .katex {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  vertical-align: middle;
}

.archive main article .post-content pre.language-math,
.article-page main article .post-content pre.language-math,
.page main article .post-content pre.language-math,
.content-area .post-content pre.language-math,
.archive main article .post-content div.language-math,
.article-page main article .post-content div.language-math,
.page main article .post-content div.language-math,
.content-area .post-content div.language-math {
  overflow-x: auto;
  text-align: center;
  background: transparent;
  border: none;
  margin: 1em 0;
}

/* ---------- 深色模式（沿用主题 .dark-color .content-area 结构） ---------- */
.dark-color .content-area .post-content,
.dark-color .archive main article .post-content,
.dark-color .article-page main article .post-content,
.dark-color .page main article .post-content {
  --md-text: hsla(0, 0%, 100%, 0.87);
  --md-text-muted: hsla(0, 0%, 100%, 0.6);
  --md-heading: hsla(0, 0%, 100%, 0.95);
  --md-border: hsla(0, 0%, 100%, 0.15);
  --md-code-bg: #2d2d2d;
  --md-code-text: hsla(0, 0%, 100%, 0.87);
  --md-blockquote-bg: #2d2d2d;
  --md-blockquote-border: hsla(0, 0%, 100%, 0.25);
  --md-table-stripe: #2d2d2d;
}

.dark-color .content-area .post-content blockquote,
.dark-color .archive main article .post-content blockquote,
.dark-color .article-page main article .post-content blockquote,
.dark-color .page main article .post-content blockquote {
  border-left-color: var(--md-blockquote-border);
}

/* ---------- 移动端 ---------- */
@media (max-width: 767.98px) {
  .archive main article .post-content,
  .article-page main article .post-content,
  .page main article .post-content,
  .content-area .post-content {
    --md-font-size: 15px;
    --md-space: 0.875em;
  }

  .archive main article .post-content h1,
  .article-page main article .post-content h1,
  .page main article .post-content h1,
  .content-area .post-content h1 { font-size: 1.625em; }

  .archive main article .post-content h2,
  .article-page main article .post-content h2,
  .page main article .post-content h2,
  .content-area .post-content h2 { font-size: 1.375em; }

  .archive main article .post-content ul,
  .archive main article .post-content ol,
  .article-page main article .post-content ul,
  .article-page main article .post-content ol,
  .page main article .post-content ul,
  .page main article .post-content ol,
  .content-area .post-content ul,
  .content-area .post-content ol {
    padding-left: 1.5em;
  }

  .archive main article .post-content table,
  .article-page main article .post-content table,
  .page main article .post-content table,
  .content-area .post-content table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}
