/* 自定义主题样式 */

/* 全局字体设置 */
:root {
    --main-font: "Noto Sans", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --code-font: "JetBrains Mono", "Fira Code", "Source Code Pro", Consolas, "Ubuntu Mono", Menlo, monospace;
    --content-max-width: 850px;
}

body {
    font-family: var(--main-font);
    line-height: 1.6;
    font-size: 16px;
    color: #333;
}

/* 标题样式 */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--main-font);
    font-weight: 600;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.2em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

h2 {
    font-size: 1.8em;
    border-bottom: 1px solid #eaecef;
    padding-bottom: 0.3em;
}

h3 {
    font-size: 1.5em;
}

h4 {
    font-size: 1.3em;
}

/* 链接样式 */
a {
    color: #0366d6;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* 代码样式 */
code {
    font-family: var(--code-font);
    font-size: 0.9em;
    padding: 0.2em 0.4em;
    background-color: rgba(27, 31, 35, 0.05);
    border-radius: 3px;
}

pre {
    background-color: #f6f8fa;
    border-radius: 3px;
    padding: 16px;
    overflow: auto;
    line-height: 1.45;
}

pre code {
    background-color: transparent;
    padding: 0;
}

/* 引用样式 */
blockquote {
    margin: 0;
    padding: 0 1em;
    color: #6a737d;
    border-left: 0.25em solid #dfe2e5;
}

/* 表格样式 */
table {
    border-collapse: collapse;
    width: 100%;
    margin-bottom: 1em;
}

table, th, td {
    border: 1px solid #dfe2e5;
}

th, td {
    padding: 8px 12px;
    text-align: left;
}

th {
    background-color: #f6f8fa;
}

/* 图片样式 */
img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* 列表样式 */
ul, ol {
    padding-left: 2em;
}

li {
    margin-bottom: 0.5em;
}

/* 提示框样式 */
.warning, .info, .tip {
    padding: 12px 16px;
    margin: 20px 0;
    border-left: 4px solid;
    border-radius: 4px;
}

.warning {
    background-color: #fff5f5;
    border-left-color: #e53e3e;
}

.info {
    background-color: #ebf8ff;
    border-left-color: #4299e1;
}

.tip {
    background-color: #f0fff4;
    border-left-color: #48bb78;
}

/* 页面内容最大宽度 */
.content {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* 打印样式优化 */
@media print {
    body {
        font-size: 12pt;
    }
    
    pre, code {
        font-size: 10pt;
    }
    
    a {
        color: #000;
        text-decoration: underline;
    }
    
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
    }
    
    img {
        page-break-inside: avoid;
        max-width: 100% !important;
    }
    
    pre, blockquote {
        page-break-inside: avoid;
    }
}

/* 暗色主题适配 */
@media (prefers-color-scheme: dark) {
    .light.ayu .content {
        --fg: #c5c5c5;
        --bg: #141414;
        --sidebar-bg: #1b1b1b;
        --sidebar-fg: #c8c9db;
        --sidebar-non-existant: #5c6773;
        --sidebar-active: #ffffff;
        --sidebar-spacer: #2d334f;
    }
}

/* 移动设备适配 */
@media only screen and (max-width: 768px) {
    :root {
        --content-max-width: 100%;
    }
    
    body {
        font-size: 15px;
    }
    
    h1 {
        font-size: 1.8em;
    }
    
    h2 {
        font-size: 1.5em;
    }
    
    h3 {
        font-size: 1.3em;
    }
}