/* ===== CSS Variables & Reset ===== */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-bg: #eef2ff;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -2px rgba(0,0,0,0.05);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
    --radius: 12px;
    --radius-sm: 8px;
    --gold: #f59e0b;
    --silver: #94a3b8;
    --bronze: #d97706;
    --green: #10b981;
    --red: #ef4444;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #64748b;
    --accent: #818cf8;
    --accent-light: #a5b4fc;
    --accent-bg: #1e1b4b;
    --border: #334155;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.5);
}

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

html {
    scroll-behavior: smooth;
}

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

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

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

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

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

.logo-icon {
    font-size: 28px;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 22px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--accent), var(--accent-light), #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 1.5px;
}

.nav {
    display: flex;
    gap: 4px;
}

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

.nav-link:hover {
    color: var(--accent);
    background: var(--accent-bg);
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition);
    font-size: 16px;
}

.theme-toggle:hover {
    transform: rotate(30deg);
    border-color: var(--accent);
}

/* ===== Stats Bar ===== */
.stats-bar {
    background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7);
    padding: 24px 0;
    color: white;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 24px;
}

.stat-card {
    text-align: center;
}

.stat-number {
    font-size: 32px;
    font-weight: 800;
    font-family: 'Inter', monospace;
    letter-spacing: -1px;
}

.stat-label {
    font-size: 13px;
    opacity: 0.85;
    margin-top: 4px;
    font-weight: 400;
}

/* ===== Main Layout ===== */
.main {
    padding: 40px 24px 60px;
}

.section {
    display: none;
    animation: fadeIn 0.4s ease;
}

.section.active {
    display: block;
}

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

.section-header {
    margin-bottom: 32px;
}

.section-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.section-desc {
    color: var(--text-secondary);
    font-size: 15px;
}

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

.news-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all var(--transition);
    cursor: pointer;
}

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

.news-card-img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: var(--text-tertiary);
}

.news-card-body {
    padding: 20px;
}

.news-card-source {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 8px;
    background: var(--accent-bg);
    padding: 3px 10px;
    border-radius: 20px;
}

.news-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.news-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-tertiary);
}

.load-more {
    text-align: center;
    margin-top: 36px;
}

/* ===== Events Timeline ===== */
.events-timeline {
    position: relative;
    padding-left: 32px;
}

.events-timeline::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-light), transparent);
}

.event-item {
    position: relative;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
    cursor: pointer;
}

.event-item:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.event-item::before {
    content: '';
    position: absolute;
    left: -27px;
    top: 24px;
    width: 12px;
    height: 12px;
    background: var(--accent);
    border-radius: 50%;
    border: 3px solid var(--bg-primary);
}

.event-date {
    font-size: 12px;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 6px;
}

.event-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.event-summary {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
}

.event-source {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-tertiary);
}

/* ===== Ranking Tabs ===== */
.ranking-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.tab {
    padding: 8px 20px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition);
}

.tab:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.tab.active {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* ===== Ranking Table ===== */
.ranking-table-wrap {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.ranking-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.ranking-table thead {
    background: var(--bg-tertiary);
}

.ranking-table th {
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.ranking-table td {
    padding: 16px 20px;
    border-top: 1px solid var(--border);
    vertical-align: middle;
}

.ranking-table tbody tr {
    transition: background var(--transition);
}

.ranking-table tbody tr:hover {
    background: var(--accent-bg);
}

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.rank-1 { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #78350f; }
.rank-2 { background: linear-gradient(135deg, #d1d5db, #9ca3af); color: #374151; }
.rank-3 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #78350f; }
.rank-default { background: var(--bg-tertiary); color: var(--text-secondary); }

.model-name {
    font-weight: 600;
    color: var(--text-primary);
}

.model-provider {
    color: var(--accent);
    font-weight: 500;
}

.model-score {
    font-family: 'Inter', monospace;
    font-weight: 700;
    color: var(--accent);
    font-size: 15px;
}

.model-desc {
    color: var(--text-secondary);
    font-size: 13px;
    max-width: 260px;
}

.model-tags {
    white-space: nowrap;
}

.tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 4px;
}

.tag-reasoning {
    background: #fef3c7;
    color: #92400e;
}

[data-theme="dark"] .tag-reasoning {
    background: #78350f;
    color: #fef3c7;
}

.tag-open {
    background: #d1fae5;
    color: #065f46;
}

[data-theme="dark"] .tag-open {
    background: #064e3b;
    color: #d1fae5;
}

.tag-restricted {
    background: #fee2e2;
    color: #991b1b;
}

[data-theme="dark"] .tag-restricted {
    background: #7f1d1d;
    color: #fee2e2;
}

.tag-closed {
    background: var(--bg-tertiary);
    color: var(--text-tertiary);
}

.highlight-cell {
    color: var(--accent) !important;
    font-weight: 800 !important;
    font-size: 15px !important;
}

/* ===== Agent Grid ===== */
.agent-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.agent-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

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

.agent-card-rank {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 48px;
    font-weight: 900;
    font-family: 'Inter', monospace;
    color: var(--border);
    line-height: 1;
    opacity: 0.5;
}

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

.agent-avatar {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.agent-info h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 2px;
}

.agent-info .provider {
    font-size: 12px;
    color: var(--accent);
    font-weight: 500;
}

.agent-score-bar {
    height: 6px;
    background: var(--bg-tertiary);
    border-radius: 3px;
    margin-bottom: 14px;
    overflow: hidden;
}

.agent-score-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-light));
    border-radius: 3px;
    transition: width 1s ease;
}

.agent-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 14px;
}

.agent-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.agent-link:hover {
    text-decoration: underline;
}

/* ===== Buttons ===== */
.btn {
    padding: 10px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    border: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-light);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 2px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent);
    color: white;
}

/* ===== Modal ===== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    z-index: 200;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.modal-overlay.show {
    display: flex;
}

.modal {
    background: var(--bg-secondary);
    border-radius: var(--radius);
    max-width: 720px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
    position: sticky;
    top: 12px;
    float: right;
    margin: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--bg-tertiary);
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    z-index: 10;
    transition: all var(--transition);
}

.modal-close:hover {
    background: var(--red);
    color: white;
}

.modal-body {
    padding: 32px;
}

.modal-body h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.4;
}

.modal-body .meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-tertiary);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}

.modal-body .content {
    font-size: 15px;
    line-height: 1.8;
    color: var(--text-secondary);
}

.modal-body .content img {
    max-width: 100%;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.modal-body .source-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 24px;
    padding: 10px 20px;
    background: var(--accent-bg);
    color: var(--accent);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
}

.modal-body .source-link:hover {
    background: var(--accent);
    color: white;
}

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

.footer-inner {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 13px;
}

.footer-sub {
    margin-top: 6px;
    font-size: 12px;
}

/* ===== Loading ===== */
.loading {
    text-align: center;
    padding: 48px;
    color: var(--text-tertiary);
    font-size: 15px;
}

.loading::before {
    content: '';
    display: block;
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

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

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 15px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .nav {
        display: none;
    }

    .header-inner {
        height: 56px;
    }

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

    .agent-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 22px;
    }

    .stat-number {
        font-size: 24px;
    }

    .ranking-table th,
    .ranking-table td {
        padding: 12px;
    }
}

/* Mobile Nav (bottom) */
@media (max-width: 768px) {
    .nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-top: 1px solid var(--border);
        padding: 8px;
        z-index: 100;
        justify-content: space-around;
    }

    .nav-link {
        font-size: 11px;
        padding: 8px 10px;
        text-align: center;
        flex: 1;
    }

    .main {
        padding-bottom: 100px;
    }

    .footer {
        padding-bottom: 80px;
    }

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

/* ===== Search Box ===== */
.search-box {
    position: relative;
}

.search-box input {
    padding: 8px 14px;
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 13px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    width: 200px;
    transition: all var(--transition);
    outline: none;
}

.search-box input:focus {
    width: 280px;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.search-results {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 380px;
    max-height: 400px;
    overflow-y: auto;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 300;
    margin-top: 8px;
}

.search-results.show { display: block; }

.search-group { padding: 8px 0; }

.search-group-title {
    padding: 6px 16px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.search-item {
    display: block;
    padding: 8px 16px;
    font-size: 13px;
    color: var(--text-primary);
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-item:hover { background: var(--accent-bg); }
.search-sub { color: var(--text-tertiary); font-size: 11px; margin-left: 8px; }
.search-empty { padding: 24px; text-align: center; color: var(--text-tertiary); font-size: 13px; }

/* ===== Dashboard Grid ===== */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.dash-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: all var(--transition);
}

.dash-card:hover { box-shadow: var(--shadow-md); }
.dash-card-wide { grid-column: span 2; }

.dash-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.dash-card-header h3 { font-size: 15px; font-weight: 700; }
.dash-more { font-size: 12px; color: var(--accent); text-decoration: none; font-weight: 500; }
.dash-more:hover { text-decoration: underline; }

.dash-news-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background var(--transition);
}

.dash-news-item:hover { background: var(--accent-bg); margin: 0 -20px; padding: 10px 20px; }
.dash-news-item:last-child { border-bottom: none; }

.dash-news-source {
    flex-shrink: 0;
    font-size: 10px;
    color: var(--accent);
    background: var(--accent-bg);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.dash-news-title {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.dash-news-time { flex-shrink: 0; font-size: 11px; color: var(--text-tertiary); }

.dash-tool-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    margin: 4px;
    transition: all var(--transition);
}

.dash-tool-chip:hover { border-color: var(--accent); background: var(--accent-bg); }
.chip-icon { font-size: 14px; }
.chip-price { font-size: 10px; color: var(--text-tertiary); }

.dash-event-mini {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}

.dash-event-mini:last-child { border-bottom: none; }
.dash-event-date { font-size: 11px; color: var(--accent); font-weight: 600; }
.dash-event-title { font-size: 13px; font-weight: 500; margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.dash-rank-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 0;
}

.dash-rank-name { flex: 1; font-size: 13px; font-weight: 500; }
.dash-rank-score { font-size: 14px; font-weight: 700; color: var(--accent); font-family: 'Inter', monospace; }

.dash-paper-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    text-decoration: none;
    color: var(--text-primary);
}

.dash-paper-mini:last-child { border-bottom: none; }
.dash-paper-title { font-size: 13px; font-weight: 500; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.paper-stars { font-size: 11px; flex-shrink: 0; color: var(--gold); font-weight: 600; }

/* Source Bars */
.source-bar-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.source-name { width: 140px; font-size: 12px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: right; flex-shrink: 0; }
.source-bar { flex: 1; height: 8px; background: var(--bg-tertiary); border-radius: 4px; overflow: hidden; }
.source-bar-fill { height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-light)); border-radius: 4px; transition: width 1s ease; }
.source-count { width: 40px; font-size: 12px; color: var(--text-tertiary); font-family: 'Inter', monospace; }

/* ===== Tool Cards ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
    position: relative;
}

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

.tool-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
}

.tool-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    flex-shrink: 0;
}

.tool-meta h3 { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.tool-rating { font-size: 12px; color: var(--gold); font-weight: 600; }

.tool-featured {
    position: absolute;
    top: 12px;
    right: 12px;
    font-size: 10px;
    padding: 2px 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: white;
    border-radius: 10px;
    font-weight: 700;
}

.tool-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 12px;
}

.tool-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.mini-tag {
    font-size: 10px;
    padding: 1px 6px;
    background: var(--bg-tertiary);
    border-radius: 8px;
    color: var(--text-tertiary);
}

/* ===== Paper Cards ===== */
.papers-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
}

.paper-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: var(--text-primary);
    transition: all var(--transition);
}

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

.paper-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.paper-cat {
    font-size: 11px;
    padding: 2px 10px;
    background: var(--accent-bg);
    color: var(--accent);
    border-radius: 10px;
    font-weight: 600;
}

.paper-title { font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.paper-authors { font-size: 12px; color: var(--accent); margin-bottom: 8px; font-weight: 500; }

.paper-abstract {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.7;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.paper-date { font-size: 11px; color: var(--text-tertiary); }

/* ===== Responsive Additions ===== */
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .dash-card-wide { grid-column: span 1; }
    .search-box input { width: 120px; }
    .search-box input:focus { width: 180px; }
    .search-results { width: 300px; }
    .tools-grid { grid-template-columns: 1fr; }
    .papers-list { grid-template-columns: 1fr; }

    .nav {
        justify-content: center;
        flex-wrap: wrap;
    }

    .nav-link {
        font-size: 10px;
        padding: 6px 8px;
    }
}
