﻿/* 基础样式重置与变量定义 */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --secondary-color: #f9fafb;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --card-radius: 12px;
    --transition: all 0.3s ease;
    --text-color: #1f2937;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
}

/* 主容器样式 */
.article-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 15px 100px;
    color: var(--text-color);
    line-height: 1.8;
}

/* 文章头部样式 */
.article-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.article-title {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 0 0 15px;
    line-height: 1.4;
    font-weight: 600;
}

.article-meta {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.meta-list {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.meta-item {
    display: flex;
    align-items: center;
}

    .meta-item i {
        margin-right: 5px;
        font-size: 0.9em;
        color: var(--primary-color);
    }

/* 文章内容样式 */
.article-content {
    background: white;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    padding: 30px;
    margin-bottom: 30px;
}

.article-body {
    font-size: 1rem;
    line-height: 1.8;
}

    .article-body p {
        margin-bottom: 1.5em;
    }

    .article-body img {
        max-width: 100%;
        height: auto;
        border-radius: var(--card-radius);
        margin: 20px 0;
        display: block;
    }

    .article-body h2,
    .article-body h3,
    .article-body h4 {
        color: var(--primary-color);
        margin: 1.5em 0 0.8em;
        line-height: 1.4;
    }

    .article-body h2 {
        font-size: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px;
    }

    .article-body h3 {
        font-size: 1.3rem;
    }

    .article-body h4 {
        font-size: 1.1rem;
    }

    .article-body ul,
    .article-body ol {
        margin: 1em 0;
        padding-left: 2em;
    }

    .article-body li {
        margin-bottom: 0.5em;
    }

    .article-body blockquote {
        border-left: 4px solid var(--primary-color);
        background: #f8fafc;
        padding: 15px 20px;
        margin: 20px 0;
        border-radius: 0 var(--card-radius) var(--card-radius) 0;
        font-style: italic;
    }

    .article-body table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        font-size: 0.9rem;
    }

        .article-body table th,
        .article-body table td {
            padding: 12px 15px;
            border: 1px solid var(--border-color);
            text-align: left;
        }

        .article-body table th {
            background: #f9fafb;
            font-weight: 600;
        }

/* 文章导航样式 */
.article-navigation {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.navigation-item {
    margin-bottom: 15px;
}

.navigation-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.navigation-item a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

    .navigation-item a:hover {
        color: var(--primary-hover);
        text-decoration: underline;
    }

.no-more {
    color: var(--text-secondary);
    font-style: italic;
}

/* 响应式调整 */
@media (min-width: 768px) {
    .article-container {
        padding: 30px 20px 120px;
    }

    .article-title {
        font-size: 2.1rem;
    }

    .article-content {
        padding: 40px;
    }

    .article-body {
        font-size: 1.05rem;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.article-content {
    animation: fadeIn 0.4s ease forwards;
}

/* 图片悬停效果 */
.article-body img {
    transition: var(--transition);
}

    .article-body img:hover {
        box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
        transform: translateY(-2px);
    }

/* 表格悬停效果 */
.article-body table tr:hover td {
    background: #f8fafc;
}

/* 无障碍优化 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 结构化数据增强 */
[itemprop="headline"] {
    font-weight: 600;
}

[itemprop="articleBody"] {
    line-height: 1.8;
}

/* 代码块样式 */
.article-body pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 15px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 20px 0;
}

.article-body code {
    background: #f3f4f6;
    padding: 2px 4px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #dc2626;
}

/* 文章内链接样式 */
.article-body a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    transition: var(--transition);
}

    .article-body a:hover {
        color: var(--primary-hover);
        border-bottom-style: solid;
    }

/* 文章导航箭头效果 */
.navigation-item a::after {
    content: "→";
    margin-left: 5px;
    transition: var(--transition);
    opacity: 0;
}

.navigation-item a:hover::after {
    opacity: 1;
    transform: translateX(3px);
}

.navigation-item.prev-article a::after {
    content: none;
}

.navigation-item.prev-article a::before {
    content: "←";
    margin-right: 5px;
    transition: var(--transition);
    opacity: 0;
}

.navigation-item.prev-article a:hover::before {
    opacity: 1;
    transform: translateX(-3px);
}
