/* 展开与折叠大挑战 - 专用样式 */
/* 基于 template-tool.html 的 CSS 变量系统 */

/* 模式选择页 */
.mode-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 32px auto;
    padding: 0 16px;
}

.mode-card {
    display: flex;
    align-items: center;
    gap: 28px;
    padding: 40px 36px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 6px solid #4facfe;
}

.mode-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.15);
}

.mode-card--learn { border-left-color: #4facfe; }
.mode-card--practice { border-left-color: #f093fb; }
.mode-card--challenge { border-left-color: #ff6b6b; }

.mode-icon {
    font-size: 4rem;
    flex-shrink: 0;
    width: 80px;
    text-align: center;
}

.mode-text {
    flex: 1;
}

.mode-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
}

.mode-desc {
    font-size: 1rem;
    color: #888;
    line-height: 1.6;
}

/* 学习模式 */
.learn-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.unfolding-3d-view {
    width: 100%;
    height: 350px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
}

.unfolding-2d-view {
    width: 100%;
    height: 350px;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 16px;
    display: none;
}

.unfolding-2d-view canvas {
    width: 100%;
    height: 100%;
}

.animate-btn-group {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-animate {
    padding: 12px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-animate--primary {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

.btn-animate--secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-animate:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.slow-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 0.9rem;
    color: #666;
}

.slow-mode-toggle input[type="checkbox"] {
    width: 44px;
    height: 24px;
    appearance: none;
    background: #ddd;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: background 0.3s;
}

.slow-mode-toggle input[type="checkbox"]:checked {
    background: #4facfe;
}

.slow-mode-toggle input[type="checkbox"]::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.slow-mode-toggle input[type="checkbox"]:checked::before {
    transform: translateX(20px);
}

.hint-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 16px;
    border-left: 4px solid #4facfe;
}

.hint-text {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.progress-bar {
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe, #00f2fe);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    font-size: 0.85rem;
    color: #888;
    text-align: center;
}

/* 练习模式 */
.practice-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.practice-2d-view {
    width: 100%;
    height: 350px;
    background: #f8f9fa;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    margin-bottom: 20px;
}

.practice-2d-view canvas {
    width: 100%;
    height: 100%;
}

.judge-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin-bottom: 20px;
}

.btn-judge {
    padding: 16px 48px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
    min-width: 160px;
}

.btn-judge--yes {
    background: linear-gradient(135deg, #11998e, #38ef7d);
    color: white;
}

.btn-judge--no {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.btn-judge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.feedback-box {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: none;
}

.feedback-box--correct {
    border-left: 4px solid #38ef7d;
}

.feedback-box--wrong {
    border-left: 4px solid #ff6b6b;
}

.feedback-text {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 12px;
}

.feedback-hint {
    font-size: 0.85rem;
    color: #888;
    line-height: 1.5;
}

.btn-next-question {
    padding: 10px 32px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-next-question:hover {
    background: #3a9aee;
}

/* 挑战模式 */
.challenge-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 16px;
}

.timer-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #ff6b6b;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-left: auto;
    position: relative;
}

.timer-circle::before {
    content: '';
    position: absolute;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 3px solid rgba(255,255,255,0.3);
}

.score-display {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    text-align: center;
    margin-bottom: 16px;
}

/* 成绩页 */
.result-container {
    max-width: 500px;
    margin: 40px auto;
    padding: 32px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    text-align: center;
}

.result-title {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #333;
}

.result-score {
    font-size: 3rem;
    font-weight: bold;
    color: #4facfe;
    margin-bottom: 8px;
}

.result-time {
    font-size: 0.95rem;
    color: #888;
    margin-bottom: 24px;
}

.result-badge {
    display: inline-block;
    padding: 8px 20px;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
    border-radius: 20px;
    font-size: 1rem;
    margin-bottom: 24px;
}

.result-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-result {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-result--primary {
    background: #4facfe;
    color: white;
}

.btn-result--secondary {
    background: #f0f0f0;
    color: #333;
}

/* 知识卡片模态框 */
.knowledge-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.knowledge-modal--active {
    display: flex;
}

.knowledge-content {
    background: white;
    border-radius: 20px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.knowledge-title {
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}

.knowledge-section {
    margin-bottom: 20px;
}

.knowledge-section h3 {
    font-size: 1.1rem;
    color: #4facfe;
    margin-bottom: 8px;
}

.knowledge-section p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
}

.knowledge-close {
    display: block;
    margin: 24px auto 0;
    padding: 10px 32px;
    background: #4facfe;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}

/* 勋章显示 */
.badge-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 12px;
    min-width: 80px;
}

.badge-item--earned {
    background: linear-gradient(135deg, #ffd89b, #195a8a);
    color: white;
}

.badge-icon {
    font-size: 2rem;
}

.badge-name {
    font-size: 0.75rem;
    text-align: center;
}

/* 响应式 */
@media (max-width: 768px) {
    .mode-cards {
        padding: 0 12px;
    }
    
    .mode-card {
        padding: 28px;
    }
    
    .mode-icon {
        font-size: 3rem;
        width: 60px;
    }
    
    .unfolding-3d-view,
    .unfolding-2d-view,
    .practice-2d-view {
        height: 280px;
    }
    
    .judge-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn-judge {
        width: 100%;
        max-width: 280px;
    }
}
