/* 基础样式重置与全局设置 */
:root {
    --primary-color: #3B82F6;
    --primary-dark-color: #2563EB;
}

/* 暗色模式主颜色类 */
.dark .text-primary {
    color: var(--primary-color) !important;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* 自定义滚动条 */
.scrollbar-custom {
    scrollbar-width: thin; /* Firefox */
    -webkit-overflow-scrolling: touch; /* iOS Safari */
    /* 删除了非标准属性 overflow-scrolling: touch; */
}

.scrollbar-custom::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollbar-custom::-webkit-scrollbar-track {
    background: #f1f1f1; /* 浅色背景 */
    border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
    .scrollbar-custom::-webkit-scrollbar-track {
        background: #374151; /* 暗色模式背景 */
    }
}

.scrollbar-custom::-webkit-scrollbar-thumb {
    background-color: rgba(156, 163, 175, 0.5);
    border-radius: 3px;
}

@media (prefers-color-scheme: dark) {
    .scrollbar-custom::-webkit-scrollbar-thumb {
        background-color: rgba(156, 163, 175, 0.6);
    }
}

.scrollbar-custom::-webkit-scrollbar-thumb:hover {
    background-color: rgba(156, 163, 175, 0.8);
}

@media (prefers-color-scheme: dark) {
    .scrollbar-custom::-webkit-scrollbar-thumb:hover {
        background-color: rgba(156, 163, 175, 0.9);
    }
}

/* 工具提示样式 */
.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    margin-bottom: 5px;
    z-index: 50;
}

@media (prefers-color-scheme: dark) {
    .tooltip {
        background-color: rgba(255, 255, 255, 0.9);
        color: #111827;
    }
}

.group:hover .tooltip {
    opacity: 1;
}

/* 即将播放列表浮窗样式 */
#upcoming-playlist {
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    z-index: 50;
}

/* 即将播放歌曲列表：设置滚动行为 */
#upcoming-songs-list {
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* 即将播放列表中的小标题样式 */
#upcoming-songs-list .text-xs.font-semibold {
    color: #6b7280;
    padding: 4px 8px;
}

@media (prefers-color-scheme: dark) {
    #upcoming-songs-list .text-xs.font-semibold {
        color: #9ca3af;
    }
}

/* 搜索框样式 */
.search-input-container {
    position: relative;
    width: 100%;
}

/* 播放列表折叠样式 */
/* 播放列表折叠头部：弹性布局、内边距、光标样式、过渡效果 */
.playlist-collapse-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    background-color: rgba(243, 244, 246, 0.8);
    transition: all 0.3s;
    border-radius: 0.5rem;
}

@media (prefers-color-scheme: dark) {
    .playlist-collapse-header {
        background-color: rgba(31, 41, 55, 0.8);
    }
}

.playlist-collapse-header:hover {
    background-color: rgba(229, 231, 235, 0.8);
}

@media (prefers-color-scheme: dark) {
    .playlist-collapse-header:hover {
        background-color: rgba(55, 65, 81, 0.8);
    }
}

/* 折叠图标：过渡效果 */
.playlist-collapse-icon {
    transition: transform 0.3s ease-in-out;
}

/* 打开的折叠图标：旋转180度 */
.playlist-collapse-icon.open {
    transform: rotate(180deg);
}

/* 播放列表折叠内容：溢出隐藏、过渡效果 */
.playlist-collapse-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

/* 播放列表组：边框、圆角、溢出隐藏 */
.playlist-group {
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    overflow: hidden;
}

@media (prefers-color-scheme: dark) {
    .playlist-group {
        border: 1px solid #374151;
    }
}

/* 播放列表组折叠内容：溢出隐藏、过渡效果、边框 */
.playlist-group-collapse-content {
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    border-top: 1px solid #e5e7eb;
    max-height: 0;
}

@media (prefers-color-scheme: dark) {
    .playlist-group-collapse-content {
        border-top: 1px solid #374151;
    }
}

/* 播放列表内容：默认隐藏 */
.playlist-content {
    display: none;
}

/* 激活的播放列表内容：显示 */
.playlist-content.active {
    display: block;
}

/* 音量控制样式 */
.volume-control {
    display: flex;
    align-items: center;
}

/* 移动端适配：音量控制和评论按钮容器 */
@media (max-width: 640px) {
    .volume-control-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
        margin-top: 0.5rem;
    }
    .comment-button-wrapper {
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* 播放模式徽章：绝对定位、小字号、背景色、圆角、内容居中 */
.play-mode-badge {
    position: absolute;
    font-size: 10px;
    top: -4px;
    right: -4px;
    background-color: #3B82F6;
    color: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 音量提示框：绝对定位、背景色、文字样式、透明度过渡 */
.volume-tooltip {
    position: absolute;
    bottom: 100%;
    right: 0;
    margin-bottom: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    white-space: nowrap;
    z-index: 10;
}

@media (prefers-color-scheme: dark) {
    .volume-tooltip {
        background-color: rgba(255, 255, 255, 0.9);
        color: #111827;
    }
}

/* 非iOS移动端音量提示文本：默认隐藏，触摸时显示 */
@media (max-width: 640px) {
    .non-ios-volume-tooltip {
        opacity: 0 !important;
        visibility: hidden !important;
        transition: all 0.2s ease;
    }

    /* 触摸音量控制时显示提示 */
    .volume-control:active .non-ios-volume-tooltip,
    .volume-button:active + .volume-control .non-ios-volume-tooltip {
        opacity: 100 !important;
        visibility: visible !important;
        bottom: auto !important;
        top: -32px !important;
    }
}

/* 自定义进度条样式 */
.progress-track {
    -webkit-appearance: none;
    appearance: none; /* 添加标准属性 */
    height: 12px;
    background-color: #e5e7eb;
    border-radius: 6px;
    outline: none;
    transition: all 0.2s ease;
}

@media (prefers-color-scheme: dark) {
    .progress-track {
        background-color: #4b5563;
    }
}

.progress-track:hover {
    height: 16px;
}

/* WebKit进度条滑块 */
.progress-track::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background-color: #3B82F6;
    cursor: pointer;
    transition: all 0.2s ease;
}

.progress-track::-webkit-slider-thumb:hover {
    transform: scale(1.25);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

/* Firefox进度条滑块 */
.progress-track::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: #3B82F6;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

.progress-track::-moz-range-thumb:hover {
    transform: scale(1.25);
}

/* 控制按钮样式 */
.control-button {
    transition: all 0.2s ease;
}

.control-button:hover {
    transform: scale(1.1);
    outline: none;
}

/* 禁用的控制按钮 */
.control-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: scale(1);
}

/* 歌词高亮样式 */
.lyric-highlight {
    color: #f7b500 !important;
    font-weight: bold;
    font-size: 18px;
    padding: 4px 0;
    margin: 4px 0;
    transition: all 0.3s ease;
    transform: scale(1.05);
}

/* 普通歌词行样式 */
.lyric-line {
    padding: 4px 8px;
    margin: 4px 0;
    transition: all 0.2s ease;
    cursor: pointer;
}

.lyric-line:hover {
    background-color: rgba(229, 231, 235, 0.5);
}

@media (prefers-color-scheme: dark) {
    .lyric-line:hover {
        background-color: rgba(55, 65, 81, 0.5);
    }
}

/* 歌词封面容器样式 */
.lyric-cover-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* 歌词封面样式：固定宽度高度、圆角、阴影、对象适配方式、变换过渡效果 */
.lyric-cover {
    width: 12rem;
    height: 12rem;
    border-radius: 0.75rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: transform 0.5s;
}

.lyric-cover:hover {
    transform: scale(1.05);
}

/* 隐藏原有封面（无歌词时）：透明度为0、禁用指针事件、过渡效果 */
.album-cover-hidden {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.5s;
}

/* 内容自动可见性：优化性能 */
.content-auto {
    content-visibility: auto;
}

/* 播放列表项样式 */
.playlist-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.playlist-item:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
    .playlist-item:hover {
        background-color: rgba(255, 255, 255, 0.05);
    }
}

.playlist-item-active {
    background-color: rgba(59, 130, 246, 0.2);
    border-left: 4px solid #3B82F6;
    font-weight: 500;
}

@media (prefers-color-scheme: dark) {
    .playlist-item-active {
        background-color: rgba(59, 130, 246, 0.3);
    }
}

/* 专辑列表中当前播放项的样式 */
.album-item.active {
    background-color: rgba(59, 130, 246, 0.2);
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .album-item.active {
        background-color: rgba(59, 130, 246, 0.3);
    }
}

/* 专辑封面旋转动画 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-animation {
    animation: rotate 20s linear infinite;
}

/* 轨道切换动画：透明度和缩放变化 */
@keyframes trackChange {
    0% { opacity: 0.7; transform: scale(0.98); } /* 开始状态 */
    50% { opacity: 0.5; transform: scale(0.95); } /* 中间状态 */
    100% { opacity: 1; transform: scale(1); } /* 结束状态 */
}

/* 轨道切换动画：应用动画关键帧 */
.track-transition {
    animation: trackChange 0.5s ease-in-out;
}

/* 响应式调整 */
@media (max-width: 640px) {
    #player-container {
        border-radius: 16px;
    }

    .w-32, .h-32 {
        width: 28px;
        height: 28px;
    }

    .w-40, .h-40 {
        width: 32px;
        height: 32px;
    }

    #song-title {
        font-size: 16px;
    }
}

/* 移动端歌词容器固定高度 */
@media (max-width: 500px) {
    #lyric-container {
        height: 400px !important;
    }
}

/* PC端歌词容器高度 */
@media (min-width: 768px) {
    #lyric-container {
        height: 320px;
    }
}

/* 暗色模式支持 */
.dark .bg-gray-100 {
    background-color: #1f2937;
}

dark .bg-gray-50 {
    background-color: #111827;
}

.dark .text-gray-600 {
    color: #d1d5db;
}

.dark .text-gray-500 {
    color: #9ca3af;
}

.dark .border-gray-200 {
    border-color: #374151;
}

.dark .bg-white {
    background-color: #1f2937;
}

.dark .text-black {
    color: #f3f4f6;
}

.dark .bg-gray-200 {
    background-color: #374151;
}

.dark .text-gray-300 {
    color: #d1d5db;
}

.dark .bg-gray-800 {
    background-color: #1f2937;
}

.dark .bg-gray-900 {
    background-color: #111827;
}

.dark .border-gray-700 {
    border-color: #374151;
}

.dark .text-gray-400 {
    color: #9ca3af;
}

.dark .text-gray-100 {
    color: #f3f4f6;
}

.dark .text-gray-900 {
    color: #f3f4f6;
}


/* 背景图片样式 */
/* 移动端背景：设置背景图片、位置、大小、固定、不重复 */
.bg-mobile {
    background: url('https://dogecloud.xn--9qr844m.cn/Mobile background image.png') center/cover fixed no-repeat; /* 移动端背景 */
}
/* 桌面端背景：媒体查询适配、设置背景图片，并确保优先级高于移动端 */
@media (min-width: 768px) {
    .bg-desktop,
    .bg-mobile.md\:bg-desktop {
        background: url('https://dogecloud.xn--9qr844m.cn/Background picture.png') center/cover fixed no-repeat !important; /* 桌面端背景，使用!important确保优先级 */
    }
}

/* CD选项卡样式 */
.cd-tabs-container {
    display: flex;
    justify-content: space-between;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding: 10px 0;
}

.cd-tab {
    flex: 1;
    padding: 12px 24px;
    margin: 0 10px;
    border: none;
    border-radius: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    color: #000; /* 白色模式下字体为黑色 */
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

/* 活动选项卡样式 */
.playlist-tab-active {
    background-color: #3B82F6;
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.cd-tab:hover:not(.playlist-tab-active) {
    background-color: rgba(255, 255, 255, 0.2);
    color: #3B82F6; /* 白色模式下悬停颜色改为主题色 */
}

/* 暗色模式适配 */
.dark .cd-tab {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff; /* 黑色模式下字体为白色 */
}

.dark .cd-tab:hover:not(.playlist-tab-active) {
    background-color: rgba(255, 255, 255, 0.1);
    color: #93c5fd; /* 黑色模式下悬停颜色改为主题色浅色 */
}

/* 暗色模式下活动选项卡样式 */
.dark .playlist-tab-active {
    background-color: #3B82F6;
    color: white;
}
/* 顶部文本容器样式 */
.top-text-container {
    
    background-color: #ffffff; /* 白色模式背景 - 纯白色 */
    border-radius: 0.5rem; /* 圆角，实现钝角效果 */
    transition: background-color 0.3s ease, border-color 0.3s ease; /* 过渡效果 */
}

/* 暗色模式样式 */
@media (prefers-color-scheme: dark) {
    .top-text-container {
        border-bottom-color: #4b5563; /* 暗色模式边框 */
        background-color: #121826 ; /* 暗色模式背景 - 蓝色主色 */
    }
}
.top-text-container p {
    margin: 0; /* 重置默认边距 */
    line-height: 1.5; /* 行高优化 */
}
/* 优化歌曲信息区域的居中效果 - 已注释 */
/* #song-info-container .pl-0 {
    text-align: center !important;
    padding: 0 1rem;
} */

/* 添加到CSS文件末尾 */
#loading-indicator {
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

/* 确保song-info-container正确布局 */
#song-info-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

/* 当没有歌词时loading-indicator的特殊样式 */
.no-lyrics #loading-indicator {
    width: 100%;
    }

/* 歌曲标题换行样式 */
#song-title {
    white-space: normal !important;
    overflow-wrap: break-word;
    word-break: break-word;
    display: block;
    line-height: 1.3;
}

/* 移除truncate类的截断效果 */
#song-title.truncate {
    white-space: normal !important;
}

/* 确保歌曲信息容器有足够的高度容纳多行标题 */
#song-info-container {
    min-height: 80px;
}

/* 右上角正在播放浮窗样式 */
#now-playing-toast {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* 浮窗显示动画类 */
#now-playing-toast.show {
    transform: translateX(0);
    opacity: 1;
}

/* 暗色模式适配 */
.dark #now-playing-toast {
    background-color: rgba(31, 41, 55, 0.95);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* 浮窗专辑封面过渡效果 */
#toast-cover {
    transition: transform 0.3s ease;
}

#now-playing-toast:hover #toast-cover {
    transform: scale(1.05);
}

/* 响应式调整 */
@media (max-width: 640px) {
    #now-playing-toast {
        max-w-[85%] !important;
        right: 12px !important;
        top: 12px !important;
        padding: 3px !important;
    }
    
    #toast-cover {
        width: 12px !important;
        height: 12px !important;
    }
}

/* 返回顶部按钮样式 */
#back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
    border: none;
}

#back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

#back-to-top:hover {
    background-color: var(--primary-dark-color);
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

#back-to-top:active {
    transform: translateY(-2px);
}

/* 暗色模式适配 */
.dark #back-to-top {
    background-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.dark #back-to-top:hover {
    background-color: var(--primary-dark-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

/* 添加正在播放标题的样式 */
#now-playing-toast .text-primary.dark\:text-primary-dark {
    font-size: 0.75rem; /* text-xs */
    font-weight: 600; /* font-semibold */
    margin-bottom: 0.25rem; /* mb-1 */
    color: var(--primary);
}

.dark #now-playing-toast .text-primary.dark\:text-primary-dark {
    color: var(--primary-dark);
}
