/* 专家排行榜页面样式 */

/* 排行榜选项卡 */
.leaderboard-tabs-section {
    margin: 15px 12px;
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 5px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.leaderboard-tabs {
    display: flex;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    gap: 5px;
    padding: 2px;
}

.leaderboard-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.leaderboard-tab {
    position: relative;
    flex: 1;
    padding: 10px 5px;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    border-radius: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
    cursor: pointer;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
}

.leaderboard-tab i {
    margin-right: 5px;
    font-size: 14px;
}

.leaderboard-tab.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary-light);
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.leaderboard-tab:active:not(.active) {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--primary-light);
}

.leaderboard-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background-color: var(--primary-light);
    border-radius: 2px 2px 0 0;
}

/* 专家排行榜部分 */
.expert-leaderboard-section {
    margin: 15px 12px;
}

.section-header {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
}

.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.section-title h2 {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    align-items: center;
    position: relative;
    padding-left: 12px;
}

.section-title h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 16px;
    background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.ranking-criteria {
    font-size: 12px;
    color: var(--text-light);
    margin-left: 12px;
}

/* 添加水平弹跳动画 */
@keyframes bounce-horizontal {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(5px);
    }
}

/* TOP 3 专家卡片样式 - 重新设计 */
.top-three-container {
    margin-bottom: 20px;
    overflow: visible;
    position: relative;
    padding: 18px 0 10px;
}

.top-experts {
    display: flex;
    justify-content: center; /* 居中对齐 */
    align-items: flex-end; /* 使卡片底部对齐，创造高度落差 */
    padding: 10px 0;
    gap: 10px;
    width: 100%;
}

.top-expert-card {
    position: relative;
    background-color: var(--card-bg);
    border-radius: 14px;
    padding: 12px 8px 14px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    flex: 1;
    min-width: 0; /* 允许卡片缩小，避免内容溢出 */
    max-width: 30%; /* 控制最大宽度，避免卡片过宽 */
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* 设置不同卡片的高度，创造错落感 */
.first-place {
    z-index: 3;
    padding-top: 16px;
    padding-bottom: 20px;
    transform: translateY(-20px); /* 使第一名卡片更高 */
    max-width: 36%; /* 第一名卡片稍宽一些 */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
}

.second-place {
    z-index: 2;
    transform: translateY(-10px); /* 使第二名卡片略高 */
    padding-top: 12px;
    padding-bottom: 16px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}

.third-place {
    z-index: 1;
    padding-top: 10px;
    padding-bottom: 14px;
}

.top-expert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 14px 14px 0 0;
}

.first-place::before {
    background: linear-gradient(to right, #f59e0b, #ef4444);
    height: 6px;
}

.second-place::before {
    background: linear-gradient(to right, #64748b, #94a3b8);
}

.third-place::before {
    background: linear-gradient(to right, #b45309, #92400e);
}

.rank-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background-color: #ef4444;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.2);
    border: 2px solid white;
    z-index: 4;
}

.first-place .rank-badge {
    width: 32px;
    height: 32px;
    font-size: 16px;
    top: -18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
    border: 3px solid white;
}

.second-place .rank-badge {
    background-color: #64748b;
    width: 28px;
    height: 28px;
    font-size: 15px;
    top: -14px;
}

.third-place .rank-badge {
    background-color: #b45309;
}

/* 头像样式 - 调整大小突出第一名 */
.expert-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background-color: #4187f7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 10px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-left: auto;
    margin-right: auto;
}

.first-place .expert-avatar {
    width: 58px;
    height: 58px;
    font-size: 24px;
    margin-bottom: 12px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.second-place .expert-avatar {
    width: 50px;
    height: 50px;
    font-size: 20px;
}

.expert-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 4px;
}

/* 专家名称样式 - 完全移除省略号，允许完整显示 */
.expert-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    text-align: center;
    width: 100%;
    margin: 0 0 8px;
    line-height: 1.3;
    white-space: normal; /* 允许换行 */
    word-break: break-word; /* 允许在单词内换行 */
    overflow: visible; /* 内容可见 */
    display: block;
    min-height: 36px; /* 确保足够的高度容纳两行文本 */
}

.first-place .expert-name {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 10px;
}

.second-place .expert-name {
    font-size: 15px;
    font-weight: 650;
    margin: 0 0 8px;
}

/* 标签样式优化 - 确保标签不换行 */
.expert-tags-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin: 0 0 10px;
    gap: 6px; /* 增加标签间距 */
    flex-wrap: nowrap; /* 防止标签换行 */
}

.expert-tag {
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap; /* 防止标签内容换行 */
    flex-shrink: 1; /* 允许标签缩小以适应空间 */
    min-width: 0; /* 允许标签缩小 */
}

.first-place .expert-tag {
    font-size: 12px;
    padding: 3px 8px;
}

/* 统一标签样式 */
/* 命中率标签样式 - 统一使用红色 */
.expert-tag-hit {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* 连红标签样式 - 统一使用橙色 */
.expert-tag-streak {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

/* 保留其他标签样式类以向后兼容 */
.expert-tag-red {
    background-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.expert-tag-blue {
    background-color: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.expert-tag-orange {
    background-color: rgba(249, 115, 22, 0.1);
    color: #f97316;
    border: 1px solid rgba(249, 115, 22, 0.2);
}

.expert-tag-purple {
    background-color: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
    border: 1px solid rgba(139, 92, 246, 0.2);
}

.expert-tag-green {
    background-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

/* 统计数据样式优化 - 确保命中率和推荐数居中对齐 */
.expert-stats {
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 16px; /* 减小间距 */
    margin-top: 2px;
}

.first-place .expert-stats {
    gap: 20px; /* 第一名卡片稍大一点的间距 */
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #ef4444;
    line-height: 1.2;
}

.first-place .stat-value {
    color: #ef4444;
    font-size: 20px;
}

.second-place .stat-value {
    font-size: 18px;
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 2px;
}

.first-place .stat-label {
    font-size: 12px;
}

/* 隐藏近期趋势 */
.expert-trend-mini {
    display: none;
}

.expert-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    border-radius: 14px;
}

/* 排名列表标题 */
.ranking-list-header {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background-color: var(--card-bg);
    border-radius: 10px 10px 0 0;
    margin-bottom: 2px;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
}

.ranking-header-rank {
    width: 28px;
    text-align: center;
    margin-left: 2px;
}

.ranking-header-expert {
    flex: 2;
    padding-left: 50px;
}

.ranking-header-hitrate {
    flex: 1;
    text-align: center;
}

.ranking-header-rec {
    flex: 1;
    text-align: center;
}

/* 其他专家排名列表 */
.expert-ranking-list {
    margin-bottom: 20px;
}

.expert-ranking-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background-color: var(--card-bg);
    border-radius: 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.expert-ranking-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.expert-ranking-item:active {
    transform: scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.rank-number {
    width: 26px;
    height: 26px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    margin-left: 2px;
}

/* 不同排名的颜色样式 */
.rank-4 {
    background: linear-gradient(135deg, #4187f7, #3671cf);
    color: white;
}

.rank-5 {
    background: linear-gradient(135deg, #5295f8, #3f7ad7);
    color: white;
}

.rank-6 {
    background: linear-gradient(135deg, #64a3fa, #4d8ae0);
    color: white;
}

.rank-7, .rank-8, .rank-9 {
    background: linear-gradient(135deg, #76b1fc, #5c98e8);
    color: white;
}

.rank-10, .rank-11, .rank-12 {
    background: linear-gradient(135deg, #88bffe, #6ba6f0);
    color: white;
}

.rank-13, .rank-14, .rank-15 {
    background: linear-gradient(135deg, #9acbfe, #7cb3f6);
    color: white;
}

.rank-16, .rank-17, .rank-18, .rank-19, .rank-20 {
    background: linear-gradient(135deg, #add9ff, #8ec1fa);
    color: white;
}

.rank-21, .rank-22, .rank-23, .rank-24, .rank-25, 
.rank-26, .rank-27, .rank-28, .rank-29, .rank-30 {
    background: linear-gradient(135deg, #c0e3ff, #a0cffc);
    color: white;
}

.expert-info-compact {
    display: flex;
    flex: 2;
    min-width: 0;
    gap: 10px;
    align-items: center;
    padding: 0 10px;
}

.expert-avatar-small {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #4187f7;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

.expert-details {
    flex: 1;
    min-width: 0;
}

.expert-name-tag {
    display: flex;
    flex-direction: column;
    justify-content: center;
    width: 100%;
}

.expert-name-tag .expert-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 6px;
    text-align: left;
    max-width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 1;
    min-height: auto; /* 重置为自动高度 */
    color: var(--text-color);
}

.expert-tags-wrapper {
    display: flex;
    flex-wrap: nowrap;
    gap: 5px;
    overflow: hidden;
}

.expert-name-tag .expert-tag {
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 0;
    flex-shrink: 0;
    border-radius: 4px;
}

.expert-hitrate {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.hitrate-value {
    font-size: 16px;
    font-weight: 700;
    color: #ef4444;
    display: flex;
    align-items: baseline;
}

.percent {
    font-size: 12px;
    margin-left: 1px;
    opacity: 0.8;
}

.expert-recnum {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

.recnum-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-light);
}

/* 底部提示信息 */
.ranking-bottom-info {
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    padding: 20px 0;
    margin-bottom: 20px;
}

.ranking-bottom-info span {
    display: inline-block;
    padding: 8px 24px;
    background-color: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

body[data-theme="light"] .ranking-bottom-info span {
    border: 1px solid rgba(0, 0, 0, 0.07);
}

/* 浅色主题样式调整 */
body[data-theme="light"] .top-expert-card {
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body[data-theme="light"] .expert-ranking-item {
    border: 1px solid rgba(0, 0, 0, 0.07);
}

body[data-theme="light"] .ranking-list-header {
    background-color: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.07);
}

body[data-theme="light"] .leaderboard-tab.active {
    background-color: rgba(59, 130, 246, 0.15);
    color: var(--primary-dark);
}

body[data-theme="light"] .first-place .stat-value {
    color: #ef4444;
}

body[data-theme="light"] .rank-number {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 响应式调整 */
@media (min-width: 400px) {
    /* 更宽屏幕上优化卡片布局 */
    .top-experts {
        gap: 15px;
    }
    
    .top-expert-card {
        padding: 12px 10px 14px;
    }
    
    .first-place {
        transform: translateY(-24px); /* 大屏幕上增加错落感 */
        padding-top: 16px;
        padding-bottom: 20px;
    }
    
    .second-place {
        transform: translateY(-12px);
    }
    
    .expert-name {
        min-height: 40px; /* 更大屏幕上给名称更多空间 */
    }
    
    .expert-name-tag .expert-name {
        max-width: 180px;
    }
}

@media (max-width: 360px) {
    .leaderboard-tabs-section,
    .expert-leaderboard-section {
        margin: 10px 8px;
    }

    .top-experts {
        gap: 5px;
    }
    
    .top-expert-card {
        padding: 10px 4px 12px;
        max-width: 31%;
    }
    
    .first-place {
        max-width: 38%;
        transform: translateY(-16px); /* 小屏幕上调整错落感 */
        padding-top: 14px;
        padding-bottom: 16px;
    }
    
    .second-place {
        transform: translateY(-8px);
        padding-top: 12px;
        padding-bottom: 14px;
    }
    
    .expert-name {
        font-size: 12px;
        line-height: 1.2;
        margin-bottom: 4px;
        min-height: 32px;
    }
    
    .first-place .expert-name {
        font-size: 13px;
        margin-bottom: 5px;
    }
    
    /* 小屏幕上调整头像尺寸 */
    .expert-avatar {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-bottom: 5px;
    }
    
    .first-place .expert-avatar {
        width: 48px;
        height: 48px;
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .second-place .expert-avatar {
        width: 42px;
        height: 42px;
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .expert-stats {
        gap: 14px;
    }
    
    .first-place .expert-stats {
        gap: 22px;
    }
    
    .stat-value {
        font-size: 14px;
    }
    
    .first-place .stat-value {
        font-size: 16px;
    }
    
    .second-place .stat-value {
        font-size: 15px;
    }
    
    .stat-label {
        font-size: 9px;
    }
    
    /* 确保标签不换行 */
    .expert-tags-container {
        margin-bottom: 5px;
        gap: 4px;
    }
    
    .expert-tag {
        font-size: 9px;
        padding: 1px 3px;
        max-width: 50%;
    }
    
    .first-place .expert-tag {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .expert-name-tag .expert-name {
        font-size: 14px;
        max-width: 120px;
    }
    
    /* 排名徽章调整 */
    .rank-badge {
        width: 22px;
        height: 22px;
        font-size: 13px;
        top: -11px;
    }
    
    .first-place .rank-badge {
        width: 28px;
        height: 28px;
        font-size: 15px;
        top: -14px;
    }
    
    .second-place .rank-badge {
        width: 24px;
        height: 24px;
        font-size: 14px;
        top: -12px;
    }
    
    .expert-avatar-small {
        width: 32px !important;
        height: 32px !important;
        font-size: 16px !important;
        border-width: 1px;
    }
    
    .expert-name-tag .expert-name {
        font-size: 12px !important;
        margin-bottom: 4px !important;
    }
    
    .expert-name-tag .expert-tag {
        font-size: 9px !important;
        padding: 1px 4px !important;
    }
    
    .rank-number {
        width: 22px !important;
        height: 22px !important;
        font-size: 12px !important;
    }
    
    .hitrate-value, .recnum-value {
        font-size: 14px !important;
    }
    
    .percent {
        font-size: 10px !important;
    }
    
    .ranking-header-expert {
        padding-left: 40px !important;
    }
}

@media (max-width: 320px) {
    .top-experts {
        gap: 3px;
    }
    
    .top-expert-card {
        padding: 8px 2px 10px;
    }
    
    .first-place {
        transform: translateY(-12px); /* 超小屏幕调整错落感 */
        padding-top: 10px;
        padding-bottom: 12px;
    }
    
    .second-place {
        transform: translateY(-6px);
        padding-top: 8px;
        padding-bottom: 10px;
    }
    
    /* 超小屏幕头像大小 */
    .expert-avatar {
        width: 36px;
        height: 36px;
        font-size: 14px;
        margin-bottom: 4px;
    }
    
    .first-place .expert-avatar {
        width: 42px;
        height: 42px;
        font-size: 18px;
        margin-bottom: 5px;
    }
    
    .second-place .expert-avatar {
        width: 38px;
        height: 38px;
        font-size: 16px;
        margin-bottom: 4px;
    }
    
    .expert-name {
        font-size: 11px;
        line-height: 1.1;
        margin-bottom: 3px;
        min-height: 28px;
    }
    
    .first-place .expert-name {
        font-size: 11px;
        margin-bottom: 3px;
    }
    
    /* 极小屏幕标签紧凑显示 */
    .expert-tag {
        font-size: 8px;
        padding: 0px 2px;
        max-width: 50%;
    }
    
    .first-place .expert-tag {
        font-size: 9px;
        padding: 1px 3px;
    }
    
    .expert-stats {
        gap: 8px;
        margin-top: 3px;
    }
    
    .first-place .expert-stats {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 12px;
    }
    
    .first-place .stat-value {
        font-size: 13px;
    }
    
    .second-place .stat-value {
        font-size: 12px;
    }
    
    .stat-label {
        font-size: 8px;
    }
    
    .expert-tags-container {
        margin-bottom: 3px;
        gap: 2px;
    }
    
    .expert-name-tag .expert-name {
        font-size: 10px;
        max-width: 100px;
    }
    
    /* 排名徽章调整 */
    .rank-badge {
        width: 20px;
        height: 20px;
        font-size: 12px;
        top: -10px;
    }
    
    .first-place .rank-badge {
        width: 24px;
        height: 24px;
        font-size: 14px;
        top: -12px;
    }
    
    .second-place .rank-badge {
        width: 22px;
        height: 22px;
        font-size: 13px;
        top: -11px;
    }
    
    .expert-avatar-small {
        width: 28px !important;
        height: 28px !important;
        font-size: 14px !important;
    }
    
    .expert-name-tag .expert-name {
        font-size: 11px !important;
    }
    
    .hitrate-value, .recnum-value {
        font-size: 12px !important;
    }
    
    .ranking-header-expert {
        padding-left: 30px !important;
    }
} 