/* Markdown → PDF 4 套模板样式
   类名前缀 mp-out-tpl- 防止与全局冲突
   v2: 整体重写，蓝色配色，结构更紧 */

/* === 代码高亮（GitHub 配色，针对 #1f2937 暗底微调） === */
.hl-kw  { color:#ff7b72; font-weight:600; }   /* 关键字：亮红 */
.hl-str { color:#a5d6ff; }                    /* 字符串：亮蓝（在暗底上显眼） */
.hl-num { color:#79c0ff; }                    /* 数字：浅蓝 */
.hl-com { color:#8b949e; font-style:italic; } /* 注释：灰 */

/* ===== 默认模板（蓝调，重写） ===== */
.mp-out-tpl-default {
  font-family: "PingFang SC", "Microsoft YaHei", "Source Han Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.7;
  color: #1f2937;
  font-size: 15px;
  word-wrap: break-word;
  text-align: left;
}
/* 标题 */
.mp-out-tpl-default h1, .mp-out-tpl-default h2, .mp-out-tpl-default h3,
.mp-out-tpl-default h4, .mp-out-tpl-default h5, .mp-out-tpl-default h6 {
  font-weight: 700; line-height: 1.35; color: #111827; margin: 1.4em 0 0.6em;
}
.mp-out-tpl-default h1 { font-size: 1.9em; border-bottom: 2px solid #3b82f6; padding-bottom: 6px; }
.mp-out-tpl-default h2 { font-size: 1.5em; border-bottom: 1px solid #e5e7eb; padding-bottom: 4px; }
.mp-out-tpl-default h3 { font-size: 1.25em; color: #2563eb; }
.mp-out-tpl-default h4 { font-size: 1.08em; color: #1e40af; }
.mp-out-tpl-default h5, .mp-out-tpl-default h6 { font-size: 1em; color: #374151; }
.mp-out-tpl-default h1:first-child, .mp-out-tpl-default h2:first-child, .mp-out-tpl-default h3:first-child { margin-top: 0.2em; }
/* 段落 */
.mp-out-tpl-default p { margin: 0.7em 0; }
.mp-out-tpl-default strong { color: #1e40af; font-weight: 700; }
.mp-out-tpl-default em { color: #1f2937; }
.mp-out-tpl-default a { color: #2563eb; text-decoration: none; border-bottom: 1px solid rgba(37,99,235,.4); }
/* 行内代码 */
.mp-out-tpl-default code {
  background: #f3f4f6; color: #be185d; padding: 1px 6px; border-radius: 4px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.9em;
}
/* 代码块 */
.mp-out-tpl-default pre {
  background: #1f2937; color: #f3f4f6; padding: 14px 18px; border-radius: 8px;
  overflow-x: auto; margin: 0.8em 0; line-height: 1.55; font-size: 13px;
}
.mp-out-tpl-default pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }
/* 引用 */
.mp-out-tpl-default blockquote {
  border-left: 4px solid #3b82f6; padding: 6px 14px; margin: 0.8em 0;
  color: #4b5563; background: #eff6ff; border-radius: 0 6px 6px 0;
}
.mp-out-tpl-default blockquote > :first-child { margin-top: 0; }
.mp-out-tpl-default blockquote > :last-child { margin-bottom: 0; }
/* 列表：marker 在内，与文字紧凑 */
.mp-out-tpl-default ul, .mp-out-tpl-default ol { margin: 0.6em 0; padding-left: 1.6em; list-style-position: outside; }
.mp-out-tpl-default li { margin: 0.2em 0; padding: 0; }
.mp-out-tpl-default li > p { margin: 0; padding: 0; }   /* marked 默认给 li 内文本包 <p>，强制 0 margin */
.mp-out-tpl-default li > ul, .mp-out-tpl-default li > ol { margin: 0.1em 0; }
/* 任务列表（checkbox）*/
.mp-out-tpl-default input[type="checkbox"] { margin-right: 4px; vertical-align: middle; }
/* 表格 */
.mp-out-tpl-default table { border-collapse: collapse; width: 100%; margin: 0.8em 0; font-size: 0.95em; }
.mp-out-tpl-default th, .mp-out-tpl-default td { border: 1px solid #e5e7eb; padding: 7px 11px; }
.mp-out-tpl-default th { background: #eff6ff; font-weight: 700; color: #1e3a8a; }
.mp-out-tpl-default tbody tr:nth-child(even) { background: #f9fafb; }
/* 图片 / 分割线 */
.mp-out-tpl-default img { max-width: 100%; border-radius: 6px; box-shadow: 0 4px 12px rgba(0,0,0,.08); margin: 0.4em 0; }
.mp-out-tpl-default hr { border: 0; border-top: 2px dashed #d1d5db; margin: 1.6em 0; }

/* ===== GitHub 模板（蓝调，重写） ===== */
.mp-out-tpl-github {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  line-height: 1.6; color: #1f2328; font-size: 15px; word-wrap: break-word; text-align: left;
}
.mp-out-tpl-github h1, .mp-out-tpl-github h2, .mp-out-tpl-github h3,
.mp-out-tpl-github h4, .mp-out-tpl-github h5, .mp-out-tpl-github h6 {
  font-weight: 600; line-height: 1.3; margin: 1.4em 0 0.6em; color: #1f2328;
}
.mp-out-tpl-github h1 { font-size: 1.9em; border-bottom: 1px solid #d1d9e0; padding-bottom: 6px; }
.mp-out-tpl-github h2 { font-size: 1.5em; border-bottom: 1px solid #d1d9e0; padding-bottom: 5px; }
.mp-out-tpl-github h3 { font-size: 1.25em; color: #2563eb; }
.mp-out-tpl-github h4 { font-size: 1.1em; color: #1e40af; }
.mp-out-tpl-github p { margin: 0.7em 0; }
.mp-out-tpl-github a { color: #2563eb; text-decoration: none; }
.mp-out-tpl-github strong { font-weight: 700; }
.mp-out-tpl-github code { background: rgba(175,184,193,0.2); color: #1f2328; padding: 1px 6px; border-radius: 4px; font-size: 0.9em; font-family: ui-monospace, Menlo, Consolas, monospace; }
.mp-out-tpl-github pre { background: #f6f8fa; color: #1f2328; padding: 14px 18px; border-radius: 6px; overflow-x: auto; margin: 0.8em 0; line-height: 1.55; font-size: 13px; }
.mp-out-tpl-github pre code { background: transparent; padding: 0; }
.mp-out-tpl-github blockquote { color: #59636e; border-left: 4px solid #d1d9e0; padding: 4px 14px; margin: 0.8em 0; background: #f6f8fa; border-radius: 0 6px 6px 0; }
.mp-out-tpl-github ul, .mp-out-tpl-github ol { margin: 0.6em 0; padding-left: 1.6em; }
.mp-out-tpl-github li { margin: 0.2em 0; }
.mp-out-tpl-github li > p { margin: 0; padding: 0; }
.mp-out-tpl-github table { border-collapse: collapse; margin: 0.8em 0; }
.mp-out-tpl-github th, .mp-out-tpl-github td { border: 1px solid #d1d9e0; padding: 6px 13px; }
.mp-out-tpl-github th { background: #f6f8fa; font-weight: 600; }
.mp-out-tpl-github img { max-width: 100%; }
.mp-out-tpl-github hr { border: 0; border-top: 1px solid #d1d9e0; margin: 1.6em 0; }

/* ===== 学术模板（蓝调，重写） ===== */
.mp-out-tpl-academic {
  font-family: "Times New Roman", "Source Han Serif SC", "Noto Serif SC", "Songti SC", serif;
  line-height: 1.8; color: #1a1a1a; font-size: 15px; word-wrap: break-word; text-align: left;
}
.mp-out-tpl-academic h1, .mp-out-tpl-academic h2, .mp-out-tpl-academic h3 {
  font-weight: 700; color: #1e3a8a; line-height: 1.35; margin: 1.4em 0 0.7em;
}
.mp-out-tpl-academic h1 { font-size: 1.8em; text-align: center; border-bottom: 2px solid #1e3a8a; padding-bottom: 8px; }
.mp-out-tpl-academic h2 { font-size: 1.4em; border-left: 4px solid #3b82f6; padding-left: 10px; }
.mp-out-tpl-academic h3 { font-size: 1.2em; color: #1e40af; }
.mp-out-tpl-academic p { margin: 0.7em 0; text-align: justify; }
.mp-out-tpl-academic a { color: #1e3a8a; text-decoration: underline; }
.mp-out-tpl-academic code { background: #f1f5f9; color: #1e40af; padding: 1px 6px; border-radius: 3px; font-size: 0.9em; }
.mp-out-tpl-academic pre { background: #f8fafc; color: #1a1a1a; padding: 14px 18px; border-radius: 6px; border-left: 3px solid #3b82f6; margin: 0.8em 0; line-height: 1.55; font-size: 13px; overflow-x: auto; }
.mp-out-tpl-academic pre code { background: transparent; }
.mp-out-tpl-academic blockquote { border-left: 3px solid #94a3b8; padding: 4px 14px; margin: 0.8em 0; color: #475569; font-style: italic; }
.mp-out-tpl-academic ul, .mp-out-tpl-academic ol { margin: 0.6em 0; padding-left: 1.8em; }
.mp-out-tpl-academic li { margin: 0.2em 0; }
.mp-out-tpl-academic li > p { margin: 0; padding: 0; }
.mp-out-tpl-academic table { border-collapse: collapse; width: 100%; margin: 0.8em 0; }
.mp-out-tpl-academic th { background: #f1f5f9; border-bottom: 2px solid #475569; padding: 8px 12px; font-weight: 700; text-align: left; }
.mp-out-tpl-academic td { border-bottom: 1px solid #e2e8f0; padding: 7px 12px; }
.mp-out-tpl-academic hr { border: 0; border-top: 1px solid #cbd5e1; margin: 1.6em 0; }

/* ===== 简历模板（蓝调，重写） ===== */
.mp-out-tpl-resume {
  font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  line-height: 1.7; color: #1f2937; font-size: 15px; word-wrap: break-word; text-align: left;
}
.mp-out-tpl-resume h1 { font-size: 2em; font-weight: 800; color: #1e3a8a; text-align: center; margin: 0 0 0.3em; border: 0; }
.mp-out-tpl-resume h2 { font-size: 1.15em; font-weight: 700; color: #fff; background: linear-gradient(135deg,#2563eb,#3b82f6); padding: 5px 12px; border-radius: 6px; margin: 1.2em 0 0.6em; }
.mp-out-tpl-resume h3 { font-size: 1.05em; color: #1e40af; font-weight: 700; margin: 0.8em 0 0.3em; }
.mp-out-tpl-resume p { margin: 0.3em 0; }
.mp-out-tpl-resume strong { color: #1e40af; }
.mp-out-tpl-resume a { color: #2563eb; text-decoration: none; }
.mp-out-tpl-resume code { background: #f1f5f9; color: #1e40af; padding: 1px 5px; border-radius: 3px; font-size: 0.9em; }
.mp-out-tpl-resume pre { background: #f8fafc; color: #1f2937; padding: 12px 16px; border-radius: 6px; margin: 0.6em 0; line-height: 1.55; font-size: 13px; }
.mp-out-tpl-resume blockquote { border-left: 3px solid #3b82f6; padding: 2px 12px; margin: 0.5em 0; color: #475569; }
.mp-out-tpl-resume ul, .mp-out-tpl-resume ol { margin: 0.4em 0; padding-left: 1.4em; }
.mp-out-tpl-resume li { margin: 0.1em 0; }
.mp-out-tpl-resume li > p { margin: 0; padding: 0; }
.mp-out-tpl-resume table { border-collapse: collapse; width: 100%; margin: 0.6em 0; }
.mp-out-tpl-resume th, .mp-out-tpl-resume td { border: 1px solid #e5e7eb; padding: 6px 10px; }
.mp-out-tpl-resume th { background: #eff6ff; color: #1e3a8a; }
.mp-out-tpl-resume hr { border: 0; border-top: 1px solid #cbd5e1; margin: 1em 0; }

/* ===== TOC 目录 ===== */
.mp-toc-block { background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 8px; padding: 12px 18px; margin: 0.6em 0 1.2em; }
.mp-toc-block .mp-toc-title { font-weight: 700; color: #1e3a8a; font-size: 1.05em; margin-bottom: 8px; }
.mp-toc-block ul { list-style: none; padding-left: 0; margin: 0; }
.mp-toc-block ul ul { padding-left: 1.5em; margin-top: 2px; }
.mp-toc-block li { margin: 3px 0; }
.mp-toc-block a { color: #2563eb; text-decoration: none; }
.mp-toc-block a:hover { text-decoration: underline; }

/* ===== 暗色模式（4 套通用） ===== */
.mp-dark .mp-pane-body.mp-out { background: #0f172a; color: #e2e8f0; }
.mp-dark .mp-pane-head { background: #1e293b; color: #e2e8f0; border-color: #334155; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h1,
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h2,
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h3,
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h4,
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h5,
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h6 { color: #f1f5f9; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h1 { border-bottom-color: #60a5fa; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h2 { border-bottom-color: #334155; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default h3 { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default a { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default code { background: #1e293b; color: #fbbf24; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default pre { background: #020617; color: #e2e8f0; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default blockquote { background: #1e293b; color: #cbd5e1; border-left-color: #60a5fa; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default th { background: #1e293b; color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default th, .mp-dark .mp-pane-body.mp-out.mp-out-tpl-default td { border-color: #334155; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-default tbody tr:nth-child(even) { background: #1e293b; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github { background: #0d1117; color: #c9d1d9; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github h1, .mp-dark .mp-pane-body.mp-out.mp-out-tpl-github h2 { border-bottom-color: #30363d; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github h3, .mp-dark .mp-pane-body.mp-out.mp-out-tpl-github a { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github code { background: rgba(110,118,129,0.4); color: #e6edf3; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github pre { background: #161b22; color: #e6edf3; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github th { background: #161b22; color: #c9d1d9; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github th, .mp-dark .mp-pane-body.mp-out.mp-out-tpl-github td { border-color: #30363d; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-github blockquote { background: #161b22; color: #8b949e; border-left-color: #30363d; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic h1 { color: #93c5fd; border-bottom-color: #60a5fa; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic h2 { color: #93c5fd; border-left-color: #60a5fa; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic h3 { color: #cbd5e1; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic a { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic code { background: #1e293b; color: #fbbf24; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic pre { background: #1e293b; border-left-color: #60a5fa; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic th { background: #1e293b; color: #93c5fd; border-bottom-color: #475569; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic td { border-bottom-color: #334155; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-academic blockquote { color: #94a3b8; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume h2 { background: linear-gradient(135deg,#1e3a8a,#2563eb); }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume h1 { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume h3 { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume a { color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume code { background: #1e293b; color: #fbbf24; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume pre { background: #020617; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume th { background: #1e293b; color: #93c5fd; }
.mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume th, .mp-dark .mp-pane-body.mp-out.mp-out-tpl-resume td { border-color: #334155; }
