/* 基础变量定义 */
:root {
    --primary-color: #3498db;
    --dark-color: #2c3e50;
    --light-color: #f8f9fa;
    --gray-color: #95a5a6;
    --white-color: #ffffff;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "微软雅黑", "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #f5f5f5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

img {
    max-width: 100%; /* 响应式图片核心 */
    height: auto;
    display: block;
}

/* 容器 - 流式宽度 */
.container {
    width: 90%;
    max-width: 1200px; /* 最大宽度限制 */
    margin: 0 auto;
    padding: 0 15px;
}

/* 头部样式 */
.site-header {
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo h1 {
    font-size: clamp(1.2rem, 3vw, 1.8rem); /* 响应式字体 */
    color: var(--primary-color);
    font-weight: 700;
}

/* 移动端菜单按钮 */
.menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark-color);
    cursor: pointer;
    display: block; /* 移动端默认显示 */
}

/* 导航菜单 */
.main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--white-color);
    box-shadow: var(--shadow);
    padding: 20px;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.main-nav.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.main-nav ul {
    display: flex;
    flex-direction: column; /* 移动端竖向排列 */
    gap: 15px;
}

.main-nav a {
    font-size: 1rem;
    color: var(--dark-color);
    padding: 8px 0;
    display: block;
    border-bottom: 1px solid #eee;
}

.main-nav a.active,
.main-nav a:hover {
    color: var(--primary-color);
}

/* 主要内容 */
.site-content {
    padding: 30px 0;
}

/* 头条新闻 */
.featured-news {
    margin-bottom: 40px;
    background-color: var(--white-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.featured-image img {
    width: 100%;
    height: auto;
}

.featured-content {
    padding: 20px;
}

.featured-content h2 {
    font-size: clamp(1.2rem, 4vw, 1.8rem);
    margin-bottom: 15px;
    line-height: 1.4;
}

.featured-content p {
    color: #666;
    margin-bottom: 20px;
    line-height: 1.8;
}

.read-more {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: var(--white-color);
    border-radius: 4px;
    font-weight: 500;
}

.read-more:hover {
    background-color: #2980b9;
}

/* 新闻网格 */
.news-grid {
    display: grid;
    grid-template-columns: 1fr; /* 移动端单列 */
    gap: 20px;
}

.news-item {
    background-color: var(--white-color);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.news-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.news-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.news-item h3 {
    font-size: 1.2rem;
    padding: 15px 15px 10px;
    line-height: 1.4;
}

.news-item p {
    padding: 0 15px 15px;
    color: #666;
    font-size: 0.9rem;
}

.news-meta {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px 15px;
    border-top: 1px solid #eee;
    font-size: 0.8rem;
    color: var(--gray-color);
}

/* 页脚 */
.site-footer {
    background-color: var(--dark-color);
    color: var(--white-color);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-columns {
    display: flex;
    flex-direction: column; /* 移动端竖向排列 */
    gap: 30px;
    margin-bottom: 30px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(255,255,255,0.1);
}

.footer-column p {
    color: #bbb;
    font-size: 0.9rem;
    line-height: 1.8;
}

.footer-column ul {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-column li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #bbb;
    font-size: 0.9rem;
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

.social-links a {
    display: inline-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-color);
    font-size: 1.2rem;
}

.social-links a:hover {
    background-color: var(--primary-color);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    color: #999;
    font-size: 0.8rem;
}

/* 媒体查询 - 平板 (768px以上) */
@media (min-width: 768px) {
    /* 菜单按钮隐藏 */
    .menu-toggle {
        display: none;
    }
    
    /* 导航菜单横向排列 */
    .main-nav {
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
        width: auto;
    }
    
    .main-nav ul {
        flex-direction: row;
        gap: 25px;
    }
    
    .main-nav a {
        border-bottom: none;
        padding: 5px 0;
        position: relative;
    }
    
    .main-nav a::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        width: 0;
        height: 2px;
        background-color: var(--primary-color);
        transition: width 0.3s ease;
    }
    
    .main-nav a:hover::after,
    .main-nav a.active::after {
        width: 100%;
    }

    /* 头条新闻 - 左右布局 */
    .featured-news {
        display: grid;
        grid-template-columns: 2fr 1fr;
    }
    
    .featured-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        padding: 30px;
    }

    /* 新闻网格 - 2列 */
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* 页脚 - 多列布局 */
    .footer-columns {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .footer-column {
        flex: 1;
        padding: 0 15px;
    }
}

/* 媒体查询 - 桌面 (992px以上) */
@media (min-width: 992px) {
    /* 新闻网格 - 3列 */
    .news-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    /* 头条新闻文字更大 */
    .featured-content h2 {
        font-size: 2rem;
    }
}

/* 媒体查询 - 大屏桌面 (1200px以上) */
@media (min-width: 1200px) {
    .container {
        width: 85%;
    }
}