/* 基础变量 */
:root {
    --primary-color: #4a6bdf;
    --primary-light: #6d8aff;
    --primary-dark: #2a4ecb;
    --secondary-color: #ff7043;
    --dark-color: #2d3748;
    --gray-color: #718096;
    --light-gray: #e2e8f0;
    --lighter-gray: #f7fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --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: 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: var(--lighter-gray);
}

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 20px;
}

/* 顶部应用栏 */
.app-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--white);
    box-shadow: var(--shadow-sm);
    padding: 15px 0;
}

.app-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    width: 30px;
    height: 24px;
    flex-direction: column;
    justify-content: space-between;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--dark-color);
    transition: var(--transition);
}

.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);
}

/* 主内容区 */
.main-content {
    padding: 30px 0;
}

/* 英雄区域 */
.hero-section {
    margin-bottom: 40px;
}

.hero-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.hero-card a {
    display: flex;
}

.hero-image {
    flex: 0 0 60%;
    height: 400px;
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-card:hover .hero-image img {
    transform: scale(1.03);
}

.hero-content {
    flex: 0 0 40%;
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.hero-content h1 {
    font-size: 28px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.excerpt {
    color: var(--gray-color);
    margin-bottom: 20px;
    font-size: 16px;
}

.meta {
    display: flex;
    gap: 15px;
    font-size: 14px;
    color: var(--gray-color);
}

/* 卡片区域 */
.card-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 24px;
    margin-bottom: 25px;
    position: relative;
    padding-left: 15px;
}

.section-title:before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 20px;
    background-color: var(--primary-color);
    border-radius: var(--radius-sm);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.view-all {
    font-size: 14px;
    color: var(--gray-color);
}

.view-all:hover {
    color: var(--primary-color);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.content-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.content-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.card-image {
    height: 180px;
    overflow: hidden;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.content-card:hover .card-image img {
    transform: scale(1.05);
}

.card-content {
    padding: 20px;
}

.card-content h3 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 列表页样式 */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--gray-color);
}

.breadcrumb a {
    color: var(--gray-color);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.breadcrumb span {
    margin: 0 8px;
}

.list-title {
    font-size: 28px;
    margin-bottom: 25px;
}

.list-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.list-card {
    background-color: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.list-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.list-card a {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.list-card .card-image {
    height: 160px;
}

.list-card .card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.list-card h2 {
    font-size: 18px;
    margin-bottom: 10px;
    line-height: 1.4;
}

.list-card .excerpt {
    font-size: 14px;
    margin-bottom: 15px;
    -webkit-line-clamp: 3;
}

/* 分页导航 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 40px;
}

.page-button {
    padding: 10px 20px;
    background-color: var(--white);
    border: 1px solid var(--light-gray);
    border-radius: var(--radius-sm);
    color: var(--dark-color);
    font-size: 14px;
    transition: var(--transition);
}

.page-button:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* 文章详情页 */
.article-detail {
    background-color: var(--white);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 40px;
}

.article-header {
    margin-bottom: 25px;
    text-align: center;
}

.article-title {
    font-size: 28px;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 15px;
}

.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-footer {
    margin-top: 40px;
}

.article-tags {
    padding: 15px 0;
    border-top: 1px solid var(--light-gray);
    border-bottom: 1px solid var(--light-gray);
    font-size: 14px;
    color: var(--gray-color);
    margin-bottom: 30px;
}

.article-navigation {
    display: flex;
    justify-content: space-between;
}

.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;
}

/* 页脚 */
.main-footer {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 50px 0 20px;
}

.footer-content {
    display: flex;
    gap: 40px;
    margin-bottom: 30px;
}

.footer-logo {
    font-size: 24px;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
}

.footer-links {
    display: flex;
    gap: 40px;
    flex: 1;
}

.links-group h3 {
    font-size: 18px;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.links-group h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--primary-color);
}

.links-group ul {
    list-style: none;
}

.links-group li {
    margin-bottom: 10px;
}

.links-group a {
    color: #ddd;
    font-size: 14px;
}

.links-group a:hover {
    color: var(--primary-light);
}

.friend-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.friend-links a {
    color: #bbb;
    font-size: 14px;
}

.friend-links a:hover {
    color: var(--primary-light);
}

.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) {
    .hero-card a {
        flex-direction: column;
    }
    
    .hero-image,
    .hero-content {
        flex: 0 0 100%;
    }
    
    .hero-image {
        height: 300px;
    }
    
    .hero-content {
        padding: 20px;
    }
    
    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }
    
    .main-nav {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background-color: var(--white);
        box-shadow: var(--shadow-md);
        padding: 20px;
        transform: translateY(-150%);
        transition: var(--transition);
    }
    
    .main-nav.active {
        transform: translateY(0);
    }
    
    .main-nav ul {
        flex-direction: column;
    }
    
    .main-nav li {
        margin: 0 0 15px 0;
    }
    
    .hero-image {
        height: 250px;
    }
    
    .article-navigation {
        flex-direction: column;
        gap: 15px;
    }
    
    .prev-article,
    .next-article {
        width: 100%;
    }
    
    .next-article {
        text-align: left;
    }
}

@media (max-width: 576px) {
    .hero-content h1 {
        font-size: 24px;
    }
    
    .section-title {
        font-size: 22px;
    }
    
    .list-title {
        font-size: 24px;
    }
    
    .article-title {
        font-size: 24px;
    }
    
    .card-grid,
    .list-grid {
        grid-template-columns: 1fr;
    }
}