* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #2c3e50;
}

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

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2rem;
    font-weight: 300;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 30px;
    align-items: start;
}

.canvas-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 20px;
    position: relative;
}

#robotCanvas {
    width: 100%;
    height: auto;
    border-radius: 8px;
    background: #f8f9fa;
    display: block;
}

.controls-overlay {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.controls-overlay button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    background: #3498db;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

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

.controls-panel {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 25px;
}

.controls-panel h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.2rem;
    font-weight: 400;
}

.joint-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.joint-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.joint-control label {
    min-width: 80px;
    font-size: 14px;
    color: #555;
}

.joint-control input[type="range"] {
    flex: 1;
    min-width: 120px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    outline: none;
    -webkit-appearance: none;
}

.joint-control input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
}

.joint-control input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

.reset-joint {
    padding: 4px 8px;
    border: 1px solid #bdc3c7;
    border-radius: 4px;
    background: white;
    color: #7f8c8d;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s;
}

.reset-joint:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

.info-panel {
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #ecf0f1;
}

.info-panel h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1rem;
    font-weight: 400;
}

.info-panel p {
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    h1 {
        font-size: 1.5rem;
        margin-bottom: 20px;
    }
    
    .main-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .canvas-container {
        padding: 15px;
    }
    
    #robotCanvas {
        height: 300px;
    }
    
    .controls-panel {
        padding: 20px;
    }
    
    .joint-control {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .joint-control label {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.3rem;
    }
    
    #robotCanvas {
        height: 250px;
    }
    
    .controls-overlay button {
        padding: 6px 12px;
        font-size: 12px;
    }
}