/* 博客基础样式 */
:root {
    /* 字体大小变量 - 参考91wink */
    --font-size-xs: 12px;
    --font-size-sm: 13px;
    --font-size-base: 14px;
    --font-size-md: 15px;
    --font-size-lg: 16px;
    --font-size-xl: 18px;
    --font-size-2xl: 20px;
    --font-size-3xl: 24px;
    --font-size-4xl: 28px;
    --font-size-5xl: 32px;
    
    /* 行高变量 */
    --line-height-tight: 1.25;
    --line-height-normal: 1.5;
    --line-height-relaxed: 1.6;
    --line-height-loose: 1.8;
    
    /* 颜色变量 - 更深的紫色 */
    --primary-color: #206be7;
    --primary-dark: #182848;
    --secondary-color: #6e8efb;
    --accent-color: #8b5fbf;  /* 从 #a17fe0 改为更深的紫色 */
    --gradient-start: #206be7;
    --gradient-end: #8b5fbf;   /* 从 #a17fe0 改为更深的紫色 */
    --text-color: #333;
    --text-light: #6c757d;
    --border-color: #e9ecef;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

.blog-container {
    padding: 2rem 0;
    background-color: var(--bg-light);
    min-height: calc(100vh - 200px);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.col-lg-9 {
    flex: 0 0 75%;
    max-width: 75%;
    padding: 0 15px;
}

.col-lg-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 15px;
}

/* 博客文章列表 */
.blog-posts {
    display: grid;
    gap: 2rem;
}

.blog-post-card {
    background: var(--white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.blog-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(75, 108, 183, 0.15);
}

.post-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.blog-post-card:hover .post-image img {
    transform: scale(1.05);
}

.post-content {
    padding: 1.5rem;
}

.post-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    font-size: var(--font-size-sm);
    color: var(--text-light);
    line-height: var(--line-height-normal);
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-title {
    margin: 0 0 1rem 0;
    font-size: var(--font-size-xl);
    font-weight: 600;
    line-height: var(--line-height-tight);
}

.post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-excerpt {
    color: var(--text-light);
    line-height: var(--line-height-relaxed);
    margin-bottom: 1rem;
    font-size: var(--font-size-base);
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag-item {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    background-color: var(--bg-light);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 0.25rem;
    font-size: var(--font-size-xs);
    transition: all 0.3s;
}

.tag-item:hover {
    background-color: var(--primary-color);
    color: var(--white);
}

.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: color 0.3s;
}

.read-more:hover {
    color: var(--accent-color);
}

/* 博客文章详情 */
.blog-post-detail {
    background: var(--white);
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.post-header {
    padding: 2rem 2.5rem;
    border-bottom: 1px solid var(--border-color);
}

.post-header .post-title {
    font-size: var(--font-size-4xl);
    margin-bottom: 1rem;
    line-height: var(--line-height-tight);
    font-weight: 700;
}

.post-header .post-meta {
    font-size: var(--font-size-sm);
    margin-bottom: 1.5rem;
}

.post-body {
    padding: 2rem 2.5rem;
    line-height: var(--line-height-loose);
    font-size: var(--font-size-md);
}

.post-body h1,
.post-body h2,
.post-body h3,
.post-body h4,
.post-body h5,
.post-body h6 {
    margin: 2rem 0 1rem 0;
    color: var(--text-color);
    line-height: var(--line-height-tight);
    font-weight: 600;
}

.post-body h1 { font-size: var(--font-size-4xl); }
.post-body h2 { font-size: var(--font-size-3xl); }
.post-body h3 { font-size: var(--font-size-2xl); }
.post-body h4 { font-size: var(--font-size-xl); }
.post-body h5 { font-size: var(--font-size-lg); }
.post-body h6 { font-size: var(--font-size-md); }

.post-body p {
    margin-bottom: 1em;
    font-size: var(--font-size-md);
    line-height: var(--line-height-loose);
}

.post-body ul,
.post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
    font-size: var(--font-size-md);
}

.post-body li {
    margin-bottom: 0.5rem;
    line-height: var(--line-height-relaxed);
}

.post-body blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid var(--primary-color);
    background-color: var(--bg-light);
    font-style: italic;
    font-size: var(--font-size-md);
    line-height: var(--line-height-relaxed);
}

.post-body code {
    background-color: var(--bg-light);
    padding: 0.25rem 0.5rem;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: var(--font-size-sm);
}

.post-body pre {
    background-color: #f8f8f8;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 1.5rem 0;
    font-size: var(--font-size-sm);
}

.post-body pre code {
    background: none;
    padding: 0;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

/* 文章导航 */
.post-footer {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
    background-color: var(--bg-light);
}

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.nav-previous,
.nav-next {
    display: flex;
}

.nav-previous a,
.nav-next a {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--white);
    border-radius: 0.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-size: var(--font-size-sm);
}

.nav-previous a:hover,
.nav-next a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(75, 108, 183, 0.15);
}

.nav-next {
    justify-content: flex-end;
}

.nav-next a {
    flex-direction: row-reverse;
}

.nav-previous a div,
.nav-next a div {
    display: flex;
    flex-direction: column;
}

.nav-previous a small,
.nav-next a small {
    color: var(--text-light);
    font-size: var(--font-size-xs);
    margin-bottom: 0.25rem;
}

.nav-previous a span,
.nav-next a span {
    font-weight: 500;
    font-size: var(--font-size-sm);
}

/* 相关文章 */
.related-posts {
    margin-top: 2rem;
    background: var(--white);
    border-radius: 0.5rem;
    padding: 2rem 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.related-posts h3 {
    margin: 0 0 1.5rem 0;
    font-size: var(--font-size-xl);
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    font-weight: 600;
}

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

.related-post-item {
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.related-post-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(75, 108, 183, 0.15);
}

.related-post-image {
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-post-content {
    padding: 1rem;
}

.related-post-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: var(--font-size-base);
    line-height: var(--line-height-tight);
    font-weight: 500;
}

.related-post-content h4 a {
    color: var(--text-color);
    text-decoration: none;
}

.related-post-content h4 a:hover {
    color: var(--primary-color);
}

.related-post-content .post-meta {
    font-size: var(--font-size-xs);
    gap: 0.5rem;
}

/* 侧边栏 */
.blog-sidebar {
    display: grid;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--white);
    border-radius: 0.5rem;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.widget-title {
    margin: 0 0 1rem 0;
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-color);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
}

/* 搜索表单 */
.search-form .input-group {
    display: flex;
}

.search-form .form-control {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.25rem 0 0 0.25rem;
    font-size: var(--font-size-sm);
}

.search-form .btn {
    padding: 0.5rem 0.75rem;
    border-radius: 0 0.25rem 0.25rem 0;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    border: 1px solid var(--primary-color);
    color: var(--white);
    font-size: var(--font-size-sm);
}

/* 推荐文章 */
.featured-posts {
    display: grid;
    gap: 1rem;
}

.featured-post-item {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.featured-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.featured-post-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 0.25rem;
    overflow: hidden;
}

.featured-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-post-content {
    flex: 1;
}

.featured-post-content h6 {
    margin: 0 0 0.5rem 0;
    font-size: var(--font-size-sm);
    line-height: var(--line-height-tight);
    font-weight: 500;
}

.featured-post-content h6 a {
    color: var(--text-color);
    text-decoration: none;
}

.featured-post-content h6 a:hover {
    color: var(--primary-color);
}

.featured-post-content .post-meta {
    font-size: var(--font-size-xs);
    gap: 0.5rem;
}

/* 分类列表 */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.5rem;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.375rem 0;
    color: var(--text-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s;
    font-size: var(--font-size-sm);
}

.category-list a:hover {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.post-count {
    color: var(--text-light);
    font-size: var(--font-size-xs);
}

/* 标签云 */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

/* 归档链接 */
.archive-links {
    text-align: center;
}

.archive-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--white);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: transform 0.3s;
}

.archive-link:hover {
    transform: translateY(-2px);
    color: var(--white);
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.pagination a,
.pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 0.25rem;
    text-decoration: none;
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: all 0.3s;
}

.pagination a {
    background: var(--white);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.pagination .current {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--white);
    border: 1px solid var(--primary-color);
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    background: var(--white);
    border-radius: 0.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.empty-state i {
    font-size: var(--font-size-5xl);
    color: var(--text-light);
    margin-bottom: 1rem;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-size: var(--font-size-xl);
}

.empty-state p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: var(--font-size-base);
}

/* 博客Hero区域 */
.blog-hero {
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.blog-hero .container {
    max-width: 800px;
}

.hero-content h1 {
    font-size: var(--font-size-4xl);
    margin-bottom: 1rem;
    font-weight: 600;
    line-height: var(--line-height-tight);
}

.hero-content p {
    font-size: var(--font-size-lg);
    opacity: 0.9;
    margin: 0;
    line-height: var(--line-height-normal);
}

.blog-header {
    margin-bottom: 2rem;
    padding: 1.5rem 0;
    border-bottom: 2px solid var(--border-color);
}

.page-title {
    font-size: var(--font-size-3xl);
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 600;
    line-height: var(--line-height-tight);
}

.page-description {
    color: var(--text-light);
    font-size: var(--font-size-base);
    margin: 0;
    line-height: var(--line-height-normal);
}

.search-info {
    color: var(--text-light);
    font-size: var(--font-size-sm);
    margin: 0.5rem 0 0 0;
}

/* 评论区样式 */
.comments-section {
    margin-top: 2rem;
    background: var(--white);
    border-radius: 0.5rem;
    padding: 2rem 2.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-title {
    font-size: var(--font-size-xl);
    margin-bottom: 2rem;
    color: var(--text-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.comment-form-wrapper {
    margin-bottom: 3rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
}

.comment-form .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.comment-form .form-group {
    margin-bottom: 1rem;
}

.comment-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.375rem;
    font-size: var(--font-size-sm);
    transition: border-color 0.3s;
}

.comment-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(75, 108, 183, 0.1);
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.comments-list {
    display: grid;
    gap: 1.5rem;
}

.comment-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    border-left: 3px solid var(--primary-color);
}

.comment-avatar {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-lg);
}

.comment-content {
    flex: 1;
}

.comment-header {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    align-items: center;
}

.comment-author {
    font-weight: 600;
    color: var(--text-color);
    font-size: var(--font-size-sm);
}

.comment-date {
    font-size: var(--font-size-xs);
    color: var(--text-light);
}

.comment-text {
    color: var(--text-color);
    line-height: var(--line-height-relaxed);
    font-size: var(--font-size-sm);
}

.no-comments {
    text-align: center;
    padding: 2rem;
    color: var(--text-light);
    font-size: var(--font-size-base);
}

/* 登录提示样式 */
.login-prompt {
    text-align: center;
    padding: 2rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
}

.login-prompt i {
    font-size: var(--font-size-3xl);
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.login-prompt h4 {
    margin-bottom: 1rem;
    color: var(--text-color);
    font-size: var(--font-size-lg);
    font-weight: 600;
}

.login-prompt p {
    color: var(--text-light);
    margin-bottom: 1.5rem;
    font-size: var(--font-size-base);
}

.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    color: var(--white);
    text-decoration: none;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: var(--font-size-sm);
    transition: transform 0.3s;
}

.login-btn:hover {
    transform: translateY(-2px);
    color: var(--white);
}

/* 用户信息显示 */
.comment-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 0.5rem;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--font-size-base);
}

.user-details span {
    color: var(--text-color);
    font-weight: 500;
    font-size: var(--font-size-sm);
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (max-width: 992px) {
    .col-lg-9,
    .col-lg-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .blog-sidebar {
        margin-top: 2rem;
    }
    
    .container {
        max-width: 100%;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-next {
        justify-content: flex-start;
    }
    
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .blog-container {
        padding: 1rem 0;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .sidebar-widget {
        padding: 1rem;
    }
    
    .featured-post-item {
        flex-direction: column;
        text-align: center;
    }
    
    .featured-post-image {
        width: 100%;
        height: 120px;
    }
    
    .blog-hero {
        padding: 2rem 0;
    }
    
    .hero-content h1 {
        font-size: var(--font-size-3xl);
    }
    
    .comment-form .form-row {
        grid-template-columns: 1fr;
    }
    
    .comment-item {
        flex-direction: column;
        text-align: center;
    }
    
    .comment-header {
        justify-content: center;
    }
    
    .post-header {
        padding: 1.5rem 2rem;
    }
    
    .post-header .post-title {
        font-size: var(--font-size-3xl);
    }
    
    .post-body {
        padding: 1.5rem 2rem;
        font-size: var(--font-size-base);
    }
    
    .related-posts,
    .comments-section {
        padding: 1.5rem 2rem;
    }
}

/* 图片优化样式 */
.post-image img,
.related-post-image img,
.featured-post-image img {
    transition: opacity 0.3s ease;
    width: 100%;
    height: auto;
}

/* 懒加载占位符 */
img[loading="lazy"] {
    opacity: 0;
    transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
    opacity: 1;
}

/* 响应式图片 */
picture {
    display: block;
    width: 100%;
}

picture img {
    width: 100%;
    height: auto;
}

/* WebP支持检测 */
.no-webp .webp-image {
    display: none;
}

.webp .fallback-image {
    display: none;
}

/* 图片加载动画 */
.post-image,
.related-post-image,
.featured-post-image {
    position: relative;
    overflow: hidden;
}

.post-image::before,
.related-post-image::before,
.featured-post-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
    z-index: 1;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

.post-image img:not([src]),
.related-post-image img:not([src]),
.featured-post-image img:not([src]) {
    background-color: #f0f0f0;
    min-height: 200px;
}

/* 1. h2 背景色 */
.post-body h2 {
    background: linear-gradient(90deg, #206be7 60%, #8b5fbf 100%);
    color: #fff;
    padding: 0.5em 1em;
    margin: 2rem 0 1rem 0;
    font-size: var(--font-size-3xl);
    font-weight: 600;
    line-height: var(--line-height-tight);
}

/* 2. 表格样式 */
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    background: #fff;
    border: 1px solid #e9ecef;
    font-size: var(--font-size-base);
}
.post-body th, .post-body td {
    border: 1px solid #e9ecef;
    padding: 0.75em 1em;
    text-align: left;
}
.post-body th {
    background: #f8f9fa;
    font-weight: 600;
}
.post-body tr:nth-child(even) {
    background: #f6f8fa;
}

/* 3. 段落间距 */
.post-body p {
    margin-bottom: 1em;
    font-size: var(--font-size-md);
    line-height: var(--line-height-loose);
} 