/**
 * 生物竞赛资讯站 - 样式表
 * 配色：青绿色系，清新学术风
 */

:root {
    --primary: #0D9488;
    --primary-light: #14B8A6;
    --primary-dark: #0F766E;
    --accent: #0891B2;
    --mint: #99F6E4;
    --bg: #FAFAF9;
    --bg-alt: #F5F5F4;
    --text: #1F2937;
    --text-light: #6B7280;
    --border: #E5E7EB;
    --white: #FFFFFF;
    
    /* 分类颜色 */
    --cat-competition: #EF4444;
    --cat-international: #3B82F6;
    --cat-knowledge: #10B981;
    --cat-skill: #F59E0B;
    --cat-exam: #8B5CF6;
}

* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    margin: 0;
}

/* Hero Header */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(13, 148, 136, 0.2);
}

.hero nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hero .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

.hero ul {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.hero a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: color 0.2s;
}

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Main */
main {
    padding: 2rem 0;
    min-height: calc(100vh - 200px);
}

/* Search */
.search-section {
    margin-bottom: 2rem;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 0 auto;
}

.search-form input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: var(--primary);
}

.search-form button {
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.search-form button:hover {
    background: var(--primary-dark);
}

/* Featured Section */
.featured {
    margin-bottom: 3rem;
}

.featured h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 4px solid var(--primary);
}

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

.featured-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.featured-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

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

.featured-card h3 {
    margin: 1rem;
    font-size: 1.1rem;
}

.featured-card h3 a {
    color: var(--text);
    text-decoration: none;
}

.featured-card h3 a:hover {
    color: var(--primary);
}

.featured-card p {
    margin: 0 1rem 1rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.news-image {
    height: 180px;
    overflow: hidden;
}

.news-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

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

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

.category-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    color: white;
    width: fit-content;
    margin-bottom: 0.75rem;
}

.category-competition { background: var(--cat-competition); }
.category-international { background: var(--cat-international); }
.category-knowledge { background: var(--cat-knowledge); }
.category-skill { background: var(--cat-skill); }
.category-exam { background: var(--cat-exam); }

.news-content h3 {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    line-height: 1.4;
}

.news-content h3 a {
    color: var(--text);
    text-decoration: none;
}

.news-content h3 a:hover {
    color: var(--primary);
}

.news-content p {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0 0 1rem;
    flex: 1;
}

.news-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-light);
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
    margin-top: auto;
}

/* Article Page */
.article-container {
    max-width: 800px;
}

.article {
    background: var(--white);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.article-header h1 {
    font-size: 1.75rem;
    margin: 0.75rem 0;
    line-height: 1.3;
}

.article-meta {
    display: flex;
    gap: 1.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.tag {
    background: var(--bg-alt);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    color: var(--text-light);
}

.article-image {
    margin: 0 0 2rem;
}

.article-image img {
    width: 100%;
    border-radius: 8px;
}

.article-content {
    font-size: 1.05rem;
    line-height: 1.8;
}

.article-content p {
    margin: 1rem 0;
}

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

.article-content a {
    color: var(--primary);
}

.article-source {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
    color: var(--text-light);
    font-size: 0.9rem;
}

.article-nav {
    margin-top: 2rem;
}

.back-link {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.2s;
}

.back-link:hover {
    background: var(--primary-dark);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination a {
    padding: 0.5rem 1rem;
    background: var(--white);
    color: var(--text);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: all 0.2s;
}

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

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

/* Footer */
footer {
    background: var(--text);
    color: var(--text-light);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

footer p {
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .hero ul {
        display: none;
    }
    
    .news-grid {
        grid-template-columns: 1fr;
    }
    
    .article {
        padding: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.4rem;
    }
    
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}
