/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 蓝色和绿色 */
    --primary-color: #2196f3;
    --primary-light: #4caf50;
    --primary-dark: #1976d2;
    --primary-gradient: var(--primary-color);
    
    /* 辅助色 */
    --success-color: #4caf50;
    --warning-color: #ff9800;
    --error-color: #f44336;
    --info-color: #2196f3;
    
    /* 中性色 */
    --text-primary: #2c3e50;
    --text-secondary: #6c757d;
    --text-light: #95a5a6;
    --bg-primary: #f8f9fa;
    --bg-white: #ffffff;
    --bg-dark: #343a40;
    
    /* 边框和阴影 */
    --border-color: #e8f0fe;
    --border-radius: 12px;
    --border-radius-lg: 20px;
    --box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --box-shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --box-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.15);
    
    /* 过渡效果 */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #f6f9fc 0%, #eef2f6 100%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* ==================== 主容器 ==================== */
.main-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.section {
    margin-bottom: 2rem;
}

.section.hidden {
    display: none;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
    transition: var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    box-shadow: var(--box-shadow-hover);
}

.card-header {
    padding: 1.75rem 2rem;
    background: var(--primary-gradient);
    text-align: center;
    border-bottom: none;
}

.card-title {
    color: white;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.card-desc {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
}

.card-body {
    padding: 2rem;
}

/* ==================== 欢迎卡片 ==================== */
.welcome-card {
    margin: 0 auto;
}

.user-form {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition-normal);
    background: white;
    color: var(--text-primary);
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input:hover,
.form-select:hover {
    border-color: var(--primary-light);
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    text-decoration: none;
    white-space: nowrap;
}

.btn-icon {
    font-size: 1.1em;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.btn-text {
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.5rem 1rem;
}

.btn-text:hover {
    color: var(--primary-color);
}

.btn-danger {
    color: var(--error-color);
}

.btn-danger:hover {
    color: #d32f2f;
}

.btn-large {
    width: 100%;
    padding: 1.125rem 2rem;
    font-size: 1.125rem;
}

/* ==================== 训练说明 ==================== */
.instructions {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border-left: 4px solid var(--primary-color);
}

.instructions-title {
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.instructions-list {
    list-style: none;
    padding-left: 0;
}

.instructions-list li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

.instructions-list li:last-child {
    margin-bottom: 0;
}

.instructions-list li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em;
}

/* ==================== 本地存储提示 ==================== */
.local-tip {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: linear-gradient(135deg, #fff8e1 0%, #fff3cd 100%);
    border-radius: var(--border-radius);
    padding: 1.25rem;
    margin-top: 1.5rem;
    border-left: 4px solid #ffc107;
}

.tip-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.tip-content {
    flex: 1;
}

.tip-title {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.tip-text {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.6;
}

/* ==================== 游戏卡片 ==================== */
.game-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.control-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.timer-value {
    font-family: 'Courier New', monospace;
    color: var(--primary-color);
    font-size: 1.75rem;
}

/* ==================== 方格区域 ==================== */
.game-area {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 1.5rem;
}

.content-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.15);
    max-width: 600px;
    width: 100%;
    line-height: 1.6;
}

.poem-title-line {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.poem-content-line {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.8;
}

.grid {
    display: grid;
    gap: 0.75rem;
    width: 100%;
    max-width: 600px;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--border-radius-lg);
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.05);
}

.grid-cell {
    display: flex;
    justify-content: center;
    align-items: center;
    background: white;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 2px solid transparent;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    min-height: 80px;
    padding: 0.5rem;
}

.cell-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    width: 100%;
    height: 100%;
}

.order-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: linear-gradient(135deg, #e8f0fe, #e3f2fd);
    padding: 0.25rem 0.5rem;
    border-radius: 10px;
    min-width: 24px;
    text-align: center;
}

.word-text {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

.grid-cell:hover {
    transform: scale(1.03);
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.grid-cell:active {
    transform: scale(0.97);
}

.grid-cell.correct {
    background: var(--primary-gradient);
    transform: scale(0.97);
    box-shadow: 0 2px 8px rgba(33, 150, 243, 0.3);
    animation: correctPulse 0.3s ease;
}

.grid-cell.correct .order-label {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

.grid-cell.correct .word-text {
    color: white;
}

.grid-cell.star-cell {
    background: linear-gradient(135deg, #fff9c4 0%, #ffeb3b 100%);
    color: #f57f17;
    cursor: default;
    opacity: 0.8;
}

.grid-cell.star-cell:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
}

.grid-cell.star-cell:active {
    transform: none;
}

.grid-cell.poem-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.grid-cell.poem-cell .poem-info {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-align: center;
    line-height: 1.2;
}

.grid-cell.poem-cell .poem-char {
    font-weight: 700;
    color: var(--text-primary);
}

.grid-cell.poem-cell.correct .poem-info {
    color: rgba(255, 255, 255, 0.8);
}

.grid-cell.poem-cell.correct .poem-char {
    color: white;
}

.grid-cell.phrase-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.grid-cell.phrase-cell .phrase-info {
    font-size: 0.6rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    text-align: center;
    line-height: 1.2;
}

.grid-cell.phrase-cell .phrase-char {
    font-weight: 700;
    color: var(--text-primary);
}

.grid-cell.phrase-cell.correct .phrase-info {
    color: rgba(255, 255, 255, 0.8);
}

.grid-cell.phrase-cell.correct .phrase-char {
    color: white;
}

/* ==================== 结果卡片 ==================== */
.result-card {
    max-width: 700px;
    margin: 0 auto;
}

.result-header {
    text-align: center;
    padding: 2rem;
    background: var(--primary-gradient);
    color: white;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 1s ease;
}

.result-title {
    color: white;
    font-size: 2rem;
    font-weight: 700;
}

.result-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 2rem;
    background: var(--bg-primary);
}

.stat-item {
    text-align: center;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.time-highlight {
    color: var(--primary-color);
    font-family: 'Courier New', monospace;
}

.level-badge {
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    color: white;
}

.level-badge.优秀 {
    background: linear-gradient(135deg, #ffd700, #ffb900);
}

.level-badge.正常 {
    background: linear-gradient(135deg, #4caf50, #45a049);
}

.level-badge.较弱 {
    background: linear-gradient(135deg, #ff9800, #f57c00);
}

.result-feedback {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.feedback-title {
    color: var(--text-primary);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.feedback-content {
    color: var(--text-secondary);
    line-height: 1.8;
}

.feedback-content p {
    margin-bottom: 1rem;
}

.feedback-content p:last-child {
    margin-bottom: 0;
}

.feedback-content strong {
    color: var(--text-primary);
}

.result-actions {
    padding: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    border-top: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.result-actions .btn {
    flex: 1 1 45%;
    min-width: 120px;
}

/* ==================== 记录卡片 ==================== */
.records-card {
    max-width: 700px;
    margin: 0 auto;
}

.records-filter {
    padding: 1rem 2rem 0;
}

.records-filter .form-input {
    width: 100%;
}

.records-content {
    padding: 2rem;
    max-height: 500px;
    overflow-y: auto;
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.record-item {
    display: grid;
    grid-template-columns: auto 1fr 1fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: var(--border-radius);
    align-items: center;
    transition: var(--transition-normal);
}

.record-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.record-rank {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    font-weight: 700;
    color: white;
    background: var(--text-light);
}

.record-rank.rank-1 {
    background: linear-gradient(135deg, #ffd700, #ffb900);
}

.record-rank.rank-2 {
    background: linear-gradient(135deg, #c0c0c0, #a0a0a0);
}

.record-rank.rank-3 {
    background: linear-gradient(135deg, #cd7f32, #b87333);
}

.record-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.record-size {
    font-weight: 600;
    color: var(--text-primary);
}

.record-date {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.record-time {
    font-family: 'Courier New', monospace;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    text-align: left !important;
    text-align: right;
}

.records-actions {
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .main-container {
        margin: 1rem auto;
        padding: 0 1rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .game-controls {
        gap: 1rem;
    }
    
    #restartBtn,
    #backBtn {
        flex: 1;
        min-width: calc(50% - 0.5rem);
        max-width: calc(50% - 0.5rem);
    }
    
    .control-value {
        font-size: 1.25rem;
    }
    
    .timer-value {
        font-size: 1.5rem;
    }
    
    .grid {
        gap: 0.5rem;
        padding: 1rem;
    }
    
    .grid-cell {
        min-height: 60px;
        padding: 0.25rem;
    }
    
    .order-label {
        font-size: 0.65rem;
        padding: 0.15rem 0.4rem;
    }
    
    .word-text {
        font-size: 1rem;
    }
    
    .result-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.75rem;
    }

    .stat-item {
        padding: 0.5rem;
    }

    .record-item {
        grid-template-columns: auto 1fr;
        gap: 0.75rem;
    }

    .record-time {
        grid-column: 2;
        text-align: left;
    }

    .result-actions {
        flex-wrap: wrap;
        padding: 1.5rem;
    }

    .result-actions .btn {
        flex: 1 1 45%;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .local-tip {
        flex-direction: column;
        text-align: center;
    }
    
    .records-filter {
        padding: 0.75rem 1rem 0;
    }
}

@media (max-width: 480px) {
    .card-title {
        font-size: 1.125rem;
    }
    
    .card-desc {
        font-size: 0.875rem;
    }
    
    .card-body {
        padding: 1.5rem;
    }
    
    .instructions {
        padding: 1rem;
    }
    
    .content-title {
        font-size: 1rem;
        padding: 0.75rem 1rem;
    }
    
    .poem-title-line {
        font-size: 1.1rem;
    }
    
    .poem-content-line {
        font-size: 1rem;
    }
    
    .grid-cell {
        min-height: 50px;
    }
    
    .word-text {
        font-size: 0.9rem;
    }
}

/* ==================== 模态框样式 ==================== */
.records-modal,
.leaderboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(3px);
    transition: opacity var(--transition-normal);
}

.records-modal.hidden,
.leaderboard-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-lg);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: var(--primary-gradient);
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color var(--transition-fast);
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.modal-body {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    padding: 1.5rem 2rem;
    background: var(--bg-primary);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    border-top: 1px solid var(--border-color);
}

.records-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.empty {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.error {
    text-align: center;
    padding: 2rem;
    color: var(--error-color);
    font-weight: 500;
}

/* ==================== 按钮组样式 ==================== */
.btn-group {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    flex-direction: row;
}

@media (max-width: 768px) {
    .btn-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .btn-group .btn {
        width: 100%;
    }
}

/* ==================== 排行榜样式 ==================== */
.leaderboard-controls {
    margin-bottom: 1.5rem;
}

.leaderboard-content {
    margin-top: 1rem;
}

.leaderboard-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.leaderboard-modal .modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.leaderboard-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.leaderboard-modal .modal-header h3 {
    margin: 0;
}

.leaderboard-modal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.leaderboard-modal .close-btn:hover {
    color: #333;
}

.leaderboard-modal .modal-body {
    padding: 20px;
}

.leaderboard-modal .difficulty-selector {
    margin-bottom: 20px;
}

.leaderboard-modal .difficulty-selector label {
    margin-right: 10px;
}

.leaderboard-modal .difficulty-selector select {
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.leaderboard-modal .leaderboard-content {
    overflow-x: auto;
}

.leaderboard-modal .leaderboard-table {
    width: 100%;
    border-collapse: collapse;
}

.leaderboard-modal .leaderboard-table th,
.leaderboard-modal .leaderboard-table td {
    padding: 12px;
    text-align: center;
    border-bottom: 1px solid #eee;
}

.leaderboard-modal .leaderboard-table th {
    background-color: #f8f9fa;
    font-weight: bold;
}

.leaderboard-modal .rank {
    font-weight: bold;
    position: relative;
}

.leaderboard-modal .medal {
    display: inline-block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-left: 5px;
}

.leaderboard-modal .medal.medal-1 {
    background-color: #ffd700;
    box-shadow: 0 0 5px #ffd700;
}

.leaderboard-modal .medal.medal-2 {
    background-color: #c0c0c0;
    box-shadow: 0 0 5px #c0c0c0;
}

.leaderboard-modal .medal.medal-3 {
    background-color: #cd7f32;
    box-shadow: 0 0 5px #cd7f32;
}

.leaderboard-modal .user-name {
    font-weight: bold;
}

.leaderboard-modal .time {
    color: #007bff;
    font-weight: bold;
}

.leaderboard-modal .loading,
.leaderboard-modal .empty,
.leaderboard-modal .error {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.leaderboard-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}

.leaderboard-modal .btn {
    padding: 8px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.leaderboard-modal .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.leaderboard-modal .btn-secondary:hover {
    background-color: #5a6268;
}

/* 模态框动画 */
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.leaderboard-modal .modal-content,
.records-modal .modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

/* 训练记录模态框样式 */
.records-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.records-modal .modal-content {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.records-modal .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.records-modal .modal-header h3 {
    margin: 0;
}

.records-modal .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.records-modal .close-btn:hover {
    color: #333;
}

.records-modal .modal-body {
    padding: 20px;
}

.records-modal .records-list {
    margin: 0;
}

.records-modal .modal-footer {
    padding: 20px;
    border-top: 1px solid #eee;
    text-align: right;
}
