/* 练习页面样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    position: relative;
}

.back-button {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.2);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.back-button:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.05);
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 练习区域 */
.practice-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* 问题卡片 */
.problem-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.problem-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.problem-header h2 {
    color: #2c3e50;
    font-size: 1.8em;
}

.difficulty-badge {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

.problem-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: center;
}

/* 西瓜可视化 */
.watermelon-illustration {
    display: flex;
    justify-content: center;
    align-items: center;
}

.watermelon {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(4, 1fr);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.watermelon-slice {
    position: relative;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.watermelon-slice[data-fraction="2/8"] {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.watermelon-slice[data-fraction="1/8"] {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.watermelon-slice[data-fraction="0/8"] {
    background: rgba(255,255,255,0.1);
    color: #666;
}

.fraction-label {
    font-size: 0.8em;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.problem-text {
    font-size: 1.2em;
    line-height: 1.6;
}

.problem-text p {
    margin-bottom: 15px;
}

.problem-text em {
    color: #667eea;
    font-weight: bold;
    font-style: normal;
}

/* 解答区域 */
.solution-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.solution-steps h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9ff;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.step:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2em;
    flex-shrink: 0;
}

.step-content p {
    margin-bottom: 10px;
    font-size: 1.1em;
}

.fraction-display {
    font-size: 1.3em;
    margin-top: 10px;
}

.fraction {
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 10px;
    margin: 0 5px;
    font-weight: bold;
}

.final-answer {
    text-align: center;
    margin-top: 15px;
}

.answer-fraction {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 1.5em;
    font-weight: bold;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* 交互区域 */
.interactive-section {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 2px solid #f0f0f0;
}

.interactive-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.fraction-input {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    font-size: 1.1em;
}

.fraction-input label {
    min-width: 100px;
    font-weight: bold;
    color: #555;
}

.fraction-input input {
    width: 60px;
    height: 40px;
    font-size: 1.2em;
    text-align: center;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: #f8f9ff;
    transition: all 0.3s ease;
}

.fraction-input input:focus {
    outline: none;
    border-color: #764ba2;
    box-shadow: 0 0 15px rgba(102, 126, 234, 0.3);
}

.result-fraction {
    background: #667eea;
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 1.2em;
}

.calculate-btn {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
    margin-top: 20px;
}

.calculate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(76, 175, 80, 0.4);
}

.calculate-btn:active {
    transform: translateY(-1px);
}

/* 知识点总结 */
.explanation-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.explanation-section h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    font-size: 1.5em;
    text-align: center;
}

.knowledge-points {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.knowledge-point {
    background: #f8f9ff;
    padding: 25px;
    border-radius: 15px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.knowledge-point:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.knowledge-point h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2em;
}

.knowledge-point p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.formula {
    background: #667eea;
    color: white;
    padding: 10px 15px;
    border-radius: 10px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-weight: bold;
    font-size: 1.1em;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .back-button {
        position: relative;
        margin-bottom: 20px;
        transform: none;
    }
    
    .problem-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .watermelon {
        width: 250px;
        height: 250px;
    }
    
    .knowledge-points {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        gap: 15px;
    }
    
    .fraction-input {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .fraction-input label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .watermelon {
        width: 200px;
        height: 200px;
    }
    
    .fraction-label {
        font-size: 0.6em;
    }
    
    .step {
        padding: 15px;
    }
    
    .step-number {
        width: 35px;
        height: 35px;
        font-size: 1em;
    }
} 