/**
 * 音乐播放器样式
 * 设计原则：纯色、简洁、无渐变、无花哨光影
 */

/* ===== 播放器容器 ===== */
.music-player-container {
    width: 100%;
    max-width: 640px;
    margin: 20px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.music-player-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ===== 加载状态 ===== */
.music-player-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 20px;
    color: #888;
    font-size: 14px;
    gap: 16px;
}

.loading-spinner {
    width: 36px;
    height: 36px;
    border: 2px solid #e5e5e5;
    border-top-color: #333;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== 错误状态 ===== */
.music-player-error {
    padding: 48px 20px;
    text-align: center;
    color: #c44;
    font-size: 14px;
}

/* ===== 播放器内容区 ===== */
.music-player-content {
    display: flex;
    flex-direction: row;
}

/* ===== 封面区域 ===== */
.music-cover-section {
    position: relative;
    width: 180px;
    min-width: 180px;
    height: 180px;
    overflow: hidden;
    background: #f0f0f0;
}

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

.music-cover-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.music-cover-section:hover .music-cover-overlay,
.music-cover-section.playing .music-cover-overlay {
    opacity: 1;
}

.music-play-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    border: none;
    color: #222;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease, background 0.15s ease;
}

.music-play-btn:hover {
    transform: scale(1.08);
    background: #f5f5f5;
}

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

/* ===== 信息区域 ===== */
.music-info-section {
    flex: 1;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.music-title {
    font-size: 16px;
    font-weight: 600;
    color: #222;
    margin: 0 0 6px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

.music-artist {
    font-size: 13px;
    color: #666;
    margin: 0 0 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.music-album {
    font-size: 12px;
    color: #999;
    margin: 0 0 16px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== 进度条 ===== */
.music-progress-area {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.music-time-current,
.music-time-duration {
    font-size: 11px;
    color: #999;
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: center;
}

.music-progress-bar {
    flex: 1;
    height: 4px;
    background: #e5e5e5;
    border-radius: 2px;
    position: relative;
    cursor: pointer;
}

.music-progress-fill {
    height: 100%;
    background: #333;
    border-radius: 2px;
    width: 0%;
    transition: width 0.1s linear;
}

.music-progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 12px;
    height: 12px;
    background: #333;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    cursor: grab;
}

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

/* ===== 控制按钮 ===== */
.music-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: auto;
}

.music-ctrl-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid #ddd;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
    padding: 0;
}

.music-ctrl-btn:hover {
    background: #f5f5f5;
    color: #222;
    border-color: #ccc;
}

.music-ctrl-btn:active {
    transform: scale(0.94);
}

.music-ctrl-play {
    width: 42px;
    height: 42px;
    background: #222;
    color: #fff;
    border-color: #222;
}

.music-ctrl-play:hover {
    background: #444;
    border-color: #444;
    color: #fff;
}

/* ===== 歌词区域 ===== */
.music-lyric-section {
    padding: 16px 24px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    max-height: 200px;
    overflow-y: auto;
    text-align: center;
}

.music-lyric-line {
    font-size: 13px;
    color: #888;
    line-height: 2;
    transition: color 0.3s ease, font-weight 0.3s ease;
    padding: 2px 0;
}

.music-lyric-line.active {
    color: #222;
    font-weight: 500;
}

/* ===== 移动端适配 ===== */
@media (max-width: 600px) {
    .music-player-container {
        margin: 12px auto;
    }
    
    .music-player-content {
        flex-direction: column;
    }
    
    .music-cover-section {
        width: 100%;
        height: auto;
        aspect-ratio: 1 / 1;
        min-width: auto;
    }
    
    .music-info-section {
        padding: 16px;
    }
    
    .music-title {
        font-size: 15px;
    }
    
    .music-artist {
        font-size: 12px;
    }
    
    .music-progress-area {
        margin-bottom: 12px;
    }
    
    .music-controls {
        gap: 16px;
    }
    
    .music-lyric-section {
        max-height: 160px;
        padding: 12px 16px;
    }
}

/* ===== 超小屏幕适配 ===== */
@media (max-width: 360px) {
    .music-info-section {
        padding: 12px;
    }
    
    .music-title {
        font-size: 14px;
    }
    
    .music-controls {
        gap: 12px;
    }
    
    .music-ctrl-btn {
        width: 32px;
        height: 32px;
    }
    
    .music-ctrl-play {
        width: 38px;
        height: 38px;
    }
}

/* ===== 深色模式适配（如果主题支持） ===== */
@media (prefers-color-scheme: dark) {
    .music-player-card {
        background: #1a1a1a;
        border-color: #333;
    }
    
    .music-title {
        color: #eee;
    }
    
    .music-artist {
        color: #aaa;
    }
    
    .music-album {
        color: #777;
    }
    
    .music-progress-bar {
        background: #333;
    }
    
    .music-progress-fill {
        background: #ddd;
    }
    
    .music-progress-handle {
        background: #ddd;
    }
    
    .music-ctrl-btn {
        border-color: #444;
        color: #aaa;
    }
    
    .music-ctrl-btn:hover {
        background: #2a2a2a;
        color: #eee;
        border-color: #555;
    }
    
    .music-ctrl-play {
        background: #ddd;
        color: #111;
        border-color: #ddd;
    }
    
    .music-ctrl-play:hover {
        background: #fff;
        border-color: #fff;
        color: #111;
    }
    
    .music-lyric-section {
        background: #111;
        border-color: #222;
    }
    
    .music-lyric-line {
        color: #666;
    }
    
    .music-lyric-line.active {
        color: #eee;
    }
    
    .music-cover-section {
        background: #222;
    }
    
    .music-player-loading {
        color: #777;
    }
    
    .loading-spinner {
        border-color: #333;
        border-top-color: #ddd;
    }
}
