:root {
    --primary-color: #ff2d55;
    --secondary-color: #5856d6;
    --bg-color: #f2f2f7;
    --card-color: rgba(255, 255, 255, 0.92);
    --text-primary: #1c1c1e;
    --text-secondary: #8e8e93;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    color: var(--text-primary);
    touch-action: pan-y;
    overflow: hidden;
    position: relative;
}

/* 全屏背景 - 使用当前歌曲封面图片 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(30px) brightness(0.6);
    z-index: -2;
    transform: scale(1.1);
    /* 防止边缘模糊不够 */
    transition: background-image 0.5s ease;
}

/* 播放器容器 */
.player-container {
    width: 100%;
    height: 100vh;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: row;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

/* 当播放时添加的样式 */
.player-container.playing {
    background: rgba(255, 255, 255, 0.8);
}

/* 封面和信息区域 */
.cover-section {
    flex: 1;
    padding: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    transition: var(--transition);
    z-index: 2;
}

.cover-image-container {
    position: relative;
    width: 300px;
    height: 300px;
    /* margin-bottom: 40px; */
    perspective: 1000px;
}

.cover-image {
    width: 100%;
    height: 100%;
    border-radius: 18px;
    object-fit: cover;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    transition: var(--transition);
    z-index: 2;
}

.cover-image:hover {
    transform: scale(1.02) rotateY(5deg);
}

.vinyl-effect {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* border-radius: 50%; */
    background: radial-gradient(circle, #ee070700 80%, rgb(242 0 0 / 60%) 100%);
    opacity: 0;
    transition: var(--transition);
    z-index: -1;
}

.cover-image-container:hover .vinyl-effect {
    opacity: 0.3;
}

.song-info {
    width: 100%;
    text-align: center;
    margin-bottom: 40px;
    display: none;
}

.song-title {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: 0.5px;
}

.song-artist {
    font-size: 22px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.song-album {
    font-size: 18px;
    color: var(--text-secondary);
    opacity: 0.8;
}

/* 进度条 */
.progress-container {
    width: 100%;
    margin-bottom: 40px;
    display: none;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    margin-bottom: 15px;
    cursor: pointer;
    overflow: hidden;
    transition: var(--transition);
    user-select: none;
}

.progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 6px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-bar.dragging .progress {
    transition: none;
}

.progress::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    background-color: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.progress-bar:hover .progress::after {
    opacity: 1;
}

.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 控制按钮 */
.controls {
    display: none;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
    gap: 20px;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: var(--transition);
    border: none;
    color: var(--text-primary);
    position: relative;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn i {
    font-size: 22px;
}

.play-btn {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 8px 25px rgba(255, 45, 85, 0.4);
}

.play-btn i {
    font-size: 30px;
}

.secondary-btn {
    color: var(--text-secondary);
}

.loop-btn.active,
.shuffle-btn.active {
    color: var(--primary-color);
}

.tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    white-space: nowrap;
}

.control-btn:hover .tooltip {
    opacity: 1;
}

/* 歌词区域 */
.lyrics-section {
    flex: 1;
    padding: 60px;
    max-height: 100vh;
    min-width: 0;
    /* background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px); */
    transition: var(--transition);
    overflow-y: auto;
}

.lyrics-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 30px;
    display: none;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.pc-download-btn {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(255, 45, 85, 0.3);
    transition: var(--transition);
    position: absolute;
    right: 10px;
}

.pc-download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 45, 85, 0.4);
}

.pc-download-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.lyrics-container {
    height: calc(100vh - 120px);
    overflow-y: auto;
    text-align: center;
}

.lyrics-container::-webkit-scrollbar {
    display: none;
}

.lyric-line {
    font-size: 20px;
    line-height: 1.8;
    color: var(--text-secondary);
    transition: var(--transition);
    cursor: pointer;
    padding: 10px 15px;
    border-radius: 12px;
    opacity: 0.8;
}

.lyric-line:hover {
    background-color: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.lyric-line.active {
    margin: 15px;
    font-size: 24px;
    font-weight: 600;
    color: var(--primary-color);
    transform: scale(1.05);
    opacity: 1;
    background-color: rgba(255, 45, 85, 0.08);
}

/* 移动端样式 */
@media (max-width: 768px) {
    body {
        height: 100vh;
        overflow: hidden;
    }

    .controls {
        margin-bottom: 0;
    }

    .player-container {
        flex-direction: column;
        max-width: 100%;
        /* height: 90vh; */
        overflow: hidden;
        position: relative;
    }

    .progress-container {
        margin-top: 100px;
    }

    .cover-section {
        padding: 25px 20px;
        flex-shrink: 0;
        width: 100%;
        transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

    .cover-image-container {
        width: 220px;
        height: 220px;
    }

    .lyrics-section {
        position: absolute;
        top: 0;
        left: 100%;
        width: 100%;
        height: 100%;
        padding: 25px 20px;
        overflow-y: auto;
        transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1);
    }

    .lyrics-section.active {
        transform: translateX(-100%);
    }

    .cover-section.hide {
        transform: translateX(-100%);
    }

    .toggle-lyrics {
        display: block;
        margin: 15px auto 0;
        background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
        color: white;
        border: none;
        padding: 10px 25px;
        border-radius: 25px;
        cursor: pointer;
        font-size: 15px;
        font-weight: 500;
        box-shadow: 0 5px 20px rgba(255, 45, 85, 0.3);
        transition: var(--transition);
    }

    .toggle-lyrics:hover {
        transform: translateY(-2px);
        box-shadow: 0 7px 25px rgba(255, 45, 85, 0.4);
    }

    .toggle-lyrics.desktop {
        display: none;
    }

    /* 加载动画优化 */
    .loading {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 1000;
        display: flex;
        justify-content: center;
        align-items: center;
    }

    .loading.hidden {
        display: none;
    }

    /* 歌词标题固定 */
    .lyrics-title {
        position: sticky;
        top: 0;
        z-index: 10;
        padding: 15px 20px;
    }

    /* 歌词容器滚动优化 */
    .lyrics-container {
        -webkit-overflow-scrolling: touch;
        overflow-y: auto;
        padding-bottom: 100px;
    }

    /* 进度条拖动优化 */
    .progress-bar {
        height: 8px;
    }

    .progress {
        height: 8px;
    }

    /* 播放列表项优化 */
    .playlist-item {
        padding: 12px 15px;
    }

    /* 按钮大小优化 */
    .control-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

    /* 封面区域优化 */
    .cover-section {
        padding-top: 20px;
    }

    /* 下载按钮固定 */
    .pc-download-btn {
        position: sticky;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 10;
        background: #ff5d9e;
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 30px;
        font-size: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        margin-top: 15px;
    }

    .song-info,
    .progress-container {
        display: block;
    }

    .controls,
    .lyrics-title {
        display: flex;
    }

    .suspended {
        display: none !important;
    }
}

/* 通用优化 */
.lyrics-container {
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
}

.lyrics-container::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* 进度条拖动优化 */
.progress-bar.dragging {
    cursor: grabbing;
}

/* 加载动画优化 */
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #ff5d9e;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 错误状态样式 */
.error-message {
    font-size: 16px;
    margin-bottom: 15px;
}

.retry-btn {
    background: #ff5d9e;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-size: 16px;
    cursor: pointer;
}

/* 播放状态下的黑胶效果 */
.playing .vinyl-effect {
    opacity: 0.3;
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.3);
}

/* 确保加载动画在移动端显示正确 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    /* 默认隐藏 */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .loading {
        background: rgba(255, 255, 255, 0.95);
    }

    .spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

.loading.hidden {
    display: none !important;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* 播放列表样式 */
.playlist-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100%;
    background: var(--card-color);
    backdrop-filter: blur(20px);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    padding: 30px;
    overflow-y: auto;
}

.playlist-container::-webkit-scrollbar {
    display: none;
}

.playlist-container.show {
    transform: translateX(0);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.playlist-title {
    font-size: 22px;
    font-weight: 600;
}

.close-playlist {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.playlist-item {
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
}

.playlist-item:hover {
    background: rgba(0, 0, 0, 0.05);
}

.playlist-item.active {
    background: rgba(255, 45, 85, 0.1);
    color: var(--primary-color);
}

.playlist-item img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    margin-right: 15px;
    object-fit: cover;
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
}

.playlist-item-artist {
    font-size: 14px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-clear-btn {
    padding: 12px;
    text-align: center;
    background-color: #f44336;
    color: white;
    margin-bottom: 15px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: var(--transition);
}

.playlist-clear-btn:hover {
    background-color: #d32f2f;
}

.playlist-empty {
    text-align: center;
    padding: 30px;
    color: #888;
    font-size: 16px;
}

.playlist-item-remove {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px;
    margin-left: auto;
    font-size: 18px;
    transition: var(--transition);
}

.playlist-item-remove:hover {
    color: #f44336;
}

/* 下载弹窗 */
.download-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.download-modal.show {
    opacity: 1;
    pointer-events: auto;
}

.download-modal-content {
    background: white;
    border-radius: 20px;
    width: 90%;
    max-width: 450px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.download-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.download-modal-title {
    font-size: 22px;
    font-weight: 600;
}

.close-download-modal {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-secondary);
}

.download-options {
    margin-bottom: 25px;
}

.download-option {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.download-option:hover {
    border-color: var(--primary-color);
}

.download-option.active {
    border-color: var(--primary-color);
    background: rgba(255, 45, 85, 0.05);
}

.download-option-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 16px;
}

.download-option-details {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
}

.download-btn-modal {
    width: 100%;
    padding: 15px;
    border-radius: 30px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
}

.download-btn-modal:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 45, 85, 0.4);
}

/* 电脑端播放 */
.suspended {
    position: absolute;
    bottom: 0;
    display: flex;
    align-items: center;
    width: 100vw;
    background-color: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(3px);
    height: 68px;
}

.pc-song-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: absolute;
    left: 10px;
}

.pc-song-info img {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
}

.pc-song-info .pc-song-title,
.pc-song-info .pc-song-artist {
    width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pc-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: absolute;
    left: 0;
    right: 0;
}

.pc-controls .pc-control-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    position: relative;
    transition: all 0.2s ease;
}

.pc-controls .pc-control-btn:hover {
    transform: scale(1.1);
}

.pc-controls .pc-control-btn:active {
    transform: scale(1);
}

.pc-controls .pc-secondary-btn {
    color: var(--text-secondary);
}

.pc-controls .pc-play-btn {
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 8px 25px rgba(255, 45, 85, 0.4);
}

.pc-progress-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: absolute;
    top: -4px;
    left: 0;
}

.pc-progress-bar {
    width: 100%;
    height: 4px;
    background-color: rgba(0, 0, 0, 0.15);
    border-radius: 2px;
}

.pc-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

.pc-progress::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 50%;
    transform: translateY(-50%);
    width: 8px;
    height: 8px;
    background-color: white;
    border: 3px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.pc-progress-container:hover .pc-progress::after {
    opacity: 1;
}

/* 错误提示 */
.error-message {
    color: #ff2d55;
    text-align: center;
    margin-top: 25px;
    font-weight: 500;
    font-size: 16px;
}

.retry-btn {
    background: linear-gradient(135deg, #ff2d55, #5856d6);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 30px;
    margin-top: 20px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.retry-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(255, 45, 85, 0.3);
}

/* 隐藏移动端切换按钮 */
.toggle-lyrics.mobile {
    display: none;
}