/* ==================== */
/* Pandoc Markdown样式 */
/* ==================== */

:root {
    --primary-color: #51751f;
    --secondary-color: #3a5916;
    --accent-color: #6a9625;
    --text-dark: #1A1A1A;
    --text-light: #666666;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #E0E0E0;
    --code-bg: #f5f5f5;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 基础样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-dark);
    background-color: var(--bg-white);
    padding: 40px;
    max-width: 900px;
    margin: 0 auto;
}

/* 标题样式 */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-dark);
}

h1 {
    font-size: 2.5em;
    padding-bottom: 0.3em;
    border-bottom: 3px solid var(--primary-color);
    margin-top: 0;
}

h2 {
    font-size: 2em;
    padding-bottom: 0.3em;
    border-bottom: 2px solid var(--border-color);
}

h3 {
    font-size: 1.5em;
    color: var(--primary-color);
}

h4 {
    font-size: 1.25em;
}

h5 {
    font-size: 1.1em;
}

h6 {
    font-size: 1em;
    color: var(--text-light);
}

/* 段落样式 */
p {
    margin-top: 0;
    margin-bottom: 16px;
}

/* 链接样式 */
a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--primary-color);
}

/* 列表样式 */
ul,
ol {
    margin-top: 0;
    margin-bottom: 16px;
    padding-left: 2em;
}

ul {
    list-style-type: disc;
}

ol {
    list-style-type: decimal;
}

li {
    margin-bottom: 8px;
    line-height: 1.8;
}

li > p {
    margin-bottom: 8px;
}

ul ul,
ul ol,
ol ol,
ol ul {
    margin-top: 8px;
    margin-bottom: 0;
}

/* 引用块样式 */
blockquote {
    margin: 0 0 16px 0;
    padding: 0 1em;
    color: var(--text-light);
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-light);
    border-radius: 0 4px 4px 0;
}

blockquote > :first-child {
    margin-top: 0;
}

blockquote > :last-child {
    margin-bottom: 0;
}

/* 代码样式 */
code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 0.9em;
    background-color: var(--code-bg);
    border-radius: 4px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
    color: #e83e8c;
}

pre {
    padding: 16px;
    overflow: auto;
    font-size: 0.9em;
    line-height: 1.6;
    background-color: var(--code-bg);
    border-radius: 8px;
    margin-bottom: 16px;
    border: 1px solid var(--border-color);
}

pre code {
    display: block;
    padding: 0;
    margin: 0;
    overflow: visible;
    line-height: inherit;
    word-wrap: normal;
    background-color: transparent;
    border: 0;
    color: var(--text-dark);
}

/* 表格样式 */
table {
    border-spacing: 0;
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 16px;
    overflow: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

table th,
table td {
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    text-align: left;
}

table th {
    font-weight: 600;
    background-color: var(--primary-color);
    color: white;
}

table tr:nth-child(even) {
    background-color: var(--bg-light);
}

table tr:hover {
    background-color: #e8f5e9;
}

/* 水平线样式 */
hr {
    height: 0;
    margin: 24px 0;
    overflow: hidden;
    background: transparent;
    border: 0;
    border-bottom: 2px solid var(--border-color);
}

/* 图片样式 */
img {
    width: 480px;
    height: auto;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    margin: 16px 0;
    display: block;
}

/* 强调样式 */
strong {
    font-weight: 700;
    color: var(--text-dark);
}

em {
    font-style: italic;
}

/* 删除线 */
del {
    text-decoration: line-through;
    color: var(--text-light);
}

/* 标记高亮 */
mark {
    background-color: #fff59d;
    padding: 2px 4px;
    border-radius: 2px;
}

/* 键盘按键样式 */
kbd {
    display: inline-block;
    padding: 3px 5px;
    font-size: 0.85em;
    line-height: 1;
    color: var(--text-dark);
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, Courier, monospace;
}

/* 详情折叠 */
details {
    margin-bottom: 16px;
    padding: 16px;
    background-color: var(--bg-light);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

details summary {
    font-weight: 600;
    cursor: pointer;
    color: var(--primary-color);
    user-select: none;
}

details summary:hover {
    color: var(--secondary-color);
}

details[open] summary {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
    body {
        padding: 20px;
        font-size: 14px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.7em;
    }

    h3 {
        font-size: 1.4em;
    }

    pre {
        padding: 12px;
    }

    table {
        font-size: 0.9em;
    }

    table th,
    table td {
        padding: 8px 12px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 15px;
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.5em;
    }
}

/* 打印样式 */
@media print {
    body {
        padding: 0;
        background-color: white;
    }

    a {
        color: black;
        text-decoration: underline;
    }

    img {
        max-width: 100%;
        page-break-inside: avoid;
    }
}
