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

:root {
    --bg-screen: #0E0E12;
    --bg-card: #1A1A22;
    --bg-input: #14141A;
    --bg-minibar: #16161E;
    --bg-tabbar: #0C0C10;
    --accent: #00C8F0;
    --accent-dim: #0088AA;
    --text-primary: #E8E8F0;
    --text-secondary: #9A9AA8;
    --text-hint: #5E5E6E;
    --border-subtle: #2A2A34;
    --minibar-height: 62px;
    --tabbar-height: 50px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --range-track-height: 4px;
    --range-thumb-size: 16px;
}

[data-theme="light"] {
    --bg-screen: #ECF4FA;
    --bg-card: #FFFFFF;
    --bg-input: #F0F8FF;
    --bg-minibar: #F5F9FF;
    --bg-tabbar: #EAF4FA;
    --accent: #3088CC;
    --accent-dim: #2266AA;
    --text-primary: #1A1A2E;
    --text-secondary: #5A5A6E;
    --text-hint: #8A8A9E;
    --border-subtle: #D0D0DC;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: var(--bg-screen);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', sans-serif;
    color: var(--text-primary);
}

#app {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

/* 页面容器 */
.page {
    position: absolute;
    inset: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: calc(var(--minibar-height) + var(--tabbar-height) + var(--safe-bottom) + 10px);
    display: none;
}
.page.active { display: block; }

/* 底部导航栏 */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--tabbar-height) + var(--safe-bottom));
    padding-bottom: var(--safe-bottom);
    background: var(--bg-tabbar);
    display: flex;
    align-items: center;
    justify-content: space-around;
    border-top: 1px solid var(--border-subtle);
    z-index: 100;
}
.tabbar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 10px;
    color: var(--text-hint);
    cursor: pointer;
}
.tabbar-item.active { color: var(--accent); }
.tabbar-item i { font-size: 20px; }

/* 迷你播放栏 */
.minibar {
    position: fixed;
    bottom: calc(var(--tabbar-height) + var(--safe-bottom));
    left: 0;
    right: 0;
    height: var(--minibar-height);
    background: var(--bg-minibar);
    display: flex;
    align-items: center;
    padding: 0 14px;
    gap: 12px;
    border-top: 1px solid var(--border-subtle);
    cursor: pointer;
    z-index: 99;
}
.minibar-cover {
    width: 44px;
    height: 44px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-hint);
    font-size: 12px;
    overflow: hidden;
}
.minibar-cover img { width: 100%; height: 100%; object-fit: cover; }
.minibar-info { flex: 1; min-width: 0; }
.minibar-title { font-size: 14px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar-lyric { font-size: 11px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.minibar-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.minibar-btn i { font-size: 24px; color: var(--accent); }

/* 全屏播放器 - 三段歌词布局 */
.player-full {
    position: fixed;
    inset: 0;
    background: var(--bg-screen);
    z-index: 200;
    display: none;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.2s;
}
.player-full.show { display: flex; transform: translateY(0); }
.player-close {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-hint);
    font-size: 24px;
    z-index: 2;
}
.player-cover {
    width: min(260px, 60vw);
    height: min(260px, 60vw);
    margin: 50px auto 20px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    border-radius: 12px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
}
.player-cover img { width: 100%; height: 100%; object-fit: cover; }

/* 三段歌词容器 */
.player-lyrics-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 0 24px;
    margin: 16px 0;
    overflow: hidden;
    position: relative;
}
.lyric-line {
    text-align: center;
    font-size: 16px;
    color: var(--text-secondary);
    line-height: 2.2;
    transition: all 0.3s ease;
    white-space: pre-wrap;
    word-break: break-word;
    max-width: 100%;
    opacity: 0.6;
}
.lyric-line.prev, .lyric-line.next {
    font-size: 14px;
    opacity: 0.4;
}
.lyric-line.current {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent);
    opacity: 1;
    margin: 8px 0;
}

/* 进度条 - input range */
.player-progress-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    margin: 10px 0 8px;
    flex-shrink: 0;
}
.player-time { font-size: 11px; color: var(--text-hint); min-width: 36px; }
.player-progress-range {
    flex: 1;
    height: var(--range-track-height);
    -webkit-appearance: none;
    appearance: none;
    background: var(--border-subtle);
    outline: none;
    cursor: pointer;
    border-radius: 2px !important;
    transition: background 0.1s;
}
.player-progress-range::-webkit-slider-runnable-track {
    height: var(--range-track-height);
    background: transparent;
    border-radius: 2px !important;
}
.player-progress-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: var(--range-thumb-size);
    height: var(--range-thumb-size);
    border-radius: 50% !important;
    background: var(--accent);
    margin-top: calc((var(--range-track-height) - var(--range-thumb-size)) / 2);
    box-shadow: 0 0 6px rgba(0,200,240,0.4);
    cursor: pointer;
}
.player-progress-range::-moz-range-track {
    height: var(--range-track-height);
    background: transparent;
    border-radius: 2px !important;
}
.player-progress-range::-moz-range-thumb {
    width: var(--range-thumb-size);
    height: var(--range-thumb-size);
    border-radius: 50% !important;
    background: var(--accent);
    border: none;
    box-shadow: 0 0 6px rgba(0,200,240,0.4);
    cursor: pointer;
}
/* 动态填充背景在 JS 中设置 style.background */

.player-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 28px;
    margin: 12px 0 30px;
    flex-shrink: 0;
}
.player-ctrl-btn {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 28px;
    color: var(--text-primary);
}
.player-ctrl-btn.main-play { font-size: 48px; color: var(--accent); }

.playlist-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    z-index: 250;
    display: none;
    align-items: flex-end;
}
.playlist-overlay.show { display: flex; }
.playlist-panel {
    width: 100%;
    max-height: 60vh;
    background: var(--bg-card);
    border-top: 2px solid var(--accent);
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.2s;
}
.playlist-overlay.show .playlist-panel { transform: translateY(0); }
.playlist-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    gap: 12px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
}
.playlist-item.current { color: var(--accent); }

/* 首页 */
.search-bar {
    margin: 14px 16px;
    height: 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    padding: 0 14px;
    cursor: pointer;
}
.search-bar i { margin-right: 8px; color: var(--text-hint); font-size: 16px; }
.section-title {
    font-size: 16px;
    font-weight: 600;
    padding: 0 16px;
    margin: 10px 0 8px;
}
.scroll-h {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 0 16px;
}
.song-card {
    flex-shrink: 0;
    width: 120px;
    cursor: pointer;
}
.song-card .cover {
    width: 120px;
    height: 120px;
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.song-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.song-card .name { font-size: 13px; margin-top: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-card .singer { font-size: 11px; color: var(--text-hint); }
.song-list {
    display: flex;
    flex-direction: column;
    padding: 0 16px;
}
.song-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 0;
    cursor: pointer;
    border-bottom: 1px solid var(--border-subtle);
}
.song-item .index { width: 22px; text-align: center; font-size: 13px; color: var(--text-hint); }
.song-item .info { flex: 1; }
.song-item .name { font-size: 14px; }
.song-item .singer { font-size: 11px; color: var(--text-hint); }

/* 我的页面 */
.my-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
}
.my-avatar {
    width: 60px;
    height: 60px;
    background: var(--bg-card);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.my-avatar img { width: 100%; height: 100%; object-fit: cover; }
.my-info { flex: 1; }
.my-nickname { font-size: 17px; font-weight: 600; }
.my-meta { font-size: 12px; color: var(--text-hint); margin-top: 4px; }
.my-vip { font-size: 10px; color: var(--accent); border: 1px solid var(--accent); display: inline-block; padding: 2px 6px; margin-top: 4px; }
.my-detail-toggle {
    padding: 10px 16px;
    color: var(--accent);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    border-top: 1px solid var(--border-subtle);
}
.my-detail-content { display: none; padding: 0 16px 10px; }
.my-detail-content.show { display: block; }
.detail-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; }
.playlist-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; border-bottom: 1px solid var(--border-subtle); }
.playlist-cover { width: 46px; height: 46px; background: var(--bg-card); overflow: hidden; }
.playlist-cover img { width: 100%; height: 100%; object-fit: cover; }

/* 登录浮层 */
.login-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-screen);
    z-index: 500;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.login-overlay.show { display: flex; }
.login-dialog {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-top: 3px solid var(--accent);
    padding: 24px 20px;
}
.login-tabs {
    display: flex;
    gap: 16px;
    border-bottom: 2px solid var(--border-subtle);
    padding-bottom: 8px;
    margin-bottom: 20px;
    position: relative;
}
.login-tab {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-hint);
    cursor: pointer;
}
.login-tab.active { color: var(--accent); }
.login-tab-slider {
    position: absolute;
    bottom: -2px;
    height: 2px;
    background: var(--accent);
    transition: left 0.2s, width 0.2s;
}
.login-input {
    width: 75%;
    height: 42px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    padding: 0 12px;
    margin: 0 auto 12px;
    display: block;
}
.login-send-btn {
    width: 75%;
    margin: 0 auto;
    text-align: center;
    font-size: 13px;
    color: var(--accent);
    cursor: pointer;
    padding: 8px;
}
.login-submit {
    width: 75%;
    height: 44px;
    background: var(--accent);
    color: #121218;
    font-weight: 600;
    border: none;
    margin: 10px auto 0;
    display: block;
    cursor: pointer;
}
.login-qr {
    width: 150px;
    height: 150px;
    margin: 0 auto;
    background: var(--bg-input);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.login-qr img { width: 100%; height: 100%; object-fit: contain; }

/* ===== 切换账号对话框 - 精致优化 ===== */
.switch-account-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 600;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.switch-account-overlay.show { display: flex; }
.switch-account-card {
    width: 100%;
    max-width: 380px;
    background: var(--bg-card);
    border-radius: 20px !important;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
    padding: 28px 24px;
    animation: slideUp 0.25s ease-out;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.switch-account-card .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}
.switch-account-card .card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}
.switch-account-card .close-btn {
    background: none;
    border: none;
    color: var(--text-hint);
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    transition: color 0.2s;
}
.switch-account-card .close-btn:hover { color: var(--text-primary); }

/* 账号列表 */
.account-list {
    max-height: 280px;
    overflow-y: auto;
    margin-bottom: 20px;
    padding-right: 4px;
}
.account-list::-webkit-scrollbar {
    width: 4px;
}
.account-list::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 4px !important;
}
.account-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    cursor: pointer;
    border-radius: 12px !important;
    transition: background 0.15s, border-color 0.15s;
    border: 2px solid transparent;
    margin-bottom: 4px;
}
.account-item:hover {
    background: var(--bg-input);
}
.account-item.current {
    border-color: var(--accent);
    background: rgba(0, 200, 240, 0.06);
}
.account-item .avatar {
    width: 44px;
    height: 44px;
    border-radius: 50% !important;
    background: var(--bg-input);
    overflow: hidden;
    flex-shrink: 0;
}
.account-item .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.account-item .info {
    flex: 1;
    min-width: 0;
}
.account-item .info .name {
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.account-item .info .id {
    font-size: 12px;
    color: var(--text-hint);
}
.account-item .badge {
    font-size: 11px;
    color: var(--accent);
    background: rgba(0, 200, 240, 0.12);
    padding: 2px 10px;
    border-radius: 20px !important;
    font-weight: 500;
}

/* 底部按钮 */
.switch-account-card .actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.switch-account-card .actions button {
    padding: 14px;
    background: transparent;
    border: 2px solid var(--accent);
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.2s;
}
.switch-account-card .actions button:hover {
    background: var(--accent);
    color: var(--bg-primary);
    transform: translateY(-1px);
}
.switch-account-card .actions button:active {
    transform: scale(0.98);
}

/* 搜索页 */
.search-page {
    position: fixed;
    inset: 0;
    background: var(--bg-screen);
    z-index: 180;
    display: none;
    flex-direction: column;
}
.search-page.show { display: flex; }
.search-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
}
.search-input {
    flex: 1;
    height: 38px;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    padding: 0 12px;
}
.search-cancel { font-size: 14px; color: var(--text-hint); cursor: pointer; }
.search-results { flex: 1; overflow-y: auto; }

/* Toast */
.toast {
    position: fixed;
    top: 20px;
    right: 16px;
    background: var(--bg-card);
    color: var(--text-primary);
    padding: 10px 16px;
    border-left: 3px solid var(--accent);
    z-index: 9999;
    font-size: 13px;
    transform: translateX(130%);
    transition: transform 0.2s;
    max-width: 260px;
    border-radius: 8px !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}
.toast.show { transform: translateX(0); }