/* 基础样式 */
:root {
    --primary-color: #4361ee;
    --secondary-color: #3f37c9;
    --accent-color: #4895ef;
    --dark-color: #1b263b;
    --light-color: #f8f9fa;
    --gray-color: #6c757d;
    --success-color: #4cc9f0;
    --warning-color: #f72585;
    --font-main: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --font-heading: 'Helvetica Neue', Arial, sans-serif;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    line-height: 1.6;
    color: #333;
    background-color: #f5f7fa;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航栏 */
.top-bar {
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 15px 0;
}

.top-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-wrapper {
    flex: 0 0 200px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color);
    font-family: var(--font-heading);
}

.main-nav ul {
    display: flex;
    list-style: none;
}

.main-nav li {
    margin-left: 25px;
}

.main-nav a {
    font-size: 16px;
    font-weight: 500;
    color: var(--dark-color);
    padding: 5px 0;
    position: relative;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--primary-color);
}

.main-nav a.active:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--primary-color);
}

.mobile-menu-btn {
    display: none;
    width: 30px;
    height: 20px;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--dark-color);
    transition: var(--transition);
}

/* 面包屑导航 */
.breadcrumb {
    padding: 15px 0;
    background-color: #fff;
    box-shadow: var(--shadow-sm);
    margin-bottom: 20px;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
}

.breadcrumb a {
    color: var(--gray-color);
    font-size: 14px;
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 8px;
    color: var(--gray-color);
    font-size: 14px;
}

/* 主内容区 */
.main-content {
    padding: 30px 0;
}

/* 特色内容区 */
.featured-section {
    margin-bottom: 40px;
}

.featured-section .container {
    display: flex;
    gap: 20px;
}

.featured-left {
    flex: 0 0 60%;
}

.featured-right {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.featured-article {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background-color: #fff;
}

.featured-link {
    display: block;
}

.featured-image {
    height: 350px;
    overflow: hidden;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.featured-link:hover .featured-image img {
    transform: scale(1.05);
}

.featured-content {
    padding: 20px;
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color);
    color: #fff;
    font-size: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.featured-content h2 {
    font-size: 24px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.excerpt {
    color: var(--gray-color);
    margin-bottom: 15px;
    font-size: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    color: var(--gray-color);
}

.side-article {
    display: flex;
    gap: 15px;
    background-color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.side-article:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.side-image {
    flex: 0 0 120px;
    height: 80px;
    overflow: hidden;
}

.side-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.side-article:hover .side-image img {
    transform: scale(1.1);
}

.side-content {
    padding: 10px 10px 10px 0;
    flex: 1;
}

.side-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分类内容区 */
.category-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 22px;
    color: var(--dark-color);
    position: relative;
    padding-left: 15px;
}

.section-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background-color: var(--primary-color);
    border-radius: var(--radius-sm);
}

.view-all {
    font-size: 14px;
    color: var(--gray-color);
}

.view-all:hover {
    color: var(--primary-color);
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.category-article {
    background-color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.category-article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.article-image {
    height: 180px;
    position: relative;
    overflow: hidden;
}

.article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-article:hover .article-image img {
    transform: scale(1.05);
}

.category-label {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--primary-color);
    color: #fff;
    padding: 3px 8px;
    font-size: 12px;
    border-radius: var(--radius-sm);
}

.article-content {
    padding: 15px;
}

.article-content h3 {
    font-size: 16px;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 列表页样式 */
.list-title {
    font-size: 26px;
    margin-bottom: 25px;
    color: var(--dark-color);
    position: relative;
    padding-left: 15px;
}

.list-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 22px;
    background-color: var(--primary-color);
    border-radius: var(--radius-sm);
}

.list-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.list-article {
    background-color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.list-article:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.list-article a {
    display: flex;
    gap: 20px;
}

.list-image {
    flex: 0 0 300px;
    height: 180px;
    overflow: hidden;
}

.list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.list-article:hover .list-image img {
    transform: scale(1.05);
}

.list-content {
    padding: 20px 20px 20px 0;
    flex: 1;
}

.list-content h2 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.page-btn {
    padding: 8px 20px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    color: var(--gray-color);
    font-size: 14px;
    transition: var(--transition);
}

.page-btn:hover {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

/* 文章详情页样式 */
.article-detail {
    background-color: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: 30px;
    margin-bottom: 40px;
}

.article-header {
    margin-bottom: 25px;
    text-align: center;
}

.article-title {
    font-size: 28px;
    margin-bottom: 15px;
    line-height: 1.4;
    color: var(--dark-color);
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 10px;
}

.article-image {
    margin-bottom: 25px;
    border-radius: var(--radius-md);
    overflow: hidden;
}

.article-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

.article-body {
    line-height: 1.8;
    font-size: 16px;
    color: #444;
}

.article-body p {
    margin-bottom: 20px;
}

.article-body img {
    max-width: 100%;
    height: auto;
    margin: 20px auto;
    display: block;
    border-radius: var(--radius-md);
}

.article-tags {
    margin: 30px 0;
    padding: 15px 0;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: var(--gray-color);
}

.article-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.prev-article,
.next-article {
    width: 48%;
}

.prev-article span,
.next-article span {
    display: block;
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 5px;
}

.prev-article a,
.next-article a {
    font-size: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.next-article {
    text-align: right;
}

/* 相关文章 */
.related-section {
    margin-bottom: 40px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.related-article {
    background-color: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.related-article:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.related-image {
    height: 150px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-article:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 15px;
}

.related-content h3 {
    font-size: 16px;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 页脚 */
.main-footer {
    background-color: var(--dark-color);
    color: #fff;
    padding: 50px 0 20px;
}

.footer-links {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.links-section {
    flex: 1;
}

.links-section h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.links-section h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.links-section ul {
    list-style: none;
}

.links-section li {
    margin-bottom: 10px;
}

.links-section a {
    color: #ddd;
    font-size: 14px;
}

.links-section a:hover {
    color: var(--primary-color);
}

.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.friend-links a {
    color: #bbb;
    font-size: 14px;
}

.friend-links a:hover {
    color: var(--primary-color);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 14px;
    color: #999;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .featured-section .container {
        flex-direction: column;
    }
    
    .featured-left,
    .featured-right {
        flex: 0 0 100%;
    }
    
    .featured-right {
        margin-top: 20px;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 30px;
    }
}

@media (max-width: 768px) {
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: #fff;
        box-shadow: var(--shadow-md);
        padding: 20px;
        transform: translateY(-150%);
        transition: var(--transition);
        z-index: 999;
    }
    
    .main-nav.active {
        transform: translateY(0);
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav li {
        margin: 0 0 15px 0;
    }
    
    .mobile-menu-btn {
        display: flex;
    }
    
    .list-article a {
        flex-direction: column;
    }
    
    .list-image {
        flex: 0 0 100%;
        height: 200px;
    }
    
    .list-content {
        padding: 20px;
    }
    
    .article-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .prev-article,
    .next-article {
        width: 100%;
    }
    
    .next-article {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .featured-image {
        height: 250px;
    }
    
    .featured-content h2 {
        font-size: 20px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
    }
}