/* SVTR AI创投数据榜单样式 */

:root {
    /* 主题颜色 */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;

    /* 功能颜色 */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --info-color: #3b82f6;

    /* 中性色 */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* 边框和阴影 */
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);

    /* 间距 */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;

    /* 圆角 */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: var(--text-primary);
    min-height: 100vh;
}

/* 顶部导航 */
.top-nav {
    background: rgba(30, 41, 59, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s;
}

.logo:hover {
    color: var(--primary-color);
}

.tagline {
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-left: 1rem;
    border-left: 2px solid var(--border-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    position: relative;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-light);
}

.nav-links a.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

/* 主容器 */
.rankings-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 页面标题 */
.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title .icon {
    font-size: 2rem;
}

.page-subtitle {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* 统计卡片 */
.stats-overview {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s;
}

.stat-card:hover {
    background: rgba(30, 41, 59, 0.8);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
}

.stat-icon {
    font-size: 2.5rem;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--radius-md);
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-light);
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* 筛选栏 */
.filter-bar {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 2rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.filter-group {
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.filter-icon {
    font-size: 1.125rem;
}

.filter-select,
.filter-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all 0.3s;
}

.filter-select:focus,
.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.filter-select:hover,
.filter-input:hover {
    border-color: var(--primary-light);
}

.reset-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: #fca5a5;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.reset-btn:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    transform: translateY(-1px);
}

/* 图表区域 */
.charts-section {
    margin-bottom: 3rem;
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all 0.3s;
}

.chart-card:hover {
    border-color: var(--primary-color);
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.15);
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
}

.chart-icon {
    font-size: 1.25rem;
}

.chart-toggle {
    width: 32px;
    height: 32px;
    background: rgba(99, 102, 241, 0.1);
    border: none;
    border-radius: var(--radius-sm);
    color: var(--primary-light);
    cursor: pointer;
    transition: all 0.3s;
}

.chart-toggle:hover {
    background: rgba(99, 102, 241, 0.2);
}

.chart-body {
    min-height: 300px;
    position: relative;
}

.chart-body canvas {
    max-height: 300px;
}

/* 榜单列表 */
.rankings-list {
    margin-bottom: 3rem;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.list-title {
    font-size: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.list-info {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

/* 表格样式 */
.rankings-table {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.rankings-table table {
    width: 100%;
    border-collapse: collapse;
}

.rankings-table thead {
    background: rgba(15, 23, 42, 0.5);
    border-bottom: 2px solid var(--border-color);
}

.rankings-table th {
    padding: 1rem;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.rankings-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.rankings-table tbody tr {
    transition: background 0.2s;
}

.rankings-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
}

.rank-col {
    width: 80px;
}

.company-col {
    min-width: 200px;
}

.category-col {
    width: 120px;
}

.funding-col {
    width: 140px;
}

.round-col {
    width: 100px;
}

.date-col {
    width: 120px;
}

.tags-col {
    min-width: 150px;
}

.action-col {
    width: 100px;
    text-align: center;
}

/* 排名徽章 */
.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1rem;
}

.rank-badge.top1 {
    background: linear-gradient(135deg, #ffd700, #ffa500);
    color: #000;
}

.rank-badge.top2 {
    background: linear-gradient(135deg, #c0c0c0, #999);
    color: #000;
}

.rank-badge.top3 {
    background: linear-gradient(135deg, #cd7f32, #8b4513);
    color: #fff;
}

.rank-badge.other {
    background: rgba(51, 65, 85, 0.5);
    color: var(--text-muted);
}

/* 公司信息 */
.company-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

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

.company-desc {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* 分类标签 */
.category-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 500;
}

.category-badge.infra {
    background: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-badge.model {
    background: rgba(59, 130, 246, 0.1);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.category-badge.app {
    background: rgba(245, 158, 11, 0.1);
    color: #fcd34d;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 融资金额 */
.funding-amount {
    font-weight: 700;
    font-size: 1.125rem;
    background: linear-gradient(135deg, var(--primary-light), #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* 轮次标签 */
.round-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 500;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* 标签组 */
.tags-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.tag {
    padding: 0.125rem 0.5rem;
    background: rgba(51, 65, 85, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* 操作按钮 */
.view-btn {
    padding: 0.5rem 1rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.view-btn:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

/* 加载状态 */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

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

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.empty-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.empty-text {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

.empty-btn {
    padding: 0.75rem 1.5rem;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    border-radius: var(--radius-md);
    color: var(--primary-light);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-btn:hover:not(:disabled) {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary-color);
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

/* 底部说明 */
.data-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

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

.data-footer h4 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--primary-light);
}

.data-footer p {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .rankings-container {
        padding: 1rem;
    }

    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        width: 100%;
        justify-content: space-around;
    }

    .page-title {
        font-size: 2rem;
    }

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

    .filter-bar {
        flex-direction: column;
    }

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

    .rankings-table {
        overflow-x: auto;
    }

    .rankings-table table {
        min-width: 800px;
    }
}

/* 弹窗样式 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-header {
    padding: 2rem 2rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
}

.modal-icon {
    font-size: 1.75rem;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.modal-close:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.modal-body {
    padding: 2rem;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.detail-item {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.detail-item.full-width {
    grid-column: 1 / -1;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.detail-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.detail-value.highlight {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 600;
}

.detail-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.detail-description {
    font-size: 0.938rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-top: 0.5rem;
}

.modal-footer {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 0 0 16px 16px;
}

.data-source-note {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.note-icon {
    font-size: 1rem;
}

@media (max-width: 768px) {
    .modal-content {
        max-height: 95vh;
        margin: 0.5rem;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding: 1.5rem;
    }

    .detail-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .modal-title {
        font-size: 1.25rem;
    }
}

/* 登录弹窗关闭按钮 */
.chat-login-close {
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: transparent;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    color: #666;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.chat-login-close:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #333;
}

/* Tab Navigation */
.tabs-navigation {
    margin: 2rem auto;
    max-width: 1400px;
    padding: 0 2rem;
}

.tabs-container {
    display: flex;
    gap: 1rem;
    background: rgba(30, 41, 59, 0.5);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    backdrop-filter: blur(10px);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.tab-btn.active {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.tab-icon {
    font-size: 1.2rem;
}

.tab-text {
    font-weight: 600;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Ecosystem Overview Styles */
.ecosystem-analytics-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 2rem;
}

.ecosystem-module-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.ecosystem-module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.ecosystem-module-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
}

.ecosystem-module-tag {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecosystem-charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(600px, 1fr));
    gap: 2rem;
    margin-top: 1rem;
}

.ecosystem-chart-container {
    background: rgba(255, 255, 255, 0.03);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ecosystem-chart-container:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border-color: rgba(102, 126, 234, 0.3);
}

.ecosystem-chart-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 4px solid #667eea;
}

.ecosystem-chart-dom {
    min-height: 350px;
}

/* Loading State */
#ecosystem-loading {
    text-align: center;
    padding: 4rem 2rem;
}

.loading-spinner {
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-text {
    color: var(--text-muted);
    font-size: 1rem;
}

/* No Data State */
.no-data {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-muted);
}

.no-data p {
    font-size: 1.125rem;
    margin-bottom: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tabs-container {
        flex-direction: column;
    }

    .tab-btn {
        width: 100%;
    }

    .ecosystem-charts-grid {
        grid-template-columns: 1fr;
    }

    .ecosystem-module-section {
        padding: 1rem;
    }
}
