/* ==================== CSS 变量 ==================== */
:root {
    --primary-color: #8b5cf6;
    --primary-light: #a78bfa;
    --primary-dark: #7c3aed;

    --bg-color: #0f0f0f;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-card: #1e1e1e;

    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --text-tertiary: #666666;

    --border-color: #2a2a2a;
    --border-light: #333333;

    --success-color: #22c55e;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;

    --nav-height: 60px;
    --mini-player-height: 64px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);

    --transition-fast: 0.15s ease;
    --transition-normal: 0.25s ease;
    --transition-slow: 0.35s ease;
}

[data-theme="light"] {
    --bg-color: #f5f5f5;
    --bg-secondary: #ffffff;
    --bg-tertiary: #e5e5e5;
    --bg-card: #ffffff;

    --text-primary: #1a1a1a;
    --text-secondary: #666666;
    --text-tertiary: #999999;

    --border-color: #e0e0e0;
    --border-light: #d0d0d0;
}

/* ==================== 基础样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 应用容器 ==================== */
.app-container {
    height: calc(100vh - var(--nav-height) - var(--mini-player-height) - var(--safe-area-bottom));
    overflow: hidden;
    position: relative;
}

.view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.view.active {
    display: flex;
}

/* ==================== 视图头部 ==================== */
.view-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    min-height: 52px;
    flex-shrink: 0;
}

.view-title {
    font-size: 18px;
    font-weight: 600;
    flex: 1;
    text-align: center;
}

.header-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.header-btn:active {
    background: var(--bg-tertiary);
}

.back-btn {
    margin-right: auto;
}

/* ==================== 搜索页 ==================== */
.search-box {
    padding: 12px 16px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    background: var(--bg-tertiary);
    border-radius: 24px;
    padding: 0 12px;
    gap: 8px;
}

.search-input-wrapper i {
    color: var(--text-secondary);
    font-size: 18px;
}

.search-input-wrapper input {
    flex: 1;
    height: 44px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
}

.search-input-wrapper input::placeholder {
    color: var(--text-tertiary);
}

.search-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

.search-btn:active {
    transform: scale(0.95);
}

.filter-row {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.filter-row::-webkit-scrollbar {
    display: none;
}

.filter-select {
    flex-shrink: 0;
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 12px;
    outline: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}

/* ==================== 搜索结果 ==================== */
.search-results {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0;
}

.song-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    transition: background var(--transition-fast);
}

.song-item:active {
    background: var(--bg-tertiary);
}

.song-item.playing {
    background: rgba(139, 92, 246, 0.1);
}

.song-item.playing .song-title {
    color: var(--primary-color);
}

.song-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.song-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-cover i {
    font-size: 24px;
    color: var(--text-tertiary);
}

.song-cover .collection-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    background: var(--primary-color);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
}

.song-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.song-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.song-meta span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.song-artist {
    max-width: 120px;
}

.song-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

.song-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.song-btn:active {
    background: var(--bg-tertiary);
    color: var(--primary-color);
}

/* ==================== 分P列表（合集展开） ==================== */
.collection-pages {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin: 0 16px;
    border-radius: 8px;
    overflow: hidden;
}

.pages-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border-color);
}

.pages-count {
    font-size: 12px;
    color: var(--text-secondary);
}

.pages-list {
    max-height: 300px;
    overflow-y: auto;
}

.page-item {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    border-bottom: 1px solid var(--border-color);
}

.page-item:last-child {
    border-bottom: none;
}

.page-item:active {
    background: var(--bg-secondary);
}

.page-index {
    width: 24px;
    font-size: 12px;
    color: var(--text-tertiary);
    text-align: center;
}

.page-info {
    flex: 1;
    min-width: 0;
}

.page-title {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-duration {
    font-size: 11px;
    color: var(--text-tertiary);
    margin-top: 2px;
}

.page-actions {
    display: flex;
    gap: 4px;
}

.page-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

.loading-pages, .error-pages {
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
}

.loading-pages i {
    animation: spin 1s linear infinite;
}

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

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 12px 16px;
    gap: 6px;
    flex-shrink: 0;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
}

.pagination:empty {
    display: none;
}

.page-btn-nav {
    min-width: 32px;
    height: 32px;
    padding: 0 10px;
    border: none;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: 13px;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-btn-nav.active {
    background: var(--primary-color);
    color: white;
}

.page-btn-nav:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ==================== 歌单列表 ==================== */
.playlist-grid {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-content: start;
}

.playlist-card {
    background: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    transition: transform var(--transition-fast);
}

.playlist-card:active {
    transform: scale(0.98);
}

.playlist-card-cover {
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.playlist-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-card-cover i {
    font-size: 40px;
    color: var(--text-tertiary);
}

.playlist-card-info {
    padding: 10px;
}

.playlist-card-name {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.playlist-card-count {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* ==================== 歌单详情 ==================== */
.playlist-info {
    display: flex;
    padding: 16px;
    gap: 16px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.playlist-cover {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.playlist-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-cover i {
    font-size: 40px;
    color: var(--text-tertiary);
}

.playlist-meta {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.playlist-meta span {
    font-size: 13px;
    color: var(--text-secondary);
}

.playlist-meta p {
    font-size: 12px;
    color: var(--text-tertiary);
    margin-top: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.playlist-actions {
    display: flex;
    padding: 0 16px 16px;
    gap: 12px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.playlist-actions .btn {
    flex: 1;
}

.track-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.track-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.track-item:active {
    background: var(--bg-tertiary);
}

.track-item.playing .track-title {
    color: var(--primary-color);
}

.track-index {
    width: 24px;
    text-align: center;
    font-size: 13px;
    color: var(--text-tertiary);
}

.track-cover {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.track-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.track-cover i {
    font-size: 20px;
    color: var(--text-tertiary);
}

.track-info {
    flex: 1;
    min-width: 0;
}

.track-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.track-artist {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cloud-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 6px;
}

.track-duration {
    font-size: 12px;
    color: var(--text-tertiary);
}

.track-btn {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

/* ==================== 云端存储 ==================== */
.cloud-stats {
    display: flex;
    justify-content: center;
    gap: 32px;
    padding: 20px;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.stat-item i {
    font-size: 28px;
    color: var(--primary-color);
}

.stat-item span {
    font-size: 13px;
    color: var(--text-secondary);
}

.cloud-files {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.cloud-file-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.cloud-file-item:active {
    background: var(--bg-tertiary);
}

.cloud-file-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cloud-file-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cloud-file-cover i {
    font-size: 24px;
    color: var(--text-tertiary);
}

.cloud-file-info {
    flex: 1;
    min-width: 0;
}

.cloud-file-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cloud-file-meta {
    display: flex;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.cloud-file-actions {
    display: flex;
    gap: 4px;
}

/* ==================== 设置页 ==================== */
.settings-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.settings-group {
    padding: 16px;
}

.settings-group:not(:last-child) {
    border-bottom: 8px solid var(--bg-color);
}

.settings-group-title {
    font-size: 12px;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.settings-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
}

.settings-item:last-child {
    border-bottom: none;
}

.settings-item-label {
    display: flex;
    align-items: center;
    gap: 12px;
}

.settings-item-label i {
    font-size: 20px;
    color: var(--text-secondary);
}

.settings-select {
    padding: 6px 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
}

.settings-value {
    color: var(--text-secondary);
    font-size: 13px;
}

.toggle-switch {
    width: 50px;
    height: 28px;
    background: var(--bg-tertiary);
    border-radius: 14px;
    position: relative;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.toggle-switch.active {
    background: var(--primary-color);
}

.toggle-slider {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: transform var(--transition-fast);
}

.toggle-switch.active .toggle-slider {
    transform: translateX(22px);
}

/* ==================== 迷你播放器 ==================== */
.mini-player {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-area-bottom));
    left: 0;
    right: 0;
    height: var(--mini-player-height);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.mini-player-content {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    gap: 10px;
    height: calc(var(--mini-player-height) - 3px);
}

.mini-cover {
    width: 46px;
    height: 46px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mini-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.mini-cover i {
    font-size: 22px;
    color: var(--text-tertiary);
}

.mini-info {
    flex: 1;
    min-width: 0;
}

.mini-title {
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-artist {
    font-size: 12px;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mini-controls {
    display: flex;
    gap: 4px;
}

.mini-btn {
    width: 42px;
    height: 42px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.mini-btn:active {
    background: var(--bg-tertiary);
}

.mini-progress {
    height: 3px;
    background: var(--bg-tertiary);
}

.mini-progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width 0.1s linear;
}

/* ==================== 全屏播放器 ==================== */
.full-player {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 200;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform var(--transition-slow);
}

.full-player.active {
    transform: translateY(0);
}

.full-player-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    padding-top: calc(8px + env(safe-area-inset-top, 0px));
}

.full-player-title {
    font-size: 14px;
    color: var(--text-secondary);
}

.full-player-cover {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cover-disc {
    width: min(280px, 70vw);
    height: min(280px, 70vw);
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 50%, #1a1a1a 100%);
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    animation: rotate 20s linear infinite paused;
}

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

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

.cover-image {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: var(--bg-tertiary);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cover-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover-image i {
    font-size: 60px;
    color: var(--text-tertiary);
}

.full-player-info {
    text-align: center;
    padding: 0 24px;
}

.full-title {
    font-size: 18px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.full-artist {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.full-progress {
    padding: 24px 24px 8px;
}

.progress-bar-wrapper {
    position: relative;
    height: 24px;
    display: flex;
    align-items: center;
}

.progress-bar-bg {
    width: 100%;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width 0.1s linear;
}

.progress-handle {
    position: absolute;
    width: 14px;
    height: 14px;
    background: var(--primary-color);
    border-radius: 50%;
    left: 0;
    transform: translateX(-50%);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

.progress-time {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-tertiary);
}

.full-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 16px 24px;
}

.control-btn {
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.control-btn.active {
    color: var(--primary-color);
}

.control-btn.play-btn {
    width: 64px;
    height: 64px;
    background: var(--primary-color);
    color: white;
    font-size: 32px;
}

.control-btn.play-btn:active {
    transform: scale(0.95);
}

.full-actions {
    display: flex;
    justify-content: space-around;
    padding: 8px 24px;
    padding-bottom: calc(24px + var(--safe-area-bottom));
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 12px;
    cursor: pointer;
    padding: 8px 16px;
}

.action-btn i {
    font-size: 22px;
}

.action-btn.active {
    color: var(--primary-color);
}

/* ==================== 播放队列面板 ==================== */
.queue-panel {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-color);
    z-index: 250;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--transition-slow);
}

.queue-panel.active {
    transform: translateX(0);
}

.queue-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(12px + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border-color);
}

.queue-header h3 {
    font-size: 18px;
    font-weight: 600;
}

.queue-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: var(--safe-area-bottom);
}

.queue-item {
    display: flex;
    align-items: center;
    padding: 10px 16px;
    gap: 12px;
    border-bottom: 1px solid var(--border-color);
}

.queue-item:active {
    background: var(--bg-tertiary);
}

.queue-item.playing {
    background: rgba(139, 92, 246, 0.1);
}

.queue-item.playing .queue-title {
    color: var(--primary-color);
}

.queue-cover {
    width: 44px;
    height: 44px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.queue-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.queue-cover i {
    font-size: 20px;
    color: var(--text-tertiary);
}

.queue-info {
    flex: 1;
    min-width: 0;
}

.queue-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.queue-artist {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.queue-remove {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: var(--text-tertiary);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
}

/* ==================== 底部导航 ==================== */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--nav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    z-index: 150;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    color: var(--text-tertiary);
    font-size: 10px;
    cursor: pointer;
    transition: color var(--transition-fast);
}

.nav-item i {
    font-size: 22px;
}

.nav-item.active {
    color: var(--primary-color);
}

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    color: var(--error-color);
}

/* ==================== 模态框 ==================== */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: none;
}

.modal.active {
    display: block;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease;
}

.modal-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
    padding-bottom: var(--safe-area-bottom);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px;
    border-top: 1px solid var(--border-color);
}

.modal-footer .btn {
    flex: 1;
}

/* ==================== 操作菜单 ==================== */
.action-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 300;
    display: none;
}

.action-sheet.active {
    display: block;
}

.action-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease;
}

.action-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    border-radius: 16px 16px 0 0;
    animation: slideUp 0.3s ease;
    padding-bottom: var(--safe-area-bottom);
}

.action-sheet-header {
    padding: 16px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.action-sheet-header:empty {
    display: none;
}

.action-sheet-list {
    padding: 8px 0;
}

.action-sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    font-size: 15px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.action-sheet-item:active {
    background: var(--bg-tertiary);
}

.action-sheet-item i {
    font-size: 20px;
    color: var(--text-secondary);
    width: 24px;
    text-align: center;
}

.action-sheet-item.danger {
    color: var(--error-color);
}

.action-sheet-item.danger i {
    color: var(--error-color);
}

.action-sheet-cancel {
    padding: 16px;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    border-top: 8px solid var(--bg-color);
    cursor: pointer;
}

/* ==================== 表单 ==================== */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 12px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 15px;
    outline: none;
    transition: border-color var(--transition-fast);
}

.form-input:focus {
    border-color: var(--primary-color);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

textarea.form-input {
    resize: vertical;
    min-height: 80px;
}

/* ==================== Toast 提示 ==================== */
.toast-container {
    position: fixed;
    top: calc(20px + env(safe-area-inset-top, 0px));
    left: 50%;
    transform: translateX(-50%);
    z-index: 400;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    font-size: 14px;
    animation: toastIn 0.3s ease;
}

.toast.hiding {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.toast-icon {
    font-size: 18px;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--error-color);
}

.toast.warning .toast-icon {
    color: var(--warning-color);
}

.toast.info .toast-icon {
    color: var(--info-color);
}

/* ==================== 空状态 ==================== */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--text-tertiary);
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 14px;
    margin-bottom: 16px;
}

/* ==================== 歌单选择列表 ==================== */
.playlist-select-list {
    max-height: 300px;
    overflow-y: auto;
}

.playlist-select-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: background var(--transition-fast);
}

.playlist-select-item:active {
    background: var(--bg-tertiary);
}

.playlist-select-cover {
    width: 48px;
    height: 48px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.playlist-select-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.playlist-select-cover i {
    font-size: 20px;
    color: var(--text-tertiary);
}

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

.playlist-select-name {
    font-size: 14px;
    font-weight: 500;
}

.playlist-select-count {
    font-size: 12px;
    color: var(--text-secondary);
}