/* 训练页面基础样式 */
.training-page {
    margin-top: 70px;
}

/* 训练类型导航 */
.training-categories {
    background-color: #f1f5f9;
    padding: 30px 0;
    border-bottom: 1px solid #e2e8f0;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.category-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.category-card.active {
    border: 2px solid #3498db;
}

.category-icon {
    width: 70px;
    height: 70px;
    background-color: #e8f4fd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
}

.category-icon i {
    font-size: 2rem;
    color: #3498db;
}

.category-card h3 {
    margin-bottom: 10px;
}

.category-card p {
    color: #666;
    margin-bottom: 0;
}

/* 训练内容区域 */
.training-content {
    padding: 50px 0;
}

.training-header {
    margin-bottom: 40px;
    text-align: center;
}

.training-description {
    max-width: 800px;
    margin: 0 auto 30px;
    color: #666;
}

/* 训练卡片样式 */
.training-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.training-card {
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.training-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.training-image {
    height: 180px;
    overflow: hidden;
}

.training-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.training-details {
    padding: 25px;
}

.training-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #777;
}

.training-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 训练模块样式 */
.training-module {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 40px;
}

.module-header {
    padding: 20px 30px;
    background-color: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.module-title {
    margin-bottom: 0;
}

.module-content {
    padding: 30px;
}

/* 记忆训练游戏样式 */
.memory-game {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 15px;
    margin: 20px 0 30px;
}

.memory-card {
    aspect-ratio: 1/1;
    background-color: #3498db;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: all 0.3s ease;
    position: relative;
}

.memory-card.flipped {
    background-color: white;
    border: 2px solid #3498db;
    color: #2c3e50;
}

.memory-card.matched {
    background-color: #2ecc71;
    border-color: #2ecc71;
    color: white;
}

.memory-game {
    display: grid;
    gap: 10px;
    margin: 20px 0;
    min-height: 300px;
    perspective: 1000px;
}

.memory-card {
    aspect-ratio: 1;
    position: relative;
    cursor: pointer;
    transform-style: preserve-3d;
    transition: transform 0.5s;
}

.memory-card.flipped {
    transform: rotateY(180deg);
}

.memory-card.matched {
    transform: rotateY(180deg);
    cursor: default;
}

.memory-card .card-front,
.memory-card .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 24px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.memory-card .card-front {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: 2px solid #ddd;
}

.memory-card .card-back {
    background: white;
    border: 2px solid #ddd;
    transform: rotateY(180deg);
}

.focus-timer {
    text-align: center;
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
}

.timer-display {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.timer-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.timer-btn.start-timer {
    background-color: #28a745;
    color: white;
}

.timer-btn.start-timer:hover:not(:disabled) {
    background-color: #218838;
}

.timer-btn.start-timer:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.timer-btn.pause-timer {
    background-color: #ffc107;
    color: #212529;
}

.timer-btn.pause-timer:hover:not(:disabled) {
    background-color: #e0a800;
}

.timer-btn.pause-timer:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.timer-btn.reset-timer {
    background-color: #6c757d;
    color: white;
}

.timer-btn.reset-timer:hover {
    background-color: #5a6268;
}

.focus-task {
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.focus-task h4 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

.task-list {
    list-style-type: none;
    padding: 0;
}

.task-list li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.task-list li:last-child {
    border-bottom: none;
}

.task-list li strong {
    color: #007bff;
}

.timer-progress {
    width: 100%;
    height: 10px;
    background-color: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
    margin: 20px 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #007bff, #28a745);
    transition: width 1s linear;
}

@media (max-width: 768px) {
    .memory-card .card-back {
        font-size: 18px;
    }
}

/* 专注力训练样式 */
.focus-timer {
    text-align: center;
    margin: 30px 0;
}

.timer-display {
    font-size: 4rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 20px;
}

.timer-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
}

.timer-btn {
    padding: 10px 20px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.start-timer {
    background-color: #2ecc71;
    color: white;
}

.pause-timer {
    background-color: #f39c12;
    color: white;
}

.reset-timer {
    background-color: #e74c3c;
    color: white;
}

.focus-task {
    background-color: #f8fafc;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.focus-task h4 {
    margin-bottom: 15px;
}

.task-list {
    padding-left: 20px;
}

.task-list li {
    margin-bottom: 10px;
}

#retention-items {
    font-size: 1.3rem;
    font-weight: 500;
    color: #2c3e50;
    line-height: 1.6;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

#retention-timer {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

#retention-answer {
    width: 100%;
    padding: 15px;
    border-radius: 4px;
    border: 2px solid #e2e8f0;
    min-height: 200px;
    margin-bottom: 15px;
    font-size: 1rem;
    resize: vertical;
}

#retention-answer:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

#retention-result {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#retention-result h4 {
    margin-top: 0;
    color: #2c3e50;
}

#retention-accuracy {
    font-size: 1.5rem;
    font-weight: bold;
    color: #3498db;
}

#retention-correct {
    color: #27ae60;
    font-weight: 500;
}

#retention-missed {
    color: #e74c3c;
    font-weight: 500;
}

.image-item {
    display: inline-block;
    margin: 10px;
}

.image-option.selected {
    border-color: #3498db !important;
    background-color: #e8f4fd !important;
}

#image-selection-area {
    display: none;
    text-align: center;
}

#image-options {
    margin: 20px 0;
}

#image-instruction {
    margin-bottom: 20px;
    font-size: 1.1rem;
    color: #666;
}

@media (max-width: 768px) {
    #retention-items {
        font-size: 1.1rem;
        padding: 15px;
    }

    #retention-timer {
        font-size: 2rem;
    }

    #retention-answer {
        min-height: 150px;
    }

    .image-item,
    .image-option {
        font-size: 2rem !important;
    }

    .timer-display {
        font-size: 36px;
    }

    .timer-controls {
        flex-direction: column;
        align-items: center;
    }

    .timer-btn {
        width: 80%;
    }
}

/* 训练指南样式 */
.training-guide {
    background-color: #f8fafc;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.guide-section {
    margin-bottom: 25px;
}

.guide-section:last-child {
    margin-bottom: 0;
}

.guide-section h4 {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.guide-section p {
    margin-bottom: 10px;
}

#speed-content {
    text-align: center;
    padding: 30px;
    background-color: #f8fafc;
    border-radius: 8px;
}

#speed-instruction h4 {
    margin-bottom: 10px;
    color: #2c3e50;
}

#speed-question {
    margin: 40px 0;
    font-size: 2.5rem;
    font-weight: bold;
    color: #2c3e50;
}

#speed-num1,
#speed-num2 {
    display: inline-block;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

#color-question,
#word-question {
    display: none;
    margin: 40px 0;
}

.color-sample {
    display: inline-block;
    width: 100px;
    height: 100px;
    border-radius: 8px;
    margin: 0 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    vertical-align: middle;
}

.color-name {
    display: block;
    margin-top: 10px;
    font-size: 1.2rem;
    font-weight: 500;
}

.word-sample {
    display: inline-block;
    padding: 15px 25px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin: 0 20px;
    font-size: 1.5rem;
    font-weight: 500;
    min-width: 120px;
}

#speed-answers {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.btn.primary-btn {
    padding: 12px 24px;
    font-size: 1rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.stats-display {
    display: inline-flex;
    gap: 30px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.stat-item p {
    margin: 10px 0;
    font-size: 1.1rem;
}

.stat-item span {
    font-weight: 600;
}

#speed-correct {
    color: #27ae60;
}

#speed-wrong {
    color: #e74c3c;
}

@media (max-width: 768px) {
    #speed-question {
        font-size: 1.8rem;
    }

    #speed-num1,
    #speed-num2 {
        padding: 10px 15px;
        font-size: 1.5rem;
    }

    .color-sample {
        width: 70px;
        height: 70px;
    }

    .word-sample {
        padding: 10px 15px;
        font-size: 1.2rem;
        min-width: 100px;
    }

    #speed-answers {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .btn.primary-btn {
        width: 80%;
    }

    .stats-display {
        gap: 15px;
    }
}

/* 响应式设计 */
@media (max-width: 992px) {
    .timer-display {
        font-size: 3.5rem;
    }
}

@media (max-width: 768px) {
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .timer-display {
        font-size: 3rem;
    }

    .memory-game {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    }
}

@media (max-width: 576px) {
    .timer-display {
        font-size: 2.5rem;
    }

    .timer-controls {
        flex-wrap: wrap;
    }

    .weekly-progress {
        gap: 5px;
    }

    .day-label,
    .day-value {
        font-size: 0.7rem;
    }
}