/* ===========================================================================
   前台公共样式（搜索页 / 歌单页等）—— 与首页保持同一视觉语言
   =========================================================================== */
: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(3, minmax(0, 1fr)); gap: 15px 10px; }
@media (min-width: 520px) {
    .pl-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 17px 12px; }
}
.pl-card { display: block; text-decoration: none; color: inherit; }
.pl-card:active .cover { transform: scale(.975); }
.pl-card .cover { border-radius: 12px; transition: transform .16s ease; }
.pl-card .pl-name {
    display: block; margin-top: 7px;
    font-size: 12.5px; font-weight: 600; letter-spacing: -.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pl-card .pl-meta {
    display: flex; align-items: center; gap: 6px;
    margin-top: 1px; font-size: 11px; color: var(--muted);
}
.pl-card .pl-meta i { font-style: normal; opacity: .5; }

/* ---------------- 空状态 ---------------- */
.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;
    }
}
