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

:root {
    --primary-color: #1a365d;
    --secondary-color: #2c5282;
    --accent-color: #ed8936;
    --text-dark: #2d3748;
    --text-light: #718096;
    --white: #ffffff;
    --gray-light: #f7fafc;
    --gray-medium: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--gray-light);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* 导航栏样式 */
header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo i {
    margin-right: 0.5rem;
    color: var(--accent-color);
}

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

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

.nav-links a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--accent-color);
}

.search-bar {
    display: flex;
}

.search-bar input {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px 0 0 4px;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent-color);
}

.search-bar button {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    background-color: #dd6b20;
}

/* 主要内容区域样式 */
main {
    padding: 2rem 0;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent-color);
}

/* 首页头条新闻样式 */
.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.hero-main {
    position: relative;
    height: 500px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.hero-main img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.hero-main:hover img {
    transform: scale(1.05);
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    color: var(--white);
    padding: 1.5rem;
}

.hero-category {
    display: inline-block;
    background-color: var(--accent-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.hero-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.hero-meta {
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    opacity: 0.9;
}

.hero-meta span {
    margin-right: 1rem;
    display: flex;
    align-items: center;
}

.hero-meta i {
    margin-right: 0.25rem;
}

.hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-sidebar-item {
    display: flex;
    gap: 1rem;
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.hero-sidebar-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.hero-sidebar-item img {
    width: 120px;
    height: 100%;
    object-fit: cover;
}

.hero-sidebar-content {
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.hero-sidebar-title {
    font-size: 1rem;
    margin-bottom: 0.5rem;
    flex-grow: 1;
}

/* 新闻卡片样式 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.news-card {
    background-color: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.news-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: var(--transition);
}

.news-card:hover .news-image {
    transform: scale(1.05);
}

.news-image-container {
    overflow: hidden;
}

.news-content {
    padding: 1.25rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    align-self: flex-start;
}

.news-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--primary-color);
}

.news-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 列表页样式 */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.category-filter button {
    background-color: var(--gray-light);
    border: 1px solid var(--gray-medium);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.category-filter button:hover,
.category-filter button.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

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

.pagination button {
    background-color: var(--white);
    border: 1px solid var(--gray-medium);
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.pagination button:hover,
.pagination button.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

/* 详情页样式 */
.news-detail {
    display: grid;
    grid-template-columns: 3fr 1fr;
    gap: 2rem;
}

.detail-content {
    background-color: var(--white);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.detail-header {
    margin-bottom: 1.5rem;
}

.detail-title {
    font-size: 2.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-light);
}

.detail-meta span {
    display: flex;
    align-items: center;
}

.detail-meta i {
    margin-right: 0.5rem;
}

.detail-image {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.detail-body p {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.detail-body h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
    color: var(--primary-color);
}

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

.detail-tags span {
    background-color: var(--gray-light);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
}

/* 侧边栏样式 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background-color: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.popular-news {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-item {
    display: flex;
    gap: 1rem;
}

.popular-item img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.popular-content {
    font-size: 0.9rem;
}

.subscribe-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.subscribe-form input {
    padding: 0.75rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    outline: none;
}

.subscribe-form button {
    background-color: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: var(--transition);
}

.subscribe-form button:hover {
    background-color: #dd6b20;
}

/* 评论区样式 */
.comments {
    margin-top: 2rem;
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    padding: 1rem;
    border: 1px solid var(--gray-medium);
    border-radius: 4px;
    resize: vertical;
    min-height: 120px;
    margin-bottom: 1rem;
}

.comment-form button {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.comment-form button:hover {
    background-color: var(--secondary-color);
}

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

.comment-item {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-medium);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.comment-author {
    font-weight: 500;
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 按钮样式 */
.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

.btn-accent {
    background-color: var(--accent-color);
}

.btn-accent:hover {
    background-color: #dd6b20;
}

/* 页脚样式 */
footer {
    background-color: var(--primary-color);
    color: var(--white);
    padding: 3rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: var(--accent-color);
}

.footer-column p {
    margin-bottom: 1rem;
    color: rgba(255, 255, 255, 0.8);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--accent-color);
    padding-left: 5px;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--accent-color);
    transform: translateY(-3px);
}

.footer-bottom {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .hero {
        grid-template-columns: 1fr;
    }
    
    .hero-main {
        height: 400px;
    }
    
    .news-detail {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-links li {
        margin: 0 0.5rem;
    }
    
    .hero-main {
        height: 300px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .detail-title {
        font-size: 1.75rem;
    }
    
    .detail-image {
        height: 300px;
    }
}

@media (max-width: 576px) {
    .hero-sidebar-item {
        flex-direction: column;
    }
    
    .hero-sidebar-item img {
        width: 100%;
        height: 150px;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .category-filter {
        justify-content: center;
    }
}
