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

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

.container {
    max-width: 1200px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

header {
    text-align: center;
    margin-bottom: 40px;
}

h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 10px;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 20px;
}

.header-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

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

.btn-toggle:hover {
    background: #764ba2;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-record {
    background: #e74c3c;
}

.btn-record:hover {
    background: #c0392b;
}

.btn-record.recording {
    background: #c0392b;
    animation: pulse 1.5s infinite;
}

.btn-record.paused {
    background: #f39c12;
}

.btn-stop {
    background: #e74c3c;
}

.btn-stop:hover {
    background: #c0392b;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.btn-custom {
    background: #27ae60;
}

.btn-custom:hover {
    background: #229954;
}

.recording-status {
    color: #e74c3c;
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 10px;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.drum-kit {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.cymbals-section,
.drums-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.drum-pad {
    background: linear-gradient(145deg, #f0f0f0, #e0e0e0);
    border: 3px solid #ddd;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.1s ease;
    position: relative;
    user-select: none;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.drum-pad:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-color: #667eea;
}

.drum-pad:active,
.drum-pad.playing {
    transform: scale(0.95) translateY(0);
    background: linear-gradient(145deg, #667eea, #764ba2);
    border-color: #764ba2;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.5);
}

.drum-pad.playing .drum-name {
    color: white;
}

.drum-pad.playing .key-hint {
    color: white;
    background: rgba(255, 255, 255, 0.3);
}

.drum-snare {
    background: linear-gradient(145deg, #ffeaa7, #fdcb6e);
}

.drum-kick {
    background: linear-gradient(145deg, #fab1a0, #e17055);
}

.drum-hihat-pedal {
    background: linear-gradient(145deg, #a29bfe, #6c5ce7);
}

.key-hint {
    display: inline-block;
    background: rgba(102, 126, 234, 0.2);
    color: #667eea;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: bold;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.shortcut-hidden {
    opacity: 0;
    visibility: hidden;
}

.drum-name {
    font-size: 1rem;
    color: #333;
    font-weight: 600;
    transition: color 0.3s ease;
}

.instructions {
    background: #f8f9fa;
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.instructions h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.instructions ul {
    list-style-position: inside;
    color: #555;
}

.instructions li {
    margin-bottom: 8px;
    line-height: 1.6;
}

footer {
    text-align: center;
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    padding: 10px 20px;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.back-link:hover {
    background: #667eea;
    color: white;
    transform: translateX(-5px);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }

    h1 {
        font-size: 2rem;
    }

    .header-buttons {
        flex-direction: column;
        align-items: center;
    }

    .btn-toggle {
        width: 100%;
        max-width: 200px;
    }

    .cymbals-section,
    .drums-section {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }

    .drum-pad {
        padding: 20px 15px;
        min-height: 100px;
    }

    .drum-name {
        font-size: 0.9rem;
    }

    .key-hint {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    .subtitle {
        font-size: 0.9rem;
    }

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

/* ==================== 自定义按键模态框样式 ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalAppear 0.3s ease-out;
}

@keyframes modalAppear {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.modal-header h2 {
    margin: 0;
    color: #333;
}

.close-modal {
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: background 0.3s;
    background: rgba(0, 0, 0, 0.1);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 20px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.btn-clear {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-clear:hover {
    background: #c0392b;
}

.btn-close {
    background: #7f8c8d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-close:hover {
    background: #95a5a6;
}

.key-instruction {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.key-instruction.active {
    background: #e3f2fd;
    color: #1976d2;
    animation: highlight 1s infinite alternate;
}

@keyframes highlight {
    from { background: #e3f2fd; }
    to { background: #bbdefb; }
}

.bindings-list {
    max-height: 400px;
    overflow-y: auto;
}

.binding-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #eee;
}

.binding-name {
    font-weight: bold;
    color: #333;
    flex: 1;
}

.binding-keys {
    display: flex;
    gap: 10px;
    margin-right: 15px;
}

.key-badge {
    background: #e0e0e0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
}

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

.btn-set-key {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.btn-set-key:hover {
    background: #2980b9;
}

.drum-pad.setting-key {
    animation: settingKeyPulse 1s infinite;
    border-color: #e74c3c;
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.5);
}

@keyframes settingKeyPulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ==================== 录音列表样式 ==================== */

.recordings-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    border-left: 4px solid #667eea;
}

.recordings-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3rem;
}

.recordings-container {
    max-height: 400px;
    overflow-y: auto;
}

.recording-item {
    background: white;
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.recording-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.recording-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.recording-number {
    background: #667eea;
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.recording-time {
    color: #666;
    font-size: 0.9rem;
}

.recording-duration {
    color: #27ae60;
    font-weight: bold;
    font-size: 0.9rem;
}

.recording-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.btn-play,
.btn-download,
.btn-delete {
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    font-weight: 600;
}

.btn-play {
    background: #3498db;
    color: white;
}

.btn-play:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

.btn-download {
    background: #27ae60;
    color: white;
}

.btn-download:hover {
    background: #229954;
    transform: translateY(-2px);
}

.btn-delete {
    background: #e74c3c;
    color: white;
}

.btn-delete:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

