/* ========== 网易云悬浮播放器 ========== */
#ncm-player {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99998;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    user-select: none;
}

/* 迷你模式（折叠态） */
#ncm-player.minimized .ncm-main {
    display: none;
}
#ncm-player.minimized .ncm-mini-btn {
    display: flex;
}

/* 迷你按钮 */
.ncm-mini-btn {
    display: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
    overflow: hidden;
}
.ncm-mini-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 28px rgba(0,0,0,0.5);
}
.ncm-mini-btn .mini-cover {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    animation: miniSpin 8s linear infinite;
    animation-play-state: paused;
}
.ncm-mini-btn.playing .mini-cover {
    animation-play-state: running;
}
@keyframes miniSpin {
    to { transform: rotate(360deg); }
}

/* 主面板 */
.ncm-main {
    width: 340px;
    background: var(--bg-card, #1a1a2e);
    border: 1px solid var(--border, rgba(255,255,255,0.08));
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.5);
    overflow: hidden;
    transition: opacity 0.3s, transform 0.3s;
}

/* 顶部拖拽栏 */
.ncm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255,255,255,0.03);
    cursor: move;
    border-bottom: 1px solid var(--border, rgba(255,255,255,0.06));
}
.ncm-header-title {
    font-size: 12px;
    color: var(--text-muted, #888);
    display: flex;
    align-items: center;
    gap: 6px;
}
.ncm-header-title svg {
    width: 14px;
    height: 14px;
    fill: #e72d2d;
}
.ncm-header-btns {
    display: flex;
    gap: 4px;
}
.ncm-header-btns button {
    width: 26px;
    height: 26px;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.ncm-header-btns button:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary, #fff);
}

/* 歌曲信息区 */
.ncm-song-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}
.ncm-cover {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}
.ncm-song-meta {
    flex: 1;
    min-width: 0;
}
.ncm-song-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #fff);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ncm-song-artist {
    font-size: 11px;
    color: var(--text-muted, #888);
    margin-top: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ncm-like-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 18px;
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.2s;
    filter: grayscale(1);
    opacity: 0.5;
}
.ncm-like-btn.liked {
    filter: grayscale(0);
    opacity: 1;
    color: #e72d2d;
}
.ncm-like-btn:hover {
    transform: scale(1.2);
}

/* 进度条 */
.ncm-progress {
    padding: 0 14px;
}
.ncm-progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    cursor: pointer;
    position: relative;
    transition: height 0.15s;
}
.ncm-progress-bar:hover {
    height: 6px;
}
.ncm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #e72d2d, #ff6b6b);
    border-radius: 2px;
    position: relative;
    transition: width 0.1s linear;
}
.ncm-progress-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
    opacity: 0;
    transition: opacity 0.15s;
}
.ncm-progress-bar:hover .ncm-progress-thumb {
    opacity: 1;
}
.ncm-time {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-muted, #666);
    margin-top: 4px;
}

/* 控制按钮 */
.ncm-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 10px 14px;
}
.ncm-ctrl-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--text-secondary, #ccc);
    font-size: 16px;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.15s;
}
.ncm-ctrl-btn:hover {
    color: var(--text-primary, #fff);
    transform: scale(1.1);
}
.ncm-play-btn {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e72d2d, #ff4757);
    color: #fff !important;
    font-size: 18px;
    box-shadow: 0 2px 12px rgba(231,45,45,0.4);
}
.ncm-play-btn:hover {
    box-shadow: 0 4px 18px rgba(231,45,45,0.6);
}

/* 歌词区域 */
.ncm-lyrics {
    height: 80px;
    overflow: hidden;
    padding: 0 14px;
    position: relative;
    mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
    -webkit-mask-image: linear-gradient(transparent, #000 15%, #000 85%, transparent);
}
.ncm-lyrics-inner {
    transition: transform 0.4s ease;
}
.ncm-lyric-line {
    font-size: 12px;
    color: var(--text-muted, #555);
    text-align: center;
    padding: 4px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.3s, font-size 0.3s;
}
.ncm-lyric-line.active {
    color: var(--text-primary, #fff);
    font-size: 13px;
    font-weight: 600;
}

/* 音量控制 */
.ncm-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 10px;
}
.ncm-volume-icon {
    font-size: 14px;
    color: var(--text-muted, #888);
    cursor: pointer;
    width: 20px;
    text-align: center;
}
.ncm-volume-slider {
    flex: 1;
    -webkit-appearance: none;
    appearance: none;
    height: 3px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}
.ncm-volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

/* 播放列表 */
.ncm-playlist-toggle {
    padding: 6px 14px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.ncm-playlist-toggle button {
    width: 100%;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 11px;
    cursor: pointer;
    padding: 4px 0;
    text-align: center;
    transition: color 0.2s;
}
.ncm-playlist-toggle button:hover {
    color: var(--text-primary, #fff);
}
.ncm-playlist {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.ncm-playlist.open {
    max-height: 200px;
}
.ncm-playlist-inner {
    max-height: 200px;
    overflow-y: auto;
    padding: 0 14px 8px;
}
.ncm-playlist-inner::-webkit-scrollbar {
    width: 3px;
}
.ncm-playlist-inner::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}
.ncm-pl-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 12px;
    color: var(--text-secondary, #aaa);
}
.ncm-pl-item:hover {
    background: rgba(255,255,255,0.05);
}
.ncm-pl-item.active {
    color: #e72d2d;
}
.ncm-pl-item.active .ncm-pl-name {
    color: #e72d2d;
}
.ncm-pl-index {
    width: 20px;
    text-align: center;
    font-size: 10px;
    color: var(--text-muted, #555);
    flex-shrink: 0;
}
.ncm-pl-item.active .ncm-pl-index {
    color: #e72d2d;
}
.ncm-pl-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ncm-pl-artist {
    font-size: 10px;
    color: var(--text-muted, #555);
    flex-shrink: 0;
    max-width: 60px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 设置面板 */
.ncm-settings {
    display: none;
    padding: 10px 14px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.ncm-settings.open {
    display: block;
}
.ncm-setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 11px;
    color: var(--text-muted, #888);
}
.ncm-setting-row select {
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    color: var(--text-primary, #fff);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    outline: none;
}
.ncm-setting-row select option {
    background: #1a1a2e;
}

/* 歌单导入 */
.ncm-import {
    padding: 8px 14px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
}
.ncm-import-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 6px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--border, rgba(255,255,255,0.1));
}
.ncm-import-tab {
    flex: 1;
    padding: 5px 0;
    border: none;
    background: transparent;
    color: var(--text-muted, #888);
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}
.ncm-import-tab.active {
    background: rgba(231,45,45,0.15);
    color: #e72d2d;
}
.ncm-import-tab:hover:not(.active) {
    background: rgba(255,255,255,0.04);
}
.ncm-import-row {
    display: flex;
    gap: 6px;
}
.ncm-import-input {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 1px solid var(--border, rgba(255,255,255,0.1));
    color: var(--text-primary, #fff);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    outline: none;
}
.ncm-import-input::placeholder {
    color: var(--text-muted, #555);
}
.ncm-import-btn {
    padding: 6px 12px;
    background: linear-gradient(135deg, #e72d2d, #ff4757);
    border: none;
    color: #fff;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity 0.2s;
}
.ncm-import-btn:hover {
    opacity: 0.85;
}
.ncm-search-results {
    display: none;
    max-height: 180px;
    overflow-y: auto;
    margin-top: 6px;
    border-top: 1px solid var(--border, rgba(255,255,255,0.06));
    padding-top: 4px;
}
.ncm-search-results::-webkit-scrollbar {
    width: 3px;
}
.ncm-search-results::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.15);
    border-radius: 2px;
}

/* 自动隐藏 */
#ncm-player.auto-hide {
    opacity: 0.3;
    transition: opacity 0.8s;
}
#ncm-player.auto-hide:hover {
    opacity: 1;
}

/* 拖拽中 */
#ncm-player.dragging {
    opacity: 0.9;
    cursor: grabbing;
}
#ncm-player.dragging .ncm-main {
    box-shadow: 0 12px 50px rgba(0,0,0,0.6);
}
