/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Microsoft YaHei', Arial, sans-serif;
}

body {
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    position: relative;
}

.nav-bar {
    position: absolute;
    top: 1rem;
    left: 2rem;
}

.back-link {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.back-link:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateX(-3px);
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

/* 容器布局 */
.container {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .container {
        grid-template-columns: 1fr;
    }
}

/* 模拟区域样式 */
.simulation-container {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.simulation {
    width: 100%;
    height: 300px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

#wave-canvas {
    width: 100%;
    height: 250px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f8f9fa;
}

.wave-info {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin-top: 1rem;
    padding: 0.5rem;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.info-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
}

.info-item span:first-child {
    font-weight: bold;
    color: #666;
}

.info-item span:last-child {
    color: #3498db;
    font-weight: bold;
}

/* 控制按钮 */
.controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

button {
    padding: 0.75rem 1.5rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

button:hover {
    background-color: #2980b9;
}

button:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

#reset-btn {
    background-color: #95a5a6;
}

#reset-btn:hover {
    background-color: #7f8c8d;
}

/* 波动模式控制 */
.wave-mode-controls {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 4px;
    width: 100%;
    justify-content: center;
}

.wave-mode-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.wave-mode-controls label:hover {
    background-color: #e9ecef;
}

.wave-mode-controls input[type="radio"] {
    margin: 0;
}

/* 参数设置区域 */
.parameters {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.parameter {
    margin-bottom: 1.5rem;
}

.parameter label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.parameter input[type="range"] {
    width: 100%;
    margin-bottom: 0.5rem;
}

.parameter span {
    font-weight: bold;
    color: #3498db;
}

/* 物理量显示区域 */
.physics-values {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.physics-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.physics-value:last-child {
    border-bottom: none;
}

.physics-value span:first-child {
    color: #666;
    font-weight: 500;
}

.physics-value span:last-child {
    color: #3498db;
    font-weight: bold;
}

/* 图表容器 */
.charts-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

@media (max-width: 1024px) {
    .charts-container {
        grid-template-columns: 1fr;
    }
}

.chart-wrapper {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-wrapper h3 {
    text-align: center;
    margin-bottom: 1rem;
    color: #555;
}

canvas {
    width: 100% !important;
    height: 300px !important;
}

/* 教学内容区域 */
.explanation {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.explanation h2 {
    color: #2c3e50;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.explanation h3 {
    color: #34495e;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.explanation p, .explanation ul {
    margin-bottom: 1rem;
    color: #555;
}

.explanation ul {
    padding-left: 2rem;
}

.explanation li {
    margin-bottom: 0.5rem;
}

.key-concepts, .key-formulas, .thinking-questions, .applications {
    margin-bottom: 2rem;
}

.formula {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    border-left: 4px solid #3498db;
}

.formula p {
    margin-bottom: 0.5rem;
    font-family: 'Courier New', monospace;
}

/* 知识检测区域 */
.interactive-quiz {
    background-color: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.interactive-quiz h2 {
    color: #2c3e50;
    border-bottom: 2px solid #e74c3c;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.quiz-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.quiz-question {
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #f39c12;
}

.quiz-question label {
    display: block;
    margin-bottom: 1rem;
    font-weight: 500;
    color: #555;
}

.quiz-question input[type="number"],
.quiz-question select {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-right: 1rem;
    font-size: 1rem;
}

.quiz-question button {
    background-color: #e74c3c;
    padding: 0.5rem 1rem;
}

.quiz-question button:hover {
    background-color: #c0392b;
}

.quiz-question span {
    margin-left: 1rem;
    font-weight: bold;
}

.quiz-question span.correct {
    color: #27ae60;
}

.quiz-question span.incorrect {
    color: #e74c3c;
}

/* 页脚 */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    main {
        padding: 1rem;
    }
    
    .container {
        gap: 1rem;
    }
    
    .charts-container {
        gap: 1rem;
    }
    
    .controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .wave-mode-controls {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .info-item {
        font-size: 0.8rem;
    }
    
    .quiz-question {
        padding: 1rem;
    }
    
    .quiz-question input[type="number"],
    .quiz-question select {
        width: 100%;
        margin-bottom: 1rem;
        margin-right: 0;
    }
    
    .quiz-question button {
        width: 100%;
    }
}

/* 动画效果 */
.transition {
    transition: all 0.3s ease;
}

.hover-effect:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.loading {
    animation: pulse 1.5s infinite;
} 