/* ── 文章详情页 & 关于页 Markdown 渲染样式 ── */

/* CSS 变量扩展：文章页专用（浅色默认）*/
:root {
    --article-code-bg:        #f6f8fa;
    --article-code-border:    #e1e4e8;
    --article-blockquote-bg:  #f1f3f5;
    --article-blockquote-text:#555555;
    --article-table-head-bg:  #f8f9fa;
    --article-table-even-bg:  #f8f9fa;
    --article-table-border:   #dee2e6;
    --article-hr-color:       #e9ecef;
    --article-heading-border: #e9ecef;
    --article-inline-code-color: #e83e8c;
}

/* 深色主题变量覆盖 */
[data-theme="dark"] {
    --article-code-bg:        #2d333b;
    --article-code-border:    #444c56;
    --article-blockquote-bg:  #2d333b;
    --article-blockquote-text:#adbac7;
    --article-table-head-bg:  #2d333b;
    --article-table-even-bg:  #272e38;
    --article-table-border:   #444c56;
    --article-hr-color:       #363c48;
    --article-heading-border: #363c48;
    --article-inline-code-color: #f47067;
}

@media (prefers-color-scheme: dark) {
    [data-theme="auto"] {
        --article-code-bg:        #2d333b;
        --article-code-border:    #444c56;
        --article-blockquote-bg:  #2d333b;
        --article-blockquote-text:#adbac7;
        --article-table-head-bg:  #2d333b;
        --article-table-even-bg:  #272e38;
        --article-table-border:   #444c56;
        --article-hr-color:       #363c48;
        --article-heading-border: #363c48;
        --article-inline-code-color: #f47067;
    }
}

.article-content {
    line-height: 1.8;
    font-size: 15px;
    word-break: break-word;
}

/* 标题 */
.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4 {
    margin-top: 1.5rem;
    margin-bottom: .75rem;
    font-weight: 600;
    border-bottom: 1px solid var(--article-heading-border);
    padding-bottom: .3rem;
}
.article-content h1 { font-size: 1.6rem; }
.article-content h2 { font-size: 1.4rem; }
.article-content h3 { font-size: 1.2rem; }

/* 段落 */
.article-content p { margin-bottom: 1rem; }

/* 引用块 */
.article-content blockquote {
    border-left: 4px solid #17a2b8;
    padding: .5rem 1rem;
    margin: 1rem 0;
    background-color: var(--article-blockquote-bg);
    color: var(--article-blockquote-text);
    border-radius: 0 4px 4px 0;
}

/* 代码块 */
.article-content pre {
    background-color: var(--article-code-bg);
    border: 1px solid var(--article-code-border);
    border-radius: 4px;
    padding: 1rem;
    overflow-x: auto;
    font-size: 13px;
    margin-bottom: 1rem;
}
.article-content code {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
}
.article-content p code,
.article-content li code {
    background-color: var(--article-code-bg);
    border: 1px solid var(--article-code-border);
    border-radius: 3px;
    padding: .1rem .4rem;
    color: var(--article-inline-code-color);
}

/* 图片自适应 */
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: .5rem 0;
}

/* 表格 */
.article-content table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
    font-size: 14px;
}
.article-content table th,
.article-content table td {
    border: 1px solid var(--article-table-border);
    padding: .5rem .75rem;
    text-align: left;
}
.article-content table thead th {
    background-color: var(--article-table-head-bg);
    font-weight: 600;
}
.article-content table tbody tr:nth-child(even) {
    background-color: var(--article-table-even-bg);
}

/* 有序/无序列表 */
.article-content ul,
.article-content ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

/* 水平线 */
.article-content hr {
    border-top: 1px solid var(--article-hr-color);
    margin: 1.5rem 0;
}

/* 目录样式 */
#toc a {
    border-left: 2px solid transparent;
    line-height: 1.6;
}
#toc a:hover,
#toc a.active {
    border-left-color: #17a2b8;
    color: #17a2b8 !important;
}
