/* article.css - 中文博客文章样式 */
.markdown {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
    line-height: 1.8;
    color: #2c3e50;
    font-size: 16px;
}

/* 标题样式 */
.markdown h1 {
    font-size: 2.25rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem 0;
    padding-bottom: 0.5rem;
    /*border-bottom: 1px solid #e9ecef;*/
    color: #1a365d;
}

.markdown h2 {
    font-size: 1.875rem;
    font-weight: 600;
    margin: 2rem 0 1.25rem 0;
    padding-bottom: 0.375rem;
    /*border-bottom: 2px solid #f1f3f4;*/
    color: #2d3748;
}

.markdown h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.75rem 0 1rem 0;
    color: #4a5568;
}

.markdown h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.875rem 0;
    color: #718096;
}

.markdown h5 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 1.25rem 0 0.75rem 0;
    color: #a0aec0;
}

.markdown h6 {
    font-size: 1rem;
    font-weight: 500;
    margin: 1rem 0 0.625rem 0;
    color: #cbd5e0;
}

/* 段落样式 */
.markdown p {
    margin: 1.25rem 0;
    text-align: justify;
    word-break: break-word;
    hyphens: auto;
}

.markdown p:first-child {
    margin-top: 0;
}

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

/* 列表样式 */
.markdown ul, .markdown ol {
    margin: 1.25rem 0;
    padding-left: 2rem;
}

.markdown li {
    margin: 0.5rem 0;
    line-height: 1.7;
}

.markdown ul li {
    list-style-type: disc;
}

.markdown ol li {
    list-style-type: decimal;
}

.markdown li > ul, .markdown li > ol {
    margin: 0.5rem 0;
}

/* 链接样式 */
.markdown a {
    color: #4299e1;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.markdown a:hover {
    color: #3182ce;
    border-bottom-color: #3182ce;
}

.markdown a:focus {
    outline: 2px solid #bee3f8;
    outline-offset: 2px;
}

/* 代码样式 */
.markdown code {
    background-color: #f7fafc;
    color: #e53e3e;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: "SFMono-Regular", "Consolas", "Liberation Mono", "Menlo", monospace;
}

.markdown pre {
    background-color: #1a202c;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.markdown pre code {
    background: none;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
}

/* 引用块样式 */
.markdown blockquote {
    background-color: #f8fafc;
    border-left: 4px solid #4299e1;
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    font-style: italic;
    color: #4a5568;
}

.markdown blockquote p {
    margin: 0.5rem 0;
}

.markdown blockquote p:first-child {
    margin-top: 0;
}

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

/* 表格样式 */
.markdown table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.875rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.markdown th {
    background-color: #f7fafc;
    font-weight: 600;
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.markdown td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.markdown tr:hover {
    background-color: #f7fafc;
}

/* 图片样式 */
.markdown img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease;
}

.markdown img:hover {
    transform: scale(1.02);
}

.markdown img + em {
    display: block;
    text-align: center;
    font-size: 0.875rem;
    color: #718096;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* 水平线 */
.markdown hr {
    /*border: none;*/
    height: 2px;
    /*background: linear-gradient(90deg, transparent, #e9ecef, transparent);*/
    margin: 2.5rem 0;
}

/* 强调文本 */
.markdown strong {
    font-weight: 700;
    color: #2d3748;
}

.markdown em {
    font-style: italic;
    color: #4a5568;
}

/* 任务列表 */
.markdown .task-list-item {
    list-style-type: none;
    margin-left: -1.5rem;
}

.markdown .task-list-item input[type="checkbox"] {
    margin-right: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .markdown {
        font-size: 15px;
        line-height: 1.7;
    }

    .markdown h1 {
        font-size: 1.875rem;
    }

    .markdown h2 {
        font-size: 1.625rem;
    }

    .markdown h3 {
        font-size: 1.375rem;
    }

    .markdown pre {
        padding: 1rem;
        font-size: 0.8125rem;
    }

    .markdown table {
        font-size: 0.8125rem;
    }
}

/* 打印样式 */
@media print {
    .markdown {
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
    }

    .markdown a {
        color: #000;
        text-decoration: underline;
    }

    .markdown pre {
        background-color: #f5f5f5;
        border: 1px solid #ddd;
    }
}

/* 特殊元素样式 */
.markdown .highlight {
    position: relative;
}

.markdown .highlight::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #4299e1, #38b2ac);
    border-radius: 2px 0 0 2px;
}

/* 数学公式支持 */
.markdown .math {
    overflow-x: auto;
    overflow-y: hidden;
}

.markdown .math-display {
    text-align: center;
    margin: 1.5rem 0;
}