/* 博客文章页面样式 */

.blog-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 0;
}

.blog-header, .post-header {
    margin-top: 1rem;
    margin-bottom: 3rem; /* 增加与正文的间距，约两行高 */
    text-align: center;
}

.blog-header h1, .post-header h1 {
    font-size: 2.4rem;
    margin-bottom: 1rem;
    line-height: 1.2;
    color: var(--accent);
}

.blog-meta, .post-meta {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1rem; /* 增加与内容标签的间距 */
}

/* 时间标签统一使用红色背景和白色字体 */
.blog-meta time,
.post-meta time {
    color: #FFFFFF; /* 白色字体 */
    background-color: #C84630; /* 红色背景 */
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    display: inline-block;
    font-weight: 500;
}

.blog-body, .post-content {
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 3rem;
}

.blog-body p, .post-content p {
    margin-bottom: 1.5rem;
}

.blog-body h2, .post-content h2 {
    font-size: 1.8rem;
    margin: 2rem 0 1rem;
}

.blog-body h3, .post-content h3 {
    font-size: 1.5rem;
    margin: 1.8rem 0 0.8rem;
}

.blog-body ol, .blog-body ul, .post-content ol, .post-content ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.blog-body li, .post-content li {
    margin-bottom: 0.8rem;
}

.blog-body ol li ol, .blog-body ul li ul, .post-content ol li ol, .post-content ul li ul {
    margin-top: 0.8rem;
    margin-bottom: 0.5rem;
}

.blog-body a, .post-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid var(--primary-color);
    transition: all 0.2s ease;
}

.blog-body a:hover, .post-content a:hover {
    opacity: 0.8;
}

/* 尾注链接样式 - 符合无障碍标准（蓝色hover） */
.post-content .footnote-link,
.post-content a.footnote-link {
    color: #0066cc;
    text-decoration: underline;
    border-bottom: none;
}

.post-content .footnote-link:hover,
.post-content a.footnote-link:hover {
    color: #0052a3;
    text-decoration: underline;
    opacity: 1;
}

/* 深色模式下的尾注链接 */
.dark-theme .post-content .footnote-link,
.dark-theme .post-content a.footnote-link {
    color: #4da6ff;
}

.dark-theme .post-content .footnote-link:hover,
.dark-theme .post-content a.footnote-link:hover {
    color: #66b3ff;
}

.blog-body .highlight, .post-content .highlight {
    background-color: rgba(66, 153, 225, 0.15);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: var(--primary-color);
}

.blog-body .highlight-yellow, .post-content .highlight-yellow {
    background-color: rgba(236, 201, 75, 0.2);
    padding: 0.1rem 0.3rem;
    border-radius: 3px;
    color: #805a00;
}

.blog-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.blog-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: var(--bg-accent);
    padding: 0.3rem 0.8rem;
    border-radius: 50px;
    font-size: 0.8rem;
}

.related-posts {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.related-posts h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background-color: var(--bg-card);
    border-radius: 8px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.related-card h4 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.related-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* 相关推荐卡片封面图样式（温暖、治愈的呼吸感） */
.related-card .cover-wrap {
    width: 100%;
    aspect-ratio: 3 / 2;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.9rem;
    background: var(--bg-secondary);
}

.related-card .cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.01);
    transition: transform 0.5s ease;
}

.related-card:hover .cover {
    transform: scale(1.05);
}

.related-card .date {
    margin-top: 0.25rem;
}

/* 博客页面的特殊元素 */
.blog-aside, aside {
    background-color: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    border-left: 3px solid var(--accent);
}

.blog-aside p:last-child, aside p:last-child {
    margin-bottom: 0;
}

.text-center {
    text-align: center;
    margin: 2rem 0;
}

.img-fluid {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .blog-header h1, .post-header h1 {
        font-size: 2rem;
    }
    .blog-header, .post-header {
        margin-bottom: 2.5rem; /* 移动端适当缩小但仍保留两行视觉留白 */
    }
    
    .blog-body, .post-content {
        font-size: 1rem;
    }
    
    .blog-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}

/* 深色模式调整 */
@media (prefers-color-scheme: dark) {
    .blog-body .highlight, .post-content .highlight {
        background-color: rgba(66, 153, 225, 0.2);
    }
    
    .blog-body .highlight-yellow, .post-content .highlight-yellow {
        background-color: rgba(236, 201, 75, 0.15);
        color: #f0c84c;
    }
}