/* 音乐合成器样式 - 孟菲斯风格 */
:root {
    --primary-color: #6e72fc;
    --secondary-color: #ad1deb;
    --accent-color-1: #ff7675;
    --accent-color-2: #fdcb6e;
    --accent-color-3: #00cec9;
    --dark-color: #2d3436;
    --light-color: #f8f9fa;
    --border-radius: 8px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-color);
    color: var(--dark-color);
    line-height: 1.6;
    overflow-x: hidden;
}

.synth-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.synth-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 4px solid var(--dark-color);
    position: relative;
    overflow: hidden;
}

/* 孟菲斯风格装饰元素 */
.memphis-decoration {
    position: absolute;
    z-index: -1;
}

.memphis-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-color-1);
    opacity: 0.7;
    top: -20px;
    right: 10%;
}

.memphis-zigzag {
    width: 100px;
    height: 20px;
    background-image: linear-gradient(45deg, var(--accent-color-2) 25%, transparent 25%),
                      linear-gradient(-45deg, var(--accent-color-2) 25%, transparent 25%),
                      linear-gradient(45deg, transparent 75%, var(--accent-color-2) 75%),
                      linear-gradient(-45deg, transparent 75%, var(--accent-color-2) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    left: 5%;
    bottom: 10px;
}

.memphis-square {
    width: 40px;
    height: 40px;
    background-color: var(--accent-color-3);
    transform: rotate(45deg);
    opacity: 0.7;
    right: 30%;
    top: 50%;
}

.synth-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--dark-color);
    position: relative;
    z-index: 1;
}

.synth-header h1::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient);
    border-radius: 2px;
}

.synth-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 20px;
}

@media (min-width: 992px) {
    .synth-content {
        flex-direction: row;
    }
}

/* 可视化区域 */
#visualizer-container {
    flex: 1;
    height: 400px;
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
    overflow: hidden;
    position: relative;
}

/* 控制区域 */
.controls-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* 合成器控制 */
.synth-controls {
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.control-group h3 {
    font-size: 1.2rem;
    margin-bottom: 5px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--accent-color-2);
    padding-bottom: 5px;
}

/* 选择器和按钮样式 */
select, button {
    padding: 10px 15px;
    border-radius: var(--border-radius);
    border: 3px solid var(--dark-color);
    background-color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

select:hover, button:hover {
    transform: translateY(-2px);
    box-shadow: var(--box-shadow);
}

button {
    background: var(--gradient);
    color: white;
}

button:active {
    transform: translateY(1px);
}

/* 开关样式 */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
    border: 2px solid var(--dark-color);
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
    border: 2px solid var(--dark-color);
}

input:checked + .toggle-slider {
    background: var(--gradient);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

/* 八度控制 */
.octave-control {
    display: flex;
    align-items: center;
    gap: 10px;
}

.octave-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
    border: 2px solid var(--dark-color);
    transition: var(--transition);
}

.octave-btn:hover {
    transform: scale(1.1);
}

.octave-display {
    font-size: 1.2rem;
    font-weight: bold;
    padding: 5px 15px;
    background-color: white;
    border-radius: var(--border-radius);
    border: 2px solid var(--dark-color);
}

/* 钢琴键盘 */
.piano-container {
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
    padding: 20px;
    overflow-x: auto;
}

.piano-keyboard {
    display: flex;
    position: relative;
    height: 150px;
    min-width: 700px;
}

.piano-key {
    position: relative;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 10px;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 5px 0 rgba(0,0,0,0.2);
}

.piano-key.white {
    background-color: white;
    border: 2px solid var(--dark-color);
    width: 60px;
    height: 100%;
    z-index: 1;
}

.piano-key.black {
    background-color: var(--dark-color);
    width: 40px;
    height: 60%;
    margin-left: -20px;
    margin-right: -20px;
    z-index: 2;
    color: white;
}

.piano-key.active {
    transform: translateY(5px);
    box-shadow: 0 0 0 rgba(0,0,0,0.2);
}

.piano-key.white.active {
    background-color: #e0e0e0;
}

.piano-key.black.active {
    background-color: #444;
}

.key-label {
    font-size: 0.8rem;
    font-weight: bold;
}

/* 说明区域 */
.instructions {
    background-color: white;
    border-radius: var(--border-radius);
    border: 4px solid var(--dark-color);
    padding: 20px;
}

.instructions h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--dark-color);
    border-bottom: 2px solid var(--accent-color-1);
    padding-bottom: 5px;
}

.instructions p {
    margin-bottom: 10px;
}

.instructions ul {
    list-style-type: none;
    padding-left: 20px;
}

.instructions li {
    margin-bottom: 5px;
    position: relative;
}

.instructions li::before {
    content: '•';
    color: var(--primary-color);
    font-weight: bold;
    position: absolute;
    left: -15px;
}

/* 页脚 */
.synth-footer {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 4px solid var(--dark-color);
    text-align: center;
    font-weight: 600;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .synth-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    #visualizer-container {
        height: 300px;
    }
    
    .piano-keyboard {
        height: 120px;
    }
    
    .piano-key.white {
        width: 45px;
    }
    
    .piano-key.black {
        width: 30px;
        margin-left: -15px;
        margin-right: -15px;
    }
}