/* ======= 音乐播放器CSS ======= */
.jp-player {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    color: #333;
    max-width: 600px;
    margin: 20px auto;
}

.jp-player :focus {
    outline: 2px solid #4a90e2;
    outline-offset: 2px;
}

.jp-player button::-moz-focus-inner {
    border: 0;
}

.jp-audio {
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 1px solid #e8ecef;
    overflow: hidden;
}

.jp-interface {
    padding: 24px;
    background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
    position: relative;
}

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

.jp-controls button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: #f1f5f9;
    color: #475569;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
    text-indent: -9999px;
    font-size: 0;
}

.jp-controls button:hover,
.jp-controls button:active,
.jp-controls button:focus {
    background: #ff7b25 !important;
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 123, 37, 0.3) !important;
}

/* 播放按钮 */
.jp-play {
    width: 56px;
    height: 56px;
    background: #ff7b25 !important;
    color: white !important;
}

.jp-play:hover {
    background: #e56a1b !important;
    box-shadow: 0 4px 12px rgba(255, 123, 37, 0.4) !important;
}

/* 播放图标 */
.jp-play::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent currentColor;
    transform: translate(-40%, -50%);
}

.jp-state-playing .jp-play::before {
    width: 16px;
    height: 16px;
    border: none;
    background:
        linear-gradient(currentColor, currentColor) left center/5px 16px no-repeat,
        linear-gradient(currentColor, currentColor) right center/5px 16px no-repeat;
    transform: translate(-50%, -50%);
}

/* 上一曲、下一曲、停止 */
.jp-previous::before,
.jp-next::before,
.jp-stop::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
}

.jp-previous::before {
    border-style: solid;
    border-width: 8px 12px 8px 0;
    border-color: transparent currentColor transparent transparent;
    transform: translate(-60%, -50%);
}

.jp-next::before {
    border-style: solid;
    border-width: 8px 0 8px 12px;
    border-color: transparent transparent transparent currentColor;
    transform: translate(-40%, -50%);
}

.jp-stop::before {
    width: 14px;
    height: 14px;
    background-color: currentColor;
    transform: translate(-50%, -50%);
}

/* ======= 进度条 ======= */
.jp-progress-area {
    width: 100%;
    margin-bottom: 8px;
    position: relative;
}

.jp-progress {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    user-select: none;
}

.custom-seek-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 101;
}

.custom-play-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    border-radius: 4px;
    background: linear-gradient(90deg, #ff7b25, #ff9c50);
    transition: width 0.1s ease;
}

/* 时间显示 */
.jp-time-holder {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* 倍速控制 */
.playback-control {
    padding: 16px 24px;
    border-top: 1px solid #f1f5f9;
    background: #f8fafc;
    display: flex;
    align-items: center;
    gap: 12px;
}

.playback-control label {
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.playback-control select {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    color: #334155;
    cursor: pointer;
    transition: all 0.2s ease;
}

.playback-control select:hover,
.playback-control select:focus {
    border-color: #ff7b25;
    box-shadow: 0 0 0 3px rgba(255, 123, 37, 0.1);
}

/* 播放列表 */
.jp-playlist {
    border-top: 1px solid #f1f5f9;
    background: white;
}

.jp-playlist ul {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: none;
    overflow: visible;
    margin-bottom: 10px; /* 可选 */
}



.jp-playlist li {
    padding: 14px 24px;
    border-bottom: 1px solid #f8fafc;
    transition: all 0.2s ease;
    cursor: pointer;
}

.jp-playlist li:hover {
    background: #f8fafc;
}

.jp-playlist-current {
    background: #fff5e6 !important;
    color: #ff7b25 !important;
    font-weight: 600;
    border-left: 3px solid #ff7b25 !important;
}
/* 点击时瞬间变色，松开立即恢复 */
.jp-controls button:active {
    transform: scale(0.95);
    background: #ff7b25 !important;
    color: white !important;
    box-shadow: 0 2px 8px rgba(255, 123, 37, 0.3);
}

/* 防止点击后保持选中状态 */
.jp-controls button:focus {
    background: #f1f5f9 !important;
    color: #475569 !important;
    box-shadow: none !important;
    outline: none !important;
}
.jp-controls button {
    -webkit-tap-highlight-color: rgba(0,0,0,0); /* 去掉 iOS 点击高亮 */
    -webkit-touch-callout: none; /* 禁止长按菜单 */
    user-select: none;
}

/* 响应式 */
@media (max-width: 768px) {
    .jp-player {
        margin: 10px;
    }
    .jp-interface {
        padding: 20px;
    }
    .jp-controls {
        gap: 12px;
    }
    .jp-controls button {
        width: 42px;
        height: 42px;
    }
    .jp-play {
        width: 48px;
        height: 48px;
    }
}
