* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

:root {
    --primary-color: #6a11cb;
    --secondary-color: #2575fc;
    --bg-dark: #1a1a2e;
    --bg-darker: #16213e;
    --text-light: rgba(255, 255, 255, 0.7);
    --card-bg: rgba(255, 255, 255, 0.08);
}

body {
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    color: #fff;
    min-height: 100vh;
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    touch-action: manipulation;
}

.player-container {
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    backdrop-filter: blur(15px);
    overflow: hidden;
}

/* 头部 */
.header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
    flex-shrink: 0;
}

.header h1 {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.header-actions {
    display: flex;
    gap: 15px;
}

.header-actions i {
    font-size: 18px;
    opacity: 0.8;
}

/* 音乐显示区域 - 占据60%高度 */
.music-display-area {
    flex: 3;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* 专辑封面 */
.album-art {
    position: relative;
    margin-bottom: 20px;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    /* 动态条纹背景 */
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(106, 17, 203, 0.2) 10px,
            rgba(106, 17, 203, 0.2) 20px
        ),
        repeating-linear-gradient(
            -45deg,
            transparent,
            transparent 10px,
            rgba(37, 117, 252, 0.15) 10px,
            rgba(37, 117, 252, 0.15) 20px
        );
    box-shadow:
        inset 0 0 20px rgba(106, 17, 203, 0.3),
        0 0 0 1px rgba(255, 255, 255, 0.1);
    /* 条纹动画 */
    animation: stripeMove 20s linear infinite;
    animation-play-state: paused;
}

.album-cover {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.4);
    animation: rotateAlbum 25s linear infinite;
    animation-play-state: paused;
    object-fit: cover;
    position: relative;
    z-index: 2;
}



.album-art.playing {
    animation-play-state: running; /* 条纹动画 */
}

.album-art.playing .album-cover {
    animation-play-state: running;
}

@keyframes stripeMove {
    from { background-position: 0 0, 0 0; }
    to { background-position: 40px 40px, 40px 40px; }
}

.album-art.paused .album-cover {
    animation-play-state: paused; /* 暂停时停止 */
}

@keyframes rotateAlbum {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* 波纹效果 */
.ripple {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    animation: rippleEffect 3s ease-out infinite;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
    border: 3px solid;
    box-shadow: 0 0 20px currentColor;
}

/* 三个波纹的不同颜色和延迟 */
.ripple:nth-child(2) {
    border-color: rgba(106, 17, 103, 0.8);
    animation-delay: 0s;
}

.ripple:nth-child(3) {
    border-color: rgba(37, 117, 252, 0.7);
    animation-delay: 1s;
}

.ripple:nth-child(4) {
    border-color: rgba(255, 255, 255, 0.5);
    animation-delay: 2s;
}


.album-art.playing .ripple {
    animation-play-state: running;
}

.album-art:not(.playing) {
    animation-play-state: paused; /* 条纹动画 */
}

.album-art:not(.playing) .ripple {
    animation-play-state: paused;
    opacity: 0;
}

.album-art.paused .ripple {
    animation-play-state: paused;
    opacity: 0;
}

@keyframes rippleEffect {
    0% {
        width: 180px;
        height: 180px;
        opacity: 0.9;
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 30px currentColor;
    }
    50% {
        opacity: 0.5;
        box-shadow: 0 0 50px currentColor;
    }
    100% {
        width: 230px;
        height: 230px;
        opacity: 0;
        transform: translate(-50%, -50%) scale(1.3);
        box-shadow: 0 0 10px currentColor;
    }
}

/* 紧凑歌词 */
.compact-lyrics {
    width: 280px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    text-align: center;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 90px;
    max-height: 120px;
    overflow: hidden;
    position: relative;
}

.compact-lyrics::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, rgba(25, 25, 40, 0.9));
    pointer-events: none;
}

.compact-lyric-line {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin: 4px 0;
    min-height: 20px;
}

.compact-lyric-line.active {
    color: white;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(106, 17, 203, 0.5);
}

/* 控制信息区域 - 占据40%高度 */
.control-info-area {
    flex: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 20px 20px 30px; /* 增加底部内边距 */
    background: rgba(0, 0, 0, 0.2);
    padding-bottom: max(30px, env(safe-area-inset-bottom)); /* 安全区域适配 */
}

/* 歌曲信息 */
.song-info {
    text-align: center;
    margin-bottom: 20px;
}

.song-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.song-artist {
    font-size: 16px;
    color: var(--text-light);
}

/* 进度条 */
.progress-area {
    margin-bottom: 20px;
}

.progress-bar {
    height: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress {
    height: 100%;
    width: 30%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    transition: width 0.1s linear;
}

.time {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-light);
}

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

.control-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 24px;
    opacity: 0.8;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.play-pause {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    box-shadow: 0 8px 25px rgba(106, 17, 203, 0.4);
}

/* 底部控制 */
.bottom-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.volume-bar {
    flex: 1;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    cursor: pointer;
}

.volume-level {
    height: 100%;
    width: 70%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
}

.play-mode {
    font-size: 20px;
    opacity: 0.7;
}

/* 播放列表按钮 */
.playlist-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* 播放列表面板 */
.playlist-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 70%;
    background: rgba(25, 25, 40, 0.95);
    backdrop-filter: blur(20px);
    border-top-left-radius: 25px;
    border-top-right-radius: 25px;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.4s ease;
    z-index: 5;
}

.playlist-panel.active {
    transform: translateY(0);
}

.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.playlist-title {
    font-size: 18px;
    font-weight: 600;
}

.close-playlist {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.playlist-items {
    height: calc(100% - 60px);
    overflow-y: auto;
}

.playlist-item {
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 8px;
}

.playlist-item.active {
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.3), rgba(37, 117, 252, 0.3));
}

.playlist-item img {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    object-fit: cover;
}

.playlist-item-info {
    flex: 1;
}

.playlist-item-title {
    font-size: 16px;
    margin-bottom: 5px;
}

.playlist-item-artist {
    font-size: 13px;
    color: var(--text-light);
}

/* 修改全屏歌词样式 */
.lyrics-fullscreen {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-darker);
    z-index: 20;
    display: none;
    flex-direction: column;
}

.lyrics-fullscreen.active {
    display: flex;
}

.close-lyrics {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 21;
    backdrop-filter: blur(10px);
}

.lyrics-content-full {
    flex: 1;
    width: 90%;
    max-width: 600px;
    margin: 80px auto 20px;
    overflow-y: auto;
    padding: 20px;
    text-align: center;
}

.lyrics-content-full .lyrics-line {
    font-size: 18px;
    line-height: 2.5;
    color: rgba(255, 255, 255, 0.6);
    padding: 5px 0;
    transition: all 0.3s ease;
}

.lyrics-content-full .lyrics-line.active {
    color: white;
    font-size: 22px;
    font-weight: 600;
    text-shadow: 0 0 10px rgba(106, 17, 203, 0.5);
}

/* 响应式 */
@media (max-width: 380px) {
    .album-cover {
        width: 240px;
        height: 240px;
    }

    .compact-lyrics {
        width: 240px;
    }

    .controls {
        gap: 20px;
    }

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

    .play-pause {
        width: 60px;
        height: 60px;
        font-size: 24px;
    }
}

/* Toast 提示 */
.toast {
    position: fixed;
    top: 80px; /* 调整到头部下方 */
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
    max-width: 80%;
    text-align: center;
}


.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}









/* 扩展歌词区域 */
.expanded-lyrics {
    cursor: pointer;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-dark) 0%, var(--bg-darker) 100%);
    z-index: 15;
    display: none;
    flex-direction: column;
    padding: 20px;
}

.expanded-lyrics.active {
    display: flex;
}

.lyrics-header {
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.current-song-info {
    flex: 1;
}

.current-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 5px;
}

.current-artist {
    font-size: 14px;
    color: var(--text-light);
}

.close-expanded-lyrics {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    backdrop-filter: blur(10px);
}

.lyrics-content-expanded {
    flex: 1;
    overflow-y: auto;
    text-align: center;
    pointer-events: none;
    padding: 10px 0;
}

.lyrics-content-expanded .lyrics-line {
    pointer-events: none;
    font-size: 16px;
    line-height: 2.2;
    color: rgba(255, 255, 255, 0.6);
    padding: 8px 0;
    transition: all 0.3s ease;
}

.lyrics-content-expanded .lyrics-line.active {
    color: white;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(106, 17, 203, 0.5);
}

/* 添加拖动指示器样式 */
.lyrics-drag-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(106, 17, 203, 0.9);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 100;
    pointer-events: none;
    backdrop-filter: blur(10px);
}