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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航栏样式 */
header {
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    text-decoration: none;
}

.logo span {
    color: #3498db;
}

.nav-links {
    display: flex;
    list-style: none;
}

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover, .nav-links a.active {
    color: #3498db;
}

/* 主要内容样式 */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 180px);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: #3498db;
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #2980b9;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.card-img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

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

.card-title a:hover {
    color: #3498db;
}

.card-excerpt {
    color: #666;
    margin-bottom: 1rem;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    color: #999;
    font-size: 0.9rem;
}

/* 页脚样式 */
footer {
    background-color: #2c3e50;
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
}

.footer-section {
    flex: 1;
    min-width: 250px;
    margin-bottom: 1.5rem;
}

.footer-section h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.footer-section p {
    margin-bottom: 0.5rem;
    color: #ddd;
}

.footer-section a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #3498db;
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #444;
    color: #aaa;
}

/* 首页样式 */
.hero {
    background-color: #2c3e50;
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 1.5rem;
    color: #ddd;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.featured-news {
    margin-bottom: 3rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.category-nav {
    display: flex;
    overflow-x: auto;
    padding: 1rem 0;
    margin-bottom: 2rem;
    gap: 1rem;
}

.category-btn {
    background-color: white;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover, .category-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 列表页样式 */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.search-box {
    display: flex;
    flex: 1;
    max-width: 400px;
}

.search-box input {
    flex: 1;
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px 0 0 4px;
}

.search-box button {
    background-color: #3498db;
    color: white;
    border: none;
    padding: 0 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

.sort-options select {
    padding: 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.news-item {
    display: flex;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.news-item:hover {
    transform: translateY(-3px);
}

.news-item-img {
    flex: 0 0 200px;
    height: 150px;
}

.news-item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-item-content {
    flex: 1;
    padding: 1.2rem;
}

.news-item-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

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

.news-item-title a:hover {
    color: #3498db;
}

.news-item-excerpt {
    color: #666;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
    gap: 0.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover, .pagination-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 详情页样式 */
.news-detail {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.news-header {
    margin-bottom: 2rem;
}

.news-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.news-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    color: #777;
    margin-bottom: 1.5rem;
}

.news-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.news-featured-img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.news-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #444;
}

.news-content p {
    margin-bottom: 1.5rem;
}

.news-content h2, .news-content h3 {
    margin: 1.8rem 0 1rem;
    color: #2c3e50;
}

.news-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.tag {
    background-color: #f1f5f9;
    color: #3498db;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
}

.share-btn:hover {
    opacity: 0.9;
}

.share-facebook {
    background-color: #3b5998;
    color: white;
}

.share-twitter {
    background-color: #1da1f2;
    color: white;
}

.share-linkedin {
    background-color: #0077b5;
    color: white;
}

.related-news {
    margin-top: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .news-item {
        flex-direction: column;
    }
    
    .news-item-img {
        flex: 0 0 180px;
    }
    
    .news-title {
        font-size: 1.6rem;
    }
    
    .footer-content {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    nav {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 0.5rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .news-detail {
        padding: 1.5rem;
    }
}