/**
 * 模型排行榜页面样式
 * 紧凑精致风格
 */

.models-rank-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 12px;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.page-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 3px 0;
    color: white;
}

.page-subtitle {
    font-size: 0.85rem;
    margin: 0;
    color: rgba(255, 255, 255, 0.9);
}

.page-subtitle a {
    text-decoration: none;
    color: rgba(255, 255, 255, 0.9);
}

.version-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    backdrop-filter: blur(10px);
}

.version-label {
    font-size: 0.7rem;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2px;
}

.version-date {
    font-size: 1rem;
    font-weight: 700;
    color: white;
}

/* 分类切换器 */
.category-switcher {
    margin-bottom: 15px;
    padding: 0;
}

.switcher-container {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 4px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.switcher-container::-webkit-scrollbar {
    height: 3px;
}

.switcher-container::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

.category-tab {
    display: inline-block;
    padding: 6px 14px;
    background: #f8f9fa;
    color: #495057;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.category-tab:hover {
    background: #e9ecef;
    color: #212529;
}

.category-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.25);
}

/* 分类概览 - 两列布局 */
.categories-overview {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.category-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.category-card {
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: all 0.2s ease;
    padding: 1rem;
}

.category-card:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.category-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 1px solid #e1e8ed;
}

.category-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
}

.category-link {
    color: #2c3e50;
    text-decoration: none;
    transition: color 0.2s ease;
}

.category-link:hover {
    color: #667eea;
}

.category-version {
    font-size: 0.75rem;
    color: #7f8c8d;
    padding: 2px 6px;
    background: white;
    border-radius: 10px;
    font-weight: 500;
}

.category-card-body {
    padding: 8px 0px;
}

.category-card-footer {
    margin-top: 8px;
    text-align: center;
    padding-top: 8px;
}

.view-all-btn {
    display: inline-block;
    padding: 4px 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.view-all-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(102, 126, 234, 0.25);
}

/* 迷你排名表格 - 4列 */
.rank-mini-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
}

.rank-mini-table thead {
    background: #f8f9fa;
}

.rank-mini-table th {
    padding: 6px 5px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 1px solid #dee2e6;
    font-size: 0.75rem;
}

.rank-mini-table .col-rank {
    width: 45px;
    text-align: center;
}

.rank-mini-table .col-model {
    width: auto;
    text-align: left;
}

.rank-mini-table .col-org {
    width: 90px;
    text-align: left;
}

.rank-mini-table .col-elo {
    width: 55px;
    text-align: center;
    font-weight: 600;
    color: #667eea;
}

.rank-mini-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
    transition: background-color 0.15s ease;
    height: 32px;
}

.rank-mini-table tbody tr:hover {
    background-color: #f8f9fa;
}

.rank-mini-table td {
    padding: 5px;
    vertical-align: middle;
}

.rank-mini-table .model-name {
    font-weight: 500;
    color: #2c3e50;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rank-mini-table .org-name {
    font-size: 0.75rem;
    color: #7f8c8d;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 搜索过滤区域 */
.search-section {
    margin-bottom: 15px;
}

.search-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
    max-width: 600px;
}

.search-input {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #e1e8ed;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    background: white;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1rem;
    pointer-events: none;
}

.search-results {
    text-align: right;
    font-size: 0.85rem;
    color: #7f8c8d;
    white-space: nowrap;
    flex-shrink: 0;
}

.search-results span {
    font-weight: 600;
    color: #667eea;
}

/* 排名表格容器 */
.main-container {
    padding: 0;
}

.rank-table-container {
    overflow-x: auto;
}

.rank-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.rank-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.rank-table th {
    padding: 10px 8px;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e1e8ed;
    white-space: nowrap;
    font-size: 0.8rem;
}

.rank-table tbody tr {
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.15s ease;
    height: 38px;
}

.rank-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.001);
}

.rank-table td {
    padding: 10px 8px;
    vertical-align: middle;
}

/* 排名列 */
.rank-table .col-rank {
    width: 65px;
    text-align: center;
}

.rank-badge {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.8rem;
}

/* 前三名特殊样式 - 更小的徽章 */
.rank-badge.rank-1 {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    box-shadow: 0 1px 3px rgba(245, 87, 108, 0.2);
}

.rank-badge.rank-2 {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    box-shadow: 0 1px 3px rgba(79, 172, 254, 0.2);
}

.rank-badge.rank-3 {
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    color: white;
    box-shadow: 0 1px 3px rgba(250, 112, 154, 0.2);
}

/* 模型名列 */
.rank-table .col-model {
    min-width: 180px;
    text-align: left;
}

.model-name-text {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.9rem;
}

/* 机构列 */
.rank-table .col-organization {
    min-width: 100px;
    text-align: left;
}

.organization-text {
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Elo分数列 */
.rank-table .col-elo {
    width: 80px;
    text-align: center;
}

.elo-score {
    font-weight: 700;
    color: #667eea;
    font-size: 0.95rem;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 15px;
    padding: 12px;
}

.page-link {
    display: inline-block;
    padding: 5px 10px;
    background: white;
    color: #667eea;
    border: 1px solid #e1e8ed;
    border-radius: 3px;
    text-decoration: none;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 0.85rem;
}

.page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-1px);
}

.page-link.page-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: transparent;
    cursor: default;
}

.page-ellipsis {
    padding: 5px 3px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* 行高亮效果 */
.rank-row:hover {
    cursor: default;
}

/* 无数据提示 */
.no-data {
    text-align: center;
    padding: 30px 20px;
    color: #95a5a6;
    font-size: 0.85rem;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .category-row {
        grid-template-columns: 1fr;
    }

    .switcher-container {
        flex-wrap: nowrap;
    }
}

@media (max-width: 768px) {
    .models-rank-page {
        padding: 8px;
    }

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

    .page-subtitle {
        font-size: 0.8rem;
    }

    .rank-table {
        font-size: 0.75rem;
    }

    .rank-table th,
    .rank-table td {
        padding: 6px 5px;
    }

    .rank-badge {
        width: 20px;
        height: 20px;
        line-height: 20px;
        font-size: 0.75rem;
    }

    .version-badge {
        flex-direction: row;
        gap: 6px;
        font-size: 0.85rem;
    }

    .category-tab {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .category-row {
        gap: 10px;
    }

    .search-container {
        flex-direction: column;
        gap: 10px;
    }

    .search-results {
        text-align: center;
    }
}
