: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);
}

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

.article-detail-container {
    padding: 0;
    margin-top: 40px;
}

.article-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.article-title {
    font-size: 1.9rem;
    font-weight: 200;
    color: var(--text-color);
    margin-bottom: 16px;
    line-height: 1.4;
    text-align: left;
}

.article-header::after {
    display: none;
}

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

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

.article-category a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

.article-category a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.article-cover {
    padding: 0;
}

.article-content {
    padding: 0;
}

.cover-image,
.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    margin: 1.8rem auto;
    display: block;
}

.article-cover:hover .cover-image,
.article-content img:hover {
    transform: scale(1.02) translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.cover-image[src=""],
.article-content img[src=""] {
    background-color: var(--bg-light);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    border: 1px dashed var(--border-color);
}

.article-content {
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 0.95rem;
}

.article-content p {
    margin-bottom: 1.2rem;
    text-align: left;
}

.article-content h1,
.article-content h2, 
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin: 1.5rem 0 1rem;
    color: var(--text-primary);
    font-weight: 600;
    line-height: 1.4;
}

.article-content h1 { font-size: 1.8rem; }
.article-content h2 { font-size: 1.5rem; }
.article-content h3 { font-size: 1.3rem; }
.article-content h4 { font-size: 1.1rem; }
.article-content h5 { font-size: 1rem; }
.article-content h6 { font-size: 0.9rem; }

.article-content ul,
.article-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 1rem 0;
    color: var(--text-tertiary);
    font-style: italic;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary-light);
    transition: var(--transition);
}

.article-content a:hover {
    color: var(--primary-dark);
    border-bottom-color: var(--primary-color);
}

.article-content h2 {
    font-size: 1.25rem;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
}

.article-content h3 {
    font-size: 1.1rem;
    margin: 1.8rem 0 0.8rem;
    color: var(--text-primary);
    font-weight: 600;
    text-align: left;
}

/* 相关推荐基础样式 */
.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;
}

.empty-article {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
    background-color: #fff;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    margin: 20px auto;
    max-width: 600px;
}

.empty-article i {
    font-size: 48px;
    color: var(--primary-light);
    margin-bottom: 16px;
    transition: var(--transition);
}

.empty-article:hover i {
    color: var(--primary-color);
    transform: rotate(5deg) scale(1.05);
}

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

.empty-article .btn {
    margin-top: 16px;
    padding: 6px 16px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
}

.empty-article .btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.no-related {
    text-align: center;
    padding: 30px 0;
    color: var(--text-tertiary);
    font-size: 0.95rem;
}

.no-related i {
    margin-right: 6px;
    color: var(--text-tertiary);
    font-size: 1rem;
}

/* 大屏适配 */
@media (min-width: 1200px) {
    .col-lg-3 {
        max-width: 32%;
    }
    .related-cover {
        width: 90px;
        height: 60px;
    }
    .related-link {
        font-size: 1rem;
    }
}

/* 中屏适配 */
@media (max-width: 992px) {
    .row {
        display: flex;
        flex-direction: column;
    }
    .col-lg-9, .col-lg-3 {
        width: 100%;
        max-width: 100%;
    }
    .col-lg-3 {
        margin-top: 30px;
    }
    .article-title {
        font-size: 1.3rem;
    }
    .related-container {
        padding: 20px;
    }
    .related-cover {
        width: 90px;
        height: 60px;
    }
}

/* 手机端适配 */
@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: 0 0 18px 0;
        width: 100%;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 5px 0;
        width: 100%;
    }

    .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;
        z-index: auto;
        background-color: #ffffff;
    }

    .content-wrapper {
        padding: 0;
    }

    .article-card {
        flex-direction: row;
        align-items: center;
        padding: 16px;
    }

    .article-cover {
        width: 120px;
        height: 85px;
        margin-right: 15px;
    }

    .article-title {
        font-size: 1.2rem;
    }

    .article-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .article-meta {
        font-size: 0.8rem;
        gap: 12px;
    }
    
    .article-views {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* 文章详细页特定样式 */
.article-detail-container {
    margin-top: 0;
}

.article-title {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 12px;
    line-height: 1.6;
}

/* 为文章内容中的h1-h6标签添加蓝色竖杠 */
.article-content h1, 
.article-content h2, 
.article-content h3, 
.article-content h4, 
.article-content h5, 
.article-content h6 {
    position: relative;
    padding-left: 8px;
    margin: 1.5em 0 0.8em 0;
}

.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%; }

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

.article-views {
    display: inline-flex;
    align-items: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-top: auto;
    gap: 6px;
}

.article-views i {
    margin-right: 0;
}

.empty-article {
    text-align: center;
    padding: 80px 0;
    color: var(--text-tertiary);
    background-color: var(--card-bg);
    border-radius: var(--radius);
    margin-top: 20px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .article-title {
        font-size: 1.4rem;
    }

    .article-meta {
        font-size: 0.8rem;
        gap: 12px;
    }
    
    .article-views {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .article-title {
        font-size: 1.3rem;
    }
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-color);
    line-height: 1.6;
    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 {
    color: var(--primary-color);
}

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

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

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

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

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

.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-item {
    margin-bottom: 8px;
    border-radius: var(--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(--radius);
    transition: var(--transition);
}

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

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

.category-item.active .category-link i {
    color: var(--primary-color);
}

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

.content-header {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-color);
    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: var(--card-padding);
    border: 1px solid var(--border-color);
    overflow: hidden;
    position: relative;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: rgba(74, 108, 247, 0.1);
}

/* 封面图 */
.article-cover {
    width: 160px;
    height: 110px;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
    margin-right: 20px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    position: relative;
}

.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-color);
    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;
    overflow: visible;
    white-space: normal;
}

/* 访问量显示 */
.article-views {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    font-size: 0.85rem;
    padding: 5px 12px;
    background-color: var(--primary-light);
    border-radius: 20px;
    margin-top: auto;
    width: fit-content;
    box-shadow: 0 2px 4px rgba(74, 108, 247, 0.08);
}

.article-views i {
    margin-right: 6px;
    font-size: 0.9rem;
}

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

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

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

.empty-article p {
    margin: 10px 0;
    font-size: 1rem;
}

/* 分页样式 */
.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(--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;
}

.pagination li.disabled a:hover {
    background-color: var(--card-bg);
    color: var(--text-secondary);
    border-color: var(--border-color);
    transform: none;
}

/* 移动端导航菜单 */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease-in-out, visibility 0.35s;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* 响应式适配 */
@media (max-width: 992px) {
    .article-cover {
        width: 140px;
        height: 100px;
    }
}

@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: 0 0 18px 0;
        width: 100%;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 5px 0;
        width: 100%;
    }

    .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;
        z-index: auto;
        background-color: var(--card-bg); /* 移动端白色卡片背景 */
        box-shadow: var(--shadow-sm);      /* 卡片阴影 */
        border: 1px solid var(--border-color); /* 卡片边框 */
        border-radius: var(--border-radius);  /* 卡片圆角 */
    }

    .content-wrapper {
        padding: 0;
    }

    .article-card {
        flex-direction: row;
        align-items: center;
        padding: 16px;
    }

    .article-cover {
        width: 120px;
        height: 85px;
        margin-right: 15px;
    }

    .article-title {
        font-size: 1rem;
    }

    .article-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
    }

    .article-meta {
        font-size: 0.8rem;
        gap: 12px;
    }
    
    .article-views {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .article-cover {
        width: 100px;
        height: 70px;
        margin-right: 12px;
    }
    
    .article-title {
        font-size: 0.95rem;
        -webkit-line-clamp: 2;
    }
    
    .article-excerpt {
        font-size: 0.85rem;
    }
    
    .article-meta {
        flex-wrap: wrap;
    }
}