/* 基金排行榜页面样式 */

.fund-card {
    max-width: 1200px;
    margin: 0 auto;
}

.section-desc {
    text-align: center;
    color: var(--text-secondary);
    margin-top: 10px;
    font-size: 0.95rem;
}

/* 筛选区域 */
.filter-section {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.filter-group select {
    min-width: 120px;
    padding: 8px 12px;
    font-size: 13px;
}

.filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.data-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* 表格容器 */
.table-container {
    overflow-x: auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.fund-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.fund-table thead {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="light"] .fund-table thead {
    background: rgba(0, 0, 0, 0.05);
}

.fund-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    border-bottom: 1px solid var(--border-color);
}

.fund-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

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

.fund-table tbody tr:hover {
    background: rgba(102, 126, 234, 0.1);
}

.fund-table tbody tr:last-child td {
    border-bottom: none;
}

/* 表格列宽 */
.col-rank { width: 60px; text-align: center; }
.col-name { min-width: 150px; }
.col-type { width: 80px; }
.col-scale { width: 90px; }
.col-day, .col-week, .col-month, .col-year { width: 80px; text-align: right; }
.col-action { width: 80px; text-align: center; }

/* 排名样式 */
.rank {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 12px;
}

.rank.top-1 { background: linear-gradient(135deg, #ffd700, #ffb347); color: #333; }
.rank.top-2 { background: linear-gradient(135deg, #c0c0c0, #a0a0a0); color: #333; }
.rank.top-3 { background: linear-gradient(135deg, #cd7f32, #b87333); color: #fff; }
.rank.normal { background: var(--glass-bg); color: var(--text-secondary); }

/* 基金名称 */
.fund-name-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

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

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

.fund-code {
    font-size: 11px;
    color: var(--text-muted);
}

/* 基金类型标签 */
.fund-type {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
}

.type-stock { background: rgba(231, 76, 60, 0.2); color: #e74c3c; }
.type-mixed { background: rgba(155, 89, 182, 0.2); color: #9b59b6; }
.type-bond { background: rgba(52, 152, 219, 0.2); color: #3498db; }
.type-index { background: rgba(46, 204, 113, 0.2); color: #2ecc71; }
.type-money { background: rgba(241, 196, 15, 0.2); color: #f1c40f; }

/* 涨幅数据 */
.rise-value {
    font-weight: 600;
    font-family: var(--font-mono);
}

.rise-positive { color: var(--success-color); }
.rise-negative { color: var(--danger-color); }
.rise-zero { color: var(--text-muted); }

/* 操作按钮 */
.btn-detail {
    padding: 6px 12px;
    font-size: 12px;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-detail:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

/* 加载状态 */
.loading-state, .error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-muted);
    gap: 15px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.error-state .btn {
    margin-top: 10px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 20px 0;
}

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

/* 基金详情弹窗 */
.fund-detail {
    max-width: 700px;
    max-height: 85vh;
    overflow-y: auto;
}

.fund-detail .modal-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.fund-detail .modal-header h3 {
    font-size: 1.2rem;
    color: var(--text-primary);
}

.fund-detail .modal-body {
    padding: 20px;
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.detail-fund-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-fund-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.detail-fund-code {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.detail-stats {
    display: flex;
    gap: 20px;
}

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

.detail-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
}

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

.detail-section {
    margin-bottom: 25px;
}

.detail-section h4 {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 12px;
    background: var(--glass-bg);
    border-radius: var(--radius-sm);
}

.detail-item-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.detail-item-value {
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
}

.rise-chart {
    height: 200px;
    background: var(--glass-bg);
    border-radius: var(--radius-md);
    padding: 15px;
    margin-top: 15px;
}

/* 响应式 */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select {
        width: 100%;
    }

    .filter-actions {
        margin-left: 0;
        justify-content: flex-end;
    }

    .fund-table {
        font-size: 12px;
    }

    .fund-table th, .fund-table td {
        padding: 10px 8px;
    }

    .col-name { min-width: 120px; }
    .col-scale { display: none; }
    .col-week, .col-month { display: none; }

    .detail-header {
        flex-direction: column;
        gap: 20px;
    }

    .detail-stats {
        width: 100%;
        justify-content: space-around;
    }

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

@media (max-width: 480px) {
    .col-year { display: none; }
    .col-action { display: none; }

    .pagination {
        flex-wrap: wrap;
    }
}

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fund-table tbody tr {
    animation: fadeIn 0.3s ease-out;
}