/* ==========================================================================
   排行榜页面专用样式 (page-ranking.css)
   优化布局和视觉效果
   ========================================================================== */

/* 页面整体布局优化 */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 页面标题区域优化 */
.page-header {
    margin-bottom: 3rem;
    padding: 2.5rem 2rem;
    background: var(--gradient-bg-light);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-text {
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect width="100" height="100" fill="none"/><circle cx="20" cy="20" r="2" fill="rgba(147, 51, 234, 0.1)"/><circle cx="80" cy="20" r="2" fill="rgba(147, 51, 234, 0.1)"/><circle cx="50" cy="50" r="2" fill="rgba(147, 51, 234, 0.1)"/><circle cx="20" cy="80" r="2" fill="rgba(147, 51, 234, 0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(147, 51, 234, 0.1)"/></svg>') repeat;
    background-size: 100px 100px;
    opacity: 0.3;
}

.page-header h2 {
    color: var(--color-primary);
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.2rem;
    position: relative;
    z-index: 1;
    margin: 0;
}

/* 子区域标题样式优化 */
.overall-ranking .page-header,
.level-rankings .page-header {
    margin-bottom: 2rem;
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, rgba(147, 51, 234, 0.05) 0%, rgba(147, 51, 234, 0.1) 100%);
    border-radius: 15px;
    border-left: 5px solid var(--color-primary);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.05);
}

.overall-ranking .page-header h3,
.level-rankings .page-header h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
    margin: 0;
    position: relative;
}

.overall-ranking .page-header h3::after,
.level-rankings .page-header h3::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 3px;
}

/* 刷新按钮样式 */
#refresh-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

#refresh-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.fa-spin {
    animation: spin 1s linear infinite;
}

/* 综合排行榜区域优化 */
.overall-ranking {
    margin-bottom: 3rem;
}

/* 综合排行榜表格容器样式 - 增强视觉效果 */
.overall-ranking .div-table-container {
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.15);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.overall-ranking .div-table-container:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(147, 51, 234, 0.2);
}

/* 综合排行榜表格样式 - 增强样式 */
.overall-ranking .div-table {
    border-radius: 0;
    box-shadow: none;
    border: none;
    background: transparent;
    width: 100%;
}

/* 综合排行榜表头样式 - 增强 */
.overall-ranking .div-table-header .div-table-row {
    background: var(--gradient-primary);
    border-radius: 0;
    box-shadow: 0 4px 10px rgba(147, 51, 234, 0.2);
}

/* 综合排行榜表头单元格样式 */
.overall-ranking .div-table-header .div-table-cell {
    font-size: 1.2rem;
    font-weight: 700;
    padding: 1.5rem 0.8rem;
    letter-spacing: 0.5px;
}

/* 综合排行榜数据行样式 */
.overall-ranking .div-table-body .div-table-row {
    border-bottom: 1px solid rgba(147, 51, 234, 0.1);
    transition: all 0.2s ease;
}

.overall-ranking .div-table-body .div-table-row:hover {
    background: rgba(147, 51, 234, 0.05);
    transform: scale(1.01);
}

/* 综合排行榜前三名特殊样式 */
.overall-ranking .div-table-body .div-table-row.top-three {
    background: linear-gradient(90deg, rgba(255, 215, 0, 0.05) 0%, rgba(147, 51, 234, 0.05) 100%);
    position: relative;
}

.overall-ranking .div-table-body .div-table-row.top-three::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 5px;
    background: var(--gradient-primary);
}

/* 综合排行榜数据单元格样式 */
.overall-ranking .div-table-body .div-table-cell {
    padding: 1.3rem 0.8rem;
    font-size: 1.1rem;
}

/* 综合排行榜排名图标彩色样式 */
.overall-ranking .rank-cell i {
    font-size: 2.2rem;
    display: block;
    margin: 0 auto;
    animation: pulse 2s infinite;
}

/* 金色奖杯 - 第一名 */
.overall-ranking .rank-cell .gold { 
    color: #FFD700; 
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
}

/* 银色奖牌 - 第二名 */
.overall-ranking .rank-cell .silver { 
    color: #E5E5E5; 
    text-shadow: 0 0 15px rgba(229, 229, 229, 0.8), 0 0 25px rgba(192, 192, 192, 0.5);
    background: linear-gradient(45deg, #E5E5E5, #B8B8B8, #E5E5E5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(192, 192, 192, 0.8));
}

/* 铜色奖牌 - 第三名 */
.overall-ranking .rank-cell .bronze { 
    color: #CD7F32; 
    text-shadow: 0 0 15px rgba(205, 127, 50, 0.8), 0 0 25px rgba(205, 127, 50, 0.5);
    background: linear-gradient(45deg, #CD7F32, #B87333, #CD7F32);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 8px rgba(205, 127, 50, 0.8));
}

/* 添加彩色动画效果 */
@keyframes colorPulse {
    0% { 
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
        transform: scale(1);
    }
    50% { 
        filter: drop-shadow(0 0 15px rgba(255, 215, 0, 1));
        transform: scale(1.1);
    }
    100% { 
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.8));
        transform: scale(1);
    }
}

.overall-ranking .rank-cell .gold {
    animation: colorPulse 2s infinite;
}

.overall-ranking .rank-cell .silver {
    animation: colorPulse 2s infinite 0.3s;
}

.overall-ranking .rank-cell .bronze {
    animation: colorPulse 2s infinite 0.6s;
}

/* 综合排行榜徽章样式增强 */
.overall-ranking .badge {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
}

.card {
    background: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.1);
    overflow: hidden;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(147, 51, 234, 0.2);
}

.card-header {
    background: var(--gradient-primary);
    color: var(--text-light);
    padding: 1.5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.card-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--color-primary-light), var(--color-accent), var(--color-primary-light));
    background-size: 200% 100%;
    animation: gradient 3s ease infinite;
}

.card-header h3 {
    margin: 0;
    font-size: 1.5rem;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
}

.card-body {
    padding: 2rem;
}

/* Div表格样式优化 - 使用Flexbox确保完美对齐 */
.div-table-container {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.05);
    margin-bottom: 1rem;
    width: 100%;
}

.div-table {
    min-width: 710px; /* 80+200+150+150+130 = 710px */
    width: 100%;
}

/* 表格行样式 */
.div-table-row {
    display: flex;
    width: 100%;
    border-bottom: 1px solid var(--border-color);
}

.div-table-header .div-table-row {
    background: var(--gradient-primary);
    border-radius: 15px 15px 0 0;
}

.div-table-body .div-table-row:last-child {
    border-bottom: none;
}

.div-table-body .div-table-row:hover {
    background: var(--bg-hover);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

/* 表格单元格样式 */
.div-table-cell {
    padding: 1.2rem 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 表头单元格样式 */
.header-cell {
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
}

/* 各列的宽度和对齐方式 */
.rank-cell {
    width: 20%;
    text-align: center;
    justify-content: center;
}

.username-cell {
    width: 20%;
    text-align: left;
    justify-content: flex-start;
    padding-left: 1.2rem;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.speed-cell {
    width: 20%;
    text-align: center;
    justify-content: center;
}

.accuracy-cell {
    width: 20%;
    text-align: center;
    justify-content: center;
}

.count-cell {
    width: 20%;
    text-align: center;
    justify-content: center;
}

/* 前三名特殊样式 */
.div-table-body .div-table-row.top-three {
    background: rgba(147, 51, 234, 0.05);
    position: relative;
}

.div-table-body .div-table-row.top-three::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
}

/* 保留原有的表格样式以防其他地方使用 */
.table-container {
    overflow-x: auto;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.05);
    margin-bottom: 1rem;
    width: 100%;
}

/* 确保表格在所有情况下都对齐 */
.ranking-table {
    /* 强制表格使用固定宽度 */
    width: 710px !important; /* 100+250+120+120+120 = 710px */
    min-width: 710px !important;
    max-width: 710px !important;
}

/* 确保表格容器不会影响表格宽度 */
.table-container .ranking-table {
    width: 710px !important;
    min-width: 710px !important;
    max-width: 710px !important;
}

/* 表头样式 */
.table th {
    background: var(--gradient-primary);
    color: var(--text-light);
    font-weight: bold;
    font-size: 1.1rem;
    position: relative;
    white-space: nowrap; /* 防止表头换行 */
    overflow: hidden;
    text-overflow: ellipsis; /* 文本溢出显示省略号 */
    height: auto;
    line-height: 1.4;
    /* 确保表头使用相同的盒子模型 */
    box-sizing: border-box;
    /* 确保表头不会影响对齐 */
    border-top: none;
    border-left: none;
    border-right: none;
}

/* 设置每列的宽度 - 使用固定像素值确保对齐 */
/* 使用更精确的宽度控制，确保表头和内容完全对齐 */
.table th:nth-child(1),
.table td:nth-child(1) { 
    width: 100px; /* 排名列 */
    min-width: 100px;
    max-width: 100px;
}

.table th:nth-child(2),
.table td:nth-child(2) { 
    width: 250px; /* 用户名列 */
    min-width: 250px;
    max-width: 250px;
}

.table th:nth-child(3),
.table td:nth-child(3) { 
    width: 120px; /* 速度列 */
    min-width: 120px;
    max-width: 120px;
}

.table th:nth-child(4),
.table td:nth-child(4) { 
    width: 120px; /* 准确率列 */
    min-width: 120px;
    max-width: 120px;
}

.table th:nth-child(5),
.table td:nth-child(5) { 
    width: 120px; /* 练习次数列 */
    min-width: 120px;
    max-width: 120px;
}

.table th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover {
    background: var(--bg-hover);
    transform: scale(1.01);
    transition: all 0.2s ease;
}

.table tr.top-three {
    background: rgba(147, 51, 234, 0.05);
    position: relative;
}

.table tr.top-three::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gradient-primary);
}

/* 排名样式优化 */
.rank {
    font-weight: bold;
    font-size: 1.2rem;
    text-align: center;
}

.rank i {
    font-size: 2rem;
    display: block;
    margin: 0 auto;
    animation: pulse 2s infinite;
}

/* 金色奖杯 - 第一名 */
.rank .gold { 
    color: #FFD700; 
    text-shadow: 0 0 15px rgba(255, 215, 0, 0.8), 0 0 25px rgba(255, 215, 0, 0.5);
    background: linear-gradient(45deg, #FFD700, #FFA500, #FFD700);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7));
}

/* 银色奖牌 - 第二名 */
.rank .silver { 
    color: #E5E5E5; 
    text-shadow: 0 0 15px rgba(229, 229, 229, 0.8), 0 0 25px rgba(192, 192, 192, 0.5);
    background: linear-gradient(45deg, #E5E5E5, #B8B8B8, #E5E5E5);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(192, 192, 192, 0.7));
}

/* 铜色奖牌 - 第三名 */
.rank .bronze { 
    color: #CD7F32; 
    text-shadow: 0 0 15px rgba(205, 127, 50, 0.8), 0 0 25px rgba(205, 127, 50, 0.5);
    background: linear-gradient(45deg, #CD7F32, #B87333, #CD7F32);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 5px rgba(205, 127, 50, 0.7));
}

/* 添加彩色动画效果 */
@keyframes colorPulse {
    0% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
    50% { filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.9)); }
    100% { filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.7)); }
}

.rank .gold {
    animation: colorPulse 2s infinite;
}

.rank .silver {
    animation: colorPulse 2s infinite 0.3s;
}

.rank .bronze {
    animation: colorPulse 2s infinite 0.6s;
}

/* 徽章样式优化 */
.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    text-align: center;
    min-width: 60px;
}

.badge-success {
    background: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
    border: 1px solid rgba(40, 167, 69, 0.2);
}

.badge-primary {
    background: rgba(147, 51, 234, 0.1);
    color: var(--color-primary);
    border: 1px solid rgba(147, 51, 234, 0.2);
}

.username {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--text-main);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
    display: block;
}

/* 级别排行榜区域优化 */
.level-rankings {
    margin-bottom: 3rem;
}

.level-rankings .page-header {
    margin-bottom: 2rem;
    padding: 2rem;
}

.level-rankings .page-header h3 {
    font-size: 2rem;
}

.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

/* 级别卡片优化 - 增强视觉效果 */
.level-ranking-card {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(147, 51, 234, 0.15);
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.level-ranking-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--gradient-primary);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.level-ranking-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at top right, rgba(147, 51, 234, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.level-ranking-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(147, 51, 234, 0.25);
}

.level-ranking-card:hover::before {
    transform: scaleX(1);
}

.level-ranking-card:hover::after {
    opacity: 1;
}

.level-ranking-card h4 {
    color: var(--color-primary);
    font-size: 1.5rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.level-ranking-card h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: var(--gradient-primary);
    border-radius: 4px;
}

.level-ranking-list {
    margin-bottom: 1.5rem;
}

.level-ranking-item {
    display: flex;
    align-items: center;
    padding: 1.2rem;
    border-bottom: 1px solid rgba(147, 51, 234, 0.1);
    transition: all 0.3s ease;
    border-radius: 12px;
    margin-bottom: 0.8rem;
    position: relative;
    overflow: hidden;
}

.level-ranking-item:last-child {
    border-bottom: none;
}

.level-ranking-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.level-ranking-item:hover {
    background: rgba(147, 51, 234, 0.05);
    transform: translateX(8px);
    box-shadow: 0 5px 15px rgba(147, 51, 234, 0.1);
}

.level-ranking-item:hover::before {
    width: 4px;
}

.level-ranking-item.first-place {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.1) 0%, rgba(147, 51, 234, 0.05) 100%);
    border-radius: 12px;
    padding: 1.2rem;
    margin-bottom: 0.8rem;
    border: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.1);
}

.level-ranking-item.first-place::before {
    width: 4px;
    background: linear-gradient(to bottom, #FFD700, #FFA500);
}

.rank-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-muted);
    font-weight: bold;
    margin-right: 1rem;
    flex-shrink: 0;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.level-ranking-item:hover .rank-badge {
    background: var(--color-primary);
    color: var(--text-light);
    transform: scale(1.1);
}

.rank-badge i {
    color: #FFD700;
    font-size: 1.2rem;
}

.user-info {
    flex: 1;
}

.user-info .username {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.stats {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
}

.wpm {
    color: var(--color-success);
    font-weight: 600;
    background: rgba(40, 167, 69, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.accuracy {
    color: var(--color-primary);
    font-weight: 600;
    background: rgba(147, 51, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 10px;
}

.no-data {
    text-align: center;
    color: var(--text-muted);
    padding: 2rem;
    font-size: 1.1rem;
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data p {
    margin: 0.5rem 0;
}

.no-data-tip {
    font-size: 0.9rem;
    font-style: italic;
    opacity: 0.7;
}

/* 页面标题图标样式 */
.page-header h2 i,
.page-header h3 i {
    margin-right: 0.5rem;
    color: var(--color-primary);
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(147, 51, 234, 0.1);
    border-radius: 50%;
    border-top-color: var(--color-primary);
    animation: spin 1s ease-in-out infinite;
}

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

/* 表格行悬停效果增强 */
.table tbody tr {
    position: relative;
    transition: all 0.2s ease;
}

.table tbody tr::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: var(--gradient-primary);
    transition: width 0.3s ease;
}

.table tbody tr:hover::after {
    width: 100%;
}

/* 确保表格在所有情况下都对齐 */
.ranking-table {
    /* 强制表格使用固定宽度 */
    width: 710px !important; /* 100+250+120+120+120 = 710px */
    min-width: 710px !important;
    max-width: 710px !important;
}

/* 确保表格容器不会影响表格宽度 */
.table-container .ranking-table {
    width: 710px !important;
    min-width: 710px !important;
    max-width: 710px !important;
}

/* 按钮样式优化 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.btn-primary {
    background: var(--gradient-primary);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(147, 51, 234, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-hover);
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(147, 51, 234, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}



/* 响应式优化 */
@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .table-container {
        margin: 0 -1rem; /* 扩展到容器边缘 */
        padding: 0 1rem; /* 添加内边距 */
    }
    
    .table {
        min-width: 600px; /* 减小最小宽度 */
    }
    
    .table th,
    .table td {
        padding: 0.8rem 0.5rem;
        font-size: 0.9rem;
    }
    
    /* 调整移动端列宽 */
    .table th:nth-child(1),
    .table td:nth-child(1) { 
        width: 80px; 
        min-width: 80px;
        max-width: 80px;
    }
    
    .table th:nth-child(2),
    .table td:nth-child(2) { 
        width: 200px; 
        min-width: 180px;
        max-width: 220px;
    }
    
    .table th:nth-child(3),
    .table td:nth-child(3) { 
        width: 100px; 
        min-width: 90px;
        max-width: 110px;
    }
    
    .table th:nth-child(4),
    .table td:nth-child(4) { 
        width: 100px; 
        min-width: 90px;
        max-width: 110px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) { 
        width: 100px; 
        min-width: 90px;
        max-width: 110px;
    }
    
    .rank i {
        font-size: 1.3rem;
    }
    
    .badge {
        padding: 0.3rem 0.5rem;
        font-size: 0.8rem;
        min-width: 50px;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
    
    .level-ranking-card {
        padding: 1rem;
    }
    
    .username {
        font-size: 0.9rem;
    }
    
    .stats {
        font-size: 0.8rem;
    }
    
    .wpm,
    .accuracy {
        padding: 0.1rem 0.3rem;
    }
}

@media (max-width: 480px) {
    .page-header h2 {
        font-size: 1.8rem;
    }
    
    .table-container {
        margin: 0 -1rem;
        padding: 0 0.5rem;
    }
    
    .table {
        min-width: 550px; /* 进一步减小最小宽度 */
    }
    
    .table th,
    .table td {
        padding: 0.6rem 0.3rem;
        font-size: 0.8rem;
    }
    
    /* 进一步调整超小屏幕列宽 */
    .table th:nth-child(1),
    .table td:nth-child(1) { 
        width: 70px; 
        min-width: 70px;
        max-width: 70px;
    }
    
    .table th:nth-child(2),
    .table td:nth-child(2) { 
        width: 180px; 
        min-width: 160px;
        max-width: 200px;
    }
    
    .table th:nth-child(3),
    .table td:nth-child(3) { 
        width: 90px; 
        min-width: 80px;
        max-width: 100px;
    }
    
    .table th:nth-child(4),
    .table td:nth-child(4) { 
        width: 90px; 
        min-width: 80px;
        max-width: 100px;
    }
    
    .table th:nth-child(5),
    .table td:nth-child(5) { 
        width: 90px; 
        min-width: 80px;
        max-width: 100px;
    }
    
    .rank i {
        font-size: 1.2rem;
    }
    
    .badge {
        padding: 0.2rem 0.4rem;
        font-size: 0.75rem;
        min-width: 45px;
    }
}

/* 动画效果 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@keyframes gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}