/* NZWL Markdown — 前台 + 预览通用样式 */

.nzwl-md-body,
.nzwl-md-preview,
.entry-content.nzwl-md-rendered,
.nzwl-single-content {
  line-height: 1.75;
  word-wrap: break-word;
}

/* 标题锚点 */
.entry-content h1[id],
.entry-content h2[id],
.entry-content h3[id],
.entry-content h4[id],
.entry-content h5[id],
.entry-content h6[id],
.nzwl-md-preview h1[id],
.nzwl-md-preview h2[id],
.nzwl-md-preview h3[id] {
  scroll-margin-top: 80px;
}

/* 代码块 */
.nzwl-code,
pre.nzwl-code,
.entry-content pre,
.nzwl-md-preview pre {
  background: #1e2228;
  color: #e6e8eb;
  padding: 14px 16px;
  border-radius: 10px;
  overflow: auto;
  font-size: 13px;
  line-height: 1.6;
  margin: 14px 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}
.nzwl-code code,
pre.nzwl-code code,
.entry-content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
  border-radius: 0;
}

.entry-content :not(pre) > code,
.nzwl-md-preview :not(pre) > code,
.nzwl-single-content :not(pre) > code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* 引用 */
.entry-content blockquote,
.nzwl-md-preview blockquote {
  border-left: 3px solid var(--nzwl-accent, #2f6fed);
  margin: 14px 0;
  padding: 8px 16px;
  color: var(--nzwl-muted, #555);
  background: #f8f9fb;
  border-radius: 0 8px 8px 0;
}
.entry-content blockquote p:last-child,
.nzwl-md-preview blockquote p:last-child {
  margin-bottom: 0;
}

/* 表格 */
.nzwl-md-table,
.entry-content table,
.nzwl-md-preview table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 14px;
  display: block;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.nzwl-md-table th,
.nzwl-md-table td,
.entry-content table th,
.entry-content table td,
.nzwl-md-preview table th,
.nzwl-md-preview table td {
  border: 1px solid var(--nzwl-border, #e6e8eb);
  padding: 8px 12px;
  text-align: left;
}
.nzwl-md-table th,
.entry-content table th,
.nzwl-md-preview table th {
  background: #f6f7f9;
  font-weight: 600;
}
.nzwl-md-table tr:nth-child(even),
.entry-content table tr:nth-child(even) {
  background: #fafbfc;
}
.nzwl-md-table th[style*="center"],
.nzwl-md-table td[style*="center"] {
  text-align: center;
}
.nzwl-md-table th[style*="right"],
.nzwl-md-table td[style*="right"] {
  text-align: right;
}

/* 任务列表 */
li.nzwl-task,
.entry-content li.nzwl-task,
.nzwl-md-preview li.nzwl-task {
  list-style: none;
  margin-left: -0.5em;
}
li.nzwl-task .nzwl-task-cb,
.entry-content li input.nzwl-task-cb {
  margin-right: 6px;
  vertical-align: middle;
}
li.nzwl-task.is-checked {
  color: #6b7280;
}

/* 删除线 / 高亮 */
del,
.entry-content del {
  color: #9aa0a6;
  text-decoration: line-through;
}
mark.nzwl-mark,
.entry-content mark {
  background: #fff3a3;
  color: inherit;
  padding: 0 3px;
  border-radius: 3px;
}

/* 图片 */
img.nzwl-md-img,
.entry-content img.nzwl-md-img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 10px 0;
}

/* 目录 TOC */
.nzwl-toc {
  background: #f6f8fb;
  border: 1px solid var(--nzwl-border, #e6e8eb);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 18px 0;
}
.nzwl-toc-title {
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 15px;
}
.nzwl-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.nzwl-toc-list li {
  margin: 4px 0;
  line-height: 1.5;
}
.nzwl-toc-list a {
  text-decoration: none;
  color: var(--nzwl-accent, #2f6fed);
}
.nzwl-toc-list a:hover {
  text-decoration: underline;
}

/* 脚注 */
.nzwl-footnotes,
.entry-content .footnotes {
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--nzwl-border, #e6e8eb);
  font-size: 0.92em;
  color: #555;
}
.nzwl-footnotes hr {
  display: none;
}
.entry-content sup a.footnote-ref,
.nzwl-md-preview sup a {
  text-decoration: none;
  font-weight: 600;
  color: var(--nzwl-accent, #2f6fed);
}

/* 定义列表 */
.entry-content dl,
.nzwl-md-preview dl {
  margin: 14px 0;
}
.entry-content dt,
.nzwl-md-preview dt {
  font-weight: 700;
  margin-top: 8px;
}
.entry-content dd,
.nzwl-md-preview dd {
  margin-left: 1.2em;
  color: #444;
}

/* 缩写 */
.entry-content abbr {
  text-decoration: underline dotted;
  cursor: help;
}

/* 数学占位 */
.nzwl-math-block {
  background: #f4f6fa;
  border-radius: 8px;
  padding: 12px 16px;
  margin: 14px 0;
  overflow-x: auto;
  font-family: "Cambria Math", "Times New Roman", serif;
  text-align: center;
}

/* 分割线 */
.entry-content hr,
.nzwl-md-preview hr {
  border: 0;
  border-top: 1px solid var(--nzwl-border, #e6e8eb);
  margin: 24px 0;
}

/* 嵌套列表间距 */
.entry-content ul ul,
.entry-content ol ol,
.entry-content ul ol,
.entry-content ol ul {
  margin: 4px 0;
}

/* 暗色模式（主题有 data-theme / .dark 时） */
[data-theme="dark"] .entry-content :not(pre) > code,
.dark .entry-content :not(pre) > code {
  background: #2a2f38;
}
[data-theme="dark"] .entry-content blockquote,
.dark .entry-content blockquote {
  background: #1a1e26;
}
[data-theme="dark"] .nzwl-toc {
  background: #1a1e26;
}
[data-theme="dark"] .nzwl-md-table th,
[data-theme="dark"] .entry-content table th {
  background: #1e2430;
}
[data-theme="dark"] mark.nzwl-mark {
  background: #5c4b12;
  color: #f5e6a8;
}
