/* 播放列表弹窗样式 */
.playlist-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.playlist-modal__content {
    background: #2c3e50;
    /* 深色背景 */
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.playlist-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-modal__tabs {
    display: flex;
    gap: 10px;
}

.playlist-modal__tab {
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.playlist-modal__tab:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.playlist-modal__tab.active {
    background: var(--primary-color);
    color: #fff;
}

.playlist-modal__close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
}

.playlist-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
}

.playlist-modal__body {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.playlist-modal__list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.playlist-modal__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.playlist-modal__empty i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.playlist-modal__empty p {
    font-size: 14px;
}

.playlist-modal__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-modal__item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.playlist-modal__item.active {
    background: rgba(26, 188, 156, 0.1);
    /* primary color with low opacity */
    border: 1px solid rgba(26, 188, 156, 0.2);
}

.playlist-modal__item-cover {
    position: relative;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-modal__item-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-modal__item-play {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s;
}

.playlist-modal__item:hover .playlist-modal__item-play,
.playlist-modal__item.active .playlist-modal__item-play {
    opacity: 1;
}

.playlist-modal__item-info {
    flex: 1;
    min-width: 0;
}

.playlist-modal__item-name {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
}

.playlist-modal__item-artist {
    font-size: 12px;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.playlist-modal__item-remove {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 14px;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.2s;
    opacity: 0;
}

.playlist-modal__item:hover .playlist-modal__item-remove {
    opacity: 1;
}

.playlist-modal__item-remove:hover {
    background: rgba(231, 76, 60, 0.1);
    color: var(--accent-color);
}

.playlist-modal__footer {
    padding: 15px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: flex-end;
}

.playlist-modal__clear {
    padding: 8px 16px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.playlist-modal__clear:hover {
    background: #c0392b;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .playlist-modal {
        padding: 0;
    }

    .playlist-modal__content {
        max-width: 100%;
        max-height: 100vh;
        border-radius: 0;
    }

    .playlist-modal__header {
        padding: 15px;
    }

    .playlist-modal__tab {
        font-size: 13px;
        padding: 6px 12px;
    }
}