/**
 * 网页音乐播放器 - 页面样式
 * Web Music Player - Page Styles
 */

/* 主题CSS变量 - Apple Blue */
:root {
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --secondary-text: #6e6e73;
    --primary-color: #007aff;
    --hover-color: #0066d6;
    --border-color: #d2d2d7;
    --player-bg: #fff;
    --item-hover: #f0f0f2;
    --item-active: #e5f1ff;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --panel-bg: #fff;
    --success-color: #34c759;
    --warning-color: #ff9500;
    --danger-color: #ff3b30;
}

/* 暗色主题 */
[data-theme='dark'] {
    --bg-color: #1d1d1f;
    --text-color: #f5f5f7;
    --secondary-text: #a1a1a6;
    --primary-color: #0a84ff;
    --hover-color: #409cff;
    --border-color: #424245;
    --player-bg: #2d2d2f;
    --item-hover: #3d3d3f;
    --item-active: #1c3a5f;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --panel-bg: #2d2d2f;
}

/* 返回按钮 */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 1002;
}

[data-theme='dark'] .back-button {
    background: rgba(45, 45, 47, 0.8);
}

.back-button:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(-2px);
}

/* 登录提示 */
.login-notice {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 149, 0, 0.3);
    padding: 40px 60px;
    border-radius: 20px;
    text-align: center;
    z-index: 1100;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

[data-theme='dark'] .login-notice {
    background: rgba(45, 45, 47, 0.95);
}

.login-notice p {
    margin: 0 0 16px 0;
    color: #ff9500;
    font-size: 18px;
}

.login-link {
    display: inline-block;
    padding: 10px 30px;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    font-weight: 500;
    border-radius: 25px;
    transition: all 0.2s ease;
}

.login-link:hover {
    background: var(--hover-color);
    transform: scale(1.05);
}

/* 用户状态栏 - 位于主题切换下方（间距 8px） */
.user-bar {
    position: fixed;
    top: 76px;
    right: 20px;
    z-index: 1001;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

[data-theme='dark'] .user-info {
    background: rgba(45, 45, 47, 0.9);
}

.user-avatar {
    width: 28px;
    height: 28px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
}

.user-name {
    font-size: 14px;
    color: var(--text-color);
    font-weight: 500;
}

/* 用户下拉菜单 */
.user-info {
    position: relative;
    cursor: pointer;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 120px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
    overflow: hidden;
}

.user-info:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

[data-theme='dark'] .user-dropdown {
    background: rgba(45, 45, 47, 0.95);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.dropdown-item:hover {
    background: var(--hover-color);
}

.dropdown-item i {
    width: 16px;
    text-align: center;
    color: var(--secondary-text);
}

.dropdown-item.logout:hover {
    background: rgba(255, 59, 48, 0.1);
    color: #ff3b30;
}

.dropdown-item.logout:hover i {
    color: #ff3b30;
}

/* 页面主体 */
body {
    margin: 0;
    padding-bottom: 100px;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: all 0.3s;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* 三栏布局 */
.main-content {
    display: flex;
    gap: 20px;
    padding: 80px 20px 20px 20px;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - 200px);
}

/* 面板通用样式 */
.panel {
    flex: 1;
    background: var(--panel-bg);
    border-radius: 16px;
    box-shadow: 0 2px 10px var(--shadow-color);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 280px;
}

.panel-header {
    padding: 16px 20px;
    background: var(--item-hover);
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

/* 正在播放的面板高亮 */
.panel.playing .panel-header {
    background: linear-gradient(135deg, rgba(52, 199, 89, 0.15), rgba(52, 199, 89, 0.05));
    border-bottom-color: rgba(52, 199, 89, 0.3);
}

.panel.playing .panel-header h3 {
    color: #34c759;
}

.panel.playing .panel-header h3::before {
    content: '🎵 ';
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.panel-actions {
    display: flex;
    gap: 8px;
}

/* 刷新按钮旋转动画 */
.btn-refresh i {
    transition: transform 0.3s ease;
}

.btn-refresh.spinning i {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* 搜索框 */
.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
}

.search-box i {
    color: var(--secondary-text);
    font-size: 14px;
}

.search-box input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    color: var(--text-color);
    outline: none;
}

.search-box input::placeholder {
    color: var(--secondary-text);
}

/* 拖拽提示区 */
.drop-hint {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    color: var(--secondary-text);
    text-align: center;
    border: 2px dashed transparent;
    border-radius: 12px;
    margin: 8px;
    transition: all 0.3s ease;
}

.drop-hint i {
    font-size: 32px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.drop-hint p {
    margin: 0;
    font-size: 14px;
}

.playlist-list.drag-over .drop-hint {
    border-color: var(--primary-color);
    background: rgba(0, 122, 255, 0.1);
    color: var(--primary-color);
}

.playlist-list.drag-over .drop-hint i {
    opacity: 1;
}

.current-playlist.drag-over {
    background: rgba(0, 122, 255, 0.05);
}

/* 按钮样式 */
.btn-small {
    padding: 6px 10px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    min-width: auto;
    height: auto;
}

.btn-small:hover {
    background: var(--hover-color);
    transform: scale(1.05);
}

.btn-share-all {
    background: var(--success-color);
}

.btn-unshare-all {
    background: var(--warning-color);
}

/* 自己的歌曲标记 */
.own-badge {
    display: inline-block;
    font-size: 10px;
    padding: 2px 6px;
    background: var(--primary-color);
    color: white;
    border-radius: 10px;
    margin-left: 6px;
    vertical-align: middle;
}

.song-item.own-song {
    border-left: 3px solid var(--primary-color);
}

.btn-create {
    background: var(--success-color);
}

/* 批量操作按钮 */
.btn-batch {
    background: var(--primary-color);
}

.btn-batch.active {
    background: var(--warning-color);
}

/* 批量操作工具栏 */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: var(--item-hover);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    cursor: pointer;
    color: var(--text-color);
}

.select-all-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.selected-count {
    font-size: 13px;
    color: var(--secondary-text);
    margin-left: auto;
}

.batch-actions {
    display: flex;
    gap: 8px;
}

.batch-actions button {
    padding: 6px 10px;
    font-size: 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: var(--primary-color);
    color: white;
    transition: all 0.2s ease;
}

.batch-actions button:hover {
    transform: scale(1.05);
}

.batch-actions button.danger {
    background: var(--danger-color);
}

/* 歌曲复选框 */
.song-checkbox {
    width: 18px;
    height: 18px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: var(--primary-color);
    flex-shrink: 0;
}

.song-item.selected {
    background: rgba(0, 122, 255, 0.1);
    border-left: 3px solid var(--primary-color);
}

/* 正在播放的歌曲高亮样式 */
.song-item.active {
    background: rgba(52, 199, 89, 0.15);
    border-left: 3px solid #34c759;
}

.song-item.active .song-title {
    color: #34c759;
    font-weight: 600;
}

/* 上传区域 */
.upload-area {
    margin: 16px;
    padding: 20px;
    border: 2px dashed var(--primary-color);
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 122, 255, 0.05);
}

.upload-area:hover {
    background: rgba(0, 122, 255, 0.1);
    border-style: solid;
}

.upload-area.dragover {
    background: rgba(0, 122, 255, 0.15);
    border-style: solid;
    transform: scale(1.02);
}

.upload-icon {
    font-size: 32px;
    color: var(--primary-color);
    margin-bottom: 8px;
}

.upload-area p {
    margin: 0;
    color: var(--secondary-text);
    font-size: 14px;
}

.upload-progress {
    margin: 16px;
    padding: 16px;
    background: var(--item-hover);
    border-radius: 12px;
}

.upload-progress .progress-bar {
    height: 6px;
    background: var(--border-color);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.upload-progress .progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

#uploadStatus {
    margin: 0;
    font-size: 12px;
    color: var(--secondary-text);
    text-align: center;
}

/* 歌曲列表 */
.song-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.song-list::-webkit-scrollbar {
    width: 6px;
}

.song-list::-webkit-scrollbar-track {
    background: transparent;
}

.song-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.empty-hint {
    text-align: center;
    color: var(--secondary-text);
    padding: 40px 20px;
    font-size: 14px;
}

/* 歌曲项目 */
.song-item {
    padding: 12px 16px;
    margin: 4px 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--panel-bg);
    border: 1px solid transparent;
}

.song-item:hover {
    background: var(--item-hover);
}

.song-item.active {
    background: var(--item-active);
    border-color: var(--primary-color);
}

.song-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.song-info {
    flex: 1;
    min-width: 0;
}

.song-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.song-artist {
    font-size: 12px;
    color: var(--secondary-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-uploader {
    font-size: 11px;
    color: var(--primary-color);
    margin-top: 2px;
}

.song-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.song-item:hover .song-actions {
    opacity: 1;
}

.song-action-btn {
    padding: 4px 8px;
    border: none;
    background: transparent;
    color: var(--secondary-text);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    min-width: auto;
    height: auto;
}

.song-action-btn:hover {
    background: var(--item-hover);
    color: var(--primary-color);
}

.song-action-btn.shared {
    color: var(--success-color);
}

.song-action-btn.delete:hover {
    color: var(--danger-color);
}

/* 歌单列表 */
.playlist-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.playlist-item {
    padding: 16px;
    margin: 4px 0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--panel-bg);
    border: 2px solid transparent;
}

.playlist-item:hover {
    background: var(--item-hover);
}

.playlist-item.drag-over {
    border-color: var(--primary-color);
    background: var(--item-active);
}

.playlist-item.active {
    background: var(--item-active);
    border-color: var(--primary-color);
}

/* 正在播放的歌单高亮 */
.playlist-item.playing {
    background: rgba(52, 199, 89, 0.15);
    border-color: #34c759;
}

.playlist-item.playing .playlist-name {
    color: #34c759;
    font-weight: 600;
}

.playlist-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.playlist-icon {
    font-size: 24px;
}

.playlist-name {
    font-size: 14px;
    font-weight: 500;
}

.playlist-count {
    font-size: 12px;
    color: var(--secondary-text);
    background: var(--item-hover);
    padding: 2px 8px;
    border-radius: 10px;
}

.playlist-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
}

.playlist-item:hover .playlist-actions {
    opacity: 1;
}

/* 当前歌单详情 */
.current-playlist {
    border-top: 1px solid var(--border-color);
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.playlist-header-bar {
    padding: 12px 16px;
    background: var(--item-hover);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.playlist-songs {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

/* 底部播放器 */
.bottom-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--player-bg);
    box-shadow: 0 -2px 10px var(--shadow-color);
    padding: 10px 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    z-index: 1000;
}

.player-left {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    min-width: 0;
}

.current-track-info {
    min-width: 0;
    overflow: hidden;
}

.track-title {
    margin: 0;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
}

.player-center {
    flex: 2;
    max-width: 600px;
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

/* 播放控制按钮 - 现代风格 */
.control-btn {
    padding: 0;
    border: none;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--primary-color), #0051a8);
    color: white;
    cursor: pointer;
    font-size: 14px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.control-btn:hover {
    background: linear-gradient(145deg, #409cff, var(--primary-color));
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(0, 122, 255, 0.4);
}

.control-btn:active {
    transform: scale(0.95);
}

/* 播放/暂停按钮 - 更大更突出 */
.control-btn.play-btn {
    width: 52px;
    height: 52px;
    font-size: 18px;
    background: linear-gradient(145deg, #34c759, #28a745);
    box-shadow: 0 4px 16px rgba(52, 199, 89, 0.4);
}

.control-btn.play-btn:hover {
    background: linear-gradient(145deg, #5dd879, #34c759);
    box-shadow: 0 6px 20px rgba(52, 199, 89, 0.5);
}

/* 播放模式按钮 - 次要样式 */
.control-btn.mode-btn {
    width: 36px;
    height: 36px;
    font-size: 12px;
    background: rgba(128, 128, 128, 0.2);
    color: var(--secondary-text);
    box-shadow: none;
}

.control-btn.mode-btn:hover {
    background: rgba(128, 128, 128, 0.3);
    color: var(--text-color);
    box-shadow: none;
}

.control-btn.mode-btn.active {
    background: linear-gradient(145deg, var(--primary-color), #0051a8);
    color: white;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.progress-container {
    width: 100%;
    height: 6px;
    background-color: var(--border-color);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

#progress {
    width: 0%;
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 3px;
    position: relative;
    transition: width 0.1s linear;
}

.progress-handle {
    width: 14px;
    height: 14px;
    background-color: var(--primary-color);
    border-radius: 50%;
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.progress-container:hover .progress-handle {
    opacity: 1;
}

.player-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.time-display {
    font-size: 12px;
    color: var(--secondary-text);
}

/* 音量控制 */
.volume-control {
    display: flex;
    align-items: center;
    margin-left: 20px;
    position: relative;
    /* 让弹窗相对于此定位 */
}

.volume-icon {
    color: var(--success-color);
    margin-right: 10px;
    cursor: pointer;
    font-size: 18px;
}

.volume-bar {
    position: relative;
    width: 80px;
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    cursor: pointer;
}

.volume-progress {
    position: absolute;
    height: 100%;
    background: var(--success-color);
    border-radius: 2px;
    width: 100%;
}

.volume-handle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translate(50%, -50%);
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border-radius: 50%;
    cursor: pointer;
}

.volume-percentage {
    position: absolute;
    left: calc(100% + 15px);
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    color: var(--secondary-text);
    min-width: 40px;
}

/* 开关切换样式 */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.toggle-text {
    font-size: 12px;
    color: var(--secondary-text);
}

.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    background: var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-switch.active {
    background: var(--success-color);
}

.toggle-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch.active .toggle-slider {
    left: 22px;
}

/* 主题切换容器 */
.theme-toggle-container {
    position: fixed;
    top: 24px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    z-index: 1002;
}

[data-theme='dark'] .theme-toggle-container {
    background: rgba(45, 45, 47, 0.9);
}

.theme-icon {
    font-size: 16px;
}

/* 弹窗样式 */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal-content {
    background: var(--panel-bg);
    border-radius: 16px;
    padding: 24px;
    min-width: 320px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-content h3 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-color);
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 12px;
    color: var(--secondary-text);
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-color);
    color: var(--text-color);
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 20px;
}

.btn-cancel {
    padding: 10px 20px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-color);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-confirm {
    padding: 10px 20px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

.btn-confirm:hover {
    background: var(--hover-color);
}

/* 歌单选择弹窗 */
.playlist-select-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.playlist-select-content {
    background: var(--panel-bg);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    min-width: 280px;
    max-width: 90vw;
    max-height: 60vh;
    overflow: hidden;
}

.playlist-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.playlist-select-header h4 {
    margin: 0;
    font-size: 16px;
    color: var(--text-color);
}

.playlist-select-header .close-btn {
    background: none;
    border: none;
    color: var(--secondary-text);
    cursor: pointer;
    padding: 4px;
    font-size: 16px;
}

.playlist-select-header .close-btn:hover {
    color: var(--text-color);
}

.playlist-select-list {
    max-height: 300px;
    overflow-y: auto;
}

.playlist-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-color);
}

.playlist-select-item:hover {
    background: var(--item-hover);
}

.playlist-select-item i {
    color: var(--primary-color);
    font-size: 14px;
}

/* 已添加到歌单的绿色指示 */
.playlist-select-item.in-playlist {
    background: rgba(52, 199, 89, 0.15);
    cursor: default;
}

.playlist-select-item.in-playlist:hover {
    background: rgba(52, 199, 89, 0.2);
}

.playlist-select-item.in-playlist i {
    color: #34c759;
}

.added-hint {
    margin-left: auto;
    font-size: 12px;
    color: #34c759;
    font-weight: 500;
}

/* 添加到歌单按钮 - 已在歌单中显示绿色 */
.song-action-btn.in-playlist {
    color: #34c759;
}

.song-action-btn.in-playlist:hover {
    background: rgba(52, 199, 89, 0.15);
}

/* 响应式布局 */
@media (max-width: 1200px) {
    .main-content {
        flex-wrap: wrap;
    }

    .panel {
        min-width: 45%;
        flex: 1 1 45%;
    }

    .pool-panel {
        flex: 1 1 100%;
    }
}

@media (max-width: 768px) {

    /* 防止 body 滚动，让 main-content 成为滚动容器 */
    body {
        overflow: hidden;
        height: 100vh;
    }

    /* 横向三栏布局 - 左右滑动吸附 */
    .main-content {
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        position: fixed !important;
        top: 45px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 90px !important;
        padding: 0 !important;
        gap: 0 !important;
        width: 100% !important;
        height: auto !important;
        max-width: none !important;
        margin: 0 !important;
        box-sizing: border-box;
        /* 横向滚动吸附 */
        overflow-x: scroll;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    /* 面板 - 横向排列，每个面板占满屏幕宽度和高度 */
    .panel {
        min-width: 100vw;
        width: 100vw;
        flex: 0 0 100vw;
        box-sizing: border-box;
        height: calc(100vh - 135px) !important;
        /* 占满屏幕（头部45px + 播放栏90px） */
        min-height: calc(100vh - 135px) !important;
        max-height: none !important;
        /* 滚动吸附 - 每个面板作为吸附点 */
        scroll-snap-align: start;
        scroll-snap-stop: always;
        overflow-y: auto;
        padding: 8px;
    }

    /* 我的音乐面板 */
    .my-music-panel {
        order: 1;
    }

    /* 播放列表面板 */
    .playlist-panel {
        order: 2;
    }

    /* 公共音乐池面板 */
    .pool-panel {
        order: 3;
    }

    /* 移动端上传区域 - 缩小 */
    .upload-area {
        padding: 15px;
        min-height: 60px;
    }

    .upload-area i {
        font-size: 24px;
        margin-bottom: 4px;
    }

    .upload-area p {
        font-size: 12px;
        margin: 0;
    }

    /* 移动端拖拽提示 - 缩小 */
    .drop-hint {
        padding: 10px;
        min-height: 40px;
    }

    .drop-hint i {
        font-size: 18px;
    }

    .drop-hint p {
        font-size: 11px;
        margin: 4px 0 0 0;
    }

    /* 面板头部 */
    .panel-header {
        padding: 12px 16px;
    }

    .panel-header h3 {
        font-size: 14px;
    }

    /* 歌曲列表项 */
    .song-item {
        padding: 10px 12px;
    }

    .song-name {
        font-size: 13px;
    }

    .song-duration {
        font-size: 11px;
    }

    /* 主题切换 - 移动端 - 在顶部栏右侧 */
    .theme-toggle-container {
        position: fixed;
        top: 8px;
        right: 12px;
        padding: 4px 8px;
        height: 32px;
        display: flex;
        align-items: center;
        z-index: 1001;
    }

    .theme-toggle-container .theme-icon {
        font-size: 14px;
    }

    .theme-toggle-container .theme-switch {
        width: 36px;
        height: 18px;
    }

    .theme-toggle-container .theme-switch::before {
        width: 14px;
        height: 14px;
    }

    .theme-toggle-container input:checked+.theme-switch::before {
        transform: translateX(18px);
    }

    /* 用户栏 - 移动端 - 在返回按钮右边 */
    .user-bar {
        position: fixed !important;
        top: 8px !important;
        left: 100px !important;
        right: auto !important;
        z-index: 1001;
        background: transparent !important;
    }

    .user-info {
        padding: 4px 8px;
        gap: 4px;
        height: 32px;
        box-sizing: border-box;
        background: var(--card-bg);
        border-radius: 16px;
    }

    .user-avatar {
        width: 24px;
        height: 24px;
        font-size: 12px;
    }

    .user-name {
        font-size: 12px;
        max-width: 50px;
        display: none;
        /* 移动端隐藏用户名，只显示头像 */
    }

    .user-dropdown {
        min-width: 90px;
    }

    .dropdown-item {
        padding: 8px 12px;
        font-size: 12px;
    }

    /* 移动端点击显示下拉菜单 */
    .user-info.dropdown-open .user-dropdown {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* 头部 */
    .header {
        padding: 12px 16px;
    }

    .header h1 {
        font-size: 18px;
    }

    /* 返回按钮 - 移动端 */
    .back-button {
        position: fixed;
        top: 8px;
        left: 12px;
        padding: 6px 12px;
        font-size: 0.8rem;
        height: 32px;
        display: flex;
        align-items: center;
        z-index: 1001;
    }

    /* 播放器控制栏 */
    .player-bar {
        padding: 12px 16px;
    }

    .player-controls button {
        width: 36px;
        height: 36px;
    }

    .player-controls button span {
        font-size: 16px;
    }

    #play-pause {
        width: 48px;
        height: 48px;
    }

    #play-pause span {
        font-size: 20px;
    }

    .track-info h4 {
        font-size: 13px;
    }

    .track-info p {
        font-size: 11px;
    }

    /* 上传区域 */
    .upload-zone {
        padding: 20px;
    }

    .upload-zone p {
        font-size: 12px;
    }
}

@media (max-width: 480px) {

    /* 超小屏幕 */
    .main-content {
        padding: 60px 8px 110px 8px;
        gap: 8px;
    }

    .theme-toggle-container {
        top: 8px;
        right: 8px;
        padding: 4px 8px;
    }

    .user-bar {
        top: 48px;
        right: 8px;
    }

    .user-name {
        display: none;
    }

    .user-info {
        padding: 4px;
        border-radius: 50%;
    }

    .header h1 {
        font-size: 16px;
    }

    .back-button {
        top: 8px;
        left: 8px;
        padding: 4px 10px;
        font-size: 0.75rem;
    }

    /* 面板高度调整 */
    .playlist-panel {
        max-height: 30vh;
    }

    .pool-panel {
        max-height: 20vh;
    }

    .upload-panel {
        max-height: 25vh;
    }

    /* 播放器控制栏 - 移动端完整适配 */
    .bottom-player {
        padding: 8px 12px;
        flex-direction: column;
        gap: 8px;
        height: auto;
    }

    /* 第一行：歌曲信息 + 控制按钮 */
    .player-left {
        display: none;
        /* 移动端隐藏左侧歌曲信息区 */
    }

    .player-center {
        width: 100%;
        max-width: none;
        order: 1;
    }

    .player-controls {
        gap: 8px;
        margin-bottom: 6px;
        justify-content: center;
    }

    /* 控制按钮尺寸调整 */
    .control-btn {
        width: 36px;
        height: 36px;
        font-size: 12px;
    }

    .control-btn.play-btn {
        width: 48px;
        height: 48px;
        font-size: 16px;
    }

    .control-btn.mode-btn {
        width: 32px;
        height: 32px;
        font-size: 11px;
    }

    /* 音量控制 - 移动端隐藏 */
    .volume-control {
        display: none;
    }

    /* 进度条 */
    .progress-container {
        height: 4px;
    }

    .progress-handle {
        width: 12px;
        height: 12px;
        right: -6px;
        opacity: 1;
        /* 移动端始终显示 */
    }

    /* 第二行：时间显示 */
    .player-right {
        width: 100%;
        order: 2;
        justify-content: center;
    }

    .time-display {
        font-size: 11px;
    }

    /* 当前播放歌曲信息 - 显示在控制按钮上方 */
    .track-title {
        font-size: 12px;
        text-align: center;
        margin-bottom: 4px;
        max-width: 100%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}