/* Site Styles - V5.14 News Portal Dark Theme */
:root {
    --bg-primary: #0d1117;
    --bg-secondary: #161b22;
    --bg-tertiary: #21262d;
    --accent: #58a6ff;
    --accent-hover: #79b8ff;
    --text-primary: #c9d1d9;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
    --border: #30363d;
    --success: #3fb950;
    --warning: #d29922;
    --radius: 8px;
    --shadow: 0 8px 24px rgba(0,0,0,0.4);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

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

/* Topbar */
.topbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
}

.topbar-nav {
    display: flex;
    gap: 20px;
}

.topbar-nav a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

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

/* Two Column Layout */
.main-content {
    padding: 24px 0;
}

.two-column {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
}

@media (max-width: 900px) {
    .two-column {
        grid-template-columns: 1fr;
    }
    .sidebar {
        order: -1;
    }
}

/* Content Main */
.content-main {
    min-width: 0;
}

.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.list-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.article-count {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* News List */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-secondary);
    border-radius: var(--radius);
    transition: background 0.2s;
}

.news-item:hover {
    background: var(--bg-tertiary);
}

.news-rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 6px;
}

.news-content {
    flex: 1;
    min-width: 0;
}

.news-title {
    display: block;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 6px;
}

.news-title:hover {
    color: var(--accent);
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.news-cat {
    font-size: 0.9rem;
}

.news-date {
    color: var(--text-muted);
}

/* Load More */
.load-more {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.more-link {
    padding: 10px 24px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: all 0.2s;
}

.more-link:hover {
    background: var(--accent);
    color: #fff;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-box {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
}

.sidebar-box h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

/* Trending List */
.trending-list {
    list-style: none;
    counter-reset: trending;
}

.trending-list li {
    counter-increment: trending;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}

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

.trending-list li::before {
    content: counter(trending) ".";
    color: var(--accent);
    font-weight: 600;
    margin-right: 8px;
}

.trending-list a {
    color: var(--text-primary);
}

.trending-list a:hover {
    color: var(--accent);
}

/* Category List */
.cat-list {
    list-style: none;
}

.cat-list li {
    padding: 6px 0;
}

.cat-list a {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.cat-list a:hover {
    color: var(--accent);
}

.cat-list .count {
    background: var(--bg-tertiary);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.75rem;
}

/* Language Buttons */
.lang-buttons {
    display: flex;
    gap: 8px;
}

.lang-btn {
    flex: 1;
    text-align: center;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.9rem;
}

.lang-btn:hover,
.lang-btn.active {
    background: var(--accent);
    color: #fff;
}

/* Footer */
.footer-compact {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 16px 0;
    margin-top: 40px;
}

.footer-compact .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-compact nav {
    display: flex;
    gap: 20px;
}

.footer-compact nav a {
    color: var(--text-muted);
}

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

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.section-more {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Article Cards (for language pages) */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.article-card {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    padding: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.4;
}

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

.card-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Responsive */
@media (max-width: 600px) {
    .topbar-inner {
        flex-direction: column;
        gap: 10px;
    }

    .topbar-nav {
        gap: 12px;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .news-item {
        padding: 12px;
    }

    .load-more {
        flex-direction: column;
    }

    .footer-compact .container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
}
