/* ===========================================================================
   前台公共样式（搜索页 / 歌单页等）—— 与首页保持同一视觉语言
   =========================================================================== */
:root {
    --brand: #6366f1;
    --brand-2: #8b5cf6;
    --ink: #0f172a;
    --ink-2: #475569;
    --muted: #8b97ab;
    --line: rgba(15, 23, 42, .07);
    --site-bg: none;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
    color: var(--ink);
    min-height: 100vh;
    background: #eef1f8;
    position: relative;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
.bg {
    position: fixed; inset: 0; z-index: -2;
    background: linear-gradient(160deg, #eef2ff 0%, #f8fafc 45%, #f5f3ff 100%);
}
.bg::after {
    content: ""; position: absolute; inset: 0;
    background-image: var(--site-bg);
    background-size: cover; background-position: center;
    opacity: .55;
}
.bg-veil {
    position: fixed; inset: 0; z-index: -1;
    background: linear-gradient(180deg, rgba(248, 250, 252, .55) 0%, rgba(248, 250, 252, .82) 38%, rgba(248, 250, 252, .96) 100%);
    backdrop-filter: saturate(120%);
    -webkit-backdrop-filter: saturate(120%);
}
.wrap {
    max-width: 620px; margin: 0 auto;
    padding: 16px 16px calc(96px + env(safe-area-inset-bottom));
}

/* ---------------- 顶部品牌 ---------------- */
.site-head { display: flex; align-items: center; gap: 11px; padding: 2px 2px 14px; }
.site-icon {
    width: 38px; height: 38px; border-radius: 12px; flex: none;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; font-size: 16px;
    box-shadow: 0 10px 20px -12px rgba(99, 102, 241, .9);
    overflow: hidden;
}
.site-icon img { width: 100%; height: 100%; object-fit: cover; }
.site-title { min-width: 0; }
.site-title h1 {
    font-size: 16.5px; font-weight: 700; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.site-title p { font-size: 11.5px; color: var(--muted); margin-top: 1px; }

/* ---------------- 歌单封面 ---------------- */
.cover {
    position: relative; aspect-ratio: 1 / 1;
    border-radius: 15px; overflow: hidden; background: #e2e8f0;
    box-shadow: 0 10px 24px -16px rgba(15, 23, 42, .55);
}
.cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 自动生成的渐变封面：底色 + 首字 + 一层柔光 */
.cover-gen {
    display: flex; align-items: center; justify-content: center;
    background:
        radial-gradient(120% 100% at 12% 8%, rgba(255, 255, 255, .34), transparent 58%),
        linear-gradient(140deg, var(--c1, #6366f1), var(--c2, #8b5cf6));
}
.cover-gen::after {
    content: ""; position: absolute; right: -18%; bottom: -26%;
    width: 78%; aspect-ratio: 1; border-radius: 50%;
    background: rgba(255, 255, 255, .13);
}
.cover-gen span {
    position: relative; z-index: 1;
    font-size: clamp(20px, 6vw, 30px); font-weight: 700;
    color: rgba(255, 255, 255, .96); letter-spacing: -.02em;
    text-shadow: 0 4px 16px rgba(15, 23, 42, .24);
}

/* 封面上的小角标 */
.cover-tag {
    position: absolute; left: 6px; top: 6px; z-index: 2;
    font-size: 9.5px; font-weight: 600; line-height: 1;
    padding: 3px 5px; border-radius: 5px;
    color: #fff; background: rgba(15, 23, 42, .42);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.cover-tag.is-user { background: rgba(244, 63, 94, .72); }
.cover-tag.is-mine { background: rgba(99, 102, 241, .82); }

/* ---------------- 歌单网格卡片：整块正方形（封面铺满 + 文字压底） ---------------- */
.pl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
@media (min-width: 520px) {
    .pl-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
}
.pl-card {
    position: relative;
    display: block; text-decoration: none; color: inherit;
    aspect-ratio: 1 / 1;
    border-radius: 17px; overflow: hidden;
    background: #e2e8f0;
    box-shadow: 0 14px 28px -20px rgba(15, 23, 42, .75);
    transition: transform .16s ease, box-shadow .2s ease;
}
.pl-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 40px -24px rgba(99, 102, 241, .58);
}
.pl-card:active { transform: translateY(-1px) scale(.99); }

/* 封面铺满整块卡片 */
.pl-card .pl-cover-wrap { position: absolute; inset: 0; }
.pl-card .cover {
    width: 100%; height: 100%; aspect-ratio: auto;
    border-radius: 0;
}
.pl-card .cover img { transition: transform .28s ease; }
.pl-card:hover .cover img { transform: scale(1.06); }

/* 底部压暗渐变，保证白字可读 */
.pl-card::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    height: 58%; pointer-events: none;
    background: linear-gradient(180deg,
        rgba(2, 6, 23, 0) 0%,
        rgba(2, 6, 23, .42) 52%,
        rgba(2, 6, 23, .84) 100%);
}

.pl-card .pl-name {
    position: absolute; left: 10px; right: 46px; bottom: 25px; z-index: 3;
    margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 13px; font-weight: 700; line-height: 1.34; letter-spacing: -.01em;
    color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
}
.pl-card .pl-meta {
    position: absolute; left: 10px; right: 46px; bottom: 8px; z-index: 3;
    margin: 0; display: block;
    font-size: 10.5px; color: rgba(255, 255, 255, .82);
    text-shadow: 0 1px 5px rgba(0, 0, 0, .45);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 封面容器（承载角标与播放键） */
.pl-cover-wrap { position: relative; }

/* 歌单卡片的播放键：封面右下角，触屏常显 / 桌面 hover 浮现 */
.pl-play {
    position: absolute; right: 8px; bottom: 8px; z-index: 4;
    width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer;
    border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 20px -8px rgba(79, 70, 229, .95), 0 0 0 0 rgba(255, 255, 255, .5);
    opacity: .96; transform: scale(1);
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
}
.pl-card:hover .pl-play {
    opacity: 1; transform: scale(1.07);
    box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 1), 0 0 0 4px rgba(255, 255, 255, .55);
}
.pl-play:active { transform: scale(.9); }
.pl-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

/* 列表式歌单行（搜索 / 我的分享）右端的播放键 —— 方格卡片里浮在右下角 */
.sm-play {
    position: absolute; right: 8px; bottom: 8px; z-index: 4;
    width: 34px; height: 34px; padding: 0; border: 0; cursor: pointer;
    border-radius: 50%; display: grid; place-items: center;
    color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
    box-shadow: 0 10px 20px -8px rgba(79, 70, 229, .95);
    transition: transform .16s ease, box-shadow .18s ease;
}
.sm-item:hover .sm-play { transform: scale(1.07); box-shadow: 0 12px 24px -8px rgba(79, 70, 229, 1); }
.sm-play:active { transform: scale(.92); }
.sm-play svg { width: 14px; height: 14px; fill: currentColor; stroke: none; }

/* ---------------- 方格版歌单列表（搜索页 / 我的分享） ---------------- */
.sm-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}
@media (min-width: 520px) {
    .sm-list { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
}
.sm-item {
    position: relative;
    display: block; text-decoration: none; color: inherit;
    aspect-ratio: 1 / 1;
    border-radius: 17px; overflow: hidden;
    background: #eef1f8;
    box-shadow: 0 14px 28px -20px rgba(15, 23, 42, .75);
    transition: transform .16s ease, box-shadow .2s ease;
}
.sm-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 24px 40px -24px rgba(99, 102, 241, .58);
}
.sm-item:active { transform: translateY(-1px) scale(.99); }

.sm-item .sm-cover {
    position: absolute; inset: 0;
    width: auto; height: auto; border-radius: 0;
    background: #eef1f8; box-shadow: none;
}
.sm-item .sm-cover .cover {
    width: 100%; height: 100%; aspect-ratio: auto; border-radius: 0;
}
.sm-item .sm-cover img { transition: transform .28s ease; }
.sm-item:hover .sm-cover img { transform: scale(1.06); }
.sm-item .cover-tag { left: 7px; top: 7px; }
.sm-item .oss-chip { left: auto; right: 7px; top: 7px; bottom: auto; }

.sm-item::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
    height: 62%; pointer-events: none;
    background: linear-gradient(180deg,
        rgba(2, 6, 23, 0) 0%,
        rgba(2, 6, 23, .44) 50%,
        rgba(2, 6, 23, .86) 100%);
}

.sm-item .sm-main {
    position: absolute; left: 0; right: 0; bottom: 0; z-index: 3;
    padding: 10px 52px 10px 11px;
    display: block; min-width: 0;
}
.sm-item .sm-t { display: flex; align-items: center; gap: 6px; min-width: 0; }
.sm-item .sm-t b {
    min-width: 0; flex: 0 1 auto;
    font-size: 13px; font-weight: 700; line-height: 1.34; letter-spacing: -.01em;
    color: #fff; text-shadow: 0 1px 6px rgba(0, 0, 0, .5);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; white-space: normal;
}
.sm-item .sm-meta {
    margin-top: 3px; font-size: 10.5px; line-height: 1.5; color: rgba(255, 255, 255, .82);
    text-shadow: 0 1px 5px rgba(0, 0, 0, .45);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sm-item .sm-go { display: none; }

/* ---------------- 空状态 ---------------- */
.empty-box {
    padding: 46px 18px; text-align: center;
    background: rgba(255, 255, 255, .7);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, .85);
    border-radius: 18px;
}
.empty-box .em-ico {
    width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 16px;
    display: grid; place-items: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(139, 92, 246, .12));
    color: var(--brand);
}
.empty-box .em-ico svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.empty-box b { display: block; font-size: 14.5px; font-weight: 600; }
.empty-box p { margin-top: 4px; font-size: 12.5px; color: var(--muted); }

/* ---------------- 分页 ---------------- */
.pager { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 22px; flex-wrap: wrap; }
.pager a, .pager span {
    min-width: 34px; height: 34px; padding: 0 8px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 13px; text-decoration: none; color: var(--ink-2);
    background: rgba(255, 255, 255, .82); border: 1px solid var(--line);
}
.pager a:active { background: #fff; }
.pager .on {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    color: #fff; border-color: transparent;
    box-shadow: 0 8px 18px -10px rgba(99, 102, 241, .9);
}
.pager .gap { background: transparent; border: 0; color: var(--muted); }

/* ---------------- 底部导航 ---------------- */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border-top: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 -10px 30px -22px rgba(15, 23, 42, .6);
}
.tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 0 3px; color: var(--muted); text-decoration: none;
    font-size: 11px; font-weight: 500; border-radius: 12px;
    transition: color .2s;
}
.tabbar a svg { width: 21px; height: 21px; }
.tabbar a span { white-space: nowrap; }
.tabbar a.active { color: var(--brand); }
.tabbar a.active svg { filter: drop-shadow(0 4px 8px rgba(99, 102, 241, .35)); }
/* 消息未读角标 */
.tabbar a { position: relative; }
.tb-dot {
    position: absolute; top: 0; left: calc(50% + 5px);
    min-width: 16px; height: 16px; padding: 0 4px;
    font-size: 9.5px; font-style: normal; font-weight: 700; line-height: 16px;
    text-align: center; color: #fff;
    background: linear-gradient(135deg, #fb7185, #f43f5e);
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, .92), 0 4px 10px -4px rgba(244, 63, 94, .9);
}

@media (min-width: 700px) {
    .wrap { padding-top: 26px; }
    .tabbar {
        max-width: 620px; margin: 0 auto; left: 50%; transform: translateX(-50%);
        border-radius: 18px 18px 0 0;
    }
}
