/* 排行榜页面样式 - 动漫清新描边风格 */

/* 嵌入版主内容区 - 两列布局 */
.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    align-items: start;
    width: 100%;
}

/* 排行榜主区域 - PC端两列布局 */
.leaderboard-main-area {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

/* 排行榜区域 */
.leaderboard-section {
    background: var(--bg-card, #fff);
    border: 2px solid #1e293b;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 4px 4px 0 #1e293b;
}

/* 侧边栏区域 */
.leaderboard-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* 页面主容器 */
.leaderboard-page {
    min-height: calc(100vh - 52px);
    padding: 30px 40px;
    background: transparent;
}

.leaderboard-page .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
}

/* 页面标题 */
.page-header {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out;
}

.page-title {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--text);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.page-title i {
    color: #ffd700;
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    opacity: 0.8;
}

/* 游戏选择器 */
.game-tabs {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.game-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: #fff;
    border: 2.5px solid #1e293b;
    border-radius: 12px;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Nunito', sans-serif;
    box-shadow: 3px 3px 0 #1e293b;
}

.game-tab:hover {
    background: #fff;
    border-color: #1e293b;
    color: #1e293b;
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #1e293b;
}

.game-tab.active {
    background: linear-gradient(135deg, #fda4af, #ff8fab);
    border-color: #1e293b;
    color: #1e293b;
    box-shadow: 3px 3px 0 #1e293b;
}

.game-tab i {
    font-size: 1.1rem;
}

/* 搜索区域 */
.search-section {
    display: flex;
    justify-content: center;
    margin-bottom: 32px;
    animation: fadeInUp 0.6s ease-out 0.15s both;
}

.search-box {
    position: relative;
    width: 100%;
    max-width: 400px;
}

.search-box i {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1rem;
}

.search-box input {
    width: 100%;
    padding: 14px 44px 14px 48px;
    background: #fff;
    border: 2.5px solid #1e293b;
    border-radius: 12px;
    color: #1e293b;
    font-size: 0.95rem;
    font-family: 'Nunito', sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 3px 3px 0 #1e293b;
}

.search-box input:focus {
    outline: none;
    border-color: #fda4af;
    box-shadow: 4px 4px 0 #1e293b;
    transform: translate(-1px, -1px);
}

.search-box input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    background: var(--bg-elevated);
    border: none;
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-clear:hover {
    background: var(--primary);
    color: var(--bg);
}

/* 模式选择器 */
.mode-tabs {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 40px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.mode-tab {
    padding: 10px 24px;
    background: #fff;
    border: 2.5px solid #1e293b;
    border-radius: 8px;
    color: #64748b;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Nunito', sans-serif;
    box-shadow: 2px 2px 0 #1e293b;
}

.mode-tab:hover {
    border-color: #1e293b;
    color: #1e293b;
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0 #1e293b;
}

.mode-tab.active {
    background: linear-gradient(135deg, #7dd3fc, #60a5fa);
    border-color: #1e293b;
    color: #1e293b;
    box-shadow: 2px 2px 0 #1e293b;
}

/* 排行榜区域 */
.leaderboard-section {
    background: #fff;
    border: 2.5px solid #1e293b;
    border-radius: 20px;
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out 0.3s both;
    margin-bottom: 40px;
    box-shadow: 6px 6px 0 #1e293b;
}

/* 排行榜头部 */
.leaderboard-header {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px;
    gap: 16px;
    padding: 16px 24px;
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border-bottom: 2.5px solid #1e293b;
    font-family: 'Nunito', sans-serif;
    font-size: 0.85rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.leaderboard-header .col-rank {
    text-align: center;
}

.leaderboard-header .col-player {
    text-align: left;
}

.leaderboard-header .col-score {
    text-align: right;
}

.leaderboard-header .col-date {
    text-align: right;
}

/* 排行榜列表 */
.leaderboard-list {
    padding: 8px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 100px;
    gap: 16px;
    align-items: center;
    padding: 16px;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: slideIn 0.4s ease-out;
    animation-fill-mode: both;
    margin: 4px 8px;
}

.leaderboard-item:hover {
    background: #f0f9ff;
    transform: translateX(4px);
    box-shadow: 2px 2px 0 #1e293b;
}

.leaderboard-item:nth-child(1) { animation-delay: 0.05s; }
.leaderboard-item:nth-child(2) { animation-delay: 0.1s; }
.leaderboard-item:nth-child(3) { animation-delay: 0.15s; }
.leaderboard-item:nth-child(4) { animation-delay: 0.2s; }
.leaderboard-item:nth-child(5) { animation-delay: 0.25s; }
.leaderboard-item:nth-child(6) { animation-delay: 0.3s; }
.leaderboard-item:nth-child(7) { animation-delay: 0.35s; }
.leaderboard-item:nth-child(8) { animation-delay: 0.4s; }
.leaderboard-item:nth-child(9) { animation-delay: 0.45s; }
.leaderboard-item:nth-child(10) { animation-delay: 0.5s; }

/* 排名列 */
.col-rank {
    display: flex;
    justify-content: center;
}

.rank-number {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    background: #fff;
    border: 2.5px solid #1e293b;
    color: #64748b;
    box-shadow: 2px 2px 0 #1e293b;
}

/* 前三名特殊样式 - 动漫描边风格 */
.leaderboard-item.top-1 .rank-number {
    background: linear-gradient(135deg, #ffd700, #ffed4e);
    border-color: #1e293b;
    color: #1e293b;
    box-shadow: 3px 3px 0 #1e293b;
    animation: glow 2s ease-in-out infinite;
}

.leaderboard-item.top-2 .rank-number {
    background: linear-gradient(135deg, #c0c0c0, #e8e8e8);
    border-color: #1e293b;
    color: #1e293b;
    box-shadow: 3px 3px 0 #1e293b;
}

.leaderboard-item.top-3 .rank-number {
    background: linear-gradient(135deg, #cd7f32, #daa520);
    border-color: #1e293b;
    color: #1e293b;
    box-shadow: 3px 3px 0 #1e293b;
}

/* 当前用户排名高亮 */
.leaderboard-item.my-rank-row {
    background: linear-gradient(135deg, #fda4af, #ff8fab);
    border: 2.5px solid #1e293b;
    border-radius: 12px;
    box-shadow: 3px 3px 0 #1e293b;
    position: relative;
}

.leaderboard-item.my-rank-row::before {
    content: '我';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    color: #1e293b;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    border: 2px solid #1e293b;
    box-shadow: 1px 1px 0 #1e293b;
}

/* 玩家列 */
.col-player {
    display: flex;
    align-items: center;
    gap: 12px;
}

.player-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fda4af, #ff8fab);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: #1e293b;
    flex-shrink: 0;
    border: 2px solid #1e293b;
    box-shadow: 2px 2px 0 #1e293b;
}

.player-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.player-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.player-id {
    font-size: 0.75rem;
    color: #64748b;
    font-family: 'Nunito', sans-serif;
}

/* 分数列 */
.col-score {
    text-align: right;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #FF6B9D;
}

/* 日期列 */
.col-date {
    text-align: right;
    font-size: 0.8rem;
    color: #64748b;
    font-family: 'Nunito', sans-serif;
}

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

.loading-state i {
    font-size: 2rem;
    margin-bottom: 16px;
    animation: spin 1s linear infinite;
}

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

/* 空状态 */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #64748b;
    text-align: center;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 8px;
}

.empty-state .hint {
    font-size: 0.85rem;
    opacity: 0.7;
}

/* 我的排名区域 */
.my-rank-section {
    margin-top: 40px;
    padding: 30px;
    background: #fff;
    border: 2.5px solid #1e293b;
    border-radius: 20px;
    animation: fadeInUp 0.6s ease-out 0.4s both;
    box-shadow: 6px 6px 0 #1e293b;
}

.my-rank-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #FF6B9D;
}

.my-rank-header i {
    font-size: 1.2rem;
}

.my-rank-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.my-rank-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.my-rank-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #fda4af, #ff8fab);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Nunito', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    border: 3px solid #1e293b;
    box-shadow: 4px 4px 0 #1e293b;
}

.my-rank-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.my-rank-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
}

.my-rank-position {
    font-family: 'Nunito', sans-serif;
    font-size: 0.9rem;
    color: #64748b;
}

.my-rank-stats {
    display: flex;
    gap: 48px;
}

.my-rank-stat {
    text-align: center;
}

.my-rank-value {
    font-family: 'Nunito', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #FF6B9D;
    line-height: 1;
}

.my-rank-label {
    font-size: 0.85rem;
    color: #64748b;
    margin-top: 4px;
}

/* 未登录状态 */
.not-logged-in {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px;
    text-align: center;
}

.not-logged-in p {
    color: #64748b;
    font-size: 1rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 32px;
    background: linear-gradient(135deg, #fda4af, #ff8fab);
    border: 2.5px solid #1e293b;
    border-radius: 12px;
    color: #1e293b;
    font-family: 'Nunito', sans-serif;
    font-size: 1rem;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 3px 3px 0 #1e293b;
}

.btn-primary:hover {
    transform: translate(-2px, -2px);
    box-shadow: 5px 5px 0 #1e293b;
}

/* 动画定义 */
@keyframes fadeInUp {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
    0% { opacity: 0; transform: translateX(-20px); }
    100% { opacity: 1; transform: translateX(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 20px var(--primary-glow), inset 0 0 20px rgba(0, 212, 255, 0.05); }
    50% { box-shadow: 0 0 40px var(--primary-glow), inset 0 0 40px rgba(0, 212, 255, 0.1); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ==================== 响应式设计 ==================== */

/* 两列布局响应式 - 保持左右布局，仅在窄屏改为单列 */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

/* 中等屏幕优化 - 900px-1200px */
@media (max-width: 1200px) and (min-width: 769px) {
    .leaderboard-item {
        grid-template-columns: 60px 1fr 100px 90px;
        gap: 12px;
        padding: 14px;
    }
    
    .rank-number {
        width: 44px;
        height: 44px;
        font-size: 0.95rem;
    }
    
    .player-avatar {
        width: 38px;
        height: 38px;
        font-size: 0.9rem;
    }
    
    .player-name {
        font-size: 0.9rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 150px;
    }
    
    .col-score {
        font-size: 1rem;
    }
    
    .col-time {
        font-size: 0.8rem;
    }
}

/* 平板设备 */
@media (max-width: 768px) {
    .leaderboard-main-area {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .leaderboard-sidebar {
        order: -1;
    }
    
    .leaderboard-page {
        padding: 80px 0 40px;
    }
    
    .leaderboard-page .container {
        padding: 0 16px;
    }
    
    .page-title {
        font-size: 1.8rem;
        gap: 12px;
    }
    
    .page-title i {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.9rem;
    }
    
    .game-tabs {
        gap: 8px;
    }
    
    .game-tab {
        padding: 12px 20px;
        font-size: 0.85rem;
    }
    
    .game-tab i {
        font-size: 1rem;
    }
    
    .mode-tabs {
        gap: 6px;
    }
    
    .mode-tab {
        padding: 8px 16px;
        font-size: 0.8rem;
    }
    
    .leaderboard-section {
        max-height: 500px;
    }
    
    .leaderboard-header {
        padding: 14px 16px;
        font-size: 0.75rem;
    }
    
    .leaderboard-item {
        padding: 14px 16px;
    }
    
    .rank-number {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .player-avatar {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .col-score {
        font-size: 1rem;
    }
    
    .my-rank-section {
        padding: 20px;
    }
    
    .my-rank-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
    
    .my-rank-value {
        font-size: 2rem;
    }
    
    .my-rank-stats {
        gap: 32px;
    }
}

/* 手机设备 */
@media (max-width: 480px) {
    .leaderboard-page {
        padding: 70px 0 30px;
    }
    
    .leaderboard-page .container {
        padding: 0 12px;
    }
    
    .page-header {
        margin-bottom: 24px;
    }
    
    .page-title {
        font-size: 1.4rem;
        gap: 10px;
    }
    
    .page-title i {
        font-size: 1.2rem;
    }
    
    .page-subtitle {
        font-size: 0.85rem;
    }
    
    .game-tabs {
        gap: 6px;
        margin-bottom: 16px;
    }
    
    .game-tab {
        padding: 10px 16px;
        font-size: 0.8rem;
        border-radius: 8px;
    }
    
    .game-tab i {
        font-size: 1rem;
    }
    
    .mode-tabs {
        margin-bottom: 20px;
    }
    
    .mode-tab {
        padding: 6px 14px;
        font-size: 0.75rem;
    }
    
    /* 隐藏表头 */
    .leaderboard-header {
        display: none;
    }
    
    /* 列表项改为卡片式 */
    .leaderboard-section {
        background: transparent;
        border: none;
        border-radius: 0;
    }
    
    .leaderboard-item {
        grid-template-columns: 60px 1fr auto;
        grid-template-rows: auto auto;
        gap: 8px 12px;
        padding: 16px;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        margin-bottom: 8px;
    }
    
    .leaderboard-item:last-child {
        margin-bottom: 0;
    }
    
    .col-rank {
        grid-row: 1 / 3;
        align-self: center;
    }
    
    .rank-number {
        width: 48px;
        height: 48px;
        font-size: 1.1rem;
    }
    
    .col-player {
        grid-column: 2;
        grid-row: 1;
        display: flex;
        align-items: center;
        gap: 10px;
        min-width: 0;
    }
    
    .player-avatar {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .player-info {
        display: flex;
        flex-direction: column;
        gap: 2px;
        min-width: 0;
        flex: 1;
    }
    
    .player-name {
        font-size: 0.95rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .player-meta {
        font-size: 0.75rem;
        color: #64748b;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .player-id {
        font-size: 0.75rem;
    }
    
    .col-score {
        grid-column: 2;
        grid-row: 2;
        text-align: left;
        font-size: 1.1rem;
    }
    
    .col-date,
    .col-time {
        grid-column: 3;
        grid-row: 1 / 3;
        align-self: center;
        font-size: 0.75rem;
        writing-mode: vertical-rl;
        text-orientation: mixed;
    }
    
    .my-rank-section {
        margin-top: 24px;
        padding: 16px;
    }
    
    .my-rank-header {
        font-size: 1rem;
        margin-bottom: 16px;
    }
    
    .my-rank-content {
        flex-direction: column;
        text-align: center;
    }
    
    .my-rank-info {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        width: 100%;
    }
    
    .my-rank-avatar {
        width: 56px;
        height: 56px;
        font-size: 1.5rem;
        flex-shrink: 0;
    }
    
    .my-rank-details {
        flex: 1;
        min-width: 0;
        text-align: left;
    }
    
    .my-rank-name {
        font-size: 1rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .my-rank-position {
        font-size: 0.8rem;
    }
    
    .my-rank-value {
        font-size: 2rem;
    }
    
    .my-rank-stats {
        gap: 24px;
        width: 100%;
        justify-content: center;
    }
    
    .btn-primary {
        padding: 12px 24px;
        font-size: 0.9rem;
    }
}

/* 超小屏幕 */
@media (max-width: 360px) {
    .game-tab {
        padding: 8px 12px;
        font-size: 0.75rem;
    }
    
    .leaderboard-item {
        padding: 12px;
    }
    
    .rank-number {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
    
    .player-avatar {
        width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .player-name {
        font-size: 0.9rem;
    }
    
    .col-score {
        font-size: 1rem;
    }
}

/* ==================== 自定义光标支持 - 全局隐藏系统光标 ==================== */
body.custom-cursor-active .game-tab,
body.custom-cursor-active .mode-tab,
body.custom-cursor-active .search-clear,
body.custom-cursor-active .btn-primary {
    cursor: none !important;
}
