/**
 * markdown 输出样式
 * 覆盖 Parsedown 渲染的常见元素：标题/段落/列表/引用/表格/代码块/行内代码/图片/链接/分隔线/脚注等
 */

.markdown {
    overflow-wrap: break-word;
    text-align: justify;
    /* CSS 变量兜底定义：主题未定义时保证表格/代码块/行内代码等样式正常生效 */
    --bodyBground: #f6f8fa;
    --borderColor: #e1e4e8;
    --aHoverColor: #5298FF;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

/* 段落 */
.markdown p {
    margin: 0 0 16px;
    line-height: 1.8;
}

.markdown h1 {
    font-size: 1.8rem !important;
    margin-top: 1em;
    margin-bottom: 16px;
    font-weight: bold;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    letter-spacing: 1px
}

.markdown h2 {
    font-size: 1.5rem !important;
    margin-top: 1em;
    margin-bottom: 16px;
    font-weight: bold;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
    letter-spacing: 1px
}

.markdown h3 {
    font-size: 1.3rem !important;
    margin-top: 1em;
    margin-bottom: 16px;
    line-height: 1.43;
    font-weight: bold
}

.markdown h4 {
    font-size: 1.2rem !important;
    margin-top: 1em;
    margin-bottom: 16px;
    font-weight: bold;
    line-height: 1.4;
    letter-spacing: 0.5px
}

.markdown h5 {
    font-size: 1rem !important;
    margin-top: 1em;
    margin-bottom: 16px;
    font-weight: bold;
    line-height: 1.4
}

.markdown h6 {
    font-size: 1rem !important;
    color: #777;
    margin-top: 1em;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 16px
}

.markdown strong {
    font-weight: bold;
    font-size: 1rem !important
}

.markdown em {
    font-style: italic
}

.markdown del {
    text-decoration: line-through
}

.markdown mark {
    background: #fff8c5;
    color: inherit;
    padding: 0 3px;
    border-radius: 3px
}

.markdown kbd {
    display: inline-block;
    padding: 2px 6px;
    font-size: 12px;
    line-height: 1.4;
    color: #444d56;
    background: var(--bodyBground);
    border: 1px solid var(--borderColor);
    border-radius: 4px;
    box-shadow: inset 0 -1px 0 var(--borderColor);
    font-family: Consolas, Menlo, monospace
}

.markdown sup,
.markdown sub {
    font-size: 75%;
    line-height: 0
}

.markdown a {
    text-decoration: underline;
    color: var(--aHoverColor)
}

.markdown a:hover {
    opacity: .85
}

.markdown a img {
    border: 1px solid #dae1f2;
}

.markdown blockquote {
    color: #666;
    border-left: 4px solid #ddd;
    padding: 8px 16px;
    margin: 0 0 16px;
    font-size: 14px;
    font-style: italic;
    background: var(--bodyBground);
    border-radius: 0 4px 4px 0
}

.markdown blockquote p {
    margin-bottom: 8px
}

.markdown blockquote p:last-child {
    margin-bottom: 0
}

.markdown ul {
    padding-left: 2em;
    margin-bottom: 16px
}

.markdown ol {
    padding-left: 2em;
    margin-bottom: 16px
}

.markdown ul ul,
.markdown ul ol,
.markdown ol ul,
.markdown ol ol {
    margin-bottom: 0
}

.markdown li {
    font-size: 15px !important;
    line-height: 2
}

.markdown li > p {
    margin-bottom: 8px
}

.markdown hr {
    height: 1px;
    border: none;
    border-top: 1px solid #ddd;
    background: none;
    margin: 24px 0
}

.markdown table {
    display: block;
    width: 100%;
    max-width: 100%;
    overflow: auto;
    word-break: keep-all;
    border-collapse: collapse;
    margin-bottom: 16px;
    table-layout: auto;
}

.markdown thead tr {
    background-color: var(--bodyBground)
}

.markdown td {
    padding: 6px 13px;
    border: 1px solid var(--borderColor)
}

.markdown th {
    padding: 6px 13px;
    border: 1px solid var(--borderColor);
    font-weight: bold
}

.markdown table tr:nth-child(even) {
    background: var(--bodyBground)
}

/* 选择不在 <pre> 标签中的 <code> 元素 */
.markdown code:not(pre > code) {
    border-radius: 3px;
    font-size: 14px;
    margin-right: 4px;
    color: var(--aHoverColor);
    background: var(--borderColor);
    padding: 2px 4px;
}

.markdown pre {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid var(--borderColor);
    background: var(--borderColor);
    overflow: auto
}

.markdown pre.prettyprint {
    padding: 10px;
    border: 1px solid #ddd;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.6
}

.markdown pre code {
    display: block;
    padding: 0;
    background: none;
    border: none;
    color: inherit;
    font-family: Consolas, Menlo, "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    white-space: pre
}

.markdown pre.prettyprint code {
    white-space: pre-wrap
}

/* prettyprint 语法高亮配色 */
.markdown pre.prettyprint .com { color: #6a737d }
.markdown pre.prettyprint .str { color: #032f62 }
.markdown pre.prettyprint .kwd { color: #d73a49 }
.markdown pre.prettyprint .typ { color: #005cc5 }
.markdown pre.prettyprint .lit { color: #005cc5 }
.markdown pre.prettyprint .pun { color: #24292e }
.markdown pre.prettyprint .pln { color: #24292e }
.markdown pre.prettyprint .tag { color: #22863a }
.markdown pre.prettyprint .atn { color: #e36209 }
.markdown pre.prettyprint .atv { color: #032f62 }
.markdown pre.prettyprint .dec { color: #005cc5 }
.markdown pre.prettyprint .fun { color: #6f42c1 }

.markdown img {
    display: block;
    margin: auto;
    box-sizing: border-box;
    border: 1px solid #dae1f2;
    max-width: 100%;
    height: auto;
}

/* 脚注区域 */
.markdown .footnotes {
    font-size: 13px;
    color: #666;
    border-top: 1px solid #eee;
    margin-top: 24px;
    padding-top: 12px
}

.markdown .footnotes li {
    font-size: 13px;
    line-height: 1.7
}
