/* ============================================================
   主题变量
   ============================================================ */
:root,
.theme-default {
    --bg-gradient-start: #f9f3e6;
    --bg-gradient-end: #e8e0d5;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.78;
    --text-primary: #2d241e;
    --text-secondary: #6b4e3a;
    --card-bg-r: 255; --card-bg-g: 255; --card-bg-b: 255;
    --player-card-bg-r: 30; --player-card-bg-g: 20; --player-card-bg-b: 15;
    --lyrics-card-bg-r: 255; --lyrics-card-bg-g: 250; --lyrics-card-bg-b: 240;
    --lyrics-text: #6f4e36;
    --lyrics-active-bg: #fff0e4;
    --lyrics-active-color: #d44c2f;
    --border-color: #f0e2d4;
    --btn-bg: #2c2c2c;
    --btn-text: white;
    --progress-played: #d44c2f;
    --progress-unplayed: #f0e2d4;
    --progress-bg: #f0e2d4;
    --progress-thumb: #d44c2f;
    --ctrl-btn-bg: #f0cfb6;
    --ctrl-btn-color: #4f2a18;
    --bg-blur-amount: 0px;
    --card-opacity: 1;
    --mask-opacity: 0.3;
    --font-scale: 1;
}
.theme-dark {
    --bg-gradient-start: #1a1a2e; --bg-gradient-end: #16213e;
    --container-bg-r: 0; --container-bg-g: 0; --container-bg-b: 0;
    --container-opacity: 0.78;
    --text-primary: #e0e0e0; --text-secondary: #b0b0b0;
    --card-bg-r: 30; --card-bg-g: 30; --card-bg-b: 40;
    --player-card-bg-r: 10; --player-card-bg-g: 10; --player-card-bg-b: 15;
    --lyrics-card-bg-r: 25; --lyrics-card-bg-g: 25; --lyrics-card-bg-b: 35;
    --lyrics-text: #c0c0c0; --lyrics-active-bg: #2a2a3a; --lyrics-active-color: #ea8c5c;
    --border-color: #3a3a4a; --btn-bg: #3a3a4a; --btn-text: #e0e0e0;
    --progress-played: #ea8c5c; --progress-unplayed: #3a3a4a;
    --progress-bg: #3a3a4a; --progress-thumb: #ea8c5c;
    --ctrl-btn-bg: #3a3a4a; --ctrl-btn-color: #e0e0e0;
}
.theme-ocean {
    --bg-gradient-start: #e0f2f1; --bg-gradient-end: #b2dfdb;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.85;
    --text-primary: #004d40; --text-secondary: #00695c;
    --card-bg-r: 255; --card-bg-g: 255; --card-bg-b: 255;
    --player-card-bg-r: 0; --player-card-bg-g: 77; --player-card-bg-b: 64;
    --lyrics-card-bg-r: 224; --lyrics-card-bg-g: 242; --lyrics-card-bg-b: 241;
    --lyrics-text: #004d40; --lyrics-active-bg: #b2dfdb; --lyrics-active-color: #00796b;
    --border-color: #b2dfdb; --btn-bg: #00796b; --btn-text: white;
    --progress-played: #00796b; --progress-unplayed: #b2dfdb;
    --progress-bg: #b2dfdb; --progress-thumb: #00796b;
    --ctrl-btn-bg: #b2dfdb; --ctrl-btn-color: #004d40;
}
.theme-purple {
    --bg-gradient-start: #f3e5f5; --bg-gradient-end: #e1bee7;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.85;
    --text-primary: #4a148c; --text-secondary: #6a1b9a;
    --card-bg-r: 255; --card-bg-g: 255; --card-bg-b: 255;
    --player-card-bg-r: 74; --player-card-bg-g: 20; --player-card-bg-b: 140;
    --lyrics-card-bg-r: 243; --lyrics-card-bg-g: 229; --lyrics-card-bg-b: 245;
    --lyrics-text: #4a148c; --lyrics-active-bg: #e1bee7; --lyrics-active-color: #8e24aa;
    --border-color: #ce93d8; --btn-bg: #8e24aa; --btn-text: white;
    --progress-played: #8e24aa; --progress-unplayed: #e1bee7;
    --progress-bg: #e1bee7; --progress-thumb: #8e24aa;
    --ctrl-btn-bg: #e1bee7; --ctrl-btn-color: #4a148c;
}
.theme-sunset {
    --bg-gradient-start: #fff3e0; --bg-gradient-end: #ffe0b2;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.85;
    --text-primary: #bf360c; --text-secondary: #e65100;
    --card-bg-r: 255; --card-bg-g: 255; --card-bg-b: 255;
    --player-card-bg-r: 191; --player-card-bg-g: 54; --player-card-bg-b: 12;
    --lyrics-card-bg-r: 255; --lyrics-card-bg-g: 243; --lyrics-card-bg-b: 224;
    --lyrics-text: #bf360c; --lyrics-active-bg: #ffe0b2; --lyrics-active-color: #f57c00;
    --border-color: #ffcc80; --btn-bg: #f57c00; --btn-text: white;
    --progress-played: #f57c00; --progress-unplayed: #ffe0b2;
    --progress-bg: #ffe0b2; --progress-thumb: #f57c00;
    --ctrl-btn-bg: #ffe0b2; --ctrl-btn-color: #bf360c;
}
.theme-gray {
    --bg-gradient-start: #e8e8e8; --bg-gradient-end: #c8c8c8;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.82;
    --text-primary: #2a2a2a; --text-secondary: #666666;
    --card-bg-r: 248; --card-bg-g: 248; --card-bg-b: 248;
    --player-card-bg-r: 58; --player-card-bg-g: 58; --player-card-bg-b: 58;
    --lyrics-card-bg-r: 248; --lyrics-card-bg-g: 248; --lyrics-card-bg-b: 248;
    --lyrics-text: #4a4a4a; --lyrics-active-bg: #e0e0e0; --lyrics-active-color: #3a3a3a;
    --border-color: #d8d8d8; --btn-bg: #4a4a4a; --btn-text: white;
    --progress-played: #4a4a4a; --progress-unplayed: #e0e0e0;
    --progress-bg: #e0e0e0; --progress-thumb: #4a4a4a;
    --ctrl-btn-bg: #d8d8d8; --ctrl-btn-color: #2a2a2a;
}
.theme-deep-purple {
    --bg-gradient-start: #2d1b4e; --bg-gradient-end: #14082a;
    --container-bg-r: 20; --container-bg-g: 8; --container-bg-b: 42;
    --container-opacity: 0.82;
    --text-primary: #e8dcf5; --text-secondary: #b8a5d8;
    --card-bg-r: 58; --card-bg-g: 36; --card-bg-b: 97;
    --player-card-bg-r: 26; --player-card-bg-g: 15; --player-card-bg-b: 48;
    --lyrics-card-bg-r: 45; --lyrics-card-bg-g: 27; --lyrics-card-bg-b: 78;
    --lyrics-text: #b8a5d8; --lyrics-active-bg: #3a2461; --lyrics-active-color: #b589ff;
    --border-color: #4a3578; --btn-bg: #6a4eab; --btn-text: white;
    --progress-played: #b589ff; --progress-unplayed: #3a2461;
    --progress-bg: #3a2461; --progress-thumb: #b589ff;
    --ctrl-btn-bg: #3a2461; --ctrl-btn-color: #e8dcf5;
}
.theme-lavender {
    --bg-gradient-start: #e8dcf5; --bg-gradient-end: #d4c4ea;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.84;
    --text-primary: #4a3b6b; --text-secondary: #6b5a8a;
    --card-bg-r: 245; --card-bg-g: 240; --card-bg-b: 252;
    --player-card-bg-r: 74; --player-card-bg-g: 59; --player-card-bg-b: 107;
    --lyrics-card-bg-r: 245; --lyrics-card-bg-g: 240; --lyrics-card-bg-b: 252;
    --lyrics-text: #6b5a8a; --lyrics-active-bg: #e8dcf5; --lyrics-active-color: #9c7ac9;
    --border-color: #d4c4ea; --btn-bg: #9c7ac9; --btn-text: white;
    --progress-played: #9c7ac9; --progress-unplayed: #d4c4ea;
    --progress-bg: #d4c4ea; --progress-thumb: #9c7ac9;
    --ctrl-btn-bg: #e8dcf5; --ctrl-btn-color: #4a3b6b;
}
.theme-mono {
    --bg-gradient-start: #ffffff; --bg-gradient-end: #e8e8e8;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.9;
    --text-primary: #000000; --text-secondary: #555555;
    --card-bg-r: 255; --card-bg-g: 255; --card-bg-b: 255;
    --player-card-bg-r: 0; --player-card-bg-g: 0; --player-card-bg-b: 0;
    --lyrics-card-bg-r: 255; --lyrics-card-bg-g: 255; --lyrics-card-bg-b: 255;
    --lyrics-text: #333333; --lyrics-active-bg: #e8e8e8; --lyrics-active-color: #000000;
    --border-color: #cccccc; --btn-bg: #000000; --btn-text: white;
    --progress-played: #000000; --progress-unplayed: #dddddd;
    --progress-bg: #dddddd; --progress-thumb: #000000;
    --ctrl-btn-bg: #e8e8e8; --ctrl-btn-color: #000000;
}
.theme-mint {
    --bg-gradient-start: #d4f5e8; --bg-gradient-end: #aee9d1;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.85;
    --text-primary: #1a5c4a; --text-secondary: #3a7f6a;
    --card-bg-r: 232; --card-bg-g: 250; --card-bg-b: 243;
    --player-card-bg-r: 26; --player-card-bg-g: 92; --player-card-bg-b: 74;
    --lyrics-card-bg-r: 232; --lyrics-card-bg-g: 250; --lyrics-card-bg-b: 243;
    --lyrics-text: #3a7f6a; --lyrics-active-bg: #b8e8d4; --lyrics-active-color: #2a9d7f;
    --border-color: #aee9d1; --btn-bg: #2a9d7f; --btn-text: white;
    --progress-played: #2a9d7f; --progress-unplayed: #aee9d1;
    --progress-bg: #aee9d1; --progress-thumb: #2a9d7f;
    --ctrl-btn-bg: #d4f5e8; --ctrl-btn-color: #1a5c4a;
}
.theme-pink {
    --bg-gradient-start: #fde4ec; --bg-gradient-end: #fcc6d8;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 0.85;
    --text-primary: #7a2a4a; --text-secondary: #a85a7a;
    --card-bg-r: 255; --card-bg-g: 240; --card-bg-b: 245;
    --player-card-bg-r: 122; --player-card-bg-g: 42; --player-card-bg-b: 74;
    --lyrics-card-bg-r: 255; --lyrics-card-bg-g: 240; --lyrics-card-bg-b: 245;
    --lyrics-text: #a85a7a; --lyrics-active-bg: #fcc6d8; --lyrics-active-color: #e94c8b;
    --border-color: #fcc6d8; --btn-bg: #e94c8b; --btn-text: white;
    --progress-played: #e94c8b; --progress-unplayed: #fcc6d8;
    --progress-bg: #fcc6d8; --progress-thumb: #e94c8b;
    --ctrl-btn-bg: #fde4ec; --ctrl-btn-color: #7a2a4a;
}
.theme-hc-a {
    --bg-gradient-start: #000000; --bg-gradient-end: #0a0a0a;
    --container-bg-r: 0; --container-bg-g: 0; --container-bg-b: 0;
    --container-opacity: 0.94;
    --text-primary: #ffff00; --text-secondary: #e0e000;
    --card-bg-r: 26; --card-bg-g: 26; --card-bg-b: 26;
    --player-card-bg-r: 0; --player-card-bg-g: 0; --player-card-bg-b: 0;
    --lyrics-card-bg-r: 26; --lyrics-card-bg-g: 26; --lyrics-card-bg-b: 26;
    --lyrics-text: #e0e000; --lyrics-active-bg: #1a1a00; --lyrics-active-color: #ffff00;
    --border-color: #ffff00; --btn-bg: #ffff00; --btn-text: #000000;
    --progress-played: #ffff00; --progress-unplayed: #333300;
    --progress-bg: #333300; --progress-thumb: #ffff00;
    --ctrl-btn-bg: #333300; --ctrl-btn-color: #ffff00;
}
.theme-hc-a .left-panel,
.theme-hc-a .player-card,
.theme-hc-a .lyrics-card,
.theme-hc-a .history-card { border: 2px solid #ffff00; }
.theme-hc-b {
    --bg-gradient-start: #ffffff; --bg-gradient-end: #ffffff;
    --container-bg-r: 255; --container-bg-g: 255; --container-bg-b: 255;
    --container-opacity: 1;
    --text-primary: #000000; --text-secondary: #000000;
    --card-bg-r: 255; --card-bg-g: 255; --card-bg-b: 255;
    --player-card-bg-r: 0; --player-card-bg-g: 0; --player-card-bg-b: 0;
    --lyrics-card-bg-r: 255; --lyrics-card-bg-g: 255; --lyrics-card-bg-b: 255;
    --lyrics-text: #000000; --lyrics-active-bg: #ffff00; --lyrics-active-color: #000000;
    --border-color: #000000; --btn-bg: #000000; --btn-text: #ffffff;
    --progress-played: #000000; --progress-unplayed: #e0e0e0;
    --progress-bg: #e0e0e0; --progress-thumb: #000000;
    --ctrl-btn-bg: #ffffff; --ctrl-btn-color: #000000;
}
.theme-hc-b .left-panel,
.theme-hc-b .player-card,
.theme-hc-b .lyrics-card,
.theme-hc-b .history-card,
.theme-hc-b .song-item,
.theme-hc-b .app-container { border: 3px solid #000000; }
.theme-custom { /* 继承默认 */ }

/* ============================================================
   全局
   ============================================================ */
html { font-size: calc(16px * var(--font-scale, 1)); }

* {
    margin: 0; padding: 0; box-sizing: border-box;
    font-family: system-ui, 'Segoe UI', 'PingFang SC', Roboto, 'Helvetica Neue', sans-serif;
    transition: background-color 0.3s ease, color 0.2s ease, border-color 0.2s ease;
}

.lyrics-container,
.fullscreen-lyrics-scroll,
.fullscreen-container,
.song-list,
.modal,
.modal-body,
#myPlaylistsModal .modal-body,
.settings-modal-content .modal-body,
.theme-body {
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.lyrics-container::-webkit-scrollbar,
.fullscreen-lyrics-scroll::-webkit-scrollbar,
.fullscreen-container::-webkit-scrollbar,
.song-list::-webkit-scrollbar,
.modal::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
#myPlaylistsModal .modal-body::-webkit-scrollbar,
.settings-modal-content .modal-body::-webkit-scrollbar,
.theme-body::-webkit-scrollbar {
    display: none; width: 0; height: 0;
}

body {
    min-height: 100vh;
    background: linear-gradient(145deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    background-size: cover;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    padding: 24px 20px;
    position: relative;
    isolation: isolate;
}
body::before {
    content: '';
    position: fixed;
    top: -60px; left: -60px; right: -60px; bottom: -60px;
    background: inherit;
    background-attachment: fixed;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    filter: blur(var(--bg-blur-amount, 0px));
    -webkit-filter: blur(var(--bg-blur-amount, 0px));
    z-index: -1;
    pointer-events: none;
}

.app-container {
    max-width: 1400px; margin: 0 auto;
    background: rgba(var(--container-bg-r), var(--container-bg-g), var(--container-bg-b), var(--container-opacity));
    backdrop-filter: blur(14px) saturate(1.15);
    -webkit-backdrop-filter: blur(14px) saturate(1.15);
    border-radius: 48px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.14),
        0 6px 18px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    padding: 28px 32px;
    transition: background 0.2s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.55);
}
@media (max-width: 860px) {
    body { padding: 12px; }
    .app-container { padding: 20px 18px; border-radius: 32px; }
}

.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.header-left h1 {
    font-size: 2rem; font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, var(--lyrics-active-color) 0%, var(--btn-bg) 60%, var(--progress-thumb) 100%);
    background-clip: text; -webkit-background-clip: text; color: transparent;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.12));
}
.header-left p { color: var(--text-secondary); margin-top: 6px; font-weight: 500; font-size: 0.9rem; letter-spacing: 0.3px; }
.header-buttons { display: flex; gap: 8px; flex-wrap: wrap; }
.theme-toggle {
    background: var(--btn-bg); color: var(--btn-text); border: none;
    padding: 8px 18px; border-radius: 40px; cursor: pointer;
    font-weight: 600; font-size: 0.9rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
.theme-toggle:hover { opacity: 0.92; transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12); }

.main-grid { display: grid; grid-template-columns: 1fr 380px; gap: 28px; }
@media (max-width: 1024px) { .main-grid { grid-template-columns: 1fr 320px; gap: 20px; } }
@media (max-width: 768px) {
    .main-grid { grid-template-columns: 1fr; gap: 20px; }
    .left-panel { order: 1; }
    .right-panel { order: 2; }
}

.left-panel {
    background: rgba(var(--card-bg-r), var(--card-bg-g), var(--card-bg-b), var(--card-opacity));
    border-radius: 32px; padding: 20px;
    backdrop-filter: blur(6px) saturate(1.1);
    -webkit-backdrop-filter: blur(6px) saturate(1.1);
    display: flex; flex-direction: column; height: 100%;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}
.search-card { margin-bottom: 24px; }
.search-box { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.search-input {
    flex: 3; padding: 14px 18px; border: none; border-radius: 48px;
    background: white; font-size: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 1px solid var(--border-color);
    color: #2a2a2a;
}
.theme-dark .search-input, .theme-hc-a .search-input, .theme-deep-purple .search-input {
    background: rgba(255,255,255,0.1); color: var(--text-primary);
}
.search-input:focus { border-color: var(--lyrics-active-color); outline: none; box-shadow: 0 0 0 4px rgba(212, 76, 47, 0.18); }
.id-parse-group { display: flex; gap: 12px; background: var(--card-bg); padding: 10px 16px; border-radius: 60px; }
.small-input { flex: 2; padding: 10px 16px; border-radius: 40px; border: 1px solid var(--border-color); background: white; color: #2a2a2a; }
.theme-dark .small-input, .theme-hc-a .small-input, .theme-deep-purple .small-input { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn {
    border: none; background: var(--btn-bg); color: var(--btn-text);
    padding: 0 24px; border-radius: 48px; font-weight: 600;
    cursor: pointer; font-size: 0.9rem; min-height: 40px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
.btn-primary {
    background: linear-gradient(100deg, var(--lyrics-active-color), var(--progress-thumb));
    box-shadow: 0 4px 14px rgba(212, 76, 47, 0.28);
    color: white;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(212, 76, 47, 0.35); }
.btn-outline { background: rgba(255,255,240,0.9); color: var(--text-primary); border: 1px solid var(--border-color); }
.theme-dark .btn-outline, .theme-hc-a .btn-outline, .theme-deep-purple .btn-outline { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.btn-outline:hover { transform: translateY(-2px); background: var(--lyrics-active-bg); color: var(--lyrics-active-color); }
.btn.btn-active { background: linear-gradient(100deg, var(--lyrics-active-color), var(--progress-thumb)) !important; color: white !important; }

.playlist-section { margin-bottom: 28px; }
.section-title {
    display: flex; justify-content: space-between; align-items: baseline;
    font-weight: 700; color: var(--text-primary);
    border-left: 4px solid var(--lyrics-active-color); padding-left: 12px; margin: 16px 0 12px 0;
}
.refresh-btn { font-size: 0.75rem; background: var(--card-bg); padding: 4px 12px; border-radius: 40px; cursor: pointer; color: var(--text-secondary); }
.playlist-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 14px; }
.playlist-item {
    background: var(--card-bg); border-radius: 24px; padding: 10px;
    text-align: center; cursor: pointer;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.playlist-item:hover { transform: translateY(-4px); background: var(--lyrics-active-bg); box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1); }
.pl-cover { width: 100%; aspect-ratio: 1; border-radius: 20px; object-fit: cover; background: var(--border-color); }
.pl-name { font-size: 0.8rem; font-weight: 600; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.pl-count { font-size: 0.7rem; color: var(--text-secondary); }

.results-header {
    display: flex; justify-content: space-between; align-items: center;
    margin: 16px 0 12px 0; font-weight: 600; color: var(--text-primary);
    border-left: 4px solid var(--lyrics-active-color); padding-left: 12px;
}

.song-list { flex: 1; overflow-y: auto; max-height: 455px; scroll-behavior: smooth; padding-right: 2px; }
.song-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--card-bg); margin-bottom: 10px; padding: 10px 14px;
    border-radius: 60px; cursor: pointer;
    transition: transform 0.18s ease, background 0.18s ease;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.song-item:hover { background: var(--lyrics-active-bg); transform: translateX(4px); }
.song-info { display: flex; align-items: center; gap: 12px; flex: 1; overflow: hidden; }
.cover-wrapper { position: relative; width: 44px; height: 44px; flex-shrink: 0; }
.song-cover { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; position: relative; z-index: 1; }
.cover-loading {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.6); border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.7rem; color: white; text-align: center; z-index: 2;
}
.song-details { flex: 1; }
.song-name { font-weight: 700; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.song-artist { font-size: 0.7rem; color: var(--text-secondary); }
.badge-free { background: #bde3c2; color: #2c6e2f; font-size: 0.65rem; border-radius: 40px; padding: 2px 8px; margin-left: 6px; }
.badge-vip { background: #f3cfc3; color: #b64926; font-size: 0.65rem; border-radius: 40px; padding: 2px 8px; margin-left: 6px; font-weight: 500; }
.play-btn-small {
    background: var(--lyrics-active-bg); border: none; border-radius: 40px; padding: 6px 16px;
    font-weight: 600; color: var(--lyrics-active-color); cursor: pointer;
}
.play-btn-small:hover { background: var(--lyrics-active-color); color: white; }

.right-panel { display: flex; flex-direction: column; gap: 24px; }
.player-card {
    background: rgba(var(--player-card-bg-r), var(--player-card-bg-g), var(--player-card-bg-b), var(--card-opacity));
    backdrop-filter: blur(14px) saturate(1.2);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    border-radius: 40px; padding: 20px; color: #fef2e6;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}
.player-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.fullscreen-btn {
    background: none; border: none; color: inherit; font-size: 1.4rem;
    cursor: pointer; padding: 0 8px; opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}
.fullscreen-btn:hover { opacity: 1; transform: scale(1.1); }
.cover-large {
    width: 160px; height: 160px; border-radius: 28px; margin: 0 auto 16px;
    display: block; object-fit: cover;
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
}
.track-title { font-size: 1.2rem; font-weight: 700; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-artist { text-align: center; opacity: 0.8; margin-bottom: 12px; font-size: 0.85rem; }
.player-controls { margin: 12px 0; }
.progress-bar-container { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.progress-bar {
    flex: 1; height: 6px; -webkit-appearance: none; appearance: none;
    background: linear-gradient(
        to right,
        var(--progress-played) 0%,
        var(--progress-played) var(--progress-percent, 0%),
        var(--progress-unplayed) var(--progress-percent, 0%),
        var(--progress-unplayed) 100%
    );
    border-radius: 5px; outline: none; cursor: pointer;
}
.progress-bar::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    background: var(--progress-played); border: 2px solid #fff;
    border-radius: 50%; cursor: pointer;
}
.progress-bar::-moz-range-thumb {
    width: 14px; height: 14px;
    background: var(--progress-played); border: 2px solid #fff;
    border-radius: 50%; cursor: pointer;
}
.time-current, .time-duration { font-size: 0.7rem; min-width: 38px; color: inherit; }
.volume-control { display: flex; align-items: center; gap: 8px; }
.volume-control input { width: 100px; }
.audio-control-buttons { display: flex; gap: 12px; justify-content: center; margin: 12px 0; flex-wrap: wrap; }
.ctrl-btn {
    background: var(--ctrl-btn-bg); border: none; padding: 8px 20px;
    border-radius: 60px; font-weight: bold; cursor: pointer; color: var(--ctrl-btn-color);
    transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}
.ctrl-btn:hover { background: var(--lyrics-active-color); color: white; transform: translateY(-1px); }
.icon-btn { font-size: 1.2rem; padding: 8px 16px; }
.loop-mode-btn { font-size: 1.1rem; min-width: 44px; }
.download-btn { background: #6c8b6e; color: white; }
.download-btn:hover { background: #4a6b4c; }

/* ✅ 卡拉OK 开关按钮（激活时高亮） */
.karaoke-btn {
    font-size: 1.1rem;
    min-width: 44px;
    opacity: 0.6;
    transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
}
.karaoke-btn.karaoke-on {
    opacity: 1;
    background: linear-gradient(100deg, var(--lyrics-active-color), var(--progress-thumb));
    color: white;
    box-shadow: 0 4px 14px rgba(212, 76, 47, 0.4);
}
.karaoke-btn.karaoke-on:hover {
    background: linear-gradient(100deg, var(--lyrics-active-color), var(--progress-thumb));
    color: white;
    transform: translateY(-1px) scale(1.03);
}

@media (max-width: 768px) {
    .audio-control-buttons { gap: 8px; }
    .ctrl-btn { padding: 6px 14px; font-size: 0.8rem; }
    .icon-btn { font-size: 1rem; padding: 6px 12px; }
}

.lyrics-card, .history-card {
    background: rgba(var(--lyrics-card-bg-r), var(--lyrics-card-bg-g), var(--lyrics-card-bg-b), var(--card-opacity));
    backdrop-filter: blur(10px) saturate(1.1);
    -webkit-backdrop-filter: blur(10px) saturate(1.1);
    border-radius: 32px; padding: 16px 18px; color: var(--text-primary);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.06);
}
.lyrics-container {
    max-height: 240px; overflow-y: auto;
    font-size: 0.85rem; line-height: 1.55;
    scroll-behavior: smooth;
    mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 12%, black 88%, transparent 100%);
}
.lyrics-lines { padding: 12px 6px; }
.lyric-line {
    position: relative;
    padding: 8px 14px 8px 18px;
    display: flex; flex-direction: column; gap: 2px;
    border-radius: 16px;
    transition: background 0.32s ease, transform 0.28s ease, color 0.28s ease;
    color: var(--lyrics-text);
    opacity: 0.55;
    transform: scale(0.96);
    transform-origin: left center;
}
.lyric-line .lyric-original { font-weight: 500; }
.lyric-line .lyric-trans { font-size: 0.82em; opacity: 0.7; color: var(--lyrics-text); }
.lyric-line.active {
    opacity: 1; transform: scale(1);
    background: var(--lyrics-active-bg);
}
.lyric-line.active::before {
    content: '';
    position: absolute; left: 4px; top: 50%;
    transform: translateY(-50%);
    width: 3px; height: 60%;
    border-radius: 4px;
    background: var(--lyrics-active-color);
    box-shadow: 0 0 8px var(--lyrics-active-color);
}
.lyric-line.active .lyric-original { color: var(--lyrics-active-color); font-weight: 700; font-size: 1.02em; }
.lyric-line.active .lyric-trans { color: var(--lyrics-active-color); opacity: 0.82; }

.empty-lyrics { text-align: center; color: var(--text-secondary); padding: 20px; }
.history-item {
    display: flex; gap: 12px; padding: 8px 0;
    border-bottom: 1px solid var(--border-color); cursor: pointer;
    font-size: 0.85rem; color: var(--text-primary);
}
.history-item:hover { background: var(--lyrics-active-bg); padding-left: 8px; border-radius: 12px; }
.history-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-artist { color: var(--text-secondary); font-size: 0.75rem; }
.footer-note {
    margin-top: 28px; text-align: center; font-size: 0.7rem;
    color: var(--text-secondary); border-top: 1px solid rgba(0,0,0,0.1); padding-top: 18px;
}
.empty-tip { text-align: center; color: var(--text-secondary); padding: 32px 20px; }
.loading-tip {
    font-size: 0.75rem; text-align: center; margin-top: 12px;
    padding: 6px; border-radius: 60px; background: rgba(0,0,0,0.3);
}

.modal {
    position: fixed; inset: 0; height: 100vh; height: 100dvh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; z-index: 1000;
    padding: 20px; overflow-y: auto; overscroll-behavior: contain;
}
.modal-content {
    background: rgb(var(--lyrics-card-bg-r, 255), var(--lyrics-card-bg-g, 249), var(--lyrics-card-bg-b, 242));
    border-radius: 32px; max-width: 380px; width: 90%;
    box-shadow: 0 24px 60px rgba(0,0,0,0.35);
    overflow: hidden;
    animation: modalFadeIn 0.25s cubic-bezier(0.2, 0.9, 0.3, 1.1);
    margin: auto; flex-shrink: 0;
    max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
    color: var(--text-primary);
}
.theme-modal-content { max-width: 520px; }
@keyframes modalFadeIn {
    from { opacity: 0; transform: scale(0.94) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 18px 22px;
    background: var(--lyrics-active-bg);
    font-weight: bold; font-size: 1.2rem; color: var(--lyrics-active-color);
    flex-shrink: 0; border-bottom: 1px solid var(--border-color);
}
.modal-close {
    background: none; border: none; font-size: 1.8rem;
    cursor: pointer; color: var(--text-secondary); line-height: 1;
}
.modal-close:hover { color: var(--lyrics-active-color); transform: rotate(90deg); }
.modal-body { padding: 24px 20px; text-align: center; color: var(--text-primary); line-height: 1.5; }
.modal-body p { margin: 8px 0; }
.modal-footer { display: flex; gap: 12px; padding: 16px 20px 24px; justify-content: center; flex-shrink: 0; }
.modal-btn {
    padding: 10px 24px; border-radius: 60px; font-weight: 600;
    cursor: pointer; border: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.modal-btn.cancel { background: var(--border-color); color: var(--text-secondary); }
.modal-btn.confirm {
    background: var(--lyrics-active-color); color: white;
    box-shadow: 0 4px 14px rgba(212, 76, 47, 0.3);
}
.modal-btn.confirm:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(212, 76, 47, 0.4); }

.theme-body { max-height: calc(100dvh - 160px); overflow-y: auto; padding: 16px 20px 24px; }
.theme-section-label {
    font-size: 0.78rem; color: var(--text-secondary); font-weight: 600;
    letter-spacing: 0.5px; margin-bottom: 10px; text-transform: uppercase;
}
.theme-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.theme-btn {
    padding: 10px 14px; border: 2px solid transparent; border-radius: 14px;
    font-size: 0.82rem; font-weight: 600; cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    text-align: center;
}
.theme-btn:hover { transform: scale(1.03); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.theme-btn.theme-default { background: #f9f3e6; color: #2d241e; }
.theme-btn.theme-dark { background: #1a1a2e; color: #e0e0e0; }
.theme-btn.theme-ocean { background: #e0f2f1; color: #004d40; }
.theme-btn.theme-purple { background: #f3e5f5; color: #4a148c; }
.theme-btn.theme-sunset { background: #fff3e0; color: #bf360c; }
.theme-btn.theme-gray { background: #e8e8e8; color: #2a2a2a; }
.theme-btn.theme-deep-purple { background: #2d1b4e; color: #e8dcf5; }
.theme-btn.theme-lavender { background: #e8dcf5; color: #4a3b6b; }
.theme-btn.theme-mono { background: #ffffff; color: #000000; border-color: #000000; }
.theme-btn.theme-mint { background: #d4f5e8; color: #1a5c4a; }
.theme-btn.theme-pink { background: #fde4ec; color: #7a2a4a; }
.theme-btn.theme-hc-a { background: #000000; color: #ffff00; border-color: #ffff00; }
.theme-btn.theme-hc-b { background: #ffffff; color: #000000; border-color: #000000; border-width: 3px; }
.theme-btn.theme-custom { background: linear-gradient(135deg, #ff6b6b, #feca57, #48dbfb, #ff9ff3); color: white; }

.custom-colors {
    display: flex; flex-direction: column; gap: 10px;
    padding: 12px; background: rgba(0,0,0,0.04); border-radius: 16px;
}
.color-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.color-row label { font-size: 0.82rem; color: var(--text-primary); font-weight: 500; }
.color-row input[type="color"] {
    width: 56px; height: 36px; border: 2px solid var(--border-color); border-radius: 10px;
    cursor: pointer; background: transparent; padding: 0;
}

.feedback-links { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.feedback-link {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 18px; border-radius: 40px; text-decoration: none;
    font-weight: 600; font-size: 0.9rem;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.feedback-link-issue {
    background: var(--lyrics-active-color); color: white;
    box-shadow: 0 4px 14px rgba(212, 76, 47, 0.28);
}
.feedback-link-issue:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(212, 76, 47, 0.38); }

/* ============================================================
   全屏播放器
   ============================================================ */
.fullscreen-modal {
    position: fixed; inset: 0; height: 100vh; height: 100dvh;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    z-index: 2000;
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.fullscreen-container {
    width: 90%; max-width: 1300px; height: 64%;
    max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
    background: rgba(30, 20, 15, 0.96);
    border-radius: 48px;
    display: flex; flex-direction: column;
    position: relative;
    padding: 24px 32px;
    box-shadow: 0 35px 70px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    margin: auto;
    overflow: hidden;
}
.close-fullscreen {
    position: absolute; top: 20px; right: 28px; background: none; border: none;
    font-size: 2rem; color: #fef2e6; cursor: pointer; z-index: 10; opacity: 0.7;
}
.close-fullscreen:hover { opacity: 1; transform: scale(1.1) rotate(90deg); }
.fullscreen-content {
    display: flex; flex: 1; gap: 48px;
    min-height: 0;
    margin-top: 20px;
    overflow: hidden;
}
.fullscreen-cover { flex: 1; display: flex; align-items: center; justify-content: center; }
.fullscreen-cover img {
    width: 100%; max-width: 400px; border-radius: 32px;
    object-fit: cover; aspect-ratio: 1;
    box-shadow: 0 25px 50px rgba(0,0,0,0.55);
}
.fullscreen-lyrics {
    flex: 1.5;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}
.fullscreen-lyrics-header { margin-bottom: 12px; text-align: center; flex-shrink: 0; }
.fullscreen-song { font-size: 1.8rem; font-weight: 700; color: #fef2e6; }
.fullscreen-artist { font-size: 1rem; color: #d4bca8; margin-top: 6px; }

.fullscreen-lyrics-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0 12px;
    scroll-behavior: smooth;
    position: relative;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 8%, black 92%, transparent 100%);
    box-sizing: border-box;
}
.fullscreen-lyrics-scroll::before,
.fullscreen-lyrics-scroll::after {
    content: '';
    display: block;
    height: calc(var(--scroll-h, 200px) * 0.42);
    pointer-events: none;
    flex-shrink: 0;
}

.fullscreen-lyric-line {
    position: relative;
    padding: 10px 16px;
    font-size: 1rem; color: #c0b0a0;
    text-align: center;
    display: flex; flex-direction: column; gap: 4px;
    border-radius: 16px;
    opacity: 0.5;
    transform: scale(0.97);
    transition: color 0.32s ease, transform 0.28s ease, opacity 0.28s ease, background 0.28s ease;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}
.fullscreen-lyric-line:hover { opacity: 0.8; background: rgba(255, 255, 255, 0.04); }
.fullscreen-lyric-line .lyric-original { color: inherit; font-weight: 500; }
.fullscreen-lyric-line .lyric-trans { font-size: 0.82em; opacity: 0.7; }
.fullscreen-lyric-line.active {
    color: #ea8c5c; font-weight: bold; font-size: 1.12rem;
    background: rgba(234, 140, 92, 0.15);
    opacity: 1; transform: scale(1);
    box-shadow: 0 4px 20px rgba(234, 140, 92, 0.15);
}
.fullscreen-lyric-line.active .lyric-original { color: #ea8c5c; }
.fullscreen-lyric-line.active .lyric-trans { color: #ea8c5c; opacity: 0.85; }

/* ✅ 卡拉OK：::after + attr(data-text) + clip-path，GPU 加速非常流畅 */
.fullscreen-lyric-line.active.karaoke-on .lyric-original {
    position: relative;
    color: rgba(234, 140, 92, 0.35);
    display: inline-block;
    max-width: 100%;
    word-break: break-word;
}
.fullscreen-lyric-line.active.karaoke-on .lyric-original::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    color: #ea8c5c;
    clip-path: inset(0 calc(100% - var(--karaoke-percent, 0%)) 0 0);
    -webkit-clip-path: inset(0 calc(100% - var(--karaoke-percent, 0%)) 0 0);
    will-change: clip-path;
    pointer-events: none;
    word-break: break-word;
}

.fullscreen-controls {
    margin-top: 24px; padding-top: 18px;
    border-top: 1px solid rgba(255,215,190,0.3);
    flex-shrink: 0;
}
.fullscreen-progress { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.fullscreen-progress .progress-bar { flex: 1; }
.fullscreen-volume { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; }
.fullscreen-volume input { width: 150px; }
.fullscreen-buttons { display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; }

@media (max-width: 1024px) {
    .fullscreen-container { width: 85%; height: 52%; padding: 20px 24px; }
    .fullscreen-content { gap: 30px; }
    .fullscreen-song { font-size: 1.5rem; }
    .fullscreen-lyric-line { font-size: 0.9rem; padding: 6px 12px; }
    .fullscreen-volume input { width: 120px; }
}
@media (max-width: 768px) {
    .fullscreen-container {
        width: 92%; height: auto;
        max-height: calc(100dvh - 40px);
        padding: 16px 20px;
        overflow-y: auto;
    }
    .fullscreen-content { flex-direction: column; gap: 20px; flex: none; overflow: visible; }
    .fullscreen-cover { flex: none; }
    .fullscreen-cover img { max-width: 180px; }
    .fullscreen-lyrics { flex: none; overflow: visible; min-height: auto; }
    .fullscreen-lyrics-scroll { max-height: 40vh; flex: none; min-height: 0; }
    .fullscreen-song { font-size: 1.2rem; }
    .fullscreen-artist { font-size: 0.85rem; }
    .fullscreen-lyric-line { font-size: 0.85rem; padding: 8px 12px; }
    .fullscreen-controls { margin-top: 20px; }
    .fullscreen-progress { margin-bottom: 12px; }
    .fullscreen-volume input { width: 100px; }
    .fullscreen-buttons { gap: 10px; flex-wrap: wrap; }
    .fullscreen-buttons .ctrl-btn { padding: 6px 12px; font-size: 0.8rem; }
    .fullscreen-buttons .icon-btn { font-size: 1rem; }
}

/* ============================================================
   设置
   ============================================================ */
.settings-modal-content {
    max-width: 900px; width: 95%;
    max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
    display: flex; flex-direction: column;
}
.settings-modal-content .modal-body {
    overflow-y: auto; text-align: left;
    padding: 22px 26px; flex: 1;
}
.settings-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 6px 32px; align-items: start;
}
.settings-grid > div { min-width: 0; }
.settings-grid > .settings-full { grid-column: 1 / -1; }
@media (max-width: 768px) {
    .settings-grid { grid-template-columns: 1fr; gap: 4px; }
    .settings-modal-content { width: 94%; }
    .settings-modal-content .modal-body { padding: 18px 16px; }
}

.settings-input {
    width: 100%; padding: 10px; margin: 10px 0;
    border: 1px solid var(--border-color); border-radius: 12px;
    background: white; font-size: 0.85rem; color: #2a2a2a;
}
.theme-dark .settings-input, .theme-hc-a .settings-input, .theme-deep-purple .settings-input {
    background: rgba(255,255,255,0.1); color: var(--text-primary);
}
.settings-buttons { display: flex; gap: 10px; margin: 10px 0; flex-wrap: wrap; }
.settings-title { font-weight: 600; margin: 12px 0 4px; color: var(--text-primary); }
.settings-desc { font-size: 0.75rem; color: var(--text-secondary); margin-bottom: 8px; }
.slider-container { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.settings-slider {
    flex: 1; height: 4px; -webkit-appearance: none;
    background: var(--progress-unplayed); border-radius: 5px; outline: none;
}
.settings-slider::-webkit-slider-thumb {
    -webkit-appearance: none; width: 14px; height: 14px;
    background: var(--progress-played); border-radius: 50%; cursor: pointer;
}
.slider-value { min-width: 45px; font-size: 0.8rem; color: var(--text-primary); }
.switch-label { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.switch-text { font-size: 0.9rem; color: var(--text-primary); }
.switch { position: relative; display: inline-block; width: 50px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background-color: #ccc; transition: 0.3s; border-radius: 24px;
}
.switch .slider:before {
    position: absolute; content: ""; height: 18px; width: 18px;
    left: 3px; bottom: 3px; background-color: white;
    transition: 0.3s; border-radius: 50%;
}
.switch input:checked + .slider { background-color: var(--lyrics-active-color); }
.switch input:checked + .slider:before { transform: translateX(26px); }

.blur-enabled .left-panel::before,
.blur-enabled .player-card::before,
.blur-enabled .lyrics-card::before,
.blur-enabled .history-card::before {
    content: ""; position: absolute; top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255, 255, 255, var(--mask-opacity));
    border-radius: inherit; pointer-events: none; z-index: 0;
}
.theme-dark.blur-enabled .left-panel::before,
.theme-dark.blur-enabled .player-card::before,
.theme-dark.blur-enabled .lyrics-card::before,
.theme-dark.blur-enabled .history-card::before {
    background: rgba(0, 0, 0, var(--mask-opacity));
}
.left-panel, .player-card, .lyrics-card, .history-card { position: relative; overflow: hidden; }
.left-panel > *, .player-card > *, .lyrics-card > *, .history-card > * { position: relative; z-index: 1; }

#myPlaylistsModal .modal-content {
    max-width: 920px; width: 95%;
    max-height: calc(100vh - 40px); max-height: calc(100dvh - 40px);
    display: flex; flex-direction: column;
}
#myPlaylistsModal .modal-body { flex: 1; overflow-y: auto; text-align: left; padding: 20px 24px; }
#myPlaylistsModal .settings-title {
    border-left: 3px solid var(--lyrics-active-color);
    padding-left: 8px; margin: 12px 0 8px 0;
}
.my-playlist-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
    gap: 12px; margin-top: 8px;
}
.my-playlist-grid .playlist-item {
    display: flex; flex-direction: column; padding: 8px;
    border-radius: 18px; background: rgba(255, 255, 255, 0.7);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); overflow: hidden;
}
.theme-dark .my-playlist-grid .playlist-item,
.theme-hc-a .my-playlist-grid .playlist-item,
.theme-deep-purple .my-playlist-grid .playlist-item {
    background: rgba(255,255,255,0.08);
}
.my-playlist-grid .playlist-item:hover {
    background: var(--lyrics-active-bg);
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.1);
}
.my-playlist-grid .pl-cover {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover;
    display: block; border-radius: 14px; background: var(--border-color);
}
.my-playlist-grid .pl-name {
    margin-top: 6px; font-size: 0.78rem; line-height: 1.25;
    height: 2.5em; display: -webkit-box;
    -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal; text-align: center;
    color: var(--text-primary); font-weight: 600;
}
.my-playlist-grid .pl-count {
    font-size: 0.68rem; text-align: center; margin-top: 2px;
    color: var(--text-secondary);
}
@media (max-width: 480px) {
    .my-playlist-grid { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); gap: 8px; }
    #myPlaylistsModal .modal-body { padding: 14px 14px; }
}

/* ============================================================
   移动端 Apple Music 风格 + 液态玻璃布局
   桌面端（默认）完全不受影响
   ============================================================ */

/* 默认隐藏移动端专属元素 */
.mobile-mini-player { display: none; }

/* 移动端生效：body.mobile-view 由 script.js 动态添加 */
body.mobile-view {
    --lg-blur: 24px;
    --lg-saturate: 180%;
    --lg-bg-light: linear-gradient(135deg, rgba(255,255,255,0.65), rgba(255,255,255,0.45));
    --lg-bg-dark:  linear-gradient(135deg, rgba(60,60,80,0.65), rgba(30,30,50,0.5));
    --lg-border-light: rgba(255,255,255,0.6);
    --lg-border-dark:  rgba(255,255,255,0.12);
    --lg-highlight-light: inset 0 1px 0 rgba(255,255,255,0.9);
    --lg-highlight-dark:  inset 0 1px 0 rgba(255,255,255,0.15);
    --lg-shadow: 0 8px 32px rgba(0,0,0,0.12);
    --lg-shadow-dark: 0 8px 32px rgba(0,0,0,0.5);
    --lg-radius: 22px;

    padding: 0 !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

/* 深色主题下的液态玻璃变量 */
body.mobile-view.theme-dark,
body.mobile-view.theme-deep-purple,
body.mobile-view.theme-hc-a {
    --lg-bg-light: var(--lg-bg-dark);
    --lg-border-light: var(--lg-border-dark);
    --lg-highlight-light: var(--lg-highlight-dark);
    --lg-shadow: var(--lg-shadow-dark);
}

/* ========== App Container ========== */
body.mobile-view .app-container {
    max-width: 100%;
    border-radius: 0;
    padding: 0;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    border: none;
    min-height: 100dvh;
    padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px));
}

/* ========== Header 液态玻璃顶部栏 ========== */
body.mobile-view .header {
    position: sticky;
    top: 0;
    z-index: 200;
    margin: 0;
    padding: calc(12px + env(safe-area-inset-top, 0px)) 16px 12px;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    background: var(--lg-bg-light);
    backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    border-bottom: 1px solid var(--lg-border-light);
    box-shadow: var(--lg-highlight-light), 0 4px 20px rgba(0,0,0,0.06);
}
body.mobile-view .header-left h1 {
    font-size: 1.4rem;
    letter-spacing: -0.3px;
}
body.mobile-view .header-left p { display: none; }

body.mobile-view .header-buttons {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 2px;
}
body.mobile-view .header-buttons::-webkit-scrollbar { display: none; }
body.mobile-view .header-buttons .theme-toggle {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 0.78rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.55);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--lg-border-light);
    box-shadow: var(--lg-highlight-light);
    font-weight: 500;
}
body.mobile-view.theme-dark .header-buttons .theme-toggle,
body.mobile-view.theme-deep-purple .header-buttons .theme-toggle,
body.mobile-view.theme-hc-a .header-buttons .theme-toggle {
    background: rgba(255,255,255,0.1);
    border-color: var(--lg-border-dark);
    color: var(--text-primary);
}

/* ========== 主网格 → 单栏 ========== */
body.mobile-view .main-grid {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px 14px 0;
}

/* 右栏：隐藏大播放器卡片（改用 mini-player + 全屏播放器） */
body.mobile-view .right-panel .player-card {
    display: none;
}
body.mobile-view .right-panel {
    gap: 14px;
}

/* ========== 卡片：液态玻璃 ========== */
body.mobile-view .search-card,
body.mobile-view .playlist-section,
body.mobile-view .lyrics-card,
body.mobile-view .history-card {
    background: var(--lg-bg-light);
    backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
    border: 1px solid var(--lg-border-light);
    border-radius: var(--lg-radius);
    box-shadow: var(--lg-highlight-light), var(--lg-shadow);
    padding: 16px;
}

body.mobile-view .left-panel {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    gap: 14px;
    display: flex;
    flex-direction: column;
}

/* ========== 输入框：胶囊 + 液态 ========== */
body.mobile-view .search-input,
body.mobile-view .small-input {
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--lg-border-light);
    border-radius: 20px;
    padding: 12px 16px;
    font-size: 0.92rem;
    box-shadow: var(--lg-highlight-light);
    color: #2a2a2a;
}
body.mobile-view.theme-dark .search-input,
body.mobile-view.theme-dark .small-input,
body.mobile-view.theme-deep-purple .search-input,
body.mobile-view.theme-deep-purple .small-input,
body.mobile-view.theme-hc-a .search-input,
body.mobile-view.theme-hc-a .small-input {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
}

body.mobile-view .search-box {
    flex-direction: column;
    gap: 10px;
}
body.mobile-view .search-box .btn-primary {
    width: 100%;
    min-height: 44px;
}

body.mobile-view .id-parse-group {
    flex-direction: column;
    gap: 10px;
    background: transparent;
    padding: 0;
}
body.mobile-view .id-parse-group .btn-outline {
    width: 100%;
    min-height: 44px;
}

/* ========== 按钮：液态胶囊 ========== */
body.mobile-view .btn {
    border-radius: 20px;
    min-height: 42px;
    font-size: 0.9rem;
}

/* ========== 歌单网格：横向滚动（Apple Music 风格） ========== */
body.mobile-view .playlist-grid {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 4px 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
}
body.mobile-view .playlist-grid::-webkit-scrollbar { display: none; }

body.mobile-view .playlist-item {
    flex: 0 0 140px;
    scroll-snap-align: start;
    background: rgba(255,255,255,0.55);
    border: 1px solid var(--lg-border-light);
    border-radius: 18px;
    padding: 10px;
    box-shadow: var(--lg-highlight-light), 0 4px 12px rgba(0,0,0,0.08);
}
body.mobile-view.theme-dark .playlist-item,
body.mobile-view.theme-deep-purple .playlist-item,
body.mobile-view.theme-hc-a .playlist-item {
    background: rgba(255,255,255,0.08);
}

/* ========== 歌曲列表：圆角胶囊 ========== */
body.mobile-view .song-list {
    max-height: none;
    padding: 0;
}
body.mobile-view .song-item {
    padding: 12px 14px;
    border-radius: 20px;
    margin-bottom: 10px;
    background: var(--lg-bg-light);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid var(--lg-border-light);
    box-shadow: var(--lg-highlight-light), 0 4px 14px rgba(0,0,0,0.08);
}
body.mobile-view .song-item:hover { transform: none; }
body.mobile-view .song-item:active {
    transform: scale(0.98);
    background: var(--lyrics-active-bg);
}
body.mobile-view.theme-dark .song-item,
body.mobile-view.theme-deep-purple .song-item,
body.mobile-view.theme-hc-a .song-item {
    background: var(--lg-bg-dark);
}

body.mobile-view .song-cover {
    width: 52px;
    height: 52px;
    border-radius: 14px;
}
body.mobile-view .cover-wrapper {
    width: 52px;
    height: 52px;
}
body.mobile-view .play-btn-small {
    padding: 8px 16px;
    font-size: 0.8rem;
    border-radius: 20px;
    background: rgba(255,255,255,0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--lg-border-light);
}

/* ========== 搜索/列表 Header ========== */
body.mobile-view .section-title,
body.mobile-view .results-header {
    font-size: 1.05rem;
    padding-left: 4px;
    border-left: none;
    margin: 4px 0 10px 0;
    font-weight: 700;
}

/* ========== Footer ========== */
body.mobile-view .footer-note {
    margin: 20px 14px 100px;
    padding: 16px 12px;
    font-size: 0.68rem;
    border-top: none;
    border-radius: 16px;
    background: rgba(255,255,255,0.25);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}
body.mobile-view.theme-dark .footer-note,
body.mobile-view.theme-deep-purple .footer-note,
body.mobile-view.theme-hc-a .footer-note {
    background: rgba(255,255,255,0.06);
}

/* ============================================================
   移动端 Mini Player（液态玻璃，固定在底部）
   ============================================================ */
body.mobile-view .mobile-mini-player {
    display: flex;
    align-items: center;
    gap: 12px;
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    z-index: 500;
    padding: 8px 10px 8px 8px;
    background: var(--lg-bg-light);
    backdrop-filter: blur(30px) saturate(220%);
    -webkit-backdrop-filter: blur(30px) saturate(220%);
    border: 1px solid var(--lg-border-light);
    border-radius: 26px;
    box-shadow:
        var(--lg-highlight-light),
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}
body.mobile-view.theme-dark .mobile-mini-player,
body.mobile-view.theme-deep-purple .mobile-mini-player,
body.mobile-view.theme-hc-a .mobile-mini-player {
    background: var(--lg-bg-dark);
    border-color: var(--lg-border-dark);
    box-shadow:
        var(--lg-highlight-dark),
        0 12px 40px rgba(0, 0, 0, 0.5),
        0 2px 8px rgba(0, 0, 0, 0.3);
}
body.mobile-view .mobile-mini-player:active {
    transform: scale(0.98);
}

body.mobile-view .mini-cover-wrap {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(0,0,0,0.06);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), inset 0 0 0 1px rgba(255,255,255,0.4);
}
body.mobile-view .mini-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
body.mobile-view .mini-cover-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    color: var(--text-secondary);
    background: linear-gradient(135deg, rgba(255,255,255,0.6), rgba(255,255,255,0.3));
}

body.mobile-view .mini-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}
body.mobile-view .mini-title {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: -0.2px;
}
body.mobile-view .mini-artist {
    font-size: 0.74rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

body.mobile-view .mini-btn {
    background: rgba(255,255,255,0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--lg-border-light);
    font-size: 1.15rem;
    padding: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    border-radius: 50%;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}
body.mobile-view.theme-dark .mini-btn,
body.mobile-view.theme-deep-purple .mini-btn,
body.mobile-view.theme-hc-a .mini-btn {
    background: rgba(255,255,255,0.1);
    border-color: var(--lg-border-dark);
}
body.mobile-view .mini-btn:active {
    transform: scale(0.9);
    background: var(--lyrics-active-color);
    color: white;
}

/* ============================================================
   移动端全屏播放器：加强液态玻璃感
   ============================================================ */
body.mobile-view .fullscreen-modal {
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
}
body.mobile-view .fullscreen-container {
    border-radius: 32px;
    background: var(--lg-bg-dark);
    backdrop-filter: blur(40px) saturate(200%);
    -webkit-backdrop-filter: blur(40px) saturate(200%);
    border: 1px solid var(--lg-border-dark);
    box-shadow:
        var(--lg-highlight-dark),
        0 30px 80px rgba(0, 0, 0, 0.6);
}

/* ============================================================
   移动端模态框：液态玻璃
   ============================================================ */
body.mobile-view .modal-content {
    background: var(--lg-bg-light);
    backdrop-filter: blur(30px) saturate(200%);
    -webkit-backdrop-filter: blur(30px) saturate(200%);
    border: 1px solid var(--lg-border-light);
    box-shadow:
        var(--lg-highlight-light),
        0 24px 60px rgba(0,0,0,0.35);
    border-radius: 28px;
}
body.mobile-view.theme-dark .modal-content,
body.mobile-view.theme-deep-purple .modal-content,
body.mobile-view.theme-hc-a .modal-content {
    background: var(--lg-bg-dark);
    border-color: var(--lg-border-dark);
    box-shadow:
        var(--lg-highlight-dark),
        0 24px 60px rgba(0,0,0,0.7);
}

body.mobile-view .modal-header {
    background: rgba(255,255,255,0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--lg-border-light);
}
body.mobile-view.theme-dark .modal-header,
body.mobile-view.theme-deep-purple .modal-header,
body.mobile-view.theme-hc-a .modal-header {
    background: rgba(255,255,255,0.06);
    border-bottom-color: var(--lg-border-dark);
}

/* ============================================================
   移动端：横屏模式下调整 mini-player 位置
   ============================================================ */
@media (orientation: landscape) and (max-height: 500px) {
    body.mobile-view .mobile-mini-player {
        left: auto;
        right: 16px;
        bottom: 12px;
        width: 340px;
    }
}

/* ============================================================
   桌面端：确保移动端元素不显示（默认已隐藏，双保险）
   ============================================================ */
body:not(.mobile-view) .mobile-mini-player {
    display: none !important;
}

/* ============================================================
   热门推荐歌单封面：强制 1:1 正方形，加载前后高度不跳变
   ============================================================ */

/* 1. 让 grid 里的卡片不被拉伸，高度由封面决定 */
.playlist-grid {
    align-items: start;
}

.playlist-grid .playlist-item {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* 2. 封面强制正方形：display:block 是关键，否则 aspect-ratio 在 img 上不稳定 */
.playlist-grid .playlist-item .pl-cover {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
    border-radius: 20px;
    background: var(--border-color);
    flex-shrink: 0;
}

/* 3. 移动端横向滚动卡片：宽度固定，封面同样锁 1:1 */
body.mobile-view .playlist-grid .playlist-item .pl-cover {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center;
}

/* 4. 老浏览器兜底：不支持 aspect-ratio 时，用 padding-bottom 撑正方形 */
@supports not (aspect-ratio: 1 / 1) {
    .playlist-grid .playlist-item .pl-cover {
        height: 0;
        padding-bottom: 100%;
        box-sizing: border-box;
    }
}

/* ============================================================
   调试日志弹窗
   ============================================================ */
.log-export-content {
    max-width: 640px;
    width: 95%;
}
.log-export-body {
    text-align: left;
    padding: 20px 22px;
    max-height: calc(100dvh - 200px);
    overflow-y: auto;
}
.log-export-body .settings-input {
    font-family: ui-monospace, Menlo, Consolas, monospace;
    font-size: 0.78rem;
}
.log-textarea {
    line-height: 1.55;
    white-space: pre;
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.03);
}
.theme-dark .log-textarea,
.theme-deep-purple .log-textarea,
.theme-hc-a .log-textarea {
    background: rgba(255, 255, 255, 0.05);
}
.log-hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--lyrics-active-color);
    font-weight: 600;
    line-height: 1.5;
}
