/* ==================================
   Music View - Dark UI
   ================================== */

#musicView.music-view-dark {
    --music-bg: #030406;
    --music-bg-soft: #0b0d11;
    --music-card: rgba(12, 14, 18, 0.92);
    --music-card-strong: #11141b;
    --music-border: rgba(255, 255, 255, 0.12);
    --music-border-soft: rgba(255, 255, 255, 0.07);
    --music-text: #f5f7fb;
    --music-text-secondary: #8f96a3;
    --music-accent: #f2f5ff;
    --music-accent-dark: #10141c;
    --music-divider: rgba(255, 255, 255, 0.14);
    --music-player-height: 114px;
    background: radial-gradient(circle at 55% -20%, #18212f 0%, #05070b 38%, #030406 100%);
    color: var(--music-text);
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
}

#musicView .music-cloud-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px 12px;
    border-bottom: 1px solid var(--music-border-soft);
    background: rgba(4, 5, 8, 0.9);
}

#musicView .music-back-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: #e8edf9;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
}

#musicView .music-back-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

#musicView .music-back-btn:active {
    transform: scale(0.96);
}

#musicView .music-back-btn svg {
    width: 18px;
    height: 18px;
}

#musicView .music-search-wrap {
    flex: 1;
    min-width: 0;
    position: relative;
}

#musicView .music-cloud-search {
    width: 100%;
}

#musicView .music-cloud-search input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--music-border);
    border-radius: 13px;
    padding: 0 42px 0 14px;
    font-size: 15px;
    outline: none;
    background: rgba(15, 17, 22, 0.96);
    color: var(--music-text);
}

#musicView .music-cloud-search input::placeholder {
    color: #737b88;
}

#musicView .music-cloud-search input:focus {
    border-color: rgba(255, 255, 255, 0.32);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

#musicView .music-search-clear {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.08);
    color: #9ba3af;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

#musicView .music-search-clear.visible {
    display: inline-flex;
}

#musicView .music-search-action {
    border: none;
    background: transparent;
    color: var(--music-text);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 4px;
}

#musicView .music-cloud-chip-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--music-border-soft);
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    background: rgba(3, 4, 6, 0.92);
}

#musicView .music-cloud-chip-row::-webkit-scrollbar {
    display: none;
}

#musicView .music-chip,
#musicView .music-cloud-chip {
    flex: 0 0 auto;
    border: 1px solid var(--music-border);
    border-radius: 999px;
    padding: 8px 16px;
    background: transparent;
    color: #c1c9d6;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#musicView .music-chip.active,
#musicView .music-cloud-chip.active {
    background: var(--music-accent);
    color: #070a10;
    border-color: var(--music-accent);
}

#musicView .music-cloud-body {
    flex: 1;
    min-height: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    background: var(--music-bg);
}

#musicView .music-loading {
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    text-align: center;
    color: #98a0ac;
    font-size: 13px;
    z-index: 5;
}

#musicView .music-result-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 2px 0 calc(var(--music-player-height) + 26px + env(safe-area-inset-bottom));
    -webkit-overflow-scrolling: touch;
    background: var(--music-bg);
}

#musicView .music-empty-state,
#musicView .music-cloud-empty {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #8790a0;
    gap: 10px;
    padding: 20px;
    background: var(--music-bg);
}

#musicView .music-empty-state-icon,
#musicView .music-cloud-empty-emoji {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    border: 1px solid var(--music-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    color: #cdd4e0;
    background: rgba(255, 255, 255, 0.03);
}

#musicView .music-empty-state-title,
#musicView .music-cloud-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #e5eaf3;
}

#musicView .music-empty-state-tip,
#musicView .music-cloud-empty-tip {
    font-size: 14px;
    color: #7f8795;
}

#musicView .music-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid var(--music-divider);
    cursor: pointer;
    background: transparent;
}

#musicView .music-list-item:active {
    background: rgba(255, 255, 255, 0.05);
}

#musicView .music-list-item .song-info {
    flex: 1;
    min-width: 0;
}

#musicView .music-list-item .song-name {
    font-size: 20px;
    line-height: 1.05;
    color: #f8fbff;
    margin-bottom: 7px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicView .music-list-item .song-artist {
    font-size: 14px;
    color: var(--music-text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicView .add-playlist-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.2px solid rgba(163, 185, 225, 0.45);
    background: transparent;
    color: #f1f5ff;
    font-size: 24px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
}

#musicView .add-playlist-btn:active {
    transform: scale(0.96);
}

#musicView .add-playlist-btn.added {
    background: rgba(255, 255, 255, 0.08);
    color: #9fa8b8;
    border-color: rgba(255, 255, 255, 0.22);
    font-size: 18px;
}

#musicView .music-mini-player {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    z-index: 20;
    padding-bottom: env(safe-area-inset-bottom);
}

#musicView .music-mini-player.active {
    display: block;
}

#musicView .player-bar {
    position: relative;
    background: rgba(4, 5, 8, 0.9);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#musicView .music-player-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: var(--music-player-height);
    padding: 10px 14px;
}

#musicView .music-blur-bg {
    position: absolute;
    inset: 0;
    opacity: 0.22;
    filter: blur(26px) saturate(1.2);
    pointer-events: none;
    background-size: cover;
    background-position: center;
}

#musicView .player-cover-box {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: #0f1217;
}

#musicView .player-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    animation: music-spin 12s linear infinite;
    animation-play-state: paused;
}

@keyframes music-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

#musicView .player-info {
    flex: 1;
    min-width: 0;
}

#musicView .player-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 4px;
    color: #f7fbff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicView .player-artist {
    font-size: 14px;
    color: #9aa2af;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicView .player-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #a6afbd;
    letter-spacing: 0.06em;
}

#musicView .player-progress {
    width: 100%;
    height: 4px;
    background: rgba(166, 175, 190, 0.28);
    border-radius: 999px;
    overflow: hidden;
    margin-top: 5px;
}

#musicView #playerProgressBar {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, #9eb1ff 0%, #eef3ff 100%);
    border-radius: 999px;
}

#musicView .player-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#musicView .player-ctrl-btn {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: #f2f6ff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

#musicView .player-ctrl-btn svg {
    width: 18px;
    height: 18px;
}

#musicView .player-main-play {
    width: 54px;
    height: 54px;
    border: 2px solid rgba(255, 255, 255, 0.86);
    background: rgba(255, 255, 255, 0.03);
}

#musicView .player-main-play svg {
    width: 20px;
    height: 20px;
    margin-left: 1px;
}

#musicView .player-playlist-popup {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: calc(var(--music-player-height) + env(safe-area-inset-bottom) + 10px);
    max-height: min(380px, calc(100vh - 220px));
    display: none;
    background: rgba(8, 10, 14, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -18px 44px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    z-index: 30;
}

#musicView .player-playlist-popup.active {
    display: block;
}

#musicView .player-playlist-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 16px 14px;
    border-bottom: 1px solid var(--music-border-soft);
    font-size: 16px;
    font-weight: 600;
    color: #f1f4fb;
}

#musicView #playerPlaylistCount {
    font-size: 13px;
    color: #939caa;
    font-weight: 500;
}

#musicView .player-playlist-list {
    max-height: min(300px, calc(100vh - 280px));
    overflow-y: auto;
}

#musicView .playlist-empty {
    padding: 22px 14px;
    text-align: center;
    font-size: 14px;
    color: #9da5b1;
}

#musicView .playlist-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--music-border-soft);
    cursor: pointer;
    background: transparent;
}

#musicView .playlist-row:last-child {
    border-bottom: none;
}

#musicView .playlist-row.active {
    background: rgba(158, 177, 255, 0.16);
}

#musicView .playlist-row.dragging {
    opacity: 0.52;
}

#musicView .playlist-row.drop-target {
    border-top: 2px solid #d6e1ff;
}

#musicView .playlist-row-handle {
    width: 20px;
    color: #96a1b3;
    font-size: 16px;
    letter-spacing: -2px;
    text-align: center;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    cursor: grab;
    flex-shrink: 0;
}

#musicView .playlist-row-info {
    flex: 1;
    min-width: 0;
}

#musicView .playlist-row-name {
    font-size: 17px;
    line-height: 1.1;
    color: #eff3fc;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicView .playlist-row-artist {
    margin-top: 4px;
    font-size: 13px;
    color: #8c95a2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#musicView .playlist-row-remove {
    border: none;
    background: transparent;
    color: #d4d9e4;
    font-size: 22px;
    line-height: 1;
    width: 24px;
    height: 24px;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
}

#musicView .music-status-msg {
    position: absolute;
    left: 0;
    right: 0;
    bottom: calc(var(--music-player-height) + env(safe-area-inset-bottom) + 14px);
    text-align: center;
    font-size: 12px;
    color: #9ca6b6;
    pointer-events: none;
    z-index: 40;
}

@media (max-width: 480px) {
    #musicView .music-list-item .song-name {
        font-size: 18px;
    }

    #musicView .player-title {
        font-size: 15px;
    }

    #musicView .player-playlist-header {
        font-size: 15px;
    }

    #musicView .playlist-row-name {
        font-size: 16px;
    }
}
