
/* 全局变量定义 */
:root {
    --primary-color: #c0392b; /* 新闻红 */
    --secondary-color: #2c3e50; /* 深蓝灰 */
    --accent-color: #e74c3c;
    --bg-color: #f4f6f7;
    --text-main: #2c3e50;
    --text-light: #7f8c8d;
    --white: #ffffff;
    --border-color: #ecf0f1;
    --shadow: 0 2px 8px rgba(0,0,0,0.05);
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif; /* 衬线体增强新闻感 */
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s;
}

a:hover {
    color: var(--primary-color);
}

ul {
    list-style: none;
}

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

/* 顶部工具栏 */
.top-bar {
    background-color: var(--secondary-color);
    color: #bdc3c7;
    font-size: 0.85rem;
    padding: 8px 0;
    font-family: sans-serif;
}

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

.top-links a {
    margin-left: 20px;
    color: #bdc3c7;
}

.top-links a:hover {
    color: var(--white);
}

/* 主导航 */
.main-header {
    background-color: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 15px 0;
}

.header-grid {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 30px;
}

.site-logo {
    font-size: 2rem;
    font-weight: 900;
    color: var(--secondary-color);
    letter-spacing: -1px;
}

.site-logo span {
    color: var(--primary-color);
}

.primary-nav {
    display: flex;
    justify-content: center;
    gap: 25px;
    font-family: sans-serif;
    font-weight: 600;
}

.nav-link.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.search-area {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.search-area input {
    border: none;
    padding: 8px 12px;
    outline: none;
    width: 150px;
}

.search-btn {
    background: var(--bg-color);
    border: none;
    padding: 0 12px;
    cursor: pointer;
}

/* 主要布局 */
.news-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-top: 30px;
    margin-bottom: 50px;
}

/* 焦点新闻 */
.hero-news {
    margin-bottom: 30px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
}

.hero-img-wrapper {
    position: relative;
    height: 400px;
}

.hero-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 40px 30px 30px;
    color: var(--white);
}

.category-tag {
    display: inline-block;
    padding: 4px 10px;
    background-color: var(--primary-color);
    color: var(--white);
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 10px;
    font-family: sans-serif;
    text-transform: uppercase;
}

.hero-title {
    font-size: 2rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.hero-summary {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 80%;
}

/* 新闻网格 */
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.news-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

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

.card-thumb {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

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

.tag {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    color: var(--white);
    font-family: sans-serif;
}

.tag.tech { background-color: #3498db; }
.tag.finance { background-color: #27ae60; }
.tag.sport { background-color: #e67e22; }
.tag.culture { background-color: #9b59b6; }

.card-content {
    padding: 15px;
}

.card-content h3 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    line-height: 1.4;
}

.meta {
    font-size: 0.8rem;
    color: var(--text-light);
    font-family: sans-serif;
}

/* 侧边栏 */
.widget {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
}

.widget-title {
    font-size: 1.2rem;
    border-left: 4px solid var(--primary-color);
    padding-left: 10px;
    margin-bottom: 20px;
    font-family: sans-serif;
}

.rank-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.rank-list li:last-child {
    border-bottom: none;
}

.rank-num {
    width: 24px;
    height: 24px;
    background-color: #bdc3c7;
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    border-radius: 4px;
    font-family: sans-serif;
}

.top-1 .rank-num { background-color: #e74c3c; }
.top-2 .rank-num { background-color: #e67e22; }
.top-3 .rank-num { background-color: #f1c40f; }

.rank-item a {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}

.heat {
    font-size: 0.8rem;
    color: #e74c3c;
    font-family: sans-serif;
}

.subscribe-box p {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 15px;
}

.sub-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sub-form input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.sub-form button {
    padding: 10px;
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.3s;
}

.sub-form button:hover {
    background-color: var(--primary-color);
}

/* 页脚 */
.site-footer {
    background-color: var(--secondary-color);
    color: #bdc3c7;
    padding: 50px 0 20px;
    font-family: sans-serif;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 20px;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 10px;
}

.footer-col ul li a:hover {
    color: var(--white);
}

.copyright-line {
    text-align: center;
    border-top: 1px solid #34495e;
    padding-top: 20px;
    font-size: 0.85rem;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .header-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        text-align: center;
    }
    
    .primary-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .news-layout {
        grid-template-columns: 1fr;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .hero-img-wrapper {
        height: 250px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
