/* 音乐播放器样式 */

/* 音乐部分容器 */
.music-section {
    height: 100%;
}

/* 音乐播放器 */
.music-player {
    background-color: transparent;
    padding: 20px 15px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: calc(100vh - 60px); /* 只减去导航栏高度 */
    height: 100%; /* 确保在长屏手机上填充可用空间 */
}

/* 播放模式按钮容器 */
.play-mode-container {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 10;
}

.play-mode-container .control-btn {
    width: 45px;
    height: 45px;
    margin: 0 0 5px 0;
    background-color: transparent;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-mode-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 专辑封面 */
.album-art {
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
    border-radius: 50%;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    -webkit-animation: rotate 20s linear infinite paused;
    animation: rotate 20s linear infinite paused;
   /* 启用硬件加速 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    -webkit-perspective: 1000;
    perspective: 1000;
    will-change: transform;
}

.album-art img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 歌曲信息 */
.song-info {
    margin-bottom: 30px;
}

.song-info h2 {
    font-size: 22px;
    color: #ffffff;
    margin-bottom: 5px;
}

.song-info p {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
}

/* 进度条 */
.progress-bar {
    height: 6px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    margin-bottom: 10px;
    position: relative;
    cursor: pointer;
}

.progress {
    height: 100%;
    background-color: #ffffff;
    border-radius: 3px;
    width: 0;
    transition: width 0.1s linear;
}

/* 时间信息 */
.time-info {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

/* 控制按钮区域 */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    padding: 5px 0;
    border-radius: 30px;
}

/* 播放模式按钮样式 */
#playModeBtn.mode-sequential {
    color: #4CAF50;
}

#playModeBtn.mode-random {
    color: #2196F3;
}

#playModeBtn.mode-loop {
    color: #FF9800;
}

/* 公告按钮样式 */
#announcementBtn {
    color: #b19cd9; /* 浅紫色，使公告图标更加醒目 */
}

#announcementBtn:hover {
    color: #d4c4f1; /* 悬停时颜色更亮 */
}

/* 歌词按钮样式 */
#lyricsBtn {
    color: #4db6ac; /* 浅蓝绿色，与歌词文本相关的颜色 */
}

#lyricsBtn:hover {
    color: #80cbc4; /* 悬停时颜色更亮 */
}

/* 控制按钮 */
.control-btn {
    background: none;
    border: none;
    font-size: 30px;
    color: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    padding: 15px;
    margin: 0 25px;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.control-btn:hover {
    transform: scale(1.1);
    color: #ffffff;
}

.control-btn:focus {
    outline: none;
}

/* 播放/暂停按钮 */
.play-btn {
    width: 90px;
    height: 90px;
    background: linear-gradient(300deg, rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
    color: white;
    font-size: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    margin: 0 35px;
    position: relative;
    overflow: hidden;
}

.play-btn::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255,255,255,0.2) 0%, rgba(255,255,255,0) 70%);
    pointer-events: none;
}

.play-btn i {
    margin-left: 3px;
}

/* 歌单标签样式 */
.playlist-tabs-container {
    margin-bottom: 15px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 5px 0;
}

.playlist-tabs {
    display: flex;
    gap: 10px;
}

.playlist-tab {
    padding: 8px 15px;
    background-color: #f0f2f5;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-block;
}

.playlist-tab:hover {
    background-color: #e8f0fe;
}

.playlist-tab.active {
    background-color: #4a6fa5;
    color: white;
}

.current-playlist-name {
    font-size: 14px;
    color: #4a6fa5;
    margin-top: 5px;
    font-style: italic;
}

/* 播放列表样式 */
.playlist-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(30, 40, 60, 0.95);
    backdrop-filter: blur(10px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 50;
    transform: translateY(100%);
    transition: all 0.3s ease;
    overflow-y: auto;
    max-height: 90%;
}

.playlist-container.show {
    transform: translateY(0);
    bottom: 0;
}

/* 播放列表标题和关闭按钮 */
.playlist-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 10px;
    position: sticky;
    top: 0;
    background-color: rgba(30, 40, 60, 0.95);
    z-index: 60;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* 搜索框样式 */
.playlist-search {
    display: flex;
    align-items: center;
    flex: 1;
    margin-right: 10px;
    position: relative;
    background-color: rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    padding: 3px;
    box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.playlist-search:focus-within {
    background-color: rgba(255, 255, 255, 0.18);
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1), 0 0 8px rgba(255, 255, 255, 0.15);
}

#searchInput {
    width: 100%;
    padding: 8px 15px;
    border: none;
    border-radius: 22px;
    background-color: transparent;
    color: #ffffff;
    font-size: 14px;
    transition: all 0.3s ease;
    line-height: 1.2;
}

#searchInput::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-style: italic;
}

#searchInput:focus {
    outline: none;
}

.search-btn {
    background-color: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 16px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 3px;
    transition: all 0.2s ease;
}

.search-btn:hover {
    color: #ffffff;
    background-color: rgba(255, 255, 255, 0.2);
    transform: scale(1.05);
}

/* 搜索结果高亮样式 */
.highlight {
    background-color: rgba(255, 215, 0, 0.3);
    border-radius: 2px;
    padding: 0 2px;
    font-weight: bold;
}

.close-playlist-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-playlist-btn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

.playlist {
    list-style: none;
    padding: 0;
}

.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.playlist-item:last-child {
    border-bottom: none;
}

.playlist-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.playlist-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

.playlist-item-info {
    flex: 1;
    text-align: left;
}

.playlist-item-title {
    font-size: 16px;
    margin-bottom: 4px;
    color: #e0e0e0;
}

.playlist-item-artist {
    font-size: 14px;
    color: #70c1ff;
    transition: color 0.2s ease;
}

.playlist-item:hover .playlist-item-artist {
    color: #a8d8ff;
}

.playlist-item.active .playlist-item-artist {
    color: #ffffff;
}

/* 收藏按钮样式 */
.song-title-container {
    position: relative;
    display: inline-block;
}

#songTitle {
    display: inline;
}

/* 收藏按钮样式 - 现在使用control-btn类，但保留特定颜色 */
#favoriteBtn {
    color: #ff7e7e; /* 浅红色，与爱心图标相关的颜色 */
}

#favoriteBtn:hover {
    color: #ff5e5e; /* 悬停时颜色更深 */
}

#favoriteBtn.active {
    color: #ff5e5e;
}

/* 播放状态 */
.playing .album-art, .album-art.playing {
    -webkit-animation-play-state: running;
    animation-play-state: running;
}

.playing .play-btn i {
    content: "\f04c";
}

/* 隐藏滚动条但保留滚动功能 */
.playlist-container,
.lyrics-container,
.playlist-tabs-container,
.playlist {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.playlist-container::-webkit-scrollbar,
.lyrics-container::-webkit-scrollbar,
.playlist-tabs-container::-webkit-scrollbar,
.playlist::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* 歌词面板样式 */
.lyrics-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(30, 40, 60, 0.95);
    backdrop-filter: blur(10px);
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.3);
    z-index: 50;
    transform: translateY(100%);
    transition: all 0.3s ease;
    overflow-y: auto;
    max-height: 90%;
}

.lyrics-container.show {
    transform: translateY(0);
    bottom: 0;
}

.lyrics-content {
    padding: 20px;
    color: #ffffff;
    font-size: 25px;
    line-height: 1.8;
    white-space: pre-line;
    text-align: center;
    padding-bottom: 20px; /* 减少底部内边距，使其与播放列表更一致 */
    overflow-y: auto; /* 启用垂直滚动 */
    max-height: 100%; /* 确保容器可以滚动 */
    height: auto; /* 让高度自适应内容 */
    scroll-behavior: smooth; /* 平滑滚动效果 */
}

/* 歌词行样式 */
.lyrics-line {
    padding: 8px 0;
    transition: all 0.3s ease;
    opacity: 0.6;
    font-size: 25px;
    margin: 5px 0;
}

/* 当前播放的歌词行样式 */
.lyrics-line.active {
    opacity: 1;
    font-size: 25px;
    font-weight: bold;
    color: #70c1ff;
    transform: scale(1.05);
}

.close-lyrics-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 25px;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-lyrics-btn:hover {
    color: #ffffff;
    transform: scale(1.1);
}

/* 音乐播放器相关动画 */
@-webkit-keyframes rotate {
    from {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

@keyframes rotate {
    from {
        -webkit-transform: rotate(0deg);
        transform: rotate(0deg);
    }
    to {
        -webkit-transform: rotate(360deg);
        transform: rotate(360deg);
    }
}

/* 音乐播放器响应式调整 */
@media (max-width: 768px) {
    /* 调整控制按钮在中等屏幕上的大小 */
    .control-btn {
        margin: 0 15px;
        padding: 12px;
        font-size: 26px;
    }

    .play-btn {
        width: 70px;
        height: 70px;
        font-size: 28px;
    }
}

/* 小屏幕手机适配 */
@media (max-width: 480px) {
    .controls button {
        width: 70px;
        height: 70px;
        margin: 0 10px;
    }

    .play-pause {
        width: 65px !important;
        height: 65px !important;
    }

    .album-cover {
        width: 150px;
        height: 150px;
    }

    .song-title {
        font-size: 1.2em;
    }

    .song-artist {
        font-size: 0.9em;
    }

    .music-player {
        padding: 15px 10px;
    }

    .playlist-container.show,
    .lyrics-container.show {
        max-height: 70vh;
    }

    .playlist-item {
        padding: 10px;
    }

    .playlist-item-title {
        font-size: 0.9em;
    }

    .playlist-item-artist {
        font-size: 0.75em;
    }
}

/* 长屏手机适配 */
@media (min-height: 700px) {
    .music-player {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: flex-start; /* 从顶部开始布局 */
        padding-bottom: 20px; /* 确保底部有足够的间距 */
    }

    .album-art {
        margin-top: 20px;
        margin-bottom: 10px;
    }
    
    .song-info {
        margin-bottom: 10px;
    }
    
    /* 将歌单标签容器移到底部元素组 */
    .playlist-tabs-container {
        margin-top: auto; /* 自动占用剩余空间，将歌单标签推向底部 */
        margin-bottom: 20px;
    }
    
    /* 底部元素组 - 进度条和控制按钮 */
    .progress-bar {
        margin-bottom: 20px;
    }
    
    .controls {
        margin-bottom: 20px;
    }

    /* 确保播放列表和歌词面板在长屏上有合适的高度 */
    .playlist-container.show,
    .lyrics-container.show {
        max-height: 70vh;
    }
}