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

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.instrument-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 1200px;
    width: 100%;
}

h1 {
    text-align: center;
    color: #667eea;
    font-size: 2.5em;
    margin-bottom: 30px;
    font-weight: 700;
}

.instrument-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.instrument-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    padding: 15px 25px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.1em;
    font-weight: 600;
}

.instrument-btn:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.instrument-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

.instrument-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    min-height: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* 钢琴样式 */
.piano {
    display: flex;
    justify-content: center;
    position: relative;
}

.piano-key {
    cursor: pointer;
    user-select: none;
    transition: all 0.1s ease;
    display: flex;
    align-items: end;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9em;
}

.white-key {
    width: 50px;
    height: 200px;
    background: white;
    border: 2px solid #ddd;
    border-radius: 0 0 8px 8px;
    margin: 0 1px;
    color: #666;
    padding-bottom: 20px;
}

.white-key:hover {
    background: #f0f0f0;
}

.white-key.active {
    background: #667eea;
    color: white;
}

.black-key {
    width: 30px;
    height: 120px;
    background: #333;
    border-radius: 0 0 5px 5px;
    position: absolute;
    color: white;
    padding-bottom: 15px;
    z-index: 2;
}

.black-key:hover {
    background: #555;
}

.black-key.active {
    background: #667eea;
}

/* 吉他样式 */
.guitar {
    width: 100%;
    max-width: 600px;
}

.guitar-neck {
    background: #8B4513;
    height: 300px;
    border-radius: 10px;
    position: relative;
    margin: 20px 0;
}

.guitar-string {
    position: absolute;
    width: 100%;
    height: 2px;
    background: #C0C0C0;
    cursor: pointer;
    transition: all 0.1s ease;
}

.guitar-string:hover {
    background: #667eea;
    height: 4px;
}

.guitar-fret {
    position: absolute;
    width: 4px;
    height: 100%;
    background: #654321;
    border-radius: 2px;
}

/* 鼓组样式 */
.drums {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 500px;
}

.drum {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: bold;
    color: white;
    transition: all 0.1s ease;
    user-select: none;
}

.drum:hover {
    transform: scale(1.05);
}

.drum:active {
    transform: scale(0.95);
}

.kick-drum {
    background: radial-gradient(circle, #8B4513, #654321);
}

.snare-drum {
    background: radial-gradient(circle, #C0C0C0, #808080);
}

.hi-hat {
    background: radial-gradient(circle, #FFD700, #DAA520);
}

.tom1 {
    background: radial-gradient(circle, #FF6B6B, #E55555);
}

.tom2 {
    background: radial-gradient(circle, #4ECDC4, #45B7B8);
}

.crash {
    background: radial-gradient(circle, #FFA500, #FF8C00);
}

/* 小提琴样式 */
.violin {
    width: 200px;
    height: 400px;
    background: #8B4513;
    border-radius: 50% 50% 30% 30%;
    position: relative;
    cursor: pointer;
    margin: 20px auto;
}

.violin-string {
    position: absolute;
    width: 2px;
    height: 300px;
    background: #C0C0C0;
    top: 50px;
    cursor: pointer;
}

.violin-bow {
    position: absolute;
    width: 300px;
    height: 4px;
    background: #654321;
    border-radius: 2px;
    top: 200px;
    left: -50px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.violin-bow:hover {
    background: #667eea;
}

.controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.control-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.3s ease;
}

.control-btn:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.control-btn.recording {
    background: #ff4444;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    justify-content: center;
}

.volume-slider {
    width: 200px;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.volume-fill {
    height: 100%;
    background: #667eea;
    border-radius: 3px;
    width: 70%;
    transition: width 0.2s ease;
}

.note-display {
    text-align: center;
    margin-top: 20px;
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
    min-height: 30px;
}

@media (max-width: 768px) {
    .instrument-container {
        padding: 20px;
        margin: 10px;
    }

    h1 {
        font-size: 2em;
    }

    .piano {
        transform: scale(0.8);
    }

    .drums {
        grid-template-columns: repeat(2, 1fr);
    }

    .drum {
        width: 100px;
        height: 100px;
        font-size: 1.5em;
    }

    .violin {
        width: 150px;
        height: 300px;
    }
}