/* ============================================================
   网易云音乐播放器（底部 · 贴侧边栏 · 可折叠）
   ------------------------------------------------------------
   默认展开：卡片贴紧屏幕底部；点右上角 ▾ 收成小胶囊（浮在底部
   上方 12px）；点胶囊 ▴ 再展开。
   横向排版（原版样式）：封面在左，歌名歌手、歌词（当前行高亮 +
   平滑滚动）、进度条在右；下方是自定义控制条（上一首/播放暂停/
   下一首，不自动播放）。
   所有选择器都限定在 #netease-player 内，不影响博客其他部分。
   ============================================================ */

/* base.html head 里有一条内联 #netease-player.pre-css{display:none}（在异步的
   本文件之前）：CSS 未到位时藏住播放器防闪现。这里同选择器、更晚的样式表，
   级联序占优 → 本文件一生效就把播放器以折叠胶囊态放出。 */
#netease-player.pre-css { display: block; }

#netease-player {
    position: fixed;
    left: 290px;              /* 紧挨 280px 宽的侧边栏 */
    bottom: 0;                /* 展开时卡片贴底 */
    z-index: 1000;
    width: 300px;             /* 小巧，不占地方 */
    max-width: calc(100vw - 20px);  /* 防小屏溢出 */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* ---------- 展开卡片 ---------- */
.np-box {
    position: relative;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border: 1px solid rgba(255, 183, 197, 0.18);
    border-bottom: none;
    border-radius: 16px 16px 0 0;   /* 贴底：只圆上角 */
    padding: 10px 12px 8px;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.10);
    transition: transform 0.3s ease, opacity 0.3s ease;
}
#netease-player.collapsed .np-box {
    transform: translateY(10px) scale(0.92);
    opacity: 0;
    pointer-events: none;
}

/* 折叠 / 展开小按钮 */
.np-toggle {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 183, 197, 0.15);
    color: #888;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    flex-shrink: 0;
    transition: all 0.25s ease;
}
.np-toggle:hover {
    background: rgba(255, 183, 197, 0.30);
    color: #e1707a;
}
#npCollapseBtn {
    position: absolute;
    top: 8px;
    right: 10px;
    z-index: 2;
}

/* ---------- APlayer 横向排版（原版样式：封面在左） ---------- */
#netease-player .aplayer {
    background: transparent;
    box-shadow: none;
    font-family: inherit;
}
/* 封面：保持 APlayer 默认的左浮动 */
#netease-player .aplayer .aplayer-pic {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    cursor: default;
}
/* 去掉 APlayer 悬浮在封面上的播放按钮（突兀，控制条里已有） */
#netease-player .aplayer .aplayer-pic .aplayer-button {
    display: none;
}
/* 右侧信息区：标题 + 歌词 + 进度条 */
#netease-player .aplayer .aplayer-info {
    height: auto;
    margin-left: 76px;        /* 64px 封面 + 12px 间距 */
    padding: 0;
}
#netease-player .aplayer .aplayer-music {
    height: auto;
    padding-right: 26px;      /* 给右上角折叠按钮让位 */
    margin-bottom: 2px;
}
#netease-player .aplayer .aplayer-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #2d3436;
}
#netease-player .aplayer .aplayer-author {
    position: static;
    font-size: 0.7rem;
    color: #b2bec3;
}
/* 歌词：当前行高亮 + 平滑滚动动效 */
#netease-player .aplayer .aplayer-lrc {
    display: block;
    height: 48px;
    margin: 2px 0;
    overflow: hidden;
}
#netease-player .aplayer .aplayer-lrc-contents {
    transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
#netease-player .aplayer .aplayer-lrc p {
    font-size: 0.7rem;
    line-height: 1.6;
    text-align: center;
    color: #999;
    transition: color 0.4s ease, transform 0.4s ease, text-shadow 0.4s ease;
}
#netease-player .aplayer .aplayer-lrc p.aplayer-lrc-current {
    color: #e1707a;
    font-weight: 600;
    transform: scale(1.06);
    text-shadow: 0 0 14px rgba(255, 183, 197, 0.65);
}
/* APlayer 自带控制条：只留进度条和时间 */
#netease-player .aplayer .aplayer-controller {
    position: static;
    display: flex;
    align-items: center;
    gap: 6px;
    height: auto;
}
#netease-player .aplayer .aplayer-bar-wrap {
    position: static;
    flex: 1;
    padding: 0;
}
#netease-player .aplayer .aplayer-bar {
    height: 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.08);
}
#netease-player .aplayer .aplayer-loaded {
    background: rgba(255, 183, 197, 0.30);
    border-radius: 4px;
}
#netease-player .aplayer .aplayer-played {
    background: linear-gradient(90deg, #ffb0c0, #e1707a);
    border-radius: 4px;
}
#netease-player .aplayer .aplayer-thumb {
    width: 10px;
    height: 10px;
    border: none;
    background: #e1707a;
    box-shadow: 0 0 6px rgba(225, 112, 122, 0.5);
}
#netease-player .aplayer .aplayer-time {
    position: static;
    font-size: 0.65rem;
    color: #aaa;
}
#netease-player .aplayer .aplayer-volume-wrap {
    display: none;            /* 精简界面：不需要音量钮 */
}
#netease-player .aplayer .aplayer-list {
    max-height: 120px;
    margin-top: 6px;
    border-radius: 10px;
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
#netease-player .aplayer .aplayer-list ol li {
    font-size: 0.72rem;
    padding: 5px 12px;
    color: #555;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}
#netease-player .aplayer .aplayer-list ol li.aplayer-list-light {
    background: rgba(255, 183, 197, 0.12);
    color: #e1707a;
}

/* ---------- 自定义控制条（封面下方：上一首/播放暂停/下一首） ---------- */
.np-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 4px;
    padding-top: 6px;
    border-top: 1px solid rgba(255, 183, 197, 0.15);
}
.np-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 183, 197, 0.15);
    color: #666;
    font-size: 0.72rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
}
.np-btn:hover {
    background: rgba(255, 183, 197, 0.30);
    color: #e1707a;
}
/* 中间播放/暂停稍大一点，但不大 */
.np-btn.np-play {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
    background: linear-gradient(135deg, #ffb0c0, #e1707a);
    color: #fff;
    box-shadow: 0 4px 12px rgba(225, 112, 122, 0.35);
}
.np-btn.np-play:hover {
    color: #fff;
    transform: scale(1.06);
}

/* ---------- 折叠胶囊（绝对定位，不占位，浮在底部上方） ---------- */
.np-pill {
    position: absolute;
    bottom: 12px;
    left: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 260px;
    max-width: calc(100vw - 20px);
    padding: 4px 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 183, 197, 0.18);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
    opacity: 0;
    transform: translateY(8px) scale(0.92);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#netease-player.collapsed .np-pill {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}
.np-pill-cover {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
}
.np-pill-title {
    flex: 1;
    min-width: 0;
    font-size: 0.75rem;
    color: #2d3436;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ---------- 手机端 ---------- */
@media (max-width: 768px) {
    #netease-player {
        left: 10px;
        width: 262px;
        max-width: calc(100vw - 20px);
    }
    .np-pill {
        width: 232px;
        max-width: calc(100vw - 20px);
        /* 避开 iPhone 底部 Home 指示条（无安全区的设备 env() 为 0，等于原值） */
        bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    }
}
