/* 
 * 喵CG音频播放器样式
 * 版本: v1.0
 * 创建日期: 2025-06-22
 */

/* 基础样式 */
.qinghe-audio-player {
    margin: 20px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    max-width: 100%;
}

.qinghe-audio-player:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.audio-player-container {
    display: flex;
    align-items: center;
    padding: 20px;
    background: #ffffff;
    position: relative;
}

/* 封面样式 */
.audio-cover {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 20px;
    flex-shrink: 0;
}

.audio-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: all 0.3s ease;
}

.audio-cover:hover .cover-overlay {
    background: rgba(0, 0, 0, 0.8);
}

.play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 3px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 1);
    transform: scale(1.15);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.play-btn:active {
    transform: scale(1.05);
}

.play-btn .play-icon,
.play-btn .pause-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    transition: all 0.3s ease;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

.play-btn.playing .play-icon {
    display: none;
}

.play-btn.playing .pause-icon {
    display: block !important;
}

/* 播放按钮脉冲效果 */
.play-btn:not(.playing):before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.3);
    transform: translate(-50%, -50%) scale(1);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(-50%, -50%) scale(1.4);
        opacity: 0;
    }
}

/* 音频信息 */
.audio-info {
    flex: 1;
    min-width: 0;
}

.audio-title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-artist {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 进度条 */
.audio-progress {
    margin-bottom: 10px;
}

.progress-bar {
    position: relative;
    height: 6px;
    background: #e1e5e9;
    border-radius: 3px;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    width: 0%;
    transition: width 0.1s ease;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: #667eea;
    border: 2px solid #ffffff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.progress-bar:hover .progress-handle {
    opacity: 1;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* 控制按钮 */
.audio-controls {
    display: flex;
    align-items: center;
    margin-left: 20px;
    gap: 12px;
}

.control-btn {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 2px solid #cbd5e1;
    padding: 12px;
    cursor: pointer;
    color: #64748b;
    transition: all 0.3s ease;
    border-radius: 8px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.control-btn:hover {
    color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.control-btn:hover i {
    color: #ffffff;
}

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

.control-btn i {
    font-size: 16px;
    transition: color 0.3s ease;
}

.control-btn .volume-icon {
    width: 20px;
    height: 20px;
    filter: brightness(0) saturate(100%) invert(42%) sepia(15%) saturate(687%) hue-rotate(183deg) brightness(95%) contrast(88%);
    transition: all 0.3s ease;
}

.control-btn:hover .volume-icon {
    filter: brightness(0) invert(1);
}

.volume-slider {
    width: 100px;
    position: relative;
    padding: 8px 0;
}

.volume-bar {
    height: 8px;
    background: linear-gradient(90deg, #e2e8f0 0%, #cbd5e1 100%);
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.volume-bar:hover {
    background: linear-gradient(90deg, #cbd5e1 0%, #94a3b8 100%);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.2);
}

.volume-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    width: 100%;
    transition: all 0.2s ease;
    position: relative;
    box-shadow: 0 1px 3px rgba(102, 126, 234, 0.3);
}

/* 音量滑块手柄 */
.volume-bar {
    --volume-percent: 100%;
}

.volume-bar:after {
    content: '';
    position: absolute;
    top: 50%;
    left: var(--volume-percent);
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: 2px solid #667eea;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
    opacity: 0;
}

.volume-bar:hover:after {
    opacity: 1;
}

/* 音量提示气泡 */
.volume-slider:hover:before {
    content: attr(data-volume) '%';
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1000;
}

.volume-slider:hover:after {
    content: '';
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #333;
    pointer-events: none;
    z-index: 1000;
}

.hidden-audio {
    display: none;
}

/* 现代风格主题 */
.qinghe-audio-player.modern {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.qinghe-audio-player.modern .audio-player-container {
    background: transparent;
}

.qinghe-audio-player.modern .audio-title {
    color: #ffffff;
}

.qinghe-audio-player.modern .audio-artist {
    color: rgba(255, 255, 255, 0.8);
}

.qinghe-audio-player.modern .progress-bar {
    background: rgba(255, 255, 255, 0.2);
}

.qinghe-audio-player.modern .progress-fill {
    background: #ffffff;
}

.qinghe-audio-player.modern .progress-handle {
    background: #ffffff;
    border-color: rgba(102, 126, 234, 0.3);
}

.qinghe-audio-player.modern .time-info {
    color: rgba(255, 255, 255, 0.7);
}

.qinghe-audio-player.modern .control-btn {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
}

.qinghe-audio-player.modern .control-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
    transform: translateY(-2px);
}

.qinghe-audio-player.modern .volume-bar {
    background: rgba(255, 255, 255, 0.2);
}

.qinghe-audio-player.modern .volume-bar:hover {
    background: rgba(255, 255, 255, 0.3);
}

.qinghe-audio-player.modern .volume-fill {
    background: #ffffff;
}

.qinghe-audio-player.modern .volume-bar:after {
    border-color: #ffffff;
}

/* 经典风格主题 */
.qinghe-audio-player.classic {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
}

.qinghe-audio-player.classic .audio-player-container {
    background: transparent;
}

.qinghe-audio-player.classic .progress-fill {
    background: #28a745;
}

.qinghe-audio-player.classic .progress-handle {
    background: #28a745;
}

.qinghe-audio-player.classic .control-btn:hover {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #28a745;
    color: #ffffff;
    transform: translateY(-2px);
}

.qinghe-audio-player.classic .volume-fill {
    background: #28a745;
}

.qinghe-audio-player.classic .volume-bar:after {
    border-color: #28a745;
}

/* 极简风格主题 */
.qinghe-audio-player.minimal {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    box-shadow: none;
}

.qinghe-audio-player.minimal:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transform: none;
}

.qinghe-audio-player.minimal .audio-cover {
    border-radius: 4px;
}

.qinghe-audio-player.minimal .progress-fill {
    background: #333;
}

.qinghe-audio-player.minimal .progress-handle {
    background: #333;
}

.qinghe-audio-player.minimal .control-btn:hover {
    background: linear-gradient(135deg, #333 0%, #555 100%);
    border-color: #333;
    color: #ffffff;
    transform: translateY(-2px);
}

.qinghe-audio-player.minimal .volume-fill {
    background: #333;
}

.qinghe-audio-player.minimal .volume-bar:after {
    border-color: #333;
}

/* 彩色风格主题 */
.qinghe-audio-player.colorful {
    background: linear-gradient(135deg, #ff6b6b 0%, #feca57 50%, #48dbfb 100%);
    color: #ffffff;
}

.qinghe-audio-player.colorful .audio-player-container {
    background: transparent;
}

.qinghe-audio-player.colorful .audio-title {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.qinghe-audio-player.colorful .audio-artist {
    color: rgba(255, 255, 255, 0.9);
}

.qinghe-audio-player.colorful .progress-bar {
    background: rgba(255, 255, 255, 0.3);
}

.qinghe-audio-player.colorful .progress-fill {
    background: #ffffff;
}

.qinghe-audio-player.colorful .progress-handle {
    background: #ffffff;
    border-color: rgba(255, 107, 107, 0.3);
}

.qinghe-audio-player.colorful .time-info {
    color: rgba(255, 255, 255, 0.8);
}

.qinghe-audio-player.colorful .control-btn {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.95);
}

.qinghe-audio-player.colorful .control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
    color: #ffffff;
    transform: translateY(-2px);
}

.qinghe-audio-player.colorful .volume-bar {
    background: rgba(255, 255, 255, 0.3);
}

.qinghe-audio-player.colorful .volume-bar:hover {
    background: rgba(255, 255, 255, 0.4);
}

.qinghe-audio-player.colorful .volume-fill {
    background: #ffffff;
}

.qinghe-audio-player.colorful .volume-bar:after {
    border-color: #ffffff;
}

/* 响应式设计 */
@media screen and (max-width: 768px) {
    .audio-player-container {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }

    .audio-cover {
        margin-right: 0;
        margin-bottom: 15px;
        width: 100px;
        height: 100px;
    }

    .audio-info {
        width: 100%;
        margin-bottom: 15px;
    }

    .audio-controls {
        margin-left: 0;
        justify-content: center;
        gap: 15px;
    }

    .control-btn {
        width: 50px;
        height: 50px;
    }

    .control-btn i {
        font-size: 18px;
    }

    .volume-slider {
        width: 120px;
    }

    .volume-bar {
        height: 10px;
    }
}

@media screen and (max-width: 480px) {
    .audio-cover {
        width: 80px;
        height: 80px;
    }

    .audio-title {
        font-size: 14px;
    }

    .audio-artist {
        font-size: 12px;
    }

    .volume-slider {
        width: 80px;
    }

    .control-btn {
        width: 45px;
        height: 45px;
    }

    .control-btn i {
        font-size: 16px;
    }
}

/* 加载动画 */
@keyframes audioPlayerFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.qinghe-audio-player {
    animation: audioPlayerFadeIn 0.5s ease-out;
}

/* 播放中的动画效果 */
.audio-cover.playing {
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}