* {
    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%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
}

/* 加载动画 */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-spinner {
    width: 80px;
    height: 80px;
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.9;
    }

    50% {
        opacity: 0.6;
    }
}

.container {
    width: 100%;
    max-width: 900px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* 播放器主体 */
.player-body {
    padding: 30px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

/* 歌曲信息区 */
.song-info {
    text-align: center;
    padding: 10px 0;
}

#current-song {
    font-size: 1.8rem;
    font-weight: 400;
    letter-spacing: 1px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 控制面板 */
.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
}

.control-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

/* 上、下一首按钮内边距调整 */
#prev-song {
    margin-left: -5px;
    /* 上一首左边距减少 */
}

#next-song {
    margin-right: -5px;
    /* 下一首右边距减少 */
}

.control-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

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



.icon {
    transition: all 0.3s ease;
}

/* 进度条 */
.progress-container {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 0 10px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.progress {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 3px;
    transition: width 0.1s linear;
    position: relative;
    width: 0%;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: -6px;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

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

/* 歌曲列表 */
.playlist-container {
    background: rgba(255, 255, 255, 0.1);
    padding: 25px 25px 30px 25px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    margin-top: 20px;
}

.playlist-container h2 {
    font-size: 1.2rem;
    font-weight: 400;
    margin-bottom: 30px;
    margin-bottom: -30px;
    text-align: center;
}

#playlist {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 15px;
    margin-right: -5px;
    padding-bottom: 20px;
    padding-top: 5px;
}

#playlist::-webkit-scrollbar {
    width: 8px;
}

#playlist::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

#playlist::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

#playlist::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.playlist-item {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
    min-height: 50px;
    box-sizing: border-box;
}

.playlist-item:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(5px);
}

.playlist-item.active {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 500;
}

.playlist-item.active::before {
    content: '▶';
    font-size: 0.8rem;
    opacity: 0.8;
}

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

    .container {
        max-width: 100%;
    }

    #current-song {
        font-size: 1.4rem;
    }

    .controls {
        gap: 15px;
    }

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

    .progress-container {
        gap: 10px;
        padding: 0;
    }

    .playlist-container {
        padding: 15px;
        max-height: 250px;
    }

    #playlist {
        max-height: 250px;
    }

    .playlist-item {
        padding: 12px 15px;
    }

    /* 移动端上、下一首按钮内边距调整 */
    #prev-song {
        margin-left: -3px;
    }

    #next-song {
        margin-right: -3px;
    }
}

@media (max-width: 480px) {
    #current-song {
        font-size: 1.2rem;
    }

    .controls {
        gap: 10px;
    }

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

    .icon {
        width: 20px;
        height: 20px;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.playlist-item {
    animation: fadeIn 0.3s ease forwards;
}

/* 加载状态 */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* 播放/暂停按钮 */
.play-pause-btn {
    width: 70px;
    height: 70px;
    background: rgba(255, 255, 255, 0.3);
    border: none;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.play-pause-btn:hover {
    background: rgba(255, 255, 255, 0.4);
    transform: scale(1.1);
}

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

/* 时间显示 */
.time-display {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 300;
    width: 100%;
    justify-content: space-between;
    flex-wrap: nowrap;
}

.time-display span {
    flex-shrink: 0;
    min-width: 55px;
    text-align: center;
}

.time-display .progress-bar {
    flex: 1;
    min-width: 100px;
    max-width: 100%;
}