
/* 航空主题CSS变量 */
:root {
    --sky-blue: #4A90E2;
    --cloud-white: #F8FAFE;
    --horizon-blue: #6BB6FF;
    --deep-blue: #2C5282;
    --aircraft-silver: #C0C8D1;
    --sunset-orange: #FF8C42;
    --gold: #FFD700;
    --silver: #C0C0C0;
    --bronze: #CD7F32;
    --header-height: 70px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--sky-blue) 0%, var(--horizon-blue) 50%, var(--cloud-white) 100%);
    min-height: 100vh;
    padding-top: var(--header-height);
    line-height: 1.6;
}

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

/* 纸质卡片样式 */
.paper-sheet {
    background: linear-gradient(135deg, var(--cloud-white) 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 15px 35px rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.1);
    position: relative;
    backdrop-filter: blur(10px);
}

/* 页面标题 */
.page-title {
    text-align: center;
    color: var(--deep-blue);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.page-subtitle {
    text-align: center;
    color: rgba(44, 82, 130, 0.7);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

/* 导航选项卡 */
.ranking-nav {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.nav-tab {
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid rgba(74, 144, 226, 0.2);
    border-radius: 25px;
    text-decoration: none;
    color: var(--deep-blue);
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-tab:hover {
    background: rgba(74, 144, 226, 0.1);
    border-color: var(--sky-blue);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.2);
    text-decoration: none;
    color: var(--sky-blue);
}

.nav-tab.active {
    background: linear-gradient(135deg, var(--sky-blue) 0%, var(--horizon-blue) 100%);
    color: white;
    border-color: transparent;
}

.nav-tab.active:hover {
    color: white;
    transform: translateY(-2px);
}

/* 错误信息 */
.error-message {
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e8e 100%);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

/* 点赞排行榜 - 图片网格 */
.ranking-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.ranking-card {
    background: linear-gradient(135deg, var(--cloud-white) 0%, #ffffff 100%);
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.15);
    border: 1px solid rgba(74, 144, 226, 0.1);
    transition: all 0.3s ease;
}

.ranking-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(74, 144, 226, 0.25);
    border-color: var(--sky-blue);
}

.card-image-container {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.ranking-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.ranking-card:hover .ranking-image {
    transform: scale(1.05);
}

/* 排名徽章 */
.rank-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.rank-1 {
    background: linear-gradient(135deg, var(--gold), #ffed4a);
    color: #8b5a00;
}

.rank-2 {
    background: linear-gradient(135deg, var(--silver), #e2e8f0);
    color: #4a5568;
}

.rank-3 {
    background: linear-gradient(135deg, var(--bronze), #d69e2e);
    color: white;
}

.rank-default {
    background: linear-gradient(135deg, var(--aircraft-silver), #e2e8f0);
    color: var(--deep-blue);
}

.ranking-card:hover .rank-badge {
    transform: scale(1.1);
}

/* 点赞徽章 */
.likes-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ff5252);
    color: white;
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.ranking-card:hover .likes-badge {
    transform: scale(1.1);
}

/* 图片ID徽章 */
.image-id-badge {
    position: absolute;
    bottom: 10px;
    left: 10px;
    background: linear-gradient(135deg, var(--sky-blue), var(--horizon-blue));
    color: white;
    padding: 6px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 10;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.ranking-card:hover .image-id-badge {
    transform: scale(1.1);
}

/* 卡片内容 */
.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--deep-blue);
    margin-bottom: 0.8rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    color: rgba(44, 82, 130, 0.7);
    font-size: 0.9rem;
    flex-wrap: nowrap; /* 防止换行 */
}

.card-meta .ms-2 {
    flex-shrink: 0; /* 防止日期被压缩 */
    white-space: nowrap;
    margin-left: 8px;
}

.photographer-link {
    color: var(--sky-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
    display: inline-block;
    max-width: 80px; /* 限制用户名最大宽度 */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}

.photographer-link:hover {
    color: var(--horizon-blue);
    text-decoration: underline;
}

/* 用户排行榜 */
.user-ranking-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.user-rank-item {
    background: linear-gradient(135deg, var(--cloud-white) 0%, #ffffff 100%);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.1);
    border: 1px solid rgba(74, 144, 226, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.user-rank-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(74, 144, 226, 0.2);
    border-color: var(--sky-blue);
}

.user-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--sky-blue), var(--horizon-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-info {
    flex-grow: 1;
}

.username {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--deep-blue);
    margin-bottom: 0.5rem;
}

.username a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.username a:hover {
    color: var(--sky-blue);
    text-decoration: underline;
}

.user-stats {
    color: rgba(44, 82, 130, 0.7);
    font-size: 1rem;
    margin-bottom: 0.8rem;
}

.approved-count {
    font-weight: 600;
    color: var(--sky-blue);
}

/* 进度条 */
.progress-bar {
    height: 8px;
    background: rgba(74, 144, 226, 0.1);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sky-blue), var(--horizon-blue));
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

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

.pagination {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.pagination-btn {
    padding: 0.8rem 1.2rem;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(74, 144, 226, 0.2);
    border-radius: 12px;
    text-decoration: none;
    color: var(--deep-blue);
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 45px;
    text-align: center;
}

.pagination-btn:hover {
    background: var(--sky-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    text-decoration: none;
}

.pagination-btn.active {
    background: linear-gradient(135deg, var(--sky-blue), var(--horizon-blue));
    color: white;
    border-color: transparent;
}

.pagination-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 无数据状态 */
.no-data {
    text-align: center;
    padding: 3rem;
    color: rgba(44, 82, 130, 0.7);
}

.no-data-icon {
    font-size: 4rem;
    color: rgba(74, 144, 226, 0.3);
    margin-bottom: 1rem;
}

.no-data h3 {
    font-size: 1.5rem;
    color: var(--deep-blue);
    margin-bottom: 0.5rem;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .ranking-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .ranking-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .ranking-container {
        padding: 1rem;
    }

    .paper-sheet {
        padding: 1.5rem;
    }

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

    .ranking-nav {
        gap: 0.5rem;
    }

    .nav-tab {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    .ranking-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .card-image-container {
        height: 180px;
    }

    .user-rank-item {
        padding: 1rem;
        gap: 1rem;
    }

    .user-avatar {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }

    .rank-badge {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .ranking-grid {
        grid-template-columns: 1fr;
    }

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

    .ranking-nav {
        flex-direction: column;
        align-items: center;
    }

    .nav-tab {
        width: 100%;
        text-align: center;
        max-width: 300px;
    }

    .photographer-link {
        max-width: 60px; /* 移动端进一步缩短用户名 */
    }
}

/* 云朵动画 */
.floating-cloud {
    position: fixed;
    z-index: -1;
    opacity: 0.1;
    pointer-events: none;
}

@keyframes cloudFloat {
    0% { 
        transform: translateX(-100px);
        opacity: 0;
    }
    10% {
        opacity: 0.1;
    }
    90% {
        opacity: 0.1;
    }
    100% { 
        transform: translateX(calc(100vw + 100px));
        opacity: 0;
    }
}