/* =======================
   全局
   ======================= */
:root {
    --np-height: 0px;
}

body {
    margin: 0;
    background: #f5f5f5;
}

body.theme-dark {
    background: #0f1115;
    color: #e6e6e6;
}

body.theme-dark .search-bar,
body.theme-dark .song-list,
body.theme-dark .np,
body.theme-dark .np-list,
body.theme-dark .lyric-panel {
    background: #1b1e24;
    color: #e6e6e6;
}

body.theme-dark .song-item {
    border-bottom: 1px solid #2a2f3a;
}

body.theme-dark .song-item:hover {
    background: #20242d;
}

body.theme-dark .title,
body.theme-dark .np-title,
body.theme-dark .np-li-title,
body.theme-dark .lyric-header {
    color: #f0f3f8;
}

body.theme-dark .meta,
body.theme-dark .np-lyric,
body.theme-dark .np-time,
body.theme-dark .np-li-artist,
body.theme-dark #lrcList li {
    color: #a3adbb;
}

body.theme-dark .search-bar .layui-input {
    background: #141821;
    color: #e6e6e6;
    border-color: #2a2f3a;
}

body.theme-dark .np {
    border-top: 1px solid #2a2f3a;
}

body.theme-dark .np-list {
    box-shadow: 0 10px 30px rgba(0,0,0,.45);
}

body.theme-dark .lyric-header {
    border-bottom: 1px solid #2a2f3a;
}

body.theme-dark .lyric-time-indicator {
    background: rgba(0,0,0,.75);
}

body.theme-dark .layui-btn-primary {
    background: transparent;
    color: #e6e6e6;
    border-color: #2a2f3a;
}

/* =======================
   主体布局
   ======================= */
.container {
    display: flex;
    transition: .3s;
}

.song-area {
    width: 100%;
    padding: 15px;
    padding-bottom: 140px; /* 防止底部播放器遮挡 */
    transition: width .35s;
}

/* PC：打开歌词时列表缩到 70% */
.container.show-lyric .song-area {
    width: 70%;
}

/* =======================
   搜索
   ======================= */
.search-bar {
    display: flex;
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 15px;
}

.search-actions {
    margin-left: 5px;
    margin-top: 10px;
    display: flex;
    justify-content: flex-end;
}

/* =======================
   歌曲列表
   ======================= */
.song-list {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
}

.song-item {
    display: flex;
    padding: 12px;
    border-bottom: 1px solid #eee;
}

.song-item:hover {
    background: #f9f9f9;
}

.cover {
    width: 80px;
    height: 80px;
    position: relative;
    flex-shrink: 0;
}

.cover img {
    width: 100%;
    height: 100%;
    border-radius: 8px;
    object-fit: cover;
}

.time {
    position: absolute;
    right: 4px;
    bottom: 4px;
    font-size: 12px;
    background: rgba(0,0,0,.6);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
}

.info {
    flex: 1;
    margin-left: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.title {
    font-size: 14px;
    font-weight: 600;
}

.meta {
    font-size: 12px;
    color: #888;
}

.play-btn {
    cursor: pointer;
    width: fit-content;
}

/* =======================
   分页
   ======================= */
.page-box {
    text-align: center;
    margin-top: 15px;
}

/* =======================
   歌词面板（PC：右侧 30% 抽屉）
   ======================= */
.lyric-panel {
    width: 30%;
    height: calc(100vh - 120px);
    position: fixed;
    right: -30%;
    top: 0;
    transition: .35s;
    box-shadow: -6px 0 18px rgba(0,0,0,.15);
    display: flex;
    flex-direction: column;
    z-index: 1001;

    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.container.show-lyric .lyric-panel {
    right: 0;
}

.lyric-header {
    height: 48px;
    line-height: 48px;
    text-align: center;
    font-weight: 700;
    border-bottom: 1px solid rgba(0,0,0,.08);
    position: relative;
}

.lyric-header i {
    position: absolute;
    right: 12px;
    top: 0;
    cursor: pointer;
}

.lyric-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    position: relative;
}

#lrcList {
    list-style: none;
    padding: 60px 0;
    margin: 0;
    text-align: center;
}

#lrcList li {
    padding: 10px 0;
    color: #888;
    opacity: .45;
    transition: all .2s;
    cursor: pointer;
}

#lrcList li.active {
    opacity: 1;
    color: #ff3b30;
    font-size: 18px;
    font-weight: 700;
}

/* 滑动时间指示器 */
.lyric-time-indicator {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(0,0,0,.65);
    color: #fff;
    padding: 6px 10px;
    border-radius: 14px;
    font-size: 12px;
    display: none;
    z-index: 10;
}

/* =======================
   网易云风格播放器（底部，PC 默认）
   ======================= */
.np {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 72px;
    background: #fff;
    border-top: 1px solid #e6e6e6;
    z-index: 9999;

    display: flex;
    align-items: center;
    padding: 0 14px;
    box-sizing: border-box;
}

/* 左侧：封面+文字 */
.np-left {
    display: flex;
    align-items: center;
    min-width: 320px;
    gap: 12px;
}

.np-cover {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #f2f2f2;
}

.np-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.np-text {
    overflow: hidden;
    min-width: 0;
}

.np-title {
    font-size: 14px;
    font-weight: 700;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-lyric {
    margin-top: 4px;
    font-size: 12px;
    color: #1E9FFF;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    opacity: .9;
}

.np-lyric:hover {
    text-decoration: underline;
    opacity: 1;
}

/* 中间：控制+进度 */
.np-center {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    min-width: 0;
}

.np-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.np-btn {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 18px;
    padding: 6px 8px;
    line-height: 1;
    color: #333;
}

.np-btn:hover {
    background: rgba(0,0,0,.05);
    border-radius: 8px;
}

.np-play {
    font-size: 22px;
    color: #d33;
}

.np-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    width: min(520px, 52vw);
}

.np-time {
    font-size: 12px;
    color: #666;
    width: 44px;
    text-align: center;
    flex-shrink: 0;
}

/* =====================
   🎚 网易云进度条样式
   ===================== */
#progress {
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    background: linear-gradient(
        to right,
        #ec4141 0%,
        #ec4141 var(--percent, 0%),
        #d8d8d8 var(--percent, 0%),
        #d8d8d8 100%
    );
    border-radius: 2px;
    outline: none;
    cursor: pointer;
}

#progress::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #ec4141;
    border-radius: 50%;
    cursor: pointer;
    margin-top: -4px;
}

#progress::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ec4141;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

#progress:hover::-webkit-slider-thumb {
    transform: scale(1.15);
}

/* 右侧：模式/歌词/列表 */
.np-right {
    display: flex;
    align-items: center;
    gap: 6px;
}

.np-lyric-btn {
    font-size: 14px;
    font-weight: 700;
    color: #666;
}

.np-lyric-btn.active {
    color: #ec4141;
}

/* 隐藏 APlayer UI，只留内核 */
.aplayer-kernel .aplayer {
    display: none !important;
}
.aplayer-kernel {
    width: 0;
    height: 0;
    overflow: hidden;
}

/* =======================
   播放列表抽屉（PC 默认）
   ======================= */
.np-list {
    position: fixed;
    right: 12px;
    bottom: 84px;
    width: 320px;
    height: 60vh;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,.18);
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: .22s ease;
    z-index: 9998;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.np-list.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.np-list-head {
    padding: 12px 12px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-weight: 800;
}

.np-list-sub {
    font-size: 12px;
    font-weight: 500;
    color: #888;
}

.np-close {
    margin-left: auto;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 16px;
    color: #666;
}

.np-list-body {
    list-style: none;
    margin: 0;
    padding: 6px 0;
    overflow-y: auto;
}

.np-li {
    padding: 10px 12px;
    cursor: pointer;
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.np-li:hover {
    background: #f7f7f7;
}

.np-li.active {
    background: rgba(217, 51, 51, 0.10);
}

.np-li-title {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.np-li-artist {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
}


@media (max-width: 768px) {

    /* =======================
       基础布局
       ======================= */
    body {
        overflow-y: auto;
    }

    body.show-lyric {
        overflow: hidden; /* 打开歌词时锁页面 */
    }

    .container {
        display: block;
    }

    /* 不再压缩列表 */
    .container.show-lyric .song-area {
        width: 100%;
    }

    .song-area {
        padding-bottom: 170px;
    }

    /* =======================
       🎵 底部播放器（两行）
       ======================= */
    .np {
        height: auto;
        padding: 10px 12px;

        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "left right"
            "center center";
        align-items: center;
        gap: 8px 10px;
    }

    .np-left {
        grid-area: left;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .np-cover {
        width: 42px;
        height: 42px;
        border-radius: 6px;
        overflow: hidden;
        flex-shrink: 0;
    }

    .np-text {
        flex: 1;
        min-width: 0;
    }

    .np-title {
        font-size: 14px;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .np-lyric {
        font-size: 12px;
        color: #999;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .np-right {
        display: flex;
        gap: 10px;
        align-items: center;
        grid-area: right;
        justify-self: end;
    }

    .np-btn {
        font-size: 16px;
        padding: 4px;
    }

    .np-play {
        font-size: 20px;
        color: #ec4141;
    }

    .np-center {
        grid-area: center;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .np-controls {
        display: flex;
        gap: 8px;
    }

    .np-progress {
        flex: 1;
        min-width: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    .np-time {
        width: 28px;
        font-size: 10px;
        text-align: center;
    }

    #progress {
        flex: 1;
        touch-action: pan-x;
    }

    /* =======================
       🎤 歌词 Bottom Sheet（核心）
       ======================= */
    .lyric-panel {
        position: fixed;
        left: 0;
        right: 0;
        width: 100%;
        top: auto;
        bottom: var(--np-height, 0px);
        height: 70vh;
        max-height: calc(100vh - var(--np-height, 0px) - 16px);

        background: #fff;
        z-index: 9998;

        border-radius: 16px 16px 0 0;
        box-shadow: 0 -10px 30px rgba(0,0,0,.2);

        display: flex;
        flex-direction: column;

        transform: translateY(100%);
        transition: transform .35s ease;
    }

    .container.show-lyric .lyric-panel {
        transform: translateY(0);
    }

    .lyric-header {
        height: 52px;
        line-height: 52px;
        text-align: center;
        font-size: 16px;
        font-weight: 700;
        border-bottom: 1px solid #eee;
        position: relative;
        flex-shrink: 0;
    }

    .lyric-header i {
        position: absolute;
        right: 14px;
        top: 0;
        font-size: 20px;
    }

    .lyric-content {
        flex: 1;
        overflow-y: auto;
        padding: 20px 16px 120px;
    }

    #lrcList {
        list-style: none;
        padding: 60px 0;
        margin: 0;
        text-align: center;
    }

    #lrcList li {
        padding: 10px 0;
        color: #999;
        opacity: .5;
        transition: all .2s;
    }

    #lrcList li.active {
        color: #ec4141;
        font-size: 18px;
        font-weight: 600;
        opacity: 1;
    }

    /* =======================
       播放列表抽屉
       ======================= */
    .np-list {
        left: 8px;
        right: 8px;
        width: auto;
        bottom: 150px;
        height: 60vh;
    }
}
