:root {
    --primary-color: #3b82f6;
    --primary-light: #eff6ff;
    --primary-dark: #2563eb;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 6px rgba(0,0,0,0.05);
    --shadow: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 24px rgba(0,0,0,0.12);
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'OPPOSans', system-ui, -apple-system, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-light);
    line-height: 1.65;
    padding-top: 50px;
}

/* 导航栏样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 15px;
    transition: var(--transition);
}

.navbar-logo {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.navbar-logo i {
    font-size: 1.4rem;
}

/* 汉堡菜单按钮 */
.menu-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001;
    display: none;
}

.menu-toggle:focus {
    outline: none;
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    margin-left: auto;
}

.nav-item {
    margin-left: 25px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* 基础布局 */
.main-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 15px 80px;
}

/* 左侧分类导航 */
.sidebar {
    width: 240px;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    padding: 24px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    max-height: calc(100vh - 100px);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.sidebar:hover {
    box-shadow: var(--shadow);
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 8px;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.category-link {
    display: flex;
    align-items: center;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 10px 12px;
    font-size: 0.95rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.category-link i {
    margin-right: 10px;
    width: 18px;
    text-align: center;
}

.category-item.active .category-link,
.category-link:hover {
    color: var(--primary-color);
    background-color: var(--primary-light);
    transform: translateX(4px);
}

/* 右侧内容区域 */
.content-wrapper {
    flex: 1;
    padding-left: 30px;
}

.content-header {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

/* 文章卡片容器 */
.article-list-container {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.article-card {
    display: flex;
    align-items: flex-start;
    background-color: #ffffff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    padding: 16px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.2);
}

.article-cover {
    width: 160px;
    height: 110px;
    flex-shrink: 0;
    border-radius: 12px;
    overflow: hidden;
    margin-right: 20px;
    box-shadow: var(--shadow-sm);
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.article-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.article-card:hover .article-cover img {
    transform: scale(1.08);
}

.article-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--transition);
}

.article-title a {
    color: inherit;
    text-decoration: none;
}

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

.article-meta {
    color: var(--text-tertiary);
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.article-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.article-meta i {
    font-size: 0.9rem;
}

.article-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 12px;
    text-align: justify;
}

.article-views {
    display: inline-flex;
    align-items: center;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    gap: 5px;
}

.article-views i {
    font-size: 0.9rem;
}

/* 空状态样式 */
.empty-article {
    text-align: center;
    padding: 80px 0;
    color: var(--text-tertiary);
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    margin: 20px auto;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    max-width: 600px;
}

.empty-article i {
    font-size: 50px;
    color: #f0f2f5;
    margin-bottom: 20px;
    transition: var(--transition);
}

.empty-article:hover i {
    transform: scale(1.1);
    color: var(--primary-light);
}

.empty-article p {
    margin: 10px 0;
    font-size: 1rem;
    color: var(--text-secondary);
}

/* 分页样式 */
.pagination-area {
    margin-top: 30px;
    text-align: center;
}

.pagination {
    display: inline-flex;
    gap: 8px;
    list-style: none;
}

.pagination li a {
    font-size: 0.9rem;
    padding: 8px 15px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    border-radius: var(--border-radius);
    text-decoration: none;
    transition: var(--transition);
    background-color: #ffffff;
}

.pagination li a:hover {
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.pagination li.active a {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
    font-weight: 500;
}

.pagination li.disabled a {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: var(--card-bg);
    border-color: var(--border-color);
    transform: none;
}

/* 相关推荐样式 */
.related-container {
    padding: 20px;
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-top: 20px;
}

.related-title {
    font-size: 1.1rem;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-title i {
    color: var(--primary-color);
    font-size: 1rem;
}

.related-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-item {
    display: flex;
    align-items: center;
    background-color: #fff;
    border-radius: var(--border-radius);
    padding: 14px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
}

.related-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    background-color: var(--primary-light);
    border-color: rgba(59, 130, 246, 0.2);
}

.related-cover {
    width: 80px;
    height: 54px;
    flex-shrink: 0;
    border-radius: var(--border-radius-sm);
    overflow: hidden;
    margin-right: 12px;
    border: 1px solid var(--border-color);
}

.related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

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

.related-info {
    flex: 1;
    min-width: 0;
}

.related-link {
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 6px;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.related-meta {
    color: var(--text-tertiary);
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 12px;
}

.related-meta span {
    display: flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
}

.related-meta i {
    font-size: 0.8rem;
}

/* 文章内容图片优化 */
.article-content img {
    max-width: 80%; /* 缩小图片宽度 */
    height: auto;   /* 保持比例不变形 */
    border-radius: var(--border-radius); /* 圆角显示 */
    box-shadow: var(--shadow);
    display: block;
    margin: 1.5rem auto; /* 居中显示 */
    object-fit: cover;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.article-content img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-hover);
}

/* 响应式适配 */
@media (max-width: 992px) {
    .article-cover {
        width: 140px;
        height: 100px;
    }
    
    .related-cover {
        width: 90px;
        height: 60px;
    }
    
    .related-link {
        font-size: 1rem;
    }
}

@media (max-width: 768px) {
    /* 移动端导航 */
    .menu-toggle {
        display: block;
    }
    
    .nav-menu {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        width: 75%;
        max-width: 300px;
        background-color: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 20px 20px;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transform: translateX(100%);
        transition: transform 0.35s ease-in-out;
        z-index: 1000;
    }
    
    .nav-menu.active {
        transform: translateX(0);
    }
    
    .nav-item {
        margin-bottom: 18px;
        width: 100%;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 5px 0;
    }

    /* 布局调整 */
    .main-container {
        flex-direction: column;
        padding: 10px 15px 60px;
    }

    .sidebar {
        width: 100%;
        max-height: 220px;
        padding: 18px;
        margin-bottom: 25px;
        overflow-y: auto;
        position: static;
        top: 0;
    }

    .content-wrapper {
        padding-left: 0;
    }

    /* 移动端文章卡片优化 */
    .article-card {
        flex-direction: column;
        padding: 16px;
    }
    
    .article-cover {
        width: 100%;
        height: 180px;
        margin-right: 0;
        margin-bottom: 15px;
    }

    /* 移动端相关推荐修复 & 布局改小 */
    .related-item {
        flex-direction: column;
        align-items: flex-start;
        padding: 10px; /* 缩小内边距 */
    }
    
    .related-cover {
        width: 100%;
        height: 90px; /* 缩小图片高度 */
        margin-right: 0;
        margin-bottom: 8px;
    }
    
    .related-info {
        width: 100%;
    }
    
    .related-link {
        font-size: 0.9rem; /* 缩小标题字体 */
        margin-bottom: 4px;
    }
    
    .related-meta {
        font-size: 0.75rem; /* 缩小元信息字体 */
    }
    
    .related-list {
        gap: 10px; /* 缩小卡片间距 */
    }
}

@media (max-width: 480px) {
    .article-cover {
        height: 160px;
    }
    
    .article-title {
        font-size: 1.1rem;
    }
    
    .article-excerpt {
        font-size: 0.85rem;
    }
    
    .article-meta {
        flex-wrap: wrap;
    }
    
    /* 小屏进一步缩小推荐文章图片 */
    .related-cover {
        height: 80px;
    }
    
    /* 小屏文章图片进一步缩小 */
    .article-content img {
        max-width: 90%;
    }
}
/* 为文章内容中的 h1-h6 标签添加蓝色竖杠（兼容移动端） */
.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4, 
.article-content h5, 
.article-content h6 {
    position: relative;
    padding-left: 12px; /* 保证有足够空间显示竖杠 */
    margin-top: 1.5em;
    margin-bottom: 0.8em;
}

.article-content h1::before, 
.article-content h2::before, 
.article-content h3::before, 
.article-content h4::before, 
.article-content h5::before, 
.article-content h6::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0.3em;
    width: 4px;
    background-color: #3b82f6; /* 蓝色竖杠 */
    border-radius: 2px;
}

/* 不同标题的竖杠高度 */
.article-content h1::before { height: 50%; }
.article-content h2::before { height: 45%; }
.article-content h3::before { height: 60%; }
.article-content h4::before { height: 60%; }
.article-content h5::before { height: 60%; }
.article-content h6::before { height: 60%; }

/* 确保移动端不会被覆盖 */
@media (max-width: 768px) {
    .article-content h1, 
    .article-content h2, 
    .article-content h3, 
    .article-content h4, 
    .article-content h5, 
    .article-content h6 {
        padding-left: 12px !important; /* 强制保留左内边距 */
        position: relative !important;
    }
}

/* 文章详情页居中样式（仅影响详情页） */
.article-detail-container .article-header {
    text-align: center;
}
.article-detail-container .article-title {
    margin-bottom: 8px;
}
.article-detail-container .article-meta {
    justify-content: center;
}
.article-detail-container .article-meta span {
    display: inline-flex;
    align-items: center;
}

/* 上一篇 / 下一篇 导航 */
/* 文章上下导航卡片样式优化（桌面+移动端自适应） */
.article-nav {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.nav-card {}

.nav-card-link {
    display: flex; /* 改为flex以便内容居中且等高 */
    flex-direction: column;
    justify-content: center;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    padding: 16px 18px;
    min-height: 110px; /* 固定最小高度，保证两卡同高 */
    transition: var(--transition);
    color: inherit;
    text-decoration: none;
}

.nav-card-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(59, 130, 246, 0.25);
    text-decoration: none;
}

.nav-card-link.disabled {
    pointer-events: none;
    background: var(--bg-light);
    box-shadow: none;
}

.nav-label {
    color: var(--text-tertiary);
    font-size: 0.92rem;
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.8; /* 标签更淡一些 */
    font-weight: 500;
}

.nav-title {
    margin-top: 8px;
    color: var(--text-primary);
    font-size: 1.02rem;
    font-weight: 700; /* 标题更重一些 */
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* 最多两行，超出省略 */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 右侧卡片右对齐（符合示例效果） */
.nav-card.next .nav-label,
.nav-card.next .nav-title {
    text-align: right;
    justify-content: flex-end;
}

@media (max-width: 992px) {
    .nav-title { font-size: 0.98rem; }
}

/* 移动端：改为单列栅格并避免错位 */
@media (max-width: 768px) {
    .article-nav {
        grid-template-columns: 1fr 1fr; /* 手机端也保持左右两列 */
        gap: 12px;
        align-items: stretch; /* 保证两列卡片拉伸为同高 */
    }
    .nav-card-link {
        min-height: 110px; /* 保持与桌面一致的等高 */
        padding: 14px 16px;
    }
}
.article-nav a,
.article-nav span {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
}
.article-nav a:hover {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
}
.article-nav .disabled {
    opacity: 0.65;
}
@media (max-width: 768px) {
    .article-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}
/* 文章列表暗黑模式适配（跟随站点暗色类） */
body.dark-mode .sidebar,
.dark-mode .sidebar {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: none;
}
body.dark-mode .sidebar-title,
.dark-mode .sidebar-title { color: #f3f4f6; }
body.dark-mode .category-link,
.dark-mode .category-link { color: #e5e7eb; }
body.dark-mode .category-item.active .category-link,
.dark-mode .category-item.active .category-link {
    background-color: #374151;
    color: #f3f4f6;
    border-color: #4b5563;
}
body.dark-mode .category-item .category-link:hover,
.dark-mode .category-item .category-link:hover { color: #3b82f6; }

body.dark-mode .article-card,
.dark-mode .article-card {
    background-color: #1f2937;
    border-color: #374151;
    box-shadow: none;
}
body.dark-mode .article-cover,
.dark-mode .article-cover { border-color: #374151; }
body.dark-mode .article-title,
.dark-mode .article-title { color: #f3f4f6; }
body.dark-mode .article-meta,
.dark-mode .article-meta { color: #9ca3af; }
body.dark-mode .article-excerpt,
.dark-mode .article-excerpt { color: #cbd5e1; }

body.dark-mode .empty-article,
.dark-mode .empty-article {
    background-color: #1f2937;
    border-color: #374151;
    color: #9ca3af;
    box-shadow: none;
}
body.dark-mode .empty-article i,
.dark-mode .empty-article i { color: #6b7280; }

body.dark-mode .pagination li a,
.dark-mode .pagination li a {
    background-color: #1f2937;
    border-color: #374151;
    color: #cbd5e1;
}
body.dark-mode .pagination li a:hover,
.dark-mode .pagination li a:hover {
    background-color: #374151;
    color: #3b82f6;
    border-color: #3b82f6;
}
body.dark-mode .pagination li.active a,
.dark-mode .pagination li.active a {
    background-color: #3b82f6;
    color: #ffffff;
    border-color: #3b82f6;
}
body.dark-mode .pagination li.disabled a,
.dark-mode .pagination li.disabled a {
    background-color: #111827;
    border-color: #374151;
}
body.dark-mode .article-nav .nav-card-link,
.dark-mode .article-nav .nav-card-link {
    background: #1f2937; /* 与站点暗色卡片背景一致 */
    border-color: #374151;
    box-shadow: none;
}
body.dark-mode .article-nav .nav-label,
.dark-mode .article-nav .nav-label {
    color: #9ca3af; /* 标签在暗色下更淡 */
}
body.dark-mode .article-nav .nav-title,
.dark-mode .article-nav .nav-title {
    color: #f3f4f6; /* 标题在暗色下更深 */
}
body.dark-mode .article-nav a:hover,
.dark-mode .article-nav a:hover {
    color: #3b82f6; /* 保持与主色一致的悬停色 */
}