/* 全局样式 */
* {
    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: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

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

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

@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 1fr;
        height: auto;
    }
}

/* 3D场景容器 */
.scene-container {
    background-color: white;
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

#three-container {
    width: 100%;
    height: 500px;
    border-radius: 4px;
    overflow: hidden;
    background: linear-gradient(to bottom, #87CEEB 0%, #98FB98 100%);
}

/* 视角控制按钮 */
.view-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.view-btn {
    padding: 0.5rem 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.view-btn:hover {
    background-color: #f0f0f0;
}

.view-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

/* 动画控制 */
.animation-controls {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 100;
}

.animation-controls button {
    padding: 0.5rem 1rem;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

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

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

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

#predict-btn {
    background-color: #e74c3c;
}

#predict-btn:hover {
    background-color: #c0392b;
}

/* 场景信息显示 */
.scene-info {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    z-index: 100;
}

.info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    min-width: 200px;
}

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

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

/* 控制面板 */
.control-panel {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
    max-height: 600px;
}

.parameter-group {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.parameter-group:last-child {
    border-bottom: none;
}

.parameter-group h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.parameter {
    margin-bottom: 1.5rem;
}

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

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

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

/* 复选框组 */
.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.checkbox-group input[type="checkbox"] {
    margin: 0;
}

/* 物理量显示 */
.physics-values {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 4px;
    margin-top: 1rem;
}

.physics-values h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1rem;
}

.physics-value {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #e9ecef;
    font-size: 0.9rem;
}

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

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

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

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

@media (max-width: 1200px) {
    .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;
    font-size: 1rem;
}

canvas {
    width: 100% !important;
    height: 250px !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;
    font-size: 0.9rem;
}

/* 知识检测区域 */
.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;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s;
}

.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;
    }
    
    .main-container {
        gap: 1rem;
    }
    
    .charts-container {
        gap: 1rem;
    }
    
    .view-controls {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .animation-controls {
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .scene-info {
        font-size: 0.8rem;
        padding: 0.5rem;
    }
    
    .info-item {
        min-width: 150px;
    }
    
    .control-panel {
        max-height: none;
    }
    
    .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;
}

/* 3D场景特定样式 */
#three-container canvas {
    display: block;
    outline: none;
}

/* 滚动条样式 */
.control-panel::-webkit-scrollbar {
    width: 6px;
}

.control-panel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.control-panel::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
} 