:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --surface-hover: #fafafa;
    --text: #000000;
    --text-secondary: #666666;
    --text-tertiary: #999999;
    --border: #e5e5e5;
    --border-light: #f0f0f0;
    --accent: #000000;
    --accent-hover: #333333;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.04), 0 2px 4px -1px rgba(0,0,0,0.02);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.05), 0 4px 6px -2px rgba(0,0,0,0.025);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

[data-theme="dark"] {
    --bg: #0a0a0a;
    --surface: #141414;
    --surface-hover: #1a1a1a;
    --text: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #555555;
    --border: #2a2a2a;
    --border-light: #1f1f1f;
    --accent: #ffffff;
    --accent-hover: #e0e0e0;
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -1px rgba(0,0,0,0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -2px rgba(0,0,0,0.3);
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ===== Header ===== */
.site-header {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(20px);
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.brand-icon {
    width: 36px;
    height: 36px;
    background: var(--accent);
    color: var(--bg);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

.brand-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text);
}

/* Nav */
.main-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.nav-link {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover {
    color: var(--text);
    background: var(--surface-hover);
}

.nav-link.active {
    color: var(--text);
    font-weight: 600;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 16px;
    right: 16px;
    height: 2px;
    background: var(--accent);
    border-radius: 2px;
}

/* Header Tools */
.header-tools {
    display: flex;
    align-items: center;
    gap: 8px;
}

.tool-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.tool-btn:hover {
    background: var(--surface-hover);
    color: var(--text);
}

.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

/* Mobile Menu */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
}

.mobile-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* Search Bar */
.search-bar {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    border-bottom: 1px solid transparent;
}

.search-bar.open {
    max-height: 80px;
    padding: 12px 24px;
    border-bottom-color: var(--border);
}

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

.search-bar input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent);
}

.search-bar button {
    padding: 10px 20px;
    background: var(--accent);
    color: var(--bg);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.search-bar button:hover {
    opacity: 0.85;
}

/* ===== Hero ===== */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.hero-inner {
    max-width: 600px;
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 16px;
    opacity: 0.6;
    margin-bottom: 32px;
    font-weight: 400;
}

.hero-stats {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.stat-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 24px;
    background: rgba(0,0,0,0.04);
    border-radius: var(--radius);
    min-width: 80px;
}

[data-theme="dark"] .stat-pill {
    background: rgba(255,255,255,0.06);
}

.stat-pill .stat-num {
    font-size: 24px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.stat-pill .stat-label {
    font-size: 12px;
    opacity: 0.6;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Filter Bar ===== */
.filter-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    position: sticky;
    top: 64px;
    z-index: 90;
}

.filter-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
}

.filter-link {
    padding: 6px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: var(--transition);
    border: 1px solid transparent;
}

.filter-link:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border);
}

.filter-link.active {
    color: var(--bg);
    background: var(--text);
    border-color: var(--text);
    font-weight: 600;
}

.filter-meta {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===== Main Layout ===== */
.main-layout {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    align-items: start;
}

.content-area { min-width: 0; }

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

.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    border-color: var(--text-tertiary);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.lang-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lang-badge.zh {
    background: #000;
    color: #fff;
}

.lang-badge.en {
    background: var(--border-light);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

[data-theme="dark"] .lang-badge.zh {
    background: #fff;
    color: #000;
}

[data-theme="dark"] .lang-badge.en {
    background: var(--surface-hover);
    color: var(--text-secondary);
    border-color: var(--border);
}

.source-tag {
    font-size: 13px;
    color: var(--text-tertiary);
    font-weight: 500;
}

.time-ago {
    margin-left: auto;
    font-size: 12px;
    color: var(--text-tertiary);
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 10px;
    letter-spacing: -0.2px;
}

.card-title a {
    color: var(--text);
    text-decoration: none;
    transition: opacity 0.2s;
}

.card-title a:hover {
    opacity: 0.7;
}

.card-summary {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 16px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 14px;
    border-top: 1px solid var(--border-light);
    font-size: 12px;
}

.fetch-time {
    color: var(--text-tertiary);
}

.read-more {
    color: var(--text);
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.read-more:hover {
    opacity: 0.7;
}

/* ===== Sidebar ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 130px;
}

.widget {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: var(--transition);
}

.widget:hover {
    box-shadow: var(--shadow-md);
}

.widget-title {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-light);
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Author Widget */
.author-header {
    text-align: center;
    margin-bottom: 20px;
}

.author-avatar-large {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 700;
    margin: 0 auto 14px;
    overflow: hidden;
}

.author-avatar-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.author-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.author-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.author-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 13px;
    transition: var(--transition);
    border: 1px solid var(--border-light);
}

.author-link:hover {
    background: var(--surface-hover);
    color: var(--text);
    border-color: var(--border);
}

.author-link svg {
    flex-shrink: 0;
    color: var(--text-tertiary);
}

/* Stats Widget */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.stat-box {
    text-align: center;
    padding: 14px 6px;
    background: var(--surface-hover);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-light);
}

.stat-box .stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}

.stat-box .stat-label {
    font-size: 10px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ===== Empty State ===== */
.empty-state {
    text-align: center;
    padding: 100px 24px;
    color: var(--text-tertiary);
    grid-column: 1 / -1;
}

.empty-icon {
    margin-bottom: 24px;
    color: var(--border);
}

.empty-state h3 {
    font-size: 22px;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 24px;
    color: var(--text-secondary);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background: var(--accent);
    color: var(--bg);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.btn-primary:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

/* ===== Pagination ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.page-link {
    padding: 8px 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--text);
    color: var(--text);
    background: var(--surface-hover);
}

.page-info {
    font-size: 14px;
    color: var(--text-tertiary);
    font-weight: 500;
}

/* ===== Footer ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    margin-top: 60px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--text);
}

/* ===== Animations ===== */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.news-card {
    animation: fadeUp 0.5s ease forwards;
    opacity: 0;
}

.news-card:nth-child(1) { animation-delay: 0.05s; }
.news-card:nth-child(2) { animation-delay: 0.1s; }
.news-card:nth-child(3) { animation-delay: 0.15s; }
.news-card:nth-child(4) { animation-delay: 0.2s; }
.news-card:nth-child(5) { animation-delay: 0.25s; }
.news-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .author-widget { grid-column: 1 / -1; }
}

@media (max-width: 768px) {
    .header-inner { height: 56px; padding: 0 16px; }
    .brand-text { font-size: 16px; }

    .main-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        padding: 12px 16px;
        flex-direction: column;
        gap: 4px;
        transform: translateY(-100%);
        opacity: 0;
        pointer-events: none;
        transition: var(--transition);
        z-index: 99;
    }

    .main-nav.open {
        transform: translateY(0);
        opacity: 1;
        pointer-events: all;
    }

    .nav-link {
        padding: 12px 16px;
        width: 100%;
    }

    .nav-link.active::after { display: none; }

    .mobile-menu-btn { display: flex; }

    .hero { min-height: 200px !important; padding: 40px 16px; }
    .hero-title { font-size: 28px; }
    .hero-subtitle { font-size: 14px; }
    .hero-stats { gap: 10px; }
    .stat-pill { padding: 10px 16px; min-width: 60px; }
    .stat-pill .stat-num { font-size: 20px; }

    .filter-bar { top: 56px; padding: 0 16px; }
    .filter-inner { height: 48px; }

    .main-layout { padding: 24px 16px; }

    .news-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .news-card { padding: 20px; }
    .card-title { font-size: 16px; }

    .sidebar {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .footer-inner {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 480px) {
    .hero-title { font-size: 24px; }
    .news-card { padding: 16px; }
    .stats-grid { gap: 8px; }
    .stat-box { padding: 10px 4px; }
    .stat-box .stat-num { font-size: 16px; }
}
