/* 全局样式 */
:root {
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --secondary-color: #764ba2;
    --text-color: #2d3748;
    --text-light: #718096;
    --bg-color: #f7fafc;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 
                 'Microsoft YaHei', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
}

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

/* 头部样式 */
.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 3rem 0 2rem;
    text-align: center;
    box-shadow: var(--shadow);
}

.header-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.header-subtitle {
    font-size: 1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
}

.update-time {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.stat-item {
    font-size: 0.95rem;
    font-weight: 500;
    background: rgba(255,255,255,0.15);
    padding: 0.5rem 1rem;
    border-radius: 20px;
}

/* 导航样式 */
.nav {
    background: white;
    border-bottom: 2px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.nav .container {
    display: flex;
    gap: 0;
    padding: 0;
}

.nav-btn {
    flex: 1;
    padding: 1rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.nav-btn:hover {
    background: var(--bg-color);
    color: var(--primary-color);
}

.nav-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--bg-color);
}

/* 内容区域 */
main {
    padding: 2rem 0;
    min-height: 60vh;
}

.content-section {
    display: none;
}

.content-section.active {
    display: block;
    animation: fadeIn 0.4s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.section-header h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

/* 标签按钮 */
.language-tabs, .rss-sources {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.tab-btn, .source-btn {
    padding: 0.5rem 1.2rem;
    border: 2px solid var(--primary-color);
    background: white;
    color: var(--primary-color);
    cursor: pointer;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s;
}

.tab-btn:hover, .source-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.tab-btn.active, .source-btn.active {
    background: var(--primary-color);
    color: white;
}

/* 卡片网格 */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

/* 卡片样式 */
.card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

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

.card-title {
    margin-bottom: 0.8rem;
}

.card-title a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    display: inline-block;
}

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

.card-description {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

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

.card-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.card-source {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.card-time {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-top: 0.5rem;
}

/* 页脚 */
.footer {
    background: var(--text-color);
    color: white;
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.footer a {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: opacity 0.3s;
}

.footer a:hover {
    opacity: 0.8;
}

.footer-note {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 1rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .header-title {
        font-size: 2rem;
    }
    
    .header-stats {
        gap: 1rem;
    }
    
    .nav .container {
        flex-direction: column;
    }
    
    .nav-btn {
        border-bottom: none;
        border-left: 3px solid transparent;
    }
    
    .nav-btn.active {
        border-left-color: var(--primary-color);
        border-bottom: none;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .container {
        padding: 0 1rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 2rem 0 1.5rem;
    }
    
    .header-title {
        font-size: 1.5rem;
    }
    
    .language-tabs, .rss-sources {
        gap: 0.3rem;
    }
    
    .tab-btn, .source-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 3rem;
    color: var(--text-light);
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}
