.metronome-container {
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #ecf0f1;
    position: relative;
    overflow: hidden;
}

.metronome-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.metronome {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 头部显示区域 */
.metronome-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 10px;
}

.bpm-display {
    text-align: center;
}

.bpm-value {
    font-size: 3.5em;
    font-weight: 700;
    color: #ecf0f1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1;
}

.bpm-label {
    display: block;
    font-size: 0.9em;
    color: #bdc3c7;
    margin-top: -5px;
    font-weight: 500;
}

.beat-indicator {
    display: flex;
    gap: 12px;
}

.beat-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #34495e;
    border: 2px solid #4a6572;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8em;
    font-weight: 600;
    color: #7f8c8d;
    transition: all 0.3s ease;
}

.beat-dot.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(231, 76, 60, 0.5);
}

/* 视觉区域 */
.metronome-visual {
    position: relative;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pendulum {
    position: relative;
    width: 200px;
    height: 100px;
    display: flex;
    justify-content: center;
}

.pendulum-arm {
    width: 3px;
    height: 80px;
    background: linear-gradient(to bottom, #e74c3c, #c0392b);
    border-radius: 2px;
    position: absolute;
    top: 0;
    transform-origin: top center;
    transition: transform 0.1s ease;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.pendulum-bob {
    width: 24px;
    height: 24px;
    background: radial-gradient(circle, #e74c3c, #c0392b);
    border-radius: 50%;
    position: absolute;
    top: 75px;
    left: 50%;
    transform: translateX(-50%);
    box-shadow: 0 0 20px rgba(231, 76, 60, 0.4);
}

.visual-pulse {
    position: absolute;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(231, 76, 60, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.visual-pulse.active {
    animation: pulse 0.5s ease-out;
}

@keyframes pulse {
    0% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    100% {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* 控制区域 */
.metronome-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.bpm-section {
    background: rgba(52, 73, 94, 0.6);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.bpm-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 15px;
}

.bpm-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.bpm-input {
    width: 100px;
    padding: 12px 40px 12px 15px;
    background: #2c3e50;
    border: 2px solid #4a6572;
    border-radius: 10px;
    color: #ecf0f1;
    font-size: 1.4em;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: all 0.3s ease;
}

.bpm-input:focus {
    border-color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.3);
}

.bpm-unit {
    position: absolute;
    right: 12px;
    color: #95a5a6;
    font-size: 0.9em;
    font-weight: 500;
}

.control-btn {
    padding: 12px;
    background: linear-gradient(135deg, #34495e, #2c3e50);
    border: 2px solid #4a6572;
    border-radius: 12px;
    color: #ecf0f1;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
}

.control-btn:hover {
    background: linear-gradient(135deg, #3d566e, #34495e);
    border-color: #5d6d7e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.control-btn:active {
    transform: translateY(0);
}

.bpm-slider-container {
    position: relative;
}

.bpm-slider {
    width: 100%;
    height: 6px;
    background: #34495e;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin: 10px 0;
}

.bpm-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: #e74c3c;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
    border: 3px solid #ecf0f1;
    transition: all 0.3s ease;
}

.bpm-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.6);
}

.bpm-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: #e74c3c;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid #ecf0f1;
    box-shadow: 0 2px 8px rgba(231, 76, 60, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.8em;
    color: #95a5a6;
    margin-top: 5px;
}

/* 主控制按钮 */
.main-controls {
    display: flex;
    gap: 15px;
}

.play-btn {
    flex: 2;
    padding: 16px 24px;
    background: linear-gradient(135deg, #27ae60, #229954);
    border-color: #27ae60;
    font-size: 1.1em;
}

.play-btn:hover {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    border-color: #2ecc71;
}

.play-btn.playing {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

.tap-btn {
    flex: 1;
    padding: 16px 20px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    border-color: #3498db;
}

.tap-btn:hover {
    background: linear-gradient(135deg, #5dade2, #3498db);
    border-color: #5dade2;
}

.tap-btn:active {
    transform: scale(0.95);
}

/* 动画 */
@keyframes pendulumSwing {
    0% { transform: rotate(-25deg); }
    50% { transform: rotate(25deg); }
    100% { transform: rotate(-25deg); }
}

.pendulum.playing .pendulum-arm {
    animation: pendulumSwing 0.5s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .metronome-container {
        padding: 20px;
    }
    
    .bpm-value {
        font-size: 2.8em;
    }
    
    .metronome-visual {
        height: 120px;
    }
    
    .pendulum {
        width: 160px;
    }
    
    .beat-dot {
        width: 28px;
        height: 28px;
        font-size: 0.7em;
    }
}

@media (max-width: 480px) {
    .metronome-container {
        padding: 15px;
    }
    
    .metronome-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .bpm-value {
        font-size: 2.4em;
    }
    
    .main-controls {
        flex-direction: column;
    }
    
    .pendulum {
        width: 140px;
    }
}

/* 禁用状态 */
.control-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.control-btn:disabled:hover {
    transform: none;
    box-shadow: none;
}