/* 排行榜页面样式 */

/* 页面头部 */
.page-header {
    text-align: center;
    padding: 20px 0;
    position: relative;
}

.page-header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
}

.back-link {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.back-link:hover {
    color: #333;
}

/* 筛选区域 */
.filter-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.filter-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.filter-row label {
    font-weight: 500;
    color: #555;
}

.filter-row select {
    padding: 8px 12px;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-width: 180px;
}

.filter-row select:focus {
    outline: none;
    border-color: #4a90d9;
    box-shadow: 0 0 0 2px rgba(74, 144, 217, 0.2);
}

/* 图片信息卡片 */
.image-info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    border-radius: 12px;
    padding: 12px 15px;
    margin-bottom: 15px;
    color: white;
}

.image-info-card.hidden {
    display: none;
}

.image-info-card img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid rgba(255,255,255,0.3);
}

.image-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;  /* 允许 flex 子元素收缩 */
    flex: 1;
    overflow: hidden;
}

.image-title {
    font-weight: 600;
    font-size: 1rem;
    /* 文本截断 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.image-badge {
    font-size: 0.75rem;
    background: rgba(255,255,255,0.2);
    padding: 2px 8px;
    border-radius: 10px;
    width: fit-content;
}

/* 我的排名卡片 */
.my-rank-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 15px 20px;
    margin-bottom: 20px;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.my-rank-card.hidden {
    display: none;
}

.my-rank-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

.my-rank-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.my-rank-content .rank-number {
    font-size: 1.5rem;
    font-weight: bold;
}

.my-rank-content .rank-time {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* 排行榜容器 */
.leaderboard-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

/* 排行榜表格 */
.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-table th,
.leaderboard-table td {
    padding: 12px 15px;
    text-align: left;
}

.leaderboard-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.leaderboard-table tbody tr {
    border-bottom: 1px solid #eee;
    transition: background 0.2s;
}

.leaderboard-table tbody tr:hover {
    background: #f8f9fa;
}

.leaderboard-table tbody tr:last-child {
    border-bottom: none;
}

/* 列宽度 */
.col-rank {
    width: 60px;
    text-align: center;
}

.col-user {
    width: auto;
}

.col-time {
    width: 100px;
    text-align: right;
}

.col-date {
    width: 100px;
    text-align: right;
}

/* 排名样式 */
.rank-cell {
    text-align: center;
    font-weight: 600;
}

.rank-medal {
    font-size: 1.3rem;
}

.rank-1 { color: #ffd700; } /* 金 */
.rank-2 { color: #c0c0c0; } /* 银 */
.rank-3 { color: #cd7f32; } /* 铜 */

/* 当前用户行高亮 */
.current-user-row {
    background: rgba(102, 126, 234, 0.1) !important;
}

.current-user-row td {
    font-weight: 600;
    color: #667eea;
}

/* 加载状态 */
.loading-cell {
    text-align: center;
    color: #999;
    padding: 40px !important;
}

/* 加载更多 */
.load-more-container {
    text-align: center;
    padding: 20px;
}

.load-more-container.hidden {
    display: none;
}

.load-more-btn {
    padding: 10px 30px;
    font-size: 1rem;
    background: #4a90d9;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-btn:hover {
    background: #3a7bc8;
}

.load-more-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state.hidden {
    display: none;
}

.empty-state p {
    margin: 10px 0;
}

.empty-state p:first-child {
    font-size: 2rem;
}

.btn-primary {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 30px;
    background: #4a90d9;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 1rem;
    transition: background 0.2s;
}

.btn-primary:hover {
    background: #3a7bc8;
}

/* 时间格式 */
.time-cell {
    font-family: 'Consolas', 'Monaco', monospace;
    text-align: right;
}

.date-cell {
    text-align: right;
    color: #888;
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 600px) {
    .page-header h1 {
        font-size: 1.4rem;
    }
    
    .back-link {
        position: static;
        display: block;
        margin-bottom: 10px;
        transform: none;
    }
    
    .difficulty-selector {
        flex-direction: column;
        gap: 8px;
    }
    
    .difficulty-selector select {
        width: 100%;
    }
    
    .my-rank-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .leaderboard-table th,
    .leaderboard-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }
    
    .col-date {
        display: none;
    }
}
