/* 全局样式 */
* {
    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: 350px;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1rem;
}

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

.vector-legend {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1rem;
}

.vector-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.vector-color {
    width: 20px;
    height: 3px;
}

.vector-color.velocity {
    background-color: #2ecc71;
}

.vector-color.acceleration {
    background-color: #e74c3c;
}

/* 控制按钮 */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
    justify-content: center;
    align-items: center;
}

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;
}

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

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

.toggle-controls {
    display: flex;
    gap: 1.5rem;
    margin-left: 1rem;
}

.toggle-controls label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* 参数设置区域 */
.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;
    position: relative;
}

.parameter label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

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

.sync-note {
    font-size: 0.8rem;
    color: #7f8c8d;
    margin-top: 0.25rem;
}

/* 物理量显示区域 */
.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;
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

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

/* 图表区域 */
.charts-container {
    display: grid;
    grid-template-columns: repeat(3, 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);
}

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

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

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

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

.key-concepts, .key-formulas, .thinking-questions, .applications {
    margin-top: 1.5rem;
}

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

.formula p {
    margin-bottom: 0.5rem;
}

.formula p:last-child {
    margin-bottom: 0;
}

/* 交互式测验 */
.interactive-quiz {
    background-color: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.drag-drop-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin: 1.5rem 0;
}

.formulas-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.formula-item {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    cursor: grab;
    user-select: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.formula-item:active {
    cursor: grabbing;
}

.targets-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.target-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    background-color: #f8f9fa;
}

.drop-zone {
    min-width: 150px;
    min-height: 40px;
    border: 2px dashed #bdc3c7;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
}

.drop-zone.filled {
    border-style: solid;
    border-color: #2ecc71;
    background-color: #eafaf1;
}

#check-answers-btn {
    margin-top: 1rem;
    background-color: #2ecc71;
}

#check-answers-btn:hover {
    background-color: #27ae60;
}

#quiz-result {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 4px;
    text-align: center;
    font-weight: bold;
}

#quiz-result.correct {
    background-color: #eafaf1;
    color: #27ae60;
}

#quiz-result.incorrect {
    background-color: #fdedeb;
    color: #e74c3c;
}

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